llm

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2025 License: MIT Imports: 9 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
}

func NewClient

func NewClient(opts ...ClientOption) *Client

func (*Client) ChatBase

func (*Client) ChatImageOnce

func (c *Client) ChatImageOnce(ctx context.Context, msg, imgURL string) (<-chan string, error)

func (*Client) ChatTextOnce

func (c *Client) ChatTextOnce(ctx context.Context, msg string) (<-chan string, error)

func (*Client) UpdateOption

func (c *Client) UpdateOption(opts ...ClientOption) *Client

type ClientOption

type ClientOption func(*Option) error

func WithAPIKey

func WithAPIKey(apiKey string) ClientOption

func WithBaseURL

func WithBaseURL(baseURL string) ClientOption

func WithModel

func WithModel(model string) ClientOption

func WithPrompt

func WithPrompt(prompt string) ClientOption

func WithPromptTpl added in v0.0.2

func WithPromptTpl(tpl string, data map[string]any) ClientOption

type ClientV1

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

func (*ClientV1) ChatOnce

func (c *ClientV1) ChatOnce(promptTPL string, promptParams map[string]string, messages ...openai.ChatCompletionMessageParamUnion) (string, error)

type Option

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

Jump to

Keyboard shortcuts

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