@squidcloud/client
Version:
A typescript implementation of the Squid client
75 lines (74 loc) • 2.82 kB
TypeScript
import { AiContextMetadata, AiContextMetadataFilter } from './ai-agent.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;
}