Documentation
¶
Overview ¶
Package openai implements providers.ModelProvider against an OpenAI-compatible /chat/completions endpoint (OpenAI, in-cluster vLLM, Ollama, OpenRouter).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
clientcore.Base
// contains filtered or unexported fields
}
Client is an OpenAI-compatible model provider.
func New ¶
New builds a client. apiKey may be empty (keyless vLLM/Ollama). maxTokens caps output tokens per request; <= 0 falls back to clientcore.DefaultMaxTokens. effort opts into deeper reasoning (reasoning_effort: minimal|low|medium|high, validated in config); empty omits the field entirely.
func (*Client) Complete ¶
func (c *Client) Complete(ctx context.Context, req providers.CompletionRequest) (providers.CompletionResponse, error)
Complete sends a streaming chat completion with tools and accumulates the full SSE response into a single CompletionResponse. Streaming is internal — callers see the same one-shot interface; consuming the stream avoids the flat request deadline truncating a long completion and lets per-index argument fragments reassemble each tool call's JSON args incrementally.