claude

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Prompt

func Prompt(ctx context.Context, bod 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