Skip to content

OpenAIRequestMessage ​

A message in the chat completion request. Represents a conversation turn from the user, assistant, system, or tool.

Example Usage ​

typescript
import { OpenAIRequestMessage } from "@meetkai/mka1/models/components";

let value: OpenAIRequestMessage = {
  role: "system",
  content: "<value>",
};

Fields ​

FieldTypeRequiredDescription
rolecomponents.Role✔️The role of the message author. Determines how the message is interpreted by the model.
namestring➖An optional name for the participant. For tool role messages, this is the name of the function called.
toolCallIdstring➖Tool call that this message is responding to. Required when role is 'tool'.
contentcomponents.Content✔️The contents of the message. Can be a string, an array of content parts (for multimodal inputs), or null for assistant messages with tool calls.
toolCallscomponents.ToolCalls[]➖The tool calls generated by the model, such as function calls. Only present for assistant messages with tool calls.