Merge pull request #889 from pipecat-ai/mb/openai-realtime-model
Add model parameter to OpenAI realtime service constructor, update de…
This commit is contained in:
@@ -24,6 +24,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
|
- `OpenAIRealtimeBetaLLMService` now takes a `model` parameter in the
|
||||||
|
constructor.
|
||||||
|
|
||||||
|
- Updated the default model for the `OpenAIRealtimeBetaLLMService`.
|
||||||
|
|
||||||
- Room expiration (`exp`) in `DailyRoomProperties` is now optional (`None`) by
|
- Room expiration (`exp`) in `DailyRoomProperties` is now optional (`None`) by
|
||||||
default instead of automatically setting a 5-minute expiration time. You must
|
default instead of automatically setting a 5-minute expiration time. You must
|
||||||
explicitly set expiration time if desired.
|
explicitly set expiration time if desired.
|
||||||
|
|||||||
@@ -72,15 +72,17 @@ class OpenAIRealtimeBetaLLMService(LLMService):
|
|||||||
self,
|
self,
|
||||||
*,
|
*,
|
||||||
api_key: str,
|
api_key: str,
|
||||||
base_url="wss://api.openai.com/v1/realtime?model=gpt-4o-realtime-preview-2024-10-01",
|
model: str = "gpt-4o-realtime-preview-2024-12-17",
|
||||||
|
base_url: str = "wss://api.openai.com/v1/realtime",
|
||||||
session_properties: events.SessionProperties = events.SessionProperties(),
|
session_properties: events.SessionProperties = events.SessionProperties(),
|
||||||
start_audio_paused: bool = False,
|
start_audio_paused: bool = False,
|
||||||
send_transcription_frames: bool = True,
|
send_transcription_frames: bool = True,
|
||||||
**kwargs,
|
**kwargs,
|
||||||
):
|
):
|
||||||
super().__init__(base_url=base_url, **kwargs)
|
full_url = f"{base_url}?model={model}"
|
||||||
|
super().__init__(base_url=full_url, **kwargs)
|
||||||
self.api_key = api_key
|
self.api_key = api_key
|
||||||
self.base_url = base_url
|
self.base_url = full_url
|
||||||
|
|
||||||
self._session_properties: events.SessionProperties = session_properties
|
self._session_properties: events.SessionProperties = session_properties
|
||||||
self._audio_input_paused = start_audio_paused
|
self._audio_input_paused = start_audio_paused
|
||||||
|
|||||||
Reference in New Issue
Block a user