UNPKG

@aristech-org/nlp-client

Version:

A Node.js client library for the Aristech NLP Service

188 lines (187 loc) 6.78 kB
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; export declare const protobufPackage = "aristech.nlp"; /** Copyright Aristech GmbH */ export interface Intent { /** ID of the intent */ id: string; /** The project ID of the intent */ projectId: string; /** The default locale for the intent's inputs and outputs */ locale: string; /** Topic of the intent */ topic: string; /** Inputs for the intent */ inputs: IntentInput[]; /** Possible chat outputs for the intent */ outputChat: string[]; /** Possible voice outputs for the intent */ outputVoice: string[]; /** Possible email outputs for the intent */ outputEmail: string[]; /** relation to other intents */ relatedTo: Relation[]; /** If the intent is a draft */ published: boolean; /** Type of the intents inputs */ type: Intent_InputType; excludeOutputFromSearch: boolean; /** List of keywords to force finding this intent */ keywords: Keyword[]; creatorId: string; } export declare enum Intent_InputType { CHAT = 0, MAIL = 1, VOICE = 2, UNRECOGNIZED = -1 } export declare function intent_InputTypeFromJSON(object: any): Intent_InputType; export declare function intent_InputTypeToJSON(object: Intent_InputType): string; /** * a type defining an input and its mapping to a uuid. if the uuid is set, the input gets edited * to the new input, if no id is set or the uuid does not exist, a new input is added to the * intent. */ export interface IntentInput { uuid: string; input: string; } export interface Relation { /** list of ids of parent intents */ parents: string[]; /** list of ids of child intents */ children: string[]; /** list of ids of same level intents */ peers: string[]; } export interface Keyword { /** a keyword for an intent */ keyword: string; /** the priority for the keyword */ priority: number; } /** * Adds or updates content to the vector database * if id of the intent is not set, a new intent is created for the project * if an id is set: first check if that id already exists and update it * if the id doesn't exist: create the intent with the given id. */ export interface UpdateContentRequest { intents: Intent[]; } /** Response for add content */ export interface UpdateContentResponse { /** Status of the update */ intentIds: string[]; } /** Removes content from the vector database */ export interface RemoveContentRequest { /** ID of the Document to be removed */ id: string[]; /** */ projectId: string; } /** Response for remove content */ export interface RemoveContentResponse { } /** Request for content */ export interface GetContentRequest { /** Prompt for the content to be retrieved */ prompt: string; /** Meta data for the content to be retrieved */ projectId: string; /** The number of results to be returned */ numResults: number; /** The threshold for the results to be returned */ threshold: number; /** Content Filters */ filters: ContentFilter[]; /** Chat id for context */ chatId: string; } /** Response for content */ export interface GetContentResponse { /** List of intents */ items: ContentResponseItem[]; /** The Chat ID that was sent to the server with the get content request */ chatId: string; } export interface ContentFilter { /** The field to be filtered */ field: string; /** The value to be filtered */ value: string; /** Operator */ operator: string; /** The label to be used for filtering */ label: string[]; } /** Response item for content */ export interface ContentResponseItem { /** Id of the intent's input that represents this match */ id: string; /** Score of the content */ score: number; /** The actual intent */ intent: Intent | undefined; /** fallbackmessage, gets set, when no intent was found in the search */ fallbackMessage: string; } export interface GetIntentsRequest { projectId: string; } export interface GetIntentsResponse { intent: Intent[]; } export interface GetScoreLimitsRequest { /** ID of the project to get the score Limits from */ projectId: string; /** List of sentences to test for the upper limit */ testSentencesUpperLimit: string[]; /** List of sentences to test for the lower limit */ testSentencesLowerLimit: string[]; } export interface GetScoreLimitsResponse { /** The minimum threshold determined by random sentences */ minThreshold: number; /** * The max threshold determined by using original input sentences for the * intents */ maxThreshold: number; } export declare const Intent: MessageFns<Intent>; export declare const IntentInput: MessageFns<IntentInput>; export declare const Relation: MessageFns<Relation>; export declare const Keyword: MessageFns<Keyword>; export declare const UpdateContentRequest: MessageFns<UpdateContentRequest>; export declare const UpdateContentResponse: MessageFns<UpdateContentResponse>; export declare const RemoveContentRequest: MessageFns<RemoveContentRequest>; export declare const RemoveContentResponse: MessageFns<RemoveContentResponse>; export declare const GetContentRequest: MessageFns<GetContentRequest>; export declare const GetContentResponse: MessageFns<GetContentResponse>; export declare const ContentFilter: MessageFns<ContentFilter>; export declare const ContentResponseItem: MessageFns<ContentResponseItem>; export declare const GetIntentsRequest: MessageFns<GetIntentsRequest>; export declare const GetIntentsResponse: MessageFns<GetIntentsResponse>; export declare const GetScoreLimitsRequest: MessageFns<GetScoreLimitsRequest>; export declare const GetScoreLimitsResponse: MessageFns<GetScoreLimitsResponse>; type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]>; } : Partial<T>; type KeysOfUnion<T> = T extends T ? keyof T : never; export type Exact<P, I extends P> = P extends Builtin ? P : P & { [K in keyof P]: Exact<P[K], I[K]>; } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never; }; export interface MessageFns<T> { encode(message: T, writer?: BinaryWriter): BinaryWriter; decode(input: BinaryReader | Uint8Array, length?: number): T; fromJSON(object: any): T; toJSON(message: T): unknown; create<I extends Exact<DeepPartial<T>, I>>(base?: I): T; fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T; } export {};