Documentation
¶
Index ¶
Constants ¶
View Source
const ( AnthropicVersionHeader = "anthropic-version" AnthropicVersion2023_01_01 = "2023-01-01" AnthropicVersion2023_06_01 = "2023-06-01" AnthropicVersionLatest = AnthropicVersion2023_06_01 AnthropicStopReasonEndTurn = "end_turn" AnthropicStopReasonMaxTokens = "max_tokens" AnthropicStopReasonStopSequence = "stop_sequence" AnthropicStopReasonToolUse = "tool_use" AnthropicStopReasonPauseTurn = "pause_turn" AnthropicStopReasonRefusal = "refusal" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnthropicContentBlock ¶
type AnthropicContentBlock struct {
Type string `json:"type"`
Text string `json:"text,omitempty"`
Source *AnthropicContentSource `json:"source,omitempty"`
// Tool use fields
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Input any `json:"input,omitempty"`
// Tool result fields
ToolUseID string `json:"tool_use_id,omitempty"`
Content string `json:"content,omitempty"`
IsError bool `json:"is_error,omitempty"`
}
type AnthropicContentSource ¶
type AnthropicMessage ¶
type AnthropicProvider ¶
type AnthropicProvider struct {
// contains filtered or unexported fields
}
func NewAnthropicProvider ¶
func NewAnthropicProvider(options ...dataplane.ProviderOption) *AnthropicProvider
func (*AnthropicProvider) Name ¶
func (p *AnthropicProvider) Name() string
func (*AnthropicProvider) SetLLMClient ¶
func (p *AnthropicProvider) SetLLMClient(client dataplane.LLMClient)
func (*AnthropicProvider) SetupRoutes ¶
type AnthropicRequest ¶
type AnthropicRequest struct {
Model string `json:"model"`
MaxTokens int `json:"max_tokens"`
Messages []AnthropicMessage `json:"messages"`
Temperature *float64 `json:"temperature,omitempty"`
TopP *float64 `json:"top_p,omitempty"`
TopK *int `json:"top_k,omitempty"`
StopSequences []string `json:"stop_sequences,omitempty"`
Stream bool `json:"stream,omitempty"`
System string `json:"system,omitempty"`
Tools []AnthropicTool `json:"tools,omitempty"`
ToolChoice any `json:"tool_choice,omitempty"`
}
type AnthropicResponse ¶
type AnthropicResponse struct {
ID string `json:"id"`
Type string `json:"type"`
Role string `json:"role"`
Content []AnthropicContentBlock `json:"content"`
Model string `json:"model"`
StopReason string `json:"stop_reason"`
StopSequence *string `json:"stop_sequence"`
Usage *AnthropicUsage `json:"usage"`
}
type AnthropicStreamDelta ¶
type AnthropicStreamEvent ¶
type AnthropicStreamEvent struct {
Type string `json:"type"`
Index int `json:"index,omitempty"`
Delta any `json:"delta,omitempty"`
Usage *AnthropicUsage `json:"usage,omitempty"`
}
type AnthropicTool ¶
type AnthropicUsage ¶
type OpenAIProvider ¶
type OpenAIProvider struct {
// contains filtered or unexported fields
}
func NewOpenAIProvider ¶
func NewOpenAIProvider(options ...dataplane.ProviderOption) *OpenAIProvider
func (*OpenAIProvider) Name ¶
func (p *OpenAIProvider) Name() string
func (*OpenAIProvider) SetLLMClient ¶
func (p *OpenAIProvider) SetLLMClient(client dataplane.LLMClient)
func (*OpenAIProvider) SetupRoutes ¶
Click to show internal directories.
Click to hide internal directories.