ais

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	API_KEY_ENV = "OPENAI_API_KEY"
)

Variables

This section is empty.

Functions

func SendPrompt

func SendPrompt(prompt, prev_ans string, max_tokens int) ([]string, error)

Types

type Engine

type Engine struct {
	ID    string `json:"id"`
	Owner string `json:"owner"`
	Ready bool   `json:"ready"`
}

func ListEngines

func ListEngines() ([]Engine, error)

type ListEnginesResponse

type ListEnginesResponse struct {
	Data []Engine `json:"data"`
}

type Message

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

type PromptRequest

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

type QuotaUsage

type QuotaUsage struct {
	Used float64
}

QuotaUsage represents the OpenAI API usage quota information

func GetOpenAIQuotaUsage

func GetOpenAIQuotaUsage() (QuotaUsage, error)

GetOpenAIQuotaUsage retrieves the current usage quota for the OpenAI API using the provided API key and returns the quota usage information as a struct

Jump to

Keyboard shortcuts

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