Include chat, weather, image, travel, streaming ASR and text examples, shared model initialization, documentation, and existing tests. Co-authored-by: TRAE CLI <traecli@bytedance.com>
37 lines
981 B
Go
37 lines
981 B
Go
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"`
|
|
}
|