Documentation ¶
Index ¶
- Variables
- type AiEngine
- func (a *AiEngine) Prompt(ctx context.Context, request *api.ChatCompletionRequest) (*api.ChatCompletionResponse, error)
- func (a *AiEngine) PromptCb(ctx *gin.Context, body *openai.ChatCompletionRequest)
- func (a *AiEngine) PromptStream(ctx context.Context, request *api.ChatCompletionRequest, ...) (*api.ChatCompletionStreamResponse, error)
- type CompletionCallback
- type ResponderFlusher
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 (*AiEngine) Prompt ¶
func (a *AiEngine) Prompt(ctx context.Context, request *api.ChatCompletionRequest) (*api.ChatCompletionResponse, error)
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 }
Click to show internal directories.
Click to hide internal directories.