effect-io-ai

Package: @effect/ai-openai-compat
Module: OpenAiClient

OpenAiClient.ChatCompletionRequestMessage

Message shapes accepted by the chat completions endpoint.

Signature

type ChatCompletionRequestMessage = | {
    readonly role: "system" | "developer" | "user" | "assistant"
    readonly content: string | ReadonlyArray<ChatCompletionContentPart> | null
    readonly tool_calls?: ReadonlyArray<ChatCompletionRequestToolCall> | undefined
  }
  | {
    readonly role: "tool"
    readonly tool_call_id: string
    readonly content: string
  }

Source

Since v4.0.0