mirror of
https://github.com/linux-do/new-api.git
synced 2025-09-17 16:06:38 +08:00
60 lines
2.2 KiB
Go
60 lines
2.2 KiB
Go
package dto
|
|
|
|
const (
|
|
RealtimeEventTypeError = "error"
|
|
RealtimeEventTypeSessionUpdate = "session.update"
|
|
RealtimeEventTypeConversationCreate = "conversation.item.create"
|
|
RealtimeEventTypeResponseCreate = "response.create"
|
|
)
|
|
|
|
type RealtimeEvent struct {
|
|
EventId string `json:"event_id"`
|
|
Type string `json:"type"`
|
|
//PreviousItemId string `json:"previous_item_id"`
|
|
Session *RealtimeSession `json:"session,omitempty"`
|
|
Item *RealtimeItem `json:"item,omitempty"`
|
|
Error *OpenAIError `json:"error,omitempty"`
|
|
}
|
|
|
|
type RealtimeSession struct {
|
|
Modalities []string `json:"modalities"`
|
|
Instructions string `json:"instructions"`
|
|
Voice string `json:"voice"`
|
|
InputAudioFormat string `json:"input_audio_format"`
|
|
OutputAudioFormat string `json:"output_audio_format"`
|
|
InputAudioTranscription InputAudioTranscription `json:"input_audio_transcription"`
|
|
TurnDetection interface{} `json:"turn_detection"`
|
|
Tools []RealTimeTool `json:"tools"`
|
|
ToolChoice string `json:"tool_choice"`
|
|
Temperature float64 `json:"temperature"`
|
|
MaxResponseOutputTokens int `json:"max_response_output_tokens"`
|
|
}
|
|
|
|
type InputAudioTranscription struct {
|
|
Model string `json:"model"`
|
|
}
|
|
|
|
type RealTimeTool struct {
|
|
Type string `json:"type"`
|
|
Name string `json:"name"`
|
|
Description string `json:"description"`
|
|
Parameters any `json:"parameters"`
|
|
}
|
|
|
|
type RealtimeItem struct {
|
|
Id string `json:"id"`
|
|
Type string `json:"type"`
|
|
Status string `json:"status"`
|
|
Role string `json:"role"`
|
|
Content RealtimeContent `json:"content"`
|
|
Name *string `json:"name,omitempty"`
|
|
ToolCalls any `json:"tool_calls,omitempty"`
|
|
CallId string `json:"call_id,omitempty"`
|
|
}
|
|
type RealtimeContent struct {
|
|
Type string `json:"type"`
|
|
Text string `json:"text,omitempty"`
|
|
Audio string `json:"audio,omitempty"` // Base64-encoded audio bytes.
|
|
Transcript string `json:"transcript,omitempty"`
|
|
}
|