UNPKG

@squidcloud/client

Version:

A typescript implementation of the Squid client

62 lines (61 loc) 2.27 kB
/** Backend related public types that should be available on the client SDK */ /** A type alias for a string that represents an AI function ID. */ export type AiFunctionId = string; /** A type alias for a string that represents an AI functions configurator ID. */ export type AiFunctionsConfiguratorId = string; /** * A type alias for a service identifier. * @category Queue */ export type TopicName = string; /** A type alias for a service class name. */ export type ServiceName = string; /** A type alias for a function name within a service. */ export type FunctionName = string; /** * Function name with contextual data, where the data must be serializable as JSON. */ export interface AiFunctionIdWithContext { /** * The ID of the AI function as described in @aiFunction decorator. * Historically named as 'name' because AI function name is the default value for 'ID'. */ name: AiFunctionId; /** A record of contextual data associated with the function call. */ context?: Record<string, unknown>; /** A list of predefined parameter values for the AI function. These parameters are hidden from the AI. */ predefinedParameters?: Record<string, unknown>; } /** * A combined service and function name in the format 'ServiceName:FunctionName'. * Uniquely identifies a function within a service. */ export type ServiceFunctionName = `${ServiceName}:${FunctionName}`; /** * LLM model name for use in API calls, eg. "gpt-4o-mini". */ export type UserAiChatModelName = string; /** * Stats about a given LLM model. */ export type LlmModelMetadata = { /** * A friendly name for the model, to display in UIs. */ displayName: string; /** Maximum tokens the model can generate in a single response. */ maxOutputTokens: number; /** Total context window size: input (aka prompt) + output (aka completion) tokens combined. */ contextWindowTokens: number; }; /** * Stats about a given embedding model. */ export type EmbeddingModelMetadata = { /** A friendly name for the model, to display in UIs. */ displayName: string; /** The number of dimensions produced by this embedding model. */ dimensions: number; /** Maximum input tokens per request. */ maxTokens: number; };