waveai

package
v0.8.13-beta.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const CloudWebsocketConnectTimeout = 1 * time.Minute
View Source
const DefaultAzureAPIVersion = "2023-05-15"
View Source
const DefaultMaxTokens = 2048
View Source
const DefaultModel = "gpt-4o-mini"
View Source
const OpenAICloudReqStr = "openai-cloudreq"
View Source
const OpenAIPacketStr = "openai"
View Source
const PacketEOFStr = "EOF"
View Source
const WCloudWSEndpoint = "wss://wsapi.waveterm.dev/"
View Source
const WCloudWSEndpointVarName = "WCLOUD_WS_ENDPOINT"

Variables

This section is empty.

Functions

func GetWSEndpoint

func GetWSEndpoint() string

func IsCloudAIRequest added in v0.8.10

func IsCloudAIRequest(opts *wshrpc.OpenAIOptsType) bool

func MakeOpenAIPacket

func MakeOpenAIPacket() *wshrpc.OpenAIPacketType

func RunAICommand added in v0.8.10

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"`
}

Jump to

Keyboard shortcuts

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