Accessors
items
- get items(): ChatItem[]
- set items(items): void
Returns void
readonly
- get readonly(): boolean
Returns boolean
Methods
addMessage
- addMessage(params): ChatMessage
Parameters
- params: {
content: string | ChatContent[];
createdAt?: number;
id?: string;
interrupted?: boolean;
role: ChatRole;
}Optional
createdAt?: number
Optional
id?: string
Optional
interrupted?: boolean
copy
- copy(options?): ChatContext
Parameters
- options: {
excludeEmptyMessage?: boolean;
excludeFunctionCall?: boolean;
excludeInstructions?: boolean;
toolCtx?: ToolContext<any>;
} = {}Optional
excludeEmptyMessage?: boolean
Optional
excludeFunctionCall?: boolean
Optional
excludeInstructions?: boolean
Optional
toolCtx?: ToolContext<any>
indexById
- indexById(itemId): undefined | number
Returns undefined | number
insert
- insert(item): void
Returns void
toJSON
- toJSON(options?): JSONObject
Parameters
- options: {
excludeAudio?: boolean;
excludeFunctionCall?: boolean;
excludeImage?: boolean;
excludeTimestamp?: boolean;
} = {}Optional
excludeAudio?: boolean
Optional
excludeFunctionCall?: boolean
Optional
excludeImage?: boolean
Optional
excludeTimestamp?: boolean
Returns JSONObject
toProviderFormat
- toProviderFormat(format, injectDummyUserMessage?): Promise<Record<string, any>[] | [Record<string, any>[], GoogleFormatData]>
Returns Promise<Record<string, any>[] | [Record<string, any>[], GoogleFormatData]>
Indicates whether the context is read-only