Documentation
¶
Index ¶
- type Client
- func (c *Client) Completion(ctx context.Context, content string) (string, error)
- func (c *Client) CreateChatCompletion(ctx context.Context, content string) (resp openai.ChatCompletionResponse, err error)
- func (c *Client) CreateCompletion(ctx context.Context, content string) (resp openai.CompletionResponse, err error)
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
}
Clint for OpenAI client interface
func (*Client) Completion ¶
func (*Client) CreateChatCompletion ¶
func (c *Client) CreateChatCompletion( ctx context.Context, content string, ) (resp openai.ChatCompletionResponse, err error)
CreateChatCompletion — API call to Create a completion for the chat message.
func (*Client) CreateCompletion ¶
func (c *Client) CreateCompletion( ctx context.Context, content string, ) (resp openai.CompletionResponse, err error)
CreateCompletion — API call to create a completion. This is the main endpoint of the API. Returns new text as well as, if requested, the probabilities over each alternative token at each position.
If using a fine-tuned model, simply provide the model's ID in the CompletionRequest object, and the server will use the model's parameters to generate the completion.
Click to show internal directories.
Click to hide internal directories.