Documentation
¶
Index ¶
Constants ¶
View Source
const ( OPENAI_TOKEN = "OPENAI_TOKEN" OPENAI_PREFIX = "openai-" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OpenAIClient ¶
func NewOpenAIClient ¶
func NewOpenAIClient(model string) (*OpenAIClient, error)
NewClient creates a new OpenAI API client using an environment variable.
func (*OpenAIClient) Prompt ¶
func (c *OpenAIClient) Prompt(ctx context.Context, messages []openai.ChatCompletionMessage) (string, error)
Prompt prompts the OpenAI API with a list of messages using 0.000001 temperature and a retry mechanism.
Click to show internal directories.
Click to hide internal directories.