Documentation
¶
Index ¶
- Variables
- func BoolPtr(v bool) *bool
- type ChatCompletionRequest
- type ChatCompletionResponse
- type ChatStream
- type Client
- type CompactResponseRequest
- type CompactedResponse
- type Config
- type ContentPart
- type CreateResponseRequest
- type DecisionCaller
- type Embedding
- type EmbeddingRequest
- type EmbeddingResponse
- type ImageURL
- type Message
- type Model
- type ModelsResponse
- type Provider
- type ProviderCapability
- type ResponseObject
- type ResponseStream
- type SystemOneAnswer
- type SystemOneQuestion
- type SystemOneRequest
- type SystemOneResponse
- type SystemOneUsage
- type Tool
- type ToolCall
- type ToolFunction
- type Usage
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrResponseNotFound = openai.ErrResponseNotFound
ErrResponseNotFound is returned (wrapped) for an unknown, expired or other client's emulated response, including an unknown previous_response_id.
Functions ¶
Types ¶
type ChatCompletionRequest ¶
type ChatCompletionRequest = openai.ChatCompletionRequest
type ChatCompletionResponse ¶
type ChatCompletionResponse = openai.ChatCompletionResponse
type ChatStream ¶
type ChatStream = openai.ChatStream
type Client ¶
type Client interface {
// Provider information
Provider() string
// Provider capabilities (client-level features)
SupportsCapability(cap string) bool
// Model management
GetModels(ctx context.Context) (*ModelsResponse, error)
// Chat completions
ChatCompletion(ctx context.Context, req ChatCompletionRequest) (*ChatCompletionResponse, error)
StreamChatCompletion(ctx context.Context, req ChatCompletionRequest) *ChatStream
// Embeddings
CreateEmbedding(ctx context.Context, req EmbeddingRequest) (*EmbeddingResponse, error)
// OpenAI Responses API
CreateResponse(ctx context.Context, req CreateResponseRequest) (*ResponseObject, error)
StreamResponse(ctx context.Context, req CreateResponseRequest) *ResponseStream
GetResponse(ctx context.Context, id string) (*ResponseObject, error)
CancelResponse(ctx context.Context, id string) (*ResponseObject, error)
DeleteResponse(ctx context.Context, id string) error
CompactResponse(ctx context.Context, req CompactResponseRequest) (*CompactedResponse, error)
// Close/cleanup
Close() error
}
Client is the universal LLM client interface
type CompactResponseRequest ¶ added in v0.32.0
type CompactResponseRequest = openai.CompactResponseRequest
type CompactedResponse ¶ added in v0.32.0
type CompactedResponse = openai.CompactedResponse
type ContentPart ¶
type ContentPart = openai.ContentPart
type CreateResponseRequest ¶
type CreateResponseRequest = openai.CreateResponseRequest
type DecisionCaller ¶ added in v0.31.0
type DecisionCaller interface {
Decide(ctx context.Context, req SystemOneRequest) (*SystemOneResponse, error)
}
DecisionCaller is implemented by clients whose provider runs decision models (see ProviderCapabilityDecision). It is a separate interface, not a Client method, so existing Client implementations keep compiling; probe with a type assertion:
dc, ok := client.(ai.DecisionCaller)
type EmbeddingRequest ¶
type EmbeddingRequest = openai.EmbeddingRequest
type EmbeddingResponse ¶
type EmbeddingResponse = openai.EmbeddingResponse
type ModelsResponse ¶
type ModelsResponse = openai.ModelsResponse
type ProviderCapability ¶
type ProviderCapability string
ProviderCapability represents provider-level features
const ( ProviderCapabilityEmbedding ProviderCapability = "embeddings" // ProviderCapabilityResponses marks clients that use the provider's // native Responses API (OpenAI, xAI). ProviderCapabilityResponses ProviderCapability = "responses" // ProviderCapabilityResponsesEmulated marks clients that serve the // Responses API by emulating it over chat completions, storing // conversations themselves (see openai.Config.ResponseStore). Every // client reports exactly one of responses and responses_emulated. ProviderCapabilityResponsesEmulated ProviderCapability = "responses_emulated" // ProviderCapabilityDecision marks providers that can run decision // models (Ollama's System One endpoint): classification, yes/no // probabilities and rubric scoring instead of chat generation. The // authoritative check is the DecisionCaller interface: a client may // report a capability this package does not yet model. ProviderCapabilityDecision ProviderCapability = "decision" )
type ResponseObject ¶
type ResponseObject = openai.ResponseObject
type ResponseStream ¶ added in v0.12.6
type ResponseStream = openai.ResponseStream
type SystemOneAnswer ¶ added in v0.31.0
type SystemOneAnswer = openai.SystemOneAnswer
type SystemOneQuestion ¶ added in v0.31.0
type SystemOneQuestion = openai.SystemOneQuestion
type SystemOneRequest ¶ added in v0.31.0
type SystemOneRequest = openai.SystemOneRequest
System One (decision model) types. See openai/systemone.go.
type SystemOneResponse ¶ added in v0.31.0
type SystemOneResponse = openai.SystemOneResponse
type SystemOneUsage ¶ added in v0.31.0
type SystemOneUsage = openai.SystemOneUsage
type ToolFunction ¶
type ToolFunction = openai.ToolFunction
Click to show internal directories.
Click to hide internal directories.