openai

package
v0.0.49 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 7, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildResponsesOutput

func BuildResponsesOutput(batch queue.Batch) []map[string]any

BuildResponsesOutput builds non-stream output[] from a breakpoint batch.

func EncodeChatCompletion

func EncodeChatCompletion(model string, batch queue.Batch) openai.ChatCompletion

EncodeChatCompletion maps a breakpoint batch to a Chat Completions response. Prefix think text is merged into message content; omitted from tool_call wire.

func EncodeChatCompletionFromExchange

func EncodeChatCompletionFromExchange(model string, resp mockconfig.ExchangeResponse) openai.ChatCompletion

EncodeChatCompletionFromExchange maps a legacy prefix exchange to Chat Completions.

func GenChatID

func GenChatID() string

func GenFuncCallID

func GenFuncCallID() string

func GenMsgID

func GenMsgID() string

func GenReasoningID

func GenReasoningID() string

func GenRespID

func GenRespID() string

func MarshalChatCompletionJSON

func MarshalChatCompletionJSON(resp mockconfig.ExchangeResponse, completion openai.ChatCompletion) ([]byte, error)

MarshalChatCompletionJSON serializes a chat completion, using null content for tool_calls.

func WireFunctionCall

func WireFunctionCall(tc mockconfig.ToolCall) (name, arguments string)

WireFunctionCall maps mock tool_calls to Responses API function_call wire names/arguments. Best-effort codex remap: bash→exec_command, command→cmd.

func WriteChatStream

func WriteChatStream(w http.ResponseWriter, model string, batch queue.Batch) error

WriteChatStream writes Chat Completions SSE for a breakpoint batch.

func WriteChatStreamFromExchange

func WriteChatStreamFromExchange(w http.ResponseWriter, model string, exchange mockconfig.ExchangeResponse) error

WriteChatStreamFromExchange writes Chat Completions SSE for a legacy exchange.

func WriteResponsesNonStream

func WriteResponsesNonStream(w http.ResponseWriter, model string, batch queue.Batch)

WriteResponsesNonStream writes a completed Responses API JSON body.

func WriteResponsesNonStreamFromExchange

func WriteResponsesNonStreamFromExchange(w http.ResponseWriter, model string, exchange mockconfig.ExchangeResponse)

WriteResponsesNonStreamFromExchange writes legacy prefix exchange as Responses API JSON.

func WriteResponsesStream

func WriteResponsesStream(w http.ResponseWriter, model string, batch queue.Batch) error

WriteResponsesStream writes Responses API SSE for a breakpoint batch.

func WriteResponsesStreamFromExchange

func WriteResponsesStreamFromExchange(w http.ResponseWriter, model string, exchange mockconfig.ExchangeResponse) error

WriteResponsesStreamFromExchange writes Responses API SSE for a legacy exchange.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL