core

package
v0.14.2 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Generative

type Generative interface {
	// CreateCompletion is an API call to create a completion.
	Completion(ctx context.Context, content string) (resp *Response, err error)
	// GetSummaryPrefix is an API call to get a summary prefix using function call.
	GetSummaryPrefix(ctx context.Context, content string) (resp *Response, err error)
}

type Platform

type Platform string
const (
	OpenAI Platform = "openai"
	Azure  Platform = "azure"
	Gemini Platform = "gemini"
)

func (Platform) IsValid

func (p Platform) IsValid() bool

IsValid returns true if the Platform is valid.

func (Platform) String

func (p Platform) String() string

String returns the string representation of the Platform.

type Response

type Response struct {
	Content string
	Usage   Usage
}

type Usage

type Usage struct {
	PromptTokens     int
	CompletionTokens int
	TotalTokens      int
}

Jump to

Keyboard shortcuts

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