Documentation
¶
Index ¶
- Variables
- func ConvertCliToOpenAI(rawJson []byte, unixTimestamp int64, isGlAPIKey bool) string
- func ConvertCliToOpenAINonStream(rawJson []byte, unixTimestamp int64, isGlAPIKey bool) string
- func FixCLIToolResponse(input string) (string, error)
- func PrepareRequest(rawJson []byte) (string, *client.Content, []client.Content, []client.ToolDeclaration)
- type FunctionCallGroup
Constants ¶
This section is empty.
Variables ¶
var MimeTypes = map[string]string{}/* 732 elements not displayed */
MimeTypes is a comprehensive map of file extensions to their corresponding MIME types. This is used to identify the type of file being uploaded or processed.
Functions ¶
func ConvertCliToOpenAI ¶
ConvertCliToOpenAI translates a single chunk of a streaming response from the backend client format to the OpenAI Server-Sent Events (SSE) format. It returns an empty string if the chunk contains no useful data.
func ConvertCliToOpenAINonStream ¶
ConvertCliToOpenAINonStream aggregates response from the backend client convert a single, non-streaming OpenAI-compatible JSON response.
func FixCLIToolResponse ¶ added in v1.9.0
FixCLIToolResponse converts the format from 1.json to 2.json It groups function calls with their corresponding responses
func PrepareRequest ¶
func PrepareRequest(rawJson []byte) (string, *client.Content, []client.Content, []client.ToolDeclaration)
PrepareRequest translates a raw JSON request from an OpenAI-compatible format to the internal format expected by the backend client. It parses messages, roles, content types (text, image, file), and tool calls.