Documentation
¶
Index ¶
- func RedactedEndpoint(value string) string
- func StripLeadingReasoningBlocks(value string) (string, bool)
- type AgentMessage
- type AgentResponse
- type AgentTool
- type AgentToolCall
- type AgentToolFunction
- type AppError
- type Client
- type Config
- type ErrorKind
- type ModelInfo
- type Request
- type Response
- type Usage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RedactedEndpoint ¶
func StripLeadingReasoningBlocks ¶
StripLeadingReasoningBlocks removes model-internal reasoning emitted before the user-visible answer. Tags inside the document body are preserved.
Types ¶
type AgentMessage ¶
type AgentMessage struct {
Role string `json:"role"`
Content string `json:"content,omitempty"`
ToolCallID string `json:"tool_call_id,omitempty"`
ToolCalls []AgentToolCall `json:"tool_calls,omitempty"`
}
type AgentResponse ¶
type AgentResponse struct {
Content string
ToolCalls []AgentToolCall
Usage Usage
RawModel string
FinishReason string
}
func CompleteAgentChatOpenAICompatible ¶
func CompleteAgentChatOpenAICompatible( ctx context.Context, config Config, messages []AgentMessage, tools []AgentTool, httpClient *http.Client, ) (AgentResponse, error)
type AgentTool ¶
type AgentTool struct {
Name string `json:"name"`
Description string `json:"description"`
Parameters json.RawMessage `json:"parameters"`
}
type AgentToolCall ¶
type AgentToolCall struct {
ID string `json:"id"`
Type string `json:"type"`
Function AgentToolFunction `json:"function"`
}
type AgentToolFunction ¶
type AppError ¶
type AppError struct {
Kind ErrorKind `json:"kind"`
Message string `json:"message"`
Retryable bool `json:"retryable"`
Usage *Usage `json:"usage,omitempty"`
Cause error `json:"-"`
}
type ErrorKind ¶
type ErrorKind string
const ( ConfigError ErrorKind = "ConfigError" DependencyError ErrorKind = "DependencyError" RenderError ErrorKind = "RenderError" RateLimitError ErrorKind = "RateLimitError" ServerError ErrorKind = "ServerError" TimeoutError ErrorKind = "TimeoutError" AuthError ErrorKind = "AuthError" ModelError ErrorKind = "ModelError" ParseError ErrorKind = "ParseError" PartialError ErrorKind = "PartialError" )
type ModelInfo ¶
Click to show internal directories.
Click to hide internal directories.