Versions in this module Expand all Collapse all v1 v1.0.11 Jan 12, 2026 Changes in this version + const APIPrefix + const ContentTypeFunctionCall + const ContentTypeFunctionCallOutput + const ContentTypeInputFile + const ContentTypeInputImage + const ContentTypeInputText + const ContentTypeOutputText + const ContentTypeRefusal + const DefaultTTL + const EventContentPartAdded + const EventContentPartDone + const EventError + const EventFunctionCallArgsDelta + const EventFunctionCallArgsDone + const EventOutputItemAdded + const EventOutputItemDone + const EventOutputTextDelta + const EventOutputTextDone + const EventRefusalDelta + const EventRefusalDone + const EventResponseCompleted + const EventResponseCreated + const EventResponseFailed + const EventResponseInProgress + const EventResponseIncomplete + const ItemTypeFunctionCall + const ItemTypeFunctionCallOutput + const ItemTypeMessage + const StatusCancelled + const StatusCompleted + const StatusFailed + const StatusInProgress + const StatusQueued + func GenerateCallID() string + func GenerateID(length int) string + func GenerateItemID() string + func GenerateMessageID() string + func GenerateResponseID() string + func MarshalChatCompletionRequest(req *ChatCompletionRequest) ([]byte, error) + func ProcessSSEStream(reader *bufio.Reader, handler func(event, data string)) error + type Annotation struct + EndIndex int + StartIndex int + Title string + Type string + URL string + type ChatChoice struct + FinishReason string + Index int + Message ChatMessage + type ChatCompletionRequest struct + MaxTokens *int + Messages []ChatMessage + Model string + ParallelToolCalls *bool + Stream bool + Temperature *float64 + ToolChoice interface{} + Tools []ChatTool + TopP *float64 + User string + func TransformRequestToChatCompletion(req *CreateRequest, store *Store) (*ChatCompletionRequest, error) + type ChatCompletionResponse struct + Choices []ChatChoice + Created int64 + ID string + Model string + Object string + Usage *ChatUsage + type ChatContentPart struct + ImageURL *ChatImageURL + Text string + Type string + type ChatDelta struct + Content string + ReasoningContent string + Role string + ToolCalls []ChatToolCall + type ChatFunction struct + Description string + Name string + Parameters interface{} + type ChatFunctionCall struct + Arguments string + Name string + type ChatImageURL struct + Detail string + URL string + type ChatMessage struct + Content interface{} + Name string + Role string + ToolCallID string + ToolCalls []ChatToolCall + type ChatStreamChoice struct + Delta ChatDelta + FinishReason *string + Index int + type ChatStreamChunk struct + Choices []ChatStreamChoice + Created int64 + ID string + Model string + Object string + Usage *ChatUsage + type ChatTool struct + Function ChatFunction + Type string + type ChatToolCall struct + Function ChatFunctionCall + ID string + Type string + type ChatUsage struct + CompletionTokens int + PromptTokens int + TotalTokens int + type ContentPart struct + Annotations []Annotation + Refusal string + Text string + Type string + type CreateRequest struct + Input json.RawMessage + Instructions string + MaxOutputTokens *int + Metadata map[string]string + Model string + ParallelToolCalls *bool + PreviousResponseID string + ReasoningEffort string + Stream bool + Temperature *float64 + ToolChoice interface{} + Tools []Tool + TopP *float64 + User string + type ErrorDetail struct + Code string + Message string + type FunctionDef struct + Description string + Name string + Parameters interface{} + type HTTPHandler struct + func NewHTTPHandler(log logging.Logger, schedulerHTTP http.Handler, allowedOrigins []string) *HTTPHandler + func (h *HTTPHandler) GetStore() *Store + func (h *HTTPHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) + func (h *HTTPHandler) SetMaxRequestBodyBytes(bytes int64) + type IncompleteDetails struct + Reason string + type InputContentPart struct + FileData string + FileID string + Filename string + ImageURL string + Text string + Type string + type InputItem struct + Arguments string + CallID string + Content json.RawMessage + ID string + Name string + Output string + Role string + Type string + type NonStreamingResponseCapture struct + Body strings.Builder + Headers http.Header + StatusCode int + func NewNonStreamingResponseCapture() *NonStreamingResponseCapture + func (c *NonStreamingResponseCapture) Header() http.Header + func (c *NonStreamingResponseCapture) Write(data []byte) (int, error) + func (c *NonStreamingResponseCapture) WriteHeader(statusCode int) + type OutputItem struct + Arguments string + CallID string + Content []ContentPart + ID string + Name string + Output string + Role string + Status string + Type string + type OutputTokensDetails struct + ReasoningTokens int + type ReasoningDetails struct + EncryptedContent string + type Response struct + CreatedAt float64 + Error *ErrorDetail + FinishReason string + ID string + IncompleteDetails *IncompleteDetails + Instructions *string + MaxOutputTokens *int + Metadata map[string]string + Model string + Object string + Output []OutputItem + OutputText string + ParallelToolCalls *bool + PreviousResponseID *string + Reasoning *ReasoningDetails + ReasoningEffort *string + Status string + Temperature *float64 + ToolChoice interface{} + Tools []Tool + TopP *float64 + Usage *Usage + User *string + func CreateErrorResponse(respID, model, code, message string) *Response + func NewResponse(id, model string) *Response + func ResponseWithTimestamp(resp *Response) *Response + func TransformChatCompletionToResponse(chatResp *ChatCompletionResponse, respID, model string) *Response + type Store struct + func NewStore(ttl time.Duration) *Store + func (s *Store) Count() int + func (s *Store) Delete(id string) bool + func (s *Store) Get(id string) (*Response, bool) + func (s *Store) GetResponseIDs() []string + func (s *Store) Save(resp *Response) + func (s *Store) Update(id string, updateFn func(*Response)) bool + type StreamEvent struct + ContentIndex int + Delta string + Error *ErrorDetail + Item *OutputItem + ItemID string + OutputIndex int + Part *ContentPart + Response *Response + SequenceNumber int + Type string + type StreamingResponseWriter struct + func NewStreamingResponseWriter(w http.ResponseWriter, resp *Response, store *Store) *StreamingResponseWriter + func (s *StreamingResponseWriter) Header() http.Header + func (s *StreamingResponseWriter) Write(data []byte) (int, error) + func (s *StreamingResponseWriter) WriteHeader(statusCode int) + type Tool struct + Description string + Function *FunctionDef + Name string + Parameters interface{} + Type string + type Usage struct + InputTokens int + OutputTokens int + OutputTokensDetails *OutputTokensDetails + TotalTokens int