claude

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const TaggedModel = llm.ModelClaude35Sonnet + "@" + Version
View Source
const Version = "20240620"

Variables

This section is empty.

Functions

func Prompt

func Prompt(ctx context.Context, prompt rq.PromptV1, rsp *llm.StreamResponse) error

Types

type Content

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

type EvContentBlockDelta

type EvContentBlockDelta struct {
	Type  string `json:"type"`
	Index int    `json:"index"`
	Delta struct {
		Type string `json:"type"`
		Text string `json:"text"`
	} `json:"delta"`
}

type EvMsgDelta

type EvMsgDelta struct {
	Type  string `json:"type"`
	Usage struct {
		OutputTokens int `json:"output_tokens"`
	} `json:"usage"`
}

type EvMsgStart

type EvMsgStart struct {
	Type    string `json:"type"`
	Message struct {
		Usage struct {
			InputTokens  int `json:"input_tokens"`
			OutputTokens int `json:"output_tokens"`
		} `json:"usage"`
	} `json:"message"`
}

type Message

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

type Request

type Request struct {
	Messages         []Message `json:"messages"`
	MaxTokens        int       `json:"max_tokens"`
	Stream           bool      `json:"stream"`
	AnthropicVersion string    `json:"anthropic_version"`
	System           string    `json:"system,omitempty"`
}

Jump to

Keyboard shortcuts

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