client

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client represents an LLM client

func New

func New(config *types.ClientConfig) *Client

New creates a new client with the given config

func (*Client) Chat

func (c *Client) Chat(ctx context.Context, message string, history []types.Message) (*types.CompletionResponse, error)

Chat sends a chat message to the LLM provider

func (*Client) GenerateCodeExplanation

func (c *Client) GenerateCodeExplanation(message, lang string) (string, error)

GenerateCodeExplanation generates an explanation for the given code in the specified language

func (*Client) GenerateCommitMessage

func (c *Client) GenerateCommitMessage(diff string, prompt string) (string, error)

GenerateCommitMessage generates a commit message for the given diff

func (*Client) Stream

func (c *Client) Stream(ctx context.Context, message string, history []types.Message) (*types.CompletionResponse, error)

Stream sends a chat message to the LLM provider and streams the response

func (*Client) TranslateMessage

func (c *Client) TranslateMessage(prompt string, message string, lang string) (string, error)

TranslateMessage translates the given message to the specified language

Jump to

Keyboard shortcuts

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