Documentation ¶
Index ¶
- func ProcessError(err error, modelId string)
- type ClaudeRequest
- type ClaudeResponse
- type Completion
- type Data
- type ImageGenerationConfig
- type InvokeModelWithResponseStreamWrapper
- type InvokeModelWrapper
- func (wrapper InvokeModelWrapper) InvokeClaude(prompt string) (string, error)
- func (wrapper InvokeModelWrapper) InvokeJurassic2(prompt string) (string, error)
- func (wrapper InvokeModelWrapper) InvokeLlama2(prompt string) (string, error)
- func (wrapper InvokeModelWrapper) InvokeTitanImage(prompt string, seed int64) (string, error)
- func (wrapper InvokeModelWrapper) InvokeTitanText(prompt string) (string, error)
- type Jurassic2Request
- type Jurassic2Response
- type Llama2Request
- type Llama2Response
- type Request
- type Response
- type Result
- type StreamingOutputHandler
- type TextGenerationConfig
- type TextToImageParams
- type TitanImageRequest
- type TitanImageResponse
- type TitanTextRequest
- type TitanTextResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ProcessError ¶
Types ¶
type ClaudeRequest ¶
type ClaudeResponse ¶
type ClaudeResponse struct {
Completion string `json:"completion"`
}
type Completion ¶
type Completion struct {
Data Data `json:"data"`
}
type ImageGenerationConfig ¶
type InvokeModelWithResponseStreamWrapper ¶
type InvokeModelWithResponseStreamWrapper struct {
BedrockRuntimeClient *bedrockruntime.Client
}
InvokeModelWithResponseStreamWrapper encapsulates Amazon Bedrock actions used in the examples. It contains a Bedrock Runtime client that is used to invoke foundation models.
func (InvokeModelWithResponseStreamWrapper) InvokeModelWithResponseStream ¶
func (wrapper InvokeModelWithResponseStreamWrapper) InvokeModelWithResponseStream(prompt string) (string, error)
type InvokeModelWrapper ¶
type InvokeModelWrapper struct {
BedrockRuntimeClient *bedrockruntime.Client
}
InvokeModelWrapper encapsulates Amazon Bedrock actions used in the examples. It contains a Bedrock Runtime client that is used to invoke foundation models.
func (InvokeModelWrapper) InvokeClaude ¶
func (wrapper InvokeModelWrapper) InvokeClaude(prompt string) (string, error)
Invokes Anthropic Claude on Amazon Bedrock to run an inference using the input provided in the request body.
func (InvokeModelWrapper) InvokeJurassic2 ¶
func (wrapper InvokeModelWrapper) InvokeJurassic2(prompt string) (string, error)
Invokes AI21 Labs Jurassic-2 on Amazon Bedrock to run an inference using the input provided in the request body.
func (InvokeModelWrapper) InvokeLlama2 ¶
func (wrapper InvokeModelWrapper) InvokeLlama2(prompt string) (string, error)
Invokes Meta Llama 2 Chat on Amazon Bedrock to run an inference using the input provided in the request body.
func (InvokeModelWrapper) InvokeTitanImage ¶
func (wrapper InvokeModelWrapper) InvokeTitanImage(prompt string, seed int64) (string, error)
Invokes the Titan Image model to create an image using the input provided in the request body.
func (InvokeModelWrapper) InvokeTitanText ¶
func (wrapper InvokeModelWrapper) InvokeTitanText(prompt string) (string, error)
type Jurassic2Request ¶
type Jurassic2Response ¶
type Jurassic2Response struct {
Completions []Completion `json:"completions"`
}
type Llama2Request ¶
type Llama2Response ¶
type Llama2Response struct {
Generation string `json:"generation"`
}
type StreamingOutputHandler ¶
type TextGenerationConfig ¶
type TextToImageParams ¶
type TextToImageParams struct {
Text string `json:"text"`
}
type TitanImageRequest ¶
type TitanImageRequest struct { TaskType string `json:"taskType"` TextToImageParams TextToImageParams `json:"textToImageParams"` ImageGenerationConfig ImageGenerationConfig `json:"imageGenerationConfig"` }
type TitanImageResponse ¶
type TitanImageResponse struct {
Images []string `json:"images"`
}
type TitanTextRequest ¶
type TitanTextRequest struct { InputText string `json:"inputText"` TextGenerationConfig TextGenerationConfig `json:"textGenerationConfig"` }
Each model provider has their own individual request and response formats. For the format, ranges, and default values for Amazon Titan Text, refer to: https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-titan-text.html