MapsMessages
trait MapsMessages
Traits
Methods
Map the given Hypervel messages to Chat Completions messages format.
Map a user message to Chat Completions format.
Map an assistant message, replaying its reasoning details with its tool calls.
Map a tool result message to Chat Completions format.
Serialize a tool call DTO to Chat Completions array format.
Map a tool call or result ID to the provider's wire format.
Details
in
MapsChatCompletionMessages at line 19
protected array
mapMessagesToChat(array $messages, string|null $instructions = null)
Map the given Hypervel messages to Chat Completions messages format.
in
MapsChatCompletionMessages at line 46
protected void
mapUserMessage(UserMessage|Message $message, array $chatMessages)
Map a user message to Chat Completions format.
at line 20
protected void
mapAssistantMessage(AssistantMessage|Message $message, array $chatMessages)
Map an assistant message, replaying its reasoning details with its tool calls.
in
MapsChatCompletionMessages at line 89
protected void
mapToolResultMessage(ToolResultMessage|Message $message, array $chatMessages)
Map a tool result message to Chat Completions format.
in
MapsChatCompletionMessages at line 107
protected array
serializeToolCallToChat(ToolCall $toolCall)
Serialize a tool call DTO to Chat Completions array format.
in
MapsChatCompletionMessages at line 122
protected string
mapToolCallId(string $id)
Map a tool call or result ID to the provider's wire format.