[]
        
(Showing Draft Content)

GC.Spread.Sheets.AI

Namespace: AI

Spread.Sheets.AI

Table of contents

Type aliases

Type aliases

AIRequestCallback

Ƭ AIRequestCallback: (config: IAIConfig) => Promise<any>

Type declaration

▸ (config): Promise<any>

Callback function type for sending an AI request.

Parameters
Name Type Description
config IAIConfig Request parameters to forward to the AI provider.
Returns

Promise<any>

Promise that resolves with the provider response.


IAIConfig

Ƭ IAIConfig: Object

Simplified request body passed to the AI provider. This shape is compatible with the OpenAI Chat Completions API request body used by this plugin, while allowing additional OpenAI-compatible fields to pass through as custom properties.

property {{ role: string; content: string }[]} [messages] - Array of message objects containing role and content pairs for conversation history

property [temperature] - Sampling temperature for the generated response. Higher values make output more random.

property [max_tokens] - Legacy maximum output token limit.

property [stream] - Whether to return the response as a server-sent event stream (SSE).

property [key: string] - Additional provider-specific or OpenAI-compatible request properties, such as model or max_completion_tokens.

Index signature

▪ [key: string]: any

Type declaration

Name Type
max_tokens? number
messages { content: string ; role: string }[]
stream? boolean
temperature? number

IAIEnvironment

Ƭ IAIEnvironment: Object

Environment configuration for the AI service endpoint.

property model - Model identifier added to the outbound request body, for example an OpenAI chat model name.

property key - API key used in the Authorization: Bearer request header.

property basePath - HTTP endpoint that receives the JSON request body, for example a server route or OpenAI-compatible API URL.

Type declaration

Name Type Description
basePath string HTTP endpoint that receives the JSON request body, for example a server route or OpenAI-compatible API URL.
key string API key used in the Authorization: Bearer request header.
model string Model identifier added to the outbound request body, for example an OpenAI chat model name.