chatgpt

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client added in v0.8.0

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

Client is a client for ChatGPT client

func NewAzureOpenAIClient added in v0.8.0

func NewAzureOpenAIClient(apiKey string, endpoint string, model string, modelMapping map[string]string, timeout time.Duration) *Client

NewAzureOpenAIClient creates a new GPTClient

func NewClient added in v0.8.0

func NewClient(apiKey string, model string, timeout time.Duration) *Client

NewClient creates a new GPTClient

func (*Client) FunctionCall added in v0.8.0

func (gpt *Client) FunctionCall(role string, prompt string, input string, funcs []openai.FunctionDefinition) (map[string]interface{}, error)

FunctionCall question to OpenAI in function calling format with given prompt and user input, and function definitions

func (*Client) Question added in v0.8.0

func (gpt *Client) Question(role string, prompt string, input string) (string, error)

Chat question to chatgpt with given prompt and user input

Jump to

Keyboard shortcuts

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