openai

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2023 License: AGPL-3.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 ChatGPTResponder

type ChatGPTResponder interface {
	RequestCompletion(string, float32, float32) (string, error)
}

type MockOpenAIClient

type MockOpenAIClient struct {
}

func NewMockClient

func NewMockClient() *MockOpenAIClient

func (*MockOpenAIClient) RequestCompletion

func (m *MockOpenAIClient) RequestCompletion(prompt string, temperature, model float32) (string, error)

type OpenAIClient

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

func NewClient

func NewClient(authToken string) *OpenAIClient

func (*OpenAIClient) RequestCompletion

func (c *OpenAIClient) RequestCompletion(prompt string, temperature, openaiModel float32) (string, error)

RequestCompletion, request ChatGPT for a text completion.

Jump to

Keyboard shortcuts

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