package
Version:
v1.20.2
Opens a new window with list of versions in this module.
Published: Dec 17, 2024
License: Apache-2.0
Opens a new window with license information.
Imports: 7
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Invoke invokes the Claude V2 model with the provided prompt.
InvokeClaude3 invokes the Claude V3 model with the provided prompt.
type Content struct {
Type string `json:"type"`
Sources []*Source `json:"source,omitempty"`
Text string `json:"text,omitempty"`
}
type Message struct {
Role string `json:"role"`
Contents []*Content `json:"content"`
}
type MessageResponse struct {
Id string `json:"id"`
Type string `json:"type"`
Role string `json:"role"`
Contents []*Content `json:"content"`
Model string `json:"model"`
StopReason string `json:"stop_reason"`
StopSequence string `json:"stop_sequence"`
Usage *MessageUsage `json:"usage"`
}
type MessageUsage struct {
InputTokens int `json:"input_tokens"`
OutputTokens int `json:"output_tokens"`
}
type Request struct {
Prompt string `json:"prompt,omitempty"`
System string `json:"system,omitempty"`
Messages []*Message `json:"messages,omitempty"`
MaxTokensToSample int `json:"max_tokens_to_sample,omitempty"`
MaxTokens int `json:"max_tokens,omitempty"`
Temperature float64 `json:"temperature,omitempty"`
TopP float64 `json:"top_p,omitempty"`
TopK int `json:"top_k,omitempty"`
StopSequences []string `json:"stop_sequences,omitempty"`
AnthropicVersion string `json:"anthropic_version,omitempty"`
}
type Response struct {
Completion string `json:"completion"`
}
type Source struct {
Type string `json:"type"`
MediaType string `json:"media_type"`
Data string `json:"data"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.