| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- 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"`
- }
|