feat: add realtime ASR voice chat with Cobra subcommand
This commit is contained in:
1 parent
dab8cbb55d
commit
74367f39e0
17 files changed
+977
-82
No files matched your search
@@ -0,0 +1,36 @@
|
||||
package model
|
||||
|
||||
// ASREvent 只包含实时转写接口使用的事件字段。
|
||||
type ASREvent struct {
|
||||
Type string `json:"type"`
|
||||
ItemID string `json:"item_id,omitempty"`
|
||||
Delta string `json:"delta,omitempty"`
|
||||
Transcript string `json:"transcript,omitempty"`
|
||||
Audio string `json:"audio,omitempty"`
|
||||
Error *struct {
|
||||
Message string `json:"message"`
|
||||
} `json:"error,omitempty"`
|
||||
}
|
||||
|
||||
// ASRSessionUpdate 配置中文、单声道 PCM 输入和手动提交。
|
||||
type ASRSessionUpdate struct {
|
||||
Type string `json:"type"`
|
||||
Session ASRSession `json:"session"`
|
||||
}
|
||||
|
||||
type ASRSession struct {
|
||||
Type string `json:"type"`
|
||||
Audio struct {
|
||||
Input struct {
|
||||
Format struct {
|
||||
Type string `json:"type"`
|
||||
Rate int `json:"rate"`
|
||||
} `json:"format"`
|
||||
Transcription struct {
|
||||
Model string `json:"model"`
|
||||
Language string `json:"language"`
|
||||
} `json:"transcription"`
|
||||
TurnDetection any `json:"turn_detection"`
|
||||
} `json:"input"`
|
||||
} `json:"audio"`
|
||||
}
|
||||
Reference in new issue
Block a user