Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BedrockRequest ¶
type BedrockRequest struct { AdditionalModelRequestFields map[string]interface{} `json:"additionalModelRequestFields"` InferenceConfig InferenceConfig `json:"inferenceConfig"` Messages []Message `json:"messages"` System []SystemMessage `json:"system"` }
BedrockRequest represents the structure of the Bedrock API request body.
func CreateBedrockRequest ¶
func CreateBedrockRequest(maxTokens int, Temperature, TopP float64, messages models.AIChatHistory, systemMessage string) BedrockRequest
type BedrockResponse ¶ added in v1.5.42
type BedrockResponse struct { Metrics Metrics `json:"metrics"` Output Output `json:"output"` StopReason string `json:"stopReason"` Usage Usage `json:"usage"` }
func InvokeBedrockConverseAPI ¶
func InvokeBedrockConverseAPI(modelIdentifier string, requestBody BedrockRequest) (*BedrockResponse, error)
type Content ¶
type Content struct {
Text string `json:"text"`
}
Content represents the content of a message.
type InferenceConfig ¶
type InferenceConfig struct { MaxTokens int `json:"maxTokens"` Temperature float64 `json:"temperature"` TopP float64 `json:"topP"` }
InferenceConfig defines the inference configurations.
type Message ¶
Message represents a single message in the messages array.
func ProcessChatMessages ¶
func ProcessChatMessages(messages models.AIChatHistory) []Message
type SystemMessage ¶
type SystemMessage struct {
Text string `json:"text"`
}
SystemMessage represents a system-level message.
Click to show internal directories.
Click to hide internal directories.