Documentation
¶
Index ¶
- Constants
- func ConvertPrompt(prompt []packet.OpenAIPromptMessageType) []openaiapi.ChatCompletionMessage
- func CreateErrorPacket(errStr string) *packet.OpenAIPacketType
- func CreateTextPacket(text string) *packet.OpenAIPacketType
- func RunCloudCompletionStream(ctx context.Context, clientId string, opts *sstore.OpenAIOptsType, ...) (chan *packet.OpenAIPacketType, *websocket.Conn, error)
- func RunCompletion(ctx context.Context, opts *sstore.OpenAIOptsType, ...) ([]*packet.OpenAIPacketType, error)
- func RunCompletionStream(ctx context.Context, opts *sstore.OpenAIOptsType, ...) (chan *packet.OpenAIPacketType, error)
Constants ¶
View Source
const CloudWebsocketConnectTimeout = 1 * time.Minute
View Source
const DefaultMaxTokens = 1000
View Source
const DefaultModel = "gpt-3.5-turbo"
View Source
const DefaultStreamChanSize = 10
Variables ¶
This section is empty.
Functions ¶
func ConvertPrompt ¶
func ConvertPrompt(prompt []packet.OpenAIPromptMessageType) []openaiapi.ChatCompletionMessage
func CreateErrorPacket ¶
func CreateErrorPacket(errStr string) *packet.OpenAIPacketType
func CreateTextPacket ¶
func CreateTextPacket(text string) *packet.OpenAIPacketType
func RunCloudCompletionStream ¶
func RunCloudCompletionStream(ctx context.Context, clientId string, opts *sstore.OpenAIOptsType, prompt []packet.OpenAIPromptMessageType) (chan *packet.OpenAIPacketType, *websocket.Conn, error)
func RunCompletion ¶
func RunCompletion(ctx context.Context, opts *sstore.OpenAIOptsType, prompt []packet.OpenAIPromptMessageType) ([]*packet.OpenAIPacketType, error)
func RunCompletionStream ¶
func RunCompletionStream(ctx context.Context, opts *sstore.OpenAIOptsType, prompt []packet.OpenAIPromptMessageType) (chan *packet.OpenAIPacketType, error)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.