anthropic

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package anthropic 基于 Anthropic 官方 SDK 实现 llm.Client, 使用 Messages 协议(POST /v1/messages)。

Index

Constants

View Source
const DefaultMaxTokens = 4096

DefaultMaxTokens Request.MaxTokens 未设置时的默认值(协议要求必填)。

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client Anthropic Messages 客户端,实现 llm.Client。

func New

func New(cfg llm.Config) *Client

New 创建客户端。

func (*Client) Chat

func (c *Client) Chat(ctx context.Context, req *llm.Request) (*llm.Response, error)

Chat 实现 llm.Client。

func (*Client) StreamChat

func (c *Client) StreamChat(ctx context.Context, req *llm.Request) (llm.Stream, error)

StreamChat 实现 llm.Client。

Jump to

Keyboard shortcuts

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