Skip to main content

Interface: CompletionRequest

Defined in: src/lib/models/prompt.ts:131 Represents a message in a completion request to an AI model. Defines the structure for input messages sent to AI models, supporting different roles (user, system, tool, function) and content types including text and images for vision-enabled models. CompletionRequest

Examples

Properties

content

content: string | CompletionRequestContent[]
Defined in: src/lib/models/prompt.ts:133 Message content as text or multimodal array

role

role: "function" | "user" | "system" | "tool"
Defined in: src/lib/models/prompt.ts:132 The role of the message sender

tool_call_id?

optional tool_call_id: string
Defined in: src/lib/models/prompt.ts:134 ID of the tool call this message responds to (for tool/function roles)