anthropic

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Client

func Client(apiKey string, req types.ChatArgs) (string, error)

func StreamClient

func StreamClient(apiKey string, req types.ChatArgs, chunkChan chan string) error

func StreamCompleteClient

func StreamCompleteClient(apiKey string, req types.ChatArgs) (string, error)

Types

type AnthChatArgs

type AnthChatArgs struct {
	types.ChatArgs
}

func ChatAnth

func ChatAnth(kwargs ...map[string]interface{}) AnthChatArgs

func (AnthChatArgs) Chat

func (params AnthChatArgs) Chat(apiKey string, prompt string, system string) (string, error)

ChatClient sends a prompt to the chat client and returns the response.

func (AnthChatArgs) StreamChat

func (params AnthChatArgs) StreamChat(apiKey string, prompt string, system string, ipcChan chan string)

func (AnthChatArgs) StreamCompleteChat

func (params AnthChatArgs) StreamCompleteChat(apiKey string, prompt string, system string) (string, error)

type ClientChatError

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

ChatError represents a chat-related error.

type RateLimiter

type RateLimiter struct {
	sync.Mutex
	// contains filtered or unexported fields
}

RateLimiter is a simple rate limiter implementation

func (*RateLimiter) Wait

func (r *RateLimiter) Wait()

Wait blocks until it's time to allow the next request

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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