Documentation
¶
Index ¶
- func EnsureResponseIncludes(values []fantasyopenai.IncludeType) []fantasyopenai.IncludeType
- func IncludeFromChat(values []string) []fantasyopenai.IncludeType
- func IsReasoningModel(modelID string) bool
- func ProviderOptionsFromChatConfig(transport Transport, options *codersdk.ChatModelOpenAIProviderOptions) fantasy.ProviderOptionsData
- func ResponsesLogProbsFromChatConfig(options *codersdk.ChatModelOpenAIProviderOptions) any
- func ServiceTierFromChat(value *string) *fantasyopenai.ServiceTier
- func TextVerbosityFromChat(value *string) *fantasyopenai.TextVerbosity
- func WebSearchTool(options *codersdk.ChatModelOpenAIProviderOptions) (fantasy.Tool, bool)
- type Transport
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureResponseIncludes ¶
func EnsureResponseIncludes( values []fantasyopenai.IncludeType, ) []fantasyopenai.IncludeType
EnsureResponseIncludes adds the OpenAI encrypted reasoning include required for Responses API reasoning continuity when it is not already present.
func IncludeFromChat ¶
func IncludeFromChat(values []string) []fantasyopenai.IncludeType
IncludeFromChat converts chat-config include values to OpenAI Responses include values and ignores unsupported entries.
func IsReasoningModel ¶
IsReasoningModel reports whether a model ID follows OpenAI reasoning model naming conventions.
func ProviderOptionsFromChatConfig ¶
func ProviderOptionsFromChatConfig( transport Transport, options *codersdk.ChatModelOpenAIProviderOptions, ) fantasy.ProviderOptionsData
ProviderOptionsFromChatConfig converts chat model OpenAI options to fantasy provider options used for inference calls.
func ResponsesLogProbsFromChatConfig ¶
func ResponsesLogProbsFromChatConfig( options *codersdk.ChatModelOpenAIProviderOptions, ) any
ResponsesLogProbsFromChatConfig maps chat-config log probability options to the value expected by OpenAI Responses provider options.
func ServiceTierFromChat ¶
func ServiceTierFromChat(value *string) *fantasyopenai.ServiceTier
ServiceTierFromChat normalizes chat-config service tier values for the OpenAI Responses API. It maps every tier the codersdk enum advertises, not only the ones fantasy declares constants for, because fantasy forwards the value to the API unchanged.
func TextVerbosityFromChat ¶
func TextVerbosityFromChat(value *string) *fantasyopenai.TextVerbosity
TextVerbosityFromChat normalizes chat-config text verbosity values for OpenAI and returns the canonical provider verbosity value.
func WebSearchTool ¶
func WebSearchTool(options *codersdk.ChatModelOpenAIProviderOptions) (fantasy.Tool, bool)
WebSearchTool returns the OpenAI provider-native web search tool when enabled by the model provider options.
Types ¶
type Transport ¶ added in v2.37.0
type Transport int
Transport identifies the OpenAI wire format a model's client speaks. It is resolved once when the client is built so that request preparation cannot disagree with the client it prepares for.
func TransportFor ¶ added in v2.37.0
TransportFor resolves the wire format for a provider and model. override, when non-nil, forces the choice instead of consulting the provider SDK's known-model list. Azure follows the known-model list because its provider exposes no equivalent hook.
func (Transport) UsesResponses ¶ added in v2.37.0
UsesResponses reports whether t selects the Responses API. It panics on TransportInvalid instead of defaulting, because an unresolved transport is a construction bug rather than user input.