openai

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: Apache-2.0 Imports: 10 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
}

func NewClient

func NewClient(apiKey, model string, debug bool) *Client

func (*Client) SendPrompt

func (cs *Client) SendPrompt(ctx context.Context, prompt string) (string, error)

type Message

type Message struct {
	Role    string `json:"role"`
	Content string `json:"content"`
}

type Operation

type Operation struct {
	Method       string
	Filenames    []string
	Content      []string
	OriginalText string
}

type Request

type Request struct {
	Model    string    `json:"model"`
	Messages []Message `json:"messages"`
}

type Response

type Response struct {
	ID      string `json:"id"`
	Object  string `json:"object"`
	Created int    `json:"created"`
	Model   string `json:"model"`
	Choices []struct {
		Message struct {
			Content string `json:"content"`
		} `json:"message"`
	} `json:"choices"`
	Status string `json:"status"`
}

Jump to

Keyboard shortcuts

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