staringos

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChatByCorpusRequest

type ChatByCorpusRequest struct {
	Model        string                         `json:"model,omitempty"`
	Prompt       []openai.ChatCompletionMessage `json:"prompt,omitempty"`
	Temperature  float32                        `json:"temperature,omitempty"`
	TopP         float32                        `json:"top_p,omitempty"`
	Functions    []openai.FunctionDefinition    `json:"functions,omitempty"`
	FunctionCall any                            `json:"function_call,omitempty"`
}

type MessageIdResponse

type MessageIdResponse struct {
	Id string `json:"id"`
}

type MessageResponse

type MessageResponse struct {
	Content      string `json:"content,omitempty"`
	IsFinish     bool   `json:"isFinish,omitempty"`
	FunctionCall any    `json:"function_call,omitempty"`
	Model        string `json:"model,omitempty"`
	AppId        int    `json:"appId,omitempty"`
	At           int64  `json:"at,omitempty"`
	T            int64  `json:"t,omitempty"`
}

func CreateChatCompletion

func CreateChatCompletion(
	ctx *dgctx.DgContext,
	request *ChatByCorpusRequest,
	apiKey string,
) (*MessageResponse, error)

CreateChatCompletion — API call to Create a completion for the chat message.

Jump to

Keyboard shortcuts

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