api

package
v1.2.7 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventMessageThinking    = "message/thinking"
	EventMessageTextTyping  = "message/text/typing"
	EventMessageTextEOF     = "message/text/EOF"
	EventMessageAudio       = "message/audio"
	EventMessageError       = "message/error"
	EventSystemAbility      = "system/ability"
	EventSystemNotification = "system/notification"
	EventSystemKeepAlive    = ""
)

Variables

View Source
var RestfulValidator *validator.Validate

Functions

This section is empty.

Types

type Audio

type Audio struct {
	MessageMeta
	Audio      []byte `json:"audio"`
	DurationMs int    `json:"durationMs,omitempty"`
}

type Chat

type Chat struct {
	ChatId     string           `json:"chatId" validate:"required"`   // unique ID for every Q&A
	TicketId   string           `json:"ticketId" validate:"required"` // A distinctive ID for each request, utilised by the client to associate messages.
	Ms         []client.Message `json:"ms" validate:"required,dive"`
	TalkOption TalkOption       `json:"talkOption"`
}

type ContentCmd

type ContentCmd string

type Error

type Error struct {
	MessageMeta
	ErrMsg string `json:"errMsg"`
}

type MessageMeta

type MessageMeta struct {
	ChatId    string      `json:"chatId"`    // unique ID for the whole chat(contains maybe hundreds of messages)
	TicketId  string      `json:"ticketId"`  // A distinctive ID for each request, utilised by the client to associate messages.
	MessageID string      `json:"messageID"` // unique ID for each message
	Role      client.Role `json:"role"`
}

type TalkOption

type TalkOption struct {
	ToText             bool               `json:"toText"`             // transcribe user's speech to text, requiring STTOption option
	ToSpeech           bool               `json:"toSpeech"`           // synthesize user's text to speech, requiring TTSOption
	Completion         bool               `json:"completion"`         // completion, requires messages or result of transcription, require LLMOption
	CompletionToSpeech bool               `json:"completionToSpeech"` // synthesize result of completion to speech, requiring TTSOption
	LLMOption          *ability.LLMOption `json:"llmOption,omitempty"`
	STTOption          *ability.STTOption `json:"sttOption,omitempty"`
	TTSOption          *ability.TTSOption `json:"ttsOption,omitempty"`
}

type Text

type Text struct {
	MessageMeta
	Text string `json:"text"`
}

Jump to

Keyboard shortcuts

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