gpt3_driver

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 17, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GPT3Driver

type GPT3Driver struct {
	Client *openai.Client
}

func New

func New(token string) *GPT3Driver

func NewWithProvider added in v0.1.0

func NewWithProvider(token, provider string) *GPT3Driver

func (*GPT3Driver) GetResponse

func (c *GPT3Driver) GetResponse(prompt models.PromptToSend) ([]string, error)

func (*GPT3Driver) GetStreamResponse

func (c *GPT3Driver) GetStreamResponse(prompt models.PromptToSend) (interfaces.StreamReceiver, error)

func (*GPT3Driver) SendRequest

func (c *GPT3Driver) SendRequest(p models.PromptToSend) (*openai.CompletionResponse, error)

func (*GPT3Driver) SendStreamRequest

func (c *GPT3Driver) SendStreamRequest(p models.PromptToSend) (*openai.CompletionStream, error)

func (*GPT3Driver) StreamAvailable

func (c *GPT3Driver) StreamAvailable() bool

func (*GPT3Driver) ToStream

type GPT3Receiver

type GPT3Receiver struct {
	Stream *openai.CompletionStream
}

func (*GPT3Receiver) Close

func (r *GPT3Receiver) Close()

func (*GPT3Receiver) Receive

func (r *GPT3Receiver) Receive() (choices []string, err error, eof bool)

Jump to

Keyboard shortcuts

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