Comments (1)
Hi @michael-pont, thanks for diving straight into the new client and getting to grips with it!
- Perhaps it's not so clearly explained or pointed towards in the docs (we'll make sure to add this to the migration guide) but we strongly encourage you to make use of the
weaviate.configure
object to define the objects that the.create()
method expects in the correct format. Indeed, you'll find that the types are not as expressive without it! - The
autoTenantX
options are only relevant to recent1.25.x
releases. In short,autoTenantCreation
will automatically create a tenant if you try to insert objects with an associated tenant that didn't previously exist, e.g.collection.withTenant('tenant').data.insert()
.autoTenantActivation
will automatically activate a tenant if you try to insert/query objects into a tenant that was previouslyCOLD
so that you don't have to pre-activate it. - If your reference was defined as
['Class']
then this translates totargetCollection: 'Class'
. You're right that one property referencing multiple collections is confusing but it is a feature of Weaviate! In the GraphQL API, this was traversable at query time through the... on MyClass { }
fragments syntax. - Your final question touches on something we're not happy about with the vectors syntax currently but is blocked by the current server-side capabilities. We would like to have it that
skipVectorization
andvectorizerPropertyName
are definable in thevectorizers:
field rather than in theproperties:
field. At the moment, if you set either of these booleans then they will betrue
for all named vectors. In future, this will not be the case but it is a current limitation.
To help your migration, here's how I would translate your .create()
code to make use of the weaviate.configure
object:
import { type CollectionConfigCreate } from '..'
import { CustomClassName } from '../types'
import weaviate from '../../index'
const className: CustomClassName = CustomClassName.SCOPED_ACCOUNT
export const ScopedAccountClass: CollectionConfigCreate = {
name: className,
description: 'A class holding scoped information about an account',
multiTenancy: weaviate.configure.multiTenancy({ enabled: true }),
vectorizers: weaviate.configure.vectorizer.text2VecOpenAI({
sourceProperties: ['notes'],
vectorIndexConfig: weaviate.configure.vectorIndex.hnsw(),
model: 'text-embedding-3-small',
dimensions: 1536,
type: 'text',
}),
generative: weaviate.configure.generative.openAI({
model: 'gpt-3.5-turbo',
temperature: 0,
}),
references: [
{
name: 'enrichmentRequests',
description:
'Enrichment Requests - which enrichment requests are linked to this account',
targetCollection: CustomClassName.ENRICHMENT_REQUEST,
},
{
name: 'customPropertyValues',
description: 'Custom property values for this scoped account',
targetCollection: CustomClassName.CUSTOM_PROPERTY_VALUE,
},
],
properties: [
{
name: 'accountId',
description: 'The account id', // No cross-reference because querying from tenant to non tenant is not possible
dataType: 'uuid',
},
{
name: 'crmAccountId',
description:
'CRM account identifier - we use this to link the account to our customers CRM',
dataType: 'text',
},
{
name: 'teamId',
description: 'Team ID - we use this as tenant identifier',
dataType: 'uuid',
},
{
name: 'name',
description:
'Name (honestly used for placeholder, as I want notes to be text[] and class creation will throw error)',
dataType: 'text',
},
{
name: 'queryResponses',
description:
'The answers to the queries that are part of this enrichment request',
dataType: 'object[]',
nestedProperties: [
{ dataType: 'text', name: 'query' },
{ dataType: 'text', name: 'customQueryId' },
{ dataType: 'text', name: 'answer' },
{ dataType: 'text', name: 'confidence' },
{ dataType: 'text', name: 'explanation' },
{
name: 'sources',
description: 'The sources of where the answer is found',
dataType: 'object[]',
nestedProperties: [
{ dataType: 'text', name: 'title' },
{ dataType: 'text', name: 'link' },
{ dataType: 'boolean', name: 'isVisitable' },
],
},
],
},
{
name: 'notes',
description: 'Optional notes for the scoped account',
dataType: 'text[]',
},
{
name: 'score',
description: 'The score of the account',
dataType: 'number',
},
{
name: 'originalUrl',
description: 'Original input URL',
dataType: 'text',
skipVectorization: true,
},
],
}
from typescript-client.
Related Issues (20)
- Support `nearVector` and `nearText` subsearches in `hybrid` queries
- PropertyConfigCreate is missing skipVectorisation in 3.0.0-rc.0 HOT 1
- Port setting is ignored in weaviate.client (rest settings) HOT 2
- `v3` beta- missing generative modules
- `v3` beta `text2vec-palm` HOT 1
- `v3` beta generative.openAI
- `v3` beta `Multi2VecPalmConfig`
- Add support for tenant exists (v2+v3)
- Docs need updating to reflect api key requirements in ^3.0.0-beta.23 HOT 2
- text2vec-transformers config missing parameters (v3 beta)
- `weaviate-client` fails to bundle on Cloudflare Workers due to `http2` dependency HOT 1
- ReferenceError: fetch is not defined HOT 1
- No weaviate.configure.vectorizer.text2vecOllama HOT 2
- Asynchronous Replication option missing from ReplicationConfig
- [Bug?] `weaviate.configure.generative.palm` method requires `projectId`
- Vectorizer configs: missing `text2vecOctoAI`
- Improper(?) 'request was without tenant' error with aggregate request HOT 2
- v3.0.8: queries with numeric filters always return empty sets HOT 6
- gRPC: Receiving RST_STREAM on insertMany HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from typescript-client.