Documentation
¶
Index ¶
Constants ¶
View Source
const MaxRequestBytes = 1 << 20
View Source
const MaxRetryAfter = 6 * time.Hour
View Source
const MaxToolArguments = 256 << 10
View Source
const MaxTurnTimeout = 10 * time.Minute
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Capabilities ¶
type Config ¶
type Config struct {
Endpoint string
APIKey string `json:"-"`
Model string
Client HTTPClient `json:"-"`
Profile string
}
type ModelProvider ¶
type Tool ¶
type Tool struct {
Name string `json:"name"`
Description string `json:"description"`
Schema json.RawMessage `json:"schema"`
}
type ToolCall ¶
type ToolCall struct {
ID string `json:"id"`
Name string `json:"name"`
Arguments json.RawMessage `json:"arguments"`
Invalid string `json:"invalid,omitempty"`
}
type ToolSchemas ¶
type ToolSchemas map[string]*jsonschema.Schema
func CompileTools ¶
func CompileTools(tools []Tool) (ToolSchemas, error)
func (ToolSchemas) Check ¶
func (s ToolSchemas) Check(call *ToolCall) error
func (ToolSchemas) Registered ¶
func (s ToolSchemas) Registered(call ToolCall) error
func (ToolSchemas) Validate ¶
func (s ToolSchemas) Validate(call ToolCall) error
type Turn ¶
type Turn struct {
OperationID string `json:"operation_id"`
Model string `json:"model"`
System string `json:"system"`
Messages []Message `json:"messages"`
Tools []Tool `json:"tools"`
MaxOutputTokens int `json:"max_output_tokens"`
Continuation json.RawMessage `json:"continuation,omitempty"`
TimeoutMS int64 `json:"timeout_ms"`
Session string `json:"-"`
}
func (Turn) Request ¶
func (t Turn) Request() TurnRequest
func (Turn) WithSkills ¶
type TurnRequest ¶
type TurnResult ¶
type TurnResult struct {
ProviderID string `json:"provider_id"`
Text string `json:"text"`
ToolCalls []ToolCall `json:"tool_calls"`
Usage Usage `json:"usage"`
Continuation json.RawMessage `json:"continuation,omitempty"`
FinishReason string `json:"finish_reason"`
}
func CollectTurn ¶
func CollectTurn(ctx context.Context, p ModelProvider, t Turn) (TurnResult, error)
func (TurnResult) GoString ¶
func (t TurnResult) GoString() string
func (TurnResult) LogValue ¶
func (t TurnResult) LogValue() slog.Value
func (TurnResult) String ¶
func (TurnResult) String() string
Click to show internal directories.
Click to hide internal directories.