Documentation ¶
Index ¶
- Constants
- func IsCloudAIRequest(opts *wshrpc.WaveAIOptsType) bool
- func MakeWaveAIPacket() *wshrpc.WaveAIPacketType
- func RunAICommand(ctx context.Context, request wshrpc.WaveAIStreamRequest) chan wshrpc.RespOrErrorUnion[wshrpc.WaveAIPacketType]
- type AIBackend
- type AnthropicBackend
- type GoogleBackend
- type OpenAIBackend
- type PerplexityBackend
- type WaveAICloudBackend
- type WaveAICloudReqPacketType
- type WaveAICmdInfoChatMessage
- type WaveAICmdInfoPacketOutputType
Constants ¶
View Source
const APIType_Google = "google"
View Source
const APIType_OpenAI = "openai"
View Source
const ApiType_Anthropic = "anthropic"
View Source
const ApiType_Perplexity = "perplexity"
View Source
const CloudWebsocketConnectTimeout = 1 * time.Minute
View Source
const DefaultAzureAPIVersion = "2023-05-15"
View Source
const OpenAICloudReqStr = "openai-cloudreq"
View Source
const PacketEOFStr = "EOF"
View Source
const WaveAIPacketstr = "waveai"
Variables ¶
This section is empty.
Functions ¶
func IsCloudAIRequest ¶ added in v0.8.10
func IsCloudAIRequest(opts *wshrpc.WaveAIOptsType) bool
func MakeWaveAIPacket ¶ added in v0.11.0
func MakeWaveAIPacket() *wshrpc.WaveAIPacketType
func RunAICommand ¶ added in v0.8.10
func RunAICommand(ctx context.Context, request wshrpc.WaveAIStreamRequest) chan wshrpc.RespOrErrorUnion[wshrpc.WaveAIPacketType]
Types ¶
type AIBackend ¶ added in v0.9.2
type AIBackend interface { StreamCompletion( ctx context.Context, request wshrpc.WaveAIStreamRequest, ) chan wshrpc.RespOrErrorUnion[wshrpc.WaveAIPacketType] }
type AnthropicBackend ¶ added in v0.9.2
type AnthropicBackend struct{}
func (AnthropicBackend) StreamCompletion ¶ added in v0.9.2
func (AnthropicBackend) StreamCompletion(ctx context.Context, request wshrpc.WaveAIStreamRequest) chan wshrpc.RespOrErrorUnion[wshrpc.WaveAIPacketType]
type GoogleBackend ¶ added in v0.11.0
type GoogleBackend struct{}
func (GoogleBackend) StreamCompletion ¶ added in v0.11.0
func (GoogleBackend) StreamCompletion(ctx context.Context, request wshrpc.WaveAIStreamRequest) chan wshrpc.RespOrErrorUnion[wshrpc.WaveAIPacketType]
type OpenAIBackend ¶ added in v0.9.2
type OpenAIBackend struct{}
func (OpenAIBackend) StreamCompletion ¶ added in v0.9.2
func (OpenAIBackend) StreamCompletion(ctx context.Context, request wshrpc.WaveAIStreamRequest) chan wshrpc.RespOrErrorUnion[wshrpc.WaveAIPacketType]
type PerplexityBackend ¶ added in v0.10.0
type PerplexityBackend struct{}
func (PerplexityBackend) StreamCompletion ¶ added in v0.10.0
func (PerplexityBackend) StreamCompletion(ctx context.Context, request wshrpc.WaveAIStreamRequest) chan wshrpc.RespOrErrorUnion[wshrpc.WaveAIPacketType]
type WaveAICloudBackend ¶ added in v0.9.2
type WaveAICloudBackend struct{}
func (WaveAICloudBackend) StreamCompletion ¶ added in v0.9.2
func (WaveAICloudBackend) StreamCompletion(ctx context.Context, request wshrpc.WaveAIStreamRequest) chan wshrpc.RespOrErrorUnion[wshrpc.WaveAIPacketType]
type WaveAICloudReqPacketType ¶ added in v0.11.0
type WaveAICloudReqPacketType struct { Type string `json:"type"` ClientId string `json:"clientid"` Prompt []wshrpc.WaveAIPromptMessageType `json:"prompt"` MaxTokens int `json:"maxtokens,omitempty"` MaxChoices int `json:"maxchoices,omitempty"` }
func MakeWaveAICloudReqPacket ¶ added in v0.11.0
func MakeWaveAICloudReqPacket() *WaveAICloudReqPacketType
type WaveAICmdInfoChatMessage ¶ added in v0.11.0
type WaveAICmdInfoChatMessage struct { MessageID int `json:"messageid"` IsAssistantResponse bool `json:"isassistantresponse,omitempty"` AssistantResponse *WaveAICmdInfoPacketOutputType `json:"assistantresponse,omitempty"` UserQuery string `json:"userquery,omitempty"` UserEngineeredQuery string `json:"userengineeredquery,omitempty"` }
type WaveAICmdInfoPacketOutputType ¶ added in v0.11.0
Click to show internal directories.
Click to hide internal directories.