openai

package
v0.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 3, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

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

func New(baseURL, model, apiKey string, maxTokens int, effort string) *Client

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

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL