openai

package
v0.0.0-...-8130f19 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

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
}

Client is the client for OpenAI API.

func GetClient

func GetClient() *Client

GetClient retrieves the OpenAI client

func NewClient

func NewClient(token, model, templateFile string) (*Client, error)

NewClient initializes the OpenAI client.

func (*Client) GetCompletion

func (c *Client) GetCompletion(ctx context.Context, prompt string) (string, error)

GetCompletion returns the completion from OpenAI API for the given prompt.

Jump to

Keyboard shortcuts

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