anthropic

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const ClaudeURL = "https://api.anthropic.com/v1/messages"

Variables

View Source
var CLAUDE_DEFAULT = Claude{
	Model:            "claude-3-opus-20240229",
	Url:              ClaudeURL,
	AnthropicVersion: "2023-06-01",
	AnthropicBeta:    "messages-2023-12-15",
	MaxTokens:        1024,
}

Functions

This section is empty.

Types

type Claude

type Claude struct {
	Model            string `json:"model"`
	MaxTokens        int    `json:"max_tokens"`
	Url              string `json:"url"`
	AnthropicVersion string `json:"anthropic-version"`
	AnthropicBeta    string `json:"anthropic-beta"`
	// contains filtered or unexported fields
}

func (*Claude) Setup added in v1.2.0

func (c *Claude) Setup() error

func (*Claude) StreamCompletions added in v1.2.0

func (c *Claude) StreamCompletions(ctx context.Context, chat models.Chat) (chan models.CompletionEvent, error)

type ContentBlockDelta

type ContentBlockDelta struct {
	Type  string `json:"type"`
	Index int    `json:"index"`
	Delta Delta  `json:"delta"`
}

type Delta

type Delta struct {
	Type string `json:"type"`
	Text string `json:"text,omitempty"`
}

Jump to

Keyboard shortcuts

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