bedrock

package
v1.8.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Invoke

func Invoke(p string) (string, error)

Invoke invokes the Claude V2 model with the provided prompt.

func InvokeClaude3 added in v1.8.5

func InvokeClaude3(p string, model string, system string) (string, error)

InvokeClaude3 invokes the Claude V3 model with the provided prompt.

Types

type Content added in v1.8.5

type Content struct {
	Type    string    `json:"type"`
	Sources []*Source `json:"source,omitempty"`
	Text    string    `json:"text,omitempty"`
}

type Message added in v1.8.5

type Message struct {
	Role     string     `json:"role"`
	Contents []*Content `json:"content"`
}

type MessageResponse added in v1.8.5

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 added in v1.8.5

type MessageUsage struct {
	InputTokens  int `json:"input_tokens"`
	OutputTokens int `json:"output_tokens"`
}

type Request

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

type Response struct {
	Completion string `json:"completion"`
}

type Source added in v1.8.5

type Source struct {
	Type      string `json:"type"`
	MediaType string `json:"media_type"`
	Data      string `json:"data"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL