MCPcopy
hub / github.com/mudler/LocalAI / OpenResponsesRequest

Struct OpenResponsesRequest

core/schema/openresponses.go:27–61  ·  view source on GitHub ↗

OpenResponsesRequest represents a request to the Open Responses API https://www.openresponses.org/specification

Source from the content-addressed store, hash-verified

25// OpenResponsesRequest represents a request to the Open Responses API
26// https://www.openresponses.org/specification
27type OpenResponsesRequest struct {
28 Model string `json:"model"`
29 Input any `json:"input"` // string or []ORItemParam
30 Tools []ORFunctionTool `json:"tools,omitempty"`
31 ToolChoice any `json:"tool_choice,omitempty"` // "auto"|"required"|"none"|{type:"function",name:"..."}
32 Stream bool `json:"stream,omitempty"`
33 MaxOutputTokens *int `json:"max_output_tokens,omitempty"`
34 Temperature *float64 `json:"temperature,omitempty"`
35 TopP *float64 `json:"top_p,omitempty"`
36 Truncation string `json:"truncation,omitempty"` // "auto"|"disabled"
37 Instructions string `json:"instructions,omitempty"`
38 Reasoning *ORReasoningParam `json:"reasoning,omitempty"`
39 Metadata map[string]string `json:"metadata,omitempty"`
40 PreviousResponseID string `json:"previous_response_id,omitempty"`
41
42 // Additional parameters from spec
43 TextFormat any `json:"text_format,omitempty"` // TextResponseFormat or JsonSchemaResponseFormatParam
44 ServiceTier string `json:"service_tier,omitempty"` // "auto"|"default"|priority hint
45 AllowedTools []string `json:"allowed_tools,omitempty"` // Restrict which tools can be invoked
46 Store *bool `json:"store,omitempty"` // Whether to store the response
47 Include []string `json:"include,omitempty"` // What to include in response
48 ParallelToolCalls *bool `json:"parallel_tool_calls,omitempty"` // Allow parallel tool calls
49 PresencePenalty *float64 `json:"presence_penalty,omitempty"` // Presence penalty (-2.0 to 2.0)
50 FrequencyPenalty *float64 `json:"frequency_penalty,omitempty"` // Frequency penalty (-2.0 to 2.0)
51 TopLogprobs *int `json:"top_logprobs,omitempty"` // Number of top logprobs to return
52 Background *bool `json:"background,omitempty"` // Run request in background
53 MaxToolCalls *int `json:"max_tool_calls,omitempty"` // Maximum number of tool calls
54
55 // OpenAI-compatible extensions (not in Open Responses spec)
56 LogitBias map[string]float64 `json:"logit_bias,omitempty"` // Map of token IDs to bias values (-100 to 100)
57
58 // Internal fields (like OpenAIRequest)
59 Context context.Context `json:"-"`
60 Cancel context.CancelFunc `json:"-"`
61}
62
63// ModelName implements the LocalAIRequest interface
64func (r *OpenResponsesRequest) ModelName(s *string) string {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected