Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typed class properties #66

Open
evenfrost opened this issue Jun 6, 2023 · 0 comments
Open

Typed class properties #66

evenfrost opened this issue Jun 6, 2023 · 0 comments

Comments

@evenfrost
Copy link

It would be great if we could specify explicit class properties for different classes.

Example:

import type { WeaviateClass } from 'weaviate-ts-client';

interface CustomerMacroProperties {
  title: string;
  text: string;
  clientId: string;
}

const CustomerMacro: WeaviateClass<CustomerMacroProperties> = {
  class: 'CustomerMacro',
  description: 'A Customer macro',
  invertedIndexConfig: {
    indexPropertyLength: true,
    indexNullState: true,
    stopwords: {
      preset: 'none',
    },
  },
  properties: [{
    name: 'title',
    description: 'The title of the macro',
    dataType: ['text'],
  }, {
    name: 'text',
    description: 'The text of the macro',
    dataType: ['text'],
  }, {
    name: 'clientId',
    description: 'The ID of the customer the macro belongs to',
    dataType: ['string'],
    moduleConfig: {
      'text2vec-contextionary': {
        skip: true,
      },
    },
  }],
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant