aiengine

package
v0.0.0-...-25c9f67 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrChatCompletion = errors.New("chat completion error")
)

Functions

This section is empty.

Types

type AiEngine

type AiEngine struct {
	// contains filtered or unexported fields
}

func NewAiEngine

func NewAiEngine(apiBaseURL, apiKey string, log lib.ILogger) *AiEngine

func (*AiEngine) Prompt

func (*AiEngine) PromptCb

func (a *AiEngine) PromptCb(ctx *gin.Context, body *openai.ChatCompletionRequest)

func (*AiEngine) PromptStream

func (a *AiEngine) PromptStream(ctx context.Context, request *api.ChatCompletionRequest, chunkCallback CompletionCallback) (*api.ChatCompletionStreamResponse, error)

type CompletionCallback

type CompletionCallback func(completion *api.ChatCompletionStreamResponse) error

type ResponderFlusher

type ResponderFlusher interface {
	http.ResponseWriter
	http.Flusher
}

Jump to

Keyboard shortcuts

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