Commit Graph

8427 Commits

Author SHA1 Message Date
Mark Backman
991fbb82da fix: read system_instruction from _settings instead of removed attribute
Replace adapter-based extraction in traced_llm with direct reads from
_settings.system_instruction (priority) and context messages (fallback).
The old approach had three bugs: signature mismatch with Anthropic
adapter, key name inconsistency, and unnecessary overhead from full
message/tools conversion.

Also deduplicate the system instruction in spans -- it was appearing as
both "system" and "param.system_instruction".
2026-03-20 21:34:22 -04:00
Kinshuk Bairagi
112d1bd375 Improve system message extraction in traced_llm
Enhanced the logic for extracting the system message in the traced_llm decorator to support LLMContext via adapter and handle exceptions gracefully. This improves compatibility with different context types and ensures better tracing information.
2026-03-20 21:34:22 -04:00
Varun Singh
7f9f151b7c enable_dialout should not depend on sip_caller_phone being set (#4087)
* enable_dialout should not depend on SIP being set

* we still need room_prefix to have pipecat-sip, s/sip/telephony in room prefix
2026-03-20 21:34:22 -04:00
Mark Backman
9edbe60c8c Add changelog entry for #4090 2026-03-20 21:34:22 -04:00
Mark Backman
7de260abe7 fix: route TTS audio through audio context queue in Fish, LMNT, Neuphonic, Rime NonJson
These services were pushing audio frames directly via push_frame() in their
WebSocket receive loops, bypassing the base TTSService audio context
serialization queue. This causes incorrect frame ordering and broken
interruption handling.

Changes per service:
- Fish Audio: use append_to_audio_context(), replace _handle_interruption
  with on_audio_context_interrupted()
- LMNT: use append_to_audio_context(), remove redundant push_frame override
- Neuphonic: use append_to_audio_context(), remove redundant push_frame and
  process_frame overrides (base class handles pause/resume)
- Rime NonJson: use append_to_audio_context(), remove redundant push_frame
  override
2026-03-20 21:34:22 -04:00
Mark Backman
073318be91 Add community integrations to README 2026-03-20 21:34:22 -04:00
filipi87
0778116a55 Changelog entry for the DeepgramSageMakerTTSService improvements. 2026-03-20 21:34:22 -04:00
filipi87
efba4f2c7a Routing the audio through the audio context queue. 2026-03-20 21:34:22 -04:00
filipi87
0afd8bf341 Improvements to DeepgramSageMakerTTSService. 2026-03-20 21:34:22 -04:00
filipi87
7e06b99029 Adding changelog entry for the Sarvam fixes. 2026-03-20 21:34:22 -04:00
filipi87
bd834083da Improvements to SarvamTTSService. 2026-03-20 21:34:22 -04:00
Paul Kompfner
aec8d13eec Remove 05a example, which was broken and isn't currently a priority to fix 2026-03-20 21:34:22 -04:00
Paul Kompfner
3b5a8acfe2 fix: typo "conversatione" → "conversation" in 20- examples 2026-03-20 21:34:22 -04:00
Paul Kompfner
6ee49333f3 docs: note input_audio coming soon, no conversion needed
The LLMContext format already matches the expected Responses API
shape for input_audio, so no adapter conversion will be needed
once OpenAI enables support.
2026-03-20 21:34:22 -04:00
Paul Kompfner
f33f2d7640 refactor: remove model init param from OpenAIResponsesLLMService
Model is only configurable via settings, matching the canonical API.
2026-03-20 21:34:22 -04:00
Paul Kompfner
eb3affd45b docs: port _closing comments from BaseOpenAILLMService 2026-03-20 21:34:22 -04:00
Paul Kompfner
0ae6a8b63a feat: include cached_tokens and reasoning_tokens in usage metrics 2026-03-20 21:34:22 -04:00
Paul Kompfner
35903905f8 refactor: use direct attribute access for typed stream events
Replace getattr() calls with direct attribute access and isinstance()
checks on the strongly-typed OpenAI SDK event models.
2026-03-20 21:34:22 -04:00
Paul Kompfner
f680f3c1fa fix: prefer _full_model_name over _settings.model in tracing
The API-provided full model name is more specific than the
user-provided model name (e.g. includes version/snapshot details).
Reorder the lookup in _get_model_name and add a comment where the
Responses service sets the field.
2026-03-20 21:34:22 -04:00
Paul Kompfner
3ddb7b4aaf fix: remove redundant instructions override in run_inference
The override would re-add `instructions` after the adapter had
intentionally converted it to a developer message for empty contexts.
Added a regression test.
2026-03-20 21:34:22 -04:00
Paul Kompfner
6b8bca3d93 feat: add 12- and 14d- image/video examples for OpenAI Responses 2026-03-20 21:34:22 -04:00
Paul Kompfner
0bb0874275 feat: add service_tier support to OpenAIResponsesLLMService 2026-03-20 21:34:22 -04:00
Paul Kompfner
e1f31ff878 feat: add 55zi update-settings example for OpenAI Responses 2026-03-20 21:34:22 -04:00
Paul Kompfner
2f2c0909f1 feat: add 20a persistent context example for OpenAI Responses 2026-03-20 21:34:22 -04:00
Paul Kompfner
ea89819ece chore: update previous_response_id comment 2026-03-20 21:34:22 -04:00
Paul Kompfner
c66a5a8ede feat: set store=False and add run_inference tests
Set store=False in Responses API calls since we send full conversation
history as input items and don't use previous_response_id.

Add 5 run_inference tests for OpenAIResponsesLLMService using real
LLMContext and adapter (only HTTP client mocked).
2026-03-20 21:34:22 -04:00
Paul Kompfner
cd2886a4a8 chore: add note about previous_response_id and empty input handling 2026-03-20 21:34:22 -04:00
Paul Kompfner
312837a1d4 test: add run_inference tests for OpenAIResponsesLLMService
Uses real LLMContext and adapter (only HTTP client is mocked) to test
basic inference, client exception propagation, system_instruction
override, empty context fallback, and max_tokens override.
2026-03-20 21:34:22 -04:00
Paul Kompfner
4d4e56cfef test: add run_inference tests for OpenAIResponsesLLMService
Tests cover basic inference, client exception propagation,
system_instruction override, and max_tokens override.
2026-03-20 21:34:22 -04:00
Paul Kompfner
05e1d9f514 docs: add changelog for OpenAI Responses API service 2026-03-20 21:34:22 -04:00
Paul Kompfner
4d548117fa feat: add OpenAI Responses API LLM service
Add OpenAIResponsesLLMService using the Responses API, with a dedicated
adapter that converts LLMContext messages to Responses API input items
(system→developer, tool_calls→function_call, tool→function_call_output,
multimodal content conversion, and tools schema flattening).

- New adapter: open_ai_responses_adapter.py
- New service: openai/responses/llm.py
- Examples: 07-interruptible and 14-function-calling variants
- 19 unit tests for adapter conversion logic
- Eval entries for both examples
2026-03-20 21:34:22 -04:00
Paul Kompfner
b5c2d41ba3 Remove changelog fragment that no longer applies after a rebase 2026-03-20 21:34:22 -04:00
Paul Kompfner
dba2fc5451 Clarify SyncParallelPipeline docstrings
Rewrite docstrings to more clearly explain what SyncParallelPipeline
does: hold all output until every parallel branch finishes, so frames
produced in response to a single input are released together.
2026-03-20 21:34:22 -04:00
Paul Kompfner
0a4acfa294 Add frame_order parameter to SyncParallelPipeline
Adds a FrameOrder enum with ARRIVAL (default, existing behavior) and
PIPELINE (pushes frames in pipeline definition order). This lets callers
guarantee output ordering between parallel pipelines — e.g. ensuring
image frames precede audio frames — without needing a separate reordering
processor downstream.

Updates the 05-sync-speech-and-image example to use FrameOrder.PIPELINE,
removing the ImageBeforeAudioReorderer class entirely.
2026-03-20 21:34:22 -04:00
Paul Kompfner
ffdf629535 Add changelog entry for Whisker debugger fix 2026-03-20 21:34:22 -04:00
Paul Kompfner
a6b94c7424 Add changelog entries for PR #4029 2026-03-20 21:34:22 -04:00
Paul Kompfner
d2341e0199 Add ImageBeforeAudioReorderer to sync-speech-and-image example
Add a processor after SyncParallelPipeline that ensures each image frame
precedes its corresponding TTS audio frames. SyncParallelPipeline batches
them together but doesn't guarantee branch ordering. The reorderer detects
when TTS frames arrive before their image (via context_id tracking) and
holds them until the image arrives.

Also rename ImageAudioSync to MarkImageForPlaybackSync for clarity.
2026-03-20 21:34:22 -04:00
Paul Kompfner
4b66dd444b Revert a couple of logs that were changed from trace to debug just for debugging 2026-03-20 21:34:22 -04:00
Paul Kompfner
7b859423ab Use TextAggregationMode.TOKEN in the 05-sync-speech-and-image
example since the SentenceAggregator already provides complete sentences.
2026-03-20 21:34:22 -04:00
Paul Kompfner
b68495ce0a Add sync_with_audio support for OutputImageRawFrame
Add a `sync_with_audio` field to `OutputImageRawFrame` that routes image
frames through the audio queue in the output transport, ensuring images
are only displayed after all preceding audio has been sent. This enables
proper audio/image synchronization in pipelines like the calendar month
narration example.

Update the 05-sync-speech-and-image example to use an `ImageAudioSync`
processor that sets this flag on image frames.
2026-03-20 21:34:22 -04:00
Paul Kompfner
f39472b150 Fix SyncParallelPipeline race condition with concurrent SystemFrame processing
The FrameProcessor two-queue architecture processes SystemFrames and
non-SystemFrames on separate concurrent async tasks. Both paths called
SyncParallelPipeline.process_frame(), which used the same per-pipeline
sink queues. A SystemFrame's wait_for_sync could steal frames from a
concurrent non-SystemFrame's wait_for_sync, corrupting synchronization
and stalling the pipeline.

This was triggered by the auto-embedded RTVI processor (added in
v0.0.101) which floods OutputTransportMessageUrgentFrame SystemFrames
through the pipeline during LLM responses.

Fix: SystemFrames (except EndFrame) now take a fast path — passed
through internal pipelines and pushed downstream directly without
touching the sink queues or drain logic. EndFrame retains the full
drain behavior as a lifecycle frame.
2026-03-20 21:34:21 -04:00
Paul Kompfner
a8ea176ea3 Minor comment typo fix 2026-03-20 21:34:21 -04:00
Paul Kompfner
12cb9599ad Fix bug resulting in SyncParallelPipeline breaking the Whisker debugger 2026-03-20 21:34:21 -04:00
filipi87
167f008e47 Mentioning the frame order fix in the changelog. 2026-03-20 21:34:21 -04:00
filipi87
fe8cb2f4e0 Always appending TTSTextFrame to the audio context. 2026-03-20 21:34:21 -04:00
filipi87
cdf44f7a3f Fixing the frame ordering of the AggregatedTextFrame. 2026-03-20 21:34:21 -04:00
filipi87
d32a8a9ee2 Fixing TTS frame order. 2026-03-20 21:34:21 -04:00
joachimchauvet
ed160fd2e0 fix(livekit): suppress InvalidState log spam from audio mixer during interruptions 2026-03-20 21:34:21 -04:00
aconchillo
84eddb64d5 Update changelog for version 0.0.106 2026-03-20 21:34:21 -04:00
Aleix Conchillo Flaqué
189249caec Add missing on_dtmf_event callback to Tavus transport
The on_dtmf_event callback was added to DailyCallbacks in #4047 but
the Tavus transport was not updated, causing a missing argument error.
2026-03-20 21:34:21 -04:00