openai_com

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var API_Endpoint_Data []APIEndpoint

API_Endpoint_Data is populated from init() with data loaded from the embedded JSON file

Functions

func NewOpenAIChatCompletionRequest

func NewOpenAIChatCompletionRequest(body *string) (completion *openai.ChatCompletionRequest, err error)

NewOpenAIChatCompletionRequest creates a new OpenAI ChatCompletion Request object from a JSON string

func NewOpenAIChatCompletionResponse

func NewOpenAIChatCompletionResponse(body *string) (completion *openai.ChatCompletionResponse, err error)

NewOpenAIChatCompletionResponse creates a new OpenAI ChatCompletion Response object from a JSON string

Types

type APIEndpoint

type APIEndpoint struct {
	URL      string    `json:"url"`
	Products []Product `json:"products"`
}

APIEndpoint represents the pricing data for a single API endpoint, such as "https://api.openai.com/v1/chat/completions"

type Product

type Product struct {
	Name            string `json:"name"`
	InputTokenCost  string `json:"inputTokenCost"`
	OutputTokenCost string `json:"outputTokenCost"`
	Currency        string `json:"currency"`
}

Product represents a model or other product attached to an endpoint

Jump to

Keyboard shortcuts

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