Skip to content

Typed class properties #66

Open
Open
@evenfrost

Description

@evenfrost

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,
      },
    },
  }],
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions