{"modulePath":"github.com/wavetermdev/waveterm","version":"v0.14.4","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package waveai\n\n## Constants\n\n```go\nconst APIType_Anthropic = \"anthropic\"\n```\n\n```go\nconst APIType_Google = \"google\"\n```\n\n```go\nconst APIType_OpenAI = \"openai\"\n```\n\n```go\nconst APIType_Perplexity = \"perplexity\"\n```\n\n```go\nconst CloudWebsocketConnectTimeout = 1 * time.Minute\n```\n\n```go\nconst DefaultAzureAPIVersion = \"2023-05-15\"\n```\n\n```go\nconst OpenAICloudReqStr = \"openai-cloudreq\"\n```\n\n```go\nconst PacketEOFStr = \"EOF\"\n```\n\n```go\nconst WaveAIPacketstr = \"waveai\"\n```\n\n## Functions\n\n```go\nfunc IsCloudAIRequest(opts *wshrpc.WaveAIOptsType) bool\n```\n\n```go\nfunc MakeWaveAIPacket() *wshrpc.WaveAIPacketType\n```\n\n```go\nfunc RunAICommand(ctx context.Context, request wshrpc.WaveAIStreamRequest) chan wshrpc.RespOrErrorUnion[wshrpc.WaveAIPacketType]\n```\n\n## Types\n\n```go\ntype AIBackend interface {\n\tStreamCompletion(\n\t\tctx context.Context,\n\t\trequest wshrpc.WaveAIStreamRequest,\n\t) chan wshrpc.RespOrErrorUnion[wshrpc.WaveAIPacketType]\n}\n```\n\n```go\ntype AnthropicBackend struct{}\n```\n\n```go\nfunc (AnthropicBackend) StreamCompletion(ctx context.Context, request wshrpc.WaveAIStreamRequest) chan wshrpc.RespOrErrorUnion[wshrpc.WaveAIPacketType]\n```\n\n```go\ntype GoogleBackend struct{}\n```\n\n```go\nfunc (GoogleBackend) StreamCompletion(ctx context.Context, request wshrpc.WaveAIStreamRequest) chan wshrpc.RespOrErrorUnion[wshrpc.WaveAIPacketType]\n```\n\n```go\ntype OpenAIBackend struct{}\n```\n\n```go\nfunc (OpenAIBackend) StreamCompletion(ctx context.Context, request wshrpc.WaveAIStreamRequest) chan wshrpc.RespOrErrorUnion[wshrpc.WaveAIPacketType]\n```\n\n```go\ntype PerplexityBackend struct{}\n```\n\n```go\nfunc (PerplexityBackend) StreamCompletion(ctx context.Context, request wshrpc.WaveAIStreamRequest) chan wshrpc.RespOrErrorUnion[wshrpc.WaveAIPacketType]\n```\n\n```go\ntype WaveAICloudBackend struct{}\n```\n\n```go\nfunc (WaveAICloudBackend) StreamCompletion(ctx context.Context, request wshrpc.WaveAIStreamRequest) chan wshrpc.RespOrErrorUnion[wshrpc.WaveAIPacketType]\n```\n\n```go\ntype WaveAICloudReqPacketType struct {\n\tType       string                           `json:\"type\"`\n\tClientId   string                           `json:\"clientid\"`\n\tPrompt     []wshrpc.WaveAIPromptMessageType `json:\"prompt\"`\n\tMaxTokens  int                              `json:\"maxtokens,omitempty\"`\n\tMaxChoices int                              `json:\"maxchoices,omitempty\"`\n}\n```\n\n```go\nfunc MakeWaveAICloudReqPacket() *WaveAICloudReqPacketType\n```\n\n```go\ntype WaveAICmdInfoChatMessage struct {\n\tMessageID           int                            `json:\"messageid\"`\n\tIsAssistantResponse bool                           `json:\"isassistantresponse,omitempty\"`\n\tAssistantResponse   *WaveAICmdInfoPacketOutputType `json:\"assistantresponse,omitempty\"`\n\tUserQuery           string                         `json:\"userquery,omitempty\"`\n\tUserEngineeredQuery string                         `json:\"userengineeredquery,omitempty\"`\n}\n```\n\n```go\ntype WaveAICmdInfoPacketOutputType struct {\n\tModel        string `json:\"model,omitempty\"`\n\tCreated      int64  `json:\"created,omitempty\"`\n\tFinishReason string `json:\"finish_reason,omitempty\"`\n\tMessage      string `json:\"message,omitempty\"`\n\tError        string `json:\"error,omitempty\"`\n}\n```\n\n","path":"github.com/wavetermdev/waveterm/pkg/waveai","name":"waveai","synopsis":"","isRedistributable":true}
