chatgpt

package
v0.0.0-...-b1e8dd2 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: LGPL-2.1 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChatGPTClient

type ChatGPTClient struct {
	APIKey string
	Tracer trace.Tracer
}

ChatGPTClient is a client for interacting with the ChatGPT API.

func NewChatGPTClient

func NewChatGPTClient() *ChatGPTClient

NewChatGPTClient creates a new ChatGPTClient. It fetches the API key from environment variables.

func (*ChatGPTClient) Ask

func (c *ChatGPTClient) Ask(ctx context.Context, prompt string) (string, error)

Ask sends a prompt to the ChatGPT API and returns the response.

Jump to

Keyboard shortcuts

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