waveai

package
v0.8.3-beta.1 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2024 License: Apache-2.0 Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const CloudWebsocketConnectTimeout = 1 * time.Minute
View Source
const DefaultMaxTokens = 1000
View Source
const DefaultModel = "gpt-4o-mini"
View Source
const DefaultStreamChanSize = 10
View Source
const OpenAICloudReqStr = "openai-cloudreq"
View Source
const OpenAIPacketStr = "openai"
View Source
const PCloudWSEndpoint = "wss://wsapi.waveterm.dev/"
View Source
const PCloudWSEndpointVarName = "PCLOUD_WS_ENDPOINT"
View Source
const PacketEOFStr = "EOF"

Variables

This section is empty.

Functions

func CreateErrorPacket

func CreateErrorPacket(errStr string) *wshrpc.OpenAIPacketType

func CreateTextPacket

func CreateTextPacket(text string) *wshrpc.OpenAIPacketType

func GetWSEndpoint

func GetWSEndpoint() string

func MakeOpenAIPacket

func MakeOpenAIPacket() *wshrpc.OpenAIPacketType

Types

type OpenAICloudReqPacketType

type OpenAICloudReqPacketType struct {
	Type       string                           `json:"type"`
	ClientId   string                           `json:"clientid"`
	Prompt     []wshrpc.OpenAIPromptMessageType `json:"prompt"`
	MaxTokens  int                              `json:"maxtokens,omitempty"`
	MaxChoices int                              `json:"maxchoices,omitempty"`
}

func MakeOpenAICloudReqPacket

func MakeOpenAICloudReqPacket() *OpenAICloudReqPacketType

type OpenAICmdInfoChatMessage

type OpenAICmdInfoChatMessage struct {
	MessageID           int                            `json:"messageid"`
	IsAssistantResponse bool                           `json:"isassistantresponse,omitempty"`
	AssistantResponse   *OpenAICmdInfoPacketOutputType `json:"assistantresponse,omitempty"`
	UserQuery           string                         `json:"userquery,omitempty"`
	UserEngineeredQuery string                         `json:"userengineeredquery,omitempty"`
}

type OpenAICmdInfoPacketOutputType

type OpenAICmdInfoPacketOutputType struct {
	Model        string `json:"model,omitempty"`
	Created      int64  `json:"created,omitempty"`
	FinishReason string `json:"finish_reason,omitempty"`
	Message      string `json:"message,omitempty"`
	Error        string `json:"error,omitempty"`
}

type OpenAIOptsType

type OpenAIOptsType struct {
	Model      string `json:"model"`
	APIToken   string `json:"apitoken"`
	BaseURL    string `json:"baseurl,omitempty"`
	MaxTokens  int    `json:"maxtokens,omitempty"`
	MaxChoices int    `json:"maxchoices,omitempty"`
	Timeout    int    `json:"timeout,omitempty"`
	BlockId    string `json:"blockid"`
}

Jump to

Keyboard shortcuts

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