Documentation
¶
Index ¶
- type Client
- func (c *Client) ChatBase(ctx context.Context, msgs []openai2.ChatCompletionMessage) (<-chan openai2.ChatCompletionStreamChoice, error)
- func (c *Client) ChatImageOnce(ctx context.Context, msg, imgURL string) (<-chan string, error)
- func (c *Client) ChatTextOnce(ctx context.Context, msg string) (<-chan string, error)
- func (c *Client) UpdateOption(opts ...ClientOption) *Client
- type ClientOption
- type ClientV1
- type Option
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 (c *Client) ChatBase(ctx context.Context, msgs []openai2.ChatCompletionMessage) (<-chan openai2.ChatCompletionStreamChoice, error)
func (*Client) ChatImageOnce ¶
func (*Client) ChatTextOnce ¶
func (*Client) UpdateOption ¶
func (c *Client) UpdateOption(opts ...ClientOption) *Client
type ClientOption ¶
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
Click to show internal directories.
Click to hide internal directories.