bedrock

package
v1.24.2 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2025 License: Apache-2.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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