groq

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: GPL-3.0 Imports: 15 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)

func StreamCompleteClient

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

Types

type ClientChatError

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

ChatError represents a chat-related error.

type GroqChatArgs

type GroqChatArgs struct {
	types.ChatArgs
}

func ChatGroq

func ChatGroq(kwargs ...map[string]interface{}) GroqChatArgs

func (GroqChatArgs) Chat

func (args GroqChatArgs) Chat(apiKey string, prompt string, assistant string) (string, error)

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

func (GroqChatArgs) StreamChat

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

StreamChat sends a prompt to the stream chat client and returns the response.

func (GroqChatArgs) StreamCompleteChat

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

StreamCompleteChat sends a prompt to the stream complete chat client and returns the response.

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