Documentation
¶
Index ¶
- Variables
- func StartServer()
- type AudioReader
- type ChatHandler
- type RestfulEHandler
- type SSE
- type Talker
- func (t *Talker) Ability(ctx context.Context) ([]error, ability.Ability)
- func (t *Talker) SelectLLMProvider(o *ability.LLMOption) (llm client.LLM, ok bool)
- func (t *Talker) SelectSTTProvider(o *ability.STTOption) (tts client.SpeechToText, ok bool)
- func (t *Talker) SelectTTSProvider(o *ability.TTSOption) (tts client.TextToSpeech, ok bool)
Constants ¶
This section is empty.
Variables ¶
View Source
var TalkCache talkCache
Functions ¶
func StartServer ¶
func StartServer()
Types ¶
type AudioReader ¶
type ChatHandler ¶
type ChatHandler struct {
// contains filtered or unexported fields
}
func NewChatHandler ¶
func (*ChatHandler) Start ¶
func (c *ChatHandler) Start(ms []client.Message, ar *AudioReader)
Start
if there is an audio
client --audio--> [toText] --text--> [completion] --text--> [toSpeech] --audio--> client
| | |
v v v
client client client
if there isn't an audio
client --text--> [completion] --text--> [toSpeech] --audio--> client
| |
v v
[toAudio] client
|
v
client
type RestfulEHandler ¶
type RestfulEHandler struct {
// contains filtered or unexported fields
}
func NewRestfulEHandler ¶
func NewRestfulEHandler(talker *Talker, sse *SSE, logger *zap.Logger) *RestfulEHandler
func (*RestfulEHandler) PostAudioChat ¶
func (h *RestfulEHandler) PostAudioChat(c echo.Context) error
func (*RestfulEHandler) ProvidersStatus ¶
func (h *RestfulEHandler) ProvidersStatus(c echo.Context) error
type SSE ¶
func (*SSE) PublishData ¶
type Talker ¶
type Talker struct {
// contains filtered or unexported fields
}
func (*Talker) Ability ¶
Ability set ability and bypass any errors that may occur
both the ability and error slice can contain elements simultaneously to emphasize this fact, we interchange the positions of errors and items.
func (*Talker) SelectLLMProvider ¶
func (*Talker) SelectSTTProvider ¶
func (*Talker) SelectTTSProvider ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.