UNPKG

@squidcloud/client

Version:

A typescript implementation of the Squid client

187 lines (186 loc) 5.54 kB
import { AiContextMetadata, AiContextMetadataFilter } from './ai-knowledge-base.public-types'; /** * Represents a category in the matchmaker. * The description is used by the AI to extract features from the content. * @category AI */ export interface MmCategory { /** The unique identifier of the category. */ id: string; /** A description used by the AI to understand and extract features from the category content. */ description: string; } /** * Represents a matchmaker entity for a given category. * The metadata is used to filter the entities when finding matches. * @category AI */ export interface MmEntity { /** The unique identifier of the entity. */ id: string; /** The content of the entity to be matched. */ content: string; /** The ID of the category this entity belongs to. */ categoryId: string; /** Metadata used for filtering entities during matching. */ metadata: AiContextMetadata; } /** * Represents a matchmaker. * The description is used to describe the matchmaker and by the AI to better understand the domain. * The categories represent the types of entities that can be matched (it is possible to match items in the same * category). * @category AI */ export interface MmMatchMaker { /** The unique identifier of the matchmaker. */ id: string; /** A description aiding the AI in understanding the matchmaker's domain. */ description: string; /** An array of categories defining the types of entities that can be matched. */ categories: Array<MmCategory>; } /** * Represents a matchmaker entity match. A high score indicates a good match. * @category AI */ export interface MmEntityMatch extends MmEntity { /** The score of the match, ranging from 0 to 100, where 100 is the best match. */ score: number; /** The reasoning behind the match score, provided by the AI. */ reasoning: string; } /** * Represents options for finding matches in the matchmaker system. * @category AI */ export interface MmFindMatchesOptions { /** Optional metadata filter conditions to narrow down matching entities; defaults to none. */ metadataFilter?: AiContextMetadataFilter; /** The maximum number of matches to return; defaults to 100, with a maximum of 100. */ limit?: number; /** The category ID to match entities against; defaults to the next or first category in the matchmaker. */ matchToCategoryId?: string; } /** * Represents options for listing entities in the matchmaker system. - * @category AI */ export interface MmListEntitiesOptions { /** Optional metadata filter conditions to narrow down listed entities; defaults to none. */ metadataFilter?: AiContextMetadataFilter; /** The maximum number of entities to return; defaults to 100. */ limit?: number; } /** * API request to delete a matchmaker * @category AI */ export interface MmDeleteMatchMakerRequest { /** The ID of the matchmaker to delete */ matchMakerId: string; } /** * API response for getting a matchmaker * @category AI */ export interface MmGetMatchMakerResponse { /** The matchmaker, if found */ matchMaker: MmMatchMaker | undefined; } /** * API request to delete an entity * @category AI */ export interface MmDeleteEntityRequest { /** The ID of the matchmaker */ matchMakerId: string; /** The ID of the entity to delete */ entityId: string; } /** * API request to insert multiple entities * @category AI */ export interface MmInsertEntitiesRequest { /** The ID of the matchmaker */ matchMakerId: string; /** Array of entities to insert */ entities: Array<MmEntity>; } /** * API request to find matches for an entity * @category AI */ export interface MmFindMatchesRequest { /** The ID of the matchmaker */ matchMakerId: string; /** The ID of the entity to find matches for */ entityId: string; /** Options for finding matches */ options: MmFindMatchesOptions; } /** * API response for finding matches * @category AI */ export interface MmFindMatchesResponse { /** Array of matching entities */ matches: Array<MmEntityMatch>; } /** * API request to find matches for an entity not yet inserted * @category AI */ export interface MmFindMatchesForEntityRequest { /** The ID of the matchmaker */ matchMakerId: string; /** The entity to find matches for */ entity: Omit<MmEntity, 'metadata' | 'id'>; /** Options for finding matches */ options: MmFindMatchesOptions; } /** * API response for finding matches for an entity * @category AI */ export interface MmFindMatchesForEntityResponse { /** Array of matching entities */ matches: Array<MmEntityMatch>; } /** * API response for listing matchmakers * @category AI */ export interface MmListMatchMakersResponse { /** Array of matchmakers */ matchMakers: Array<MmMatchMaker>; } /** * API request to list entities * @category AI */ export interface MmListEntitiesRequest { /** The ID of the matchmaker */ matchMakerId: string; /** The ID of the category */ categoryId: string; /** Options for listing entities */ options: MmListEntitiesOptions; } /** * API response for listing entities * @category AI */ export interface MmListEntitiesResponse { /** Array of entities */ entities: Array<MmEntity>; } /** * API response for getting an entity * @category AI */ export interface MmGetEntityResponse { /** The entity, if found */ entity: MmEntity | undefined; }