Skip to content

Commit 7bc55a6

Browse files
authored
Merge pull request #34 from pipecat-ai/mb/update-voice-ui-kit-0.8.0
Update voice-ui-kit to 0.8.0
2 parents 0a2c6f6 + cc25ac7 commit 7bc55a6

7 files changed

Lines changed: 124 additions & 41 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ All notable changes to **SmallWebRTC Prebuilt** will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [2.3.0] - 2026-02-25
9+
10+
### Changed
11+
12+
- Update to `voice-ui-kit` 0.8.0, which adds support for function call status
13+
information in the ConversationPanel.
14+
815
## [2.2.0] - 2026-02-13
916

1017
### Changed
@@ -19,7 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1926

2027
### Changed
2128

22-
- Update to voice-ui-kit 0.7.1, which introduces support for the
29+
- Update to `voice-ui-kit` 0.7.1, which introduces support for the
2330
`bot-output` event. Now the conversation panel displays text optimally for
2431
configured TTS service.
2532

client/package-lock.json

Lines changed: 40 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"@pipecat-ai/client-react": "^1.1.0",
2727
"@pipecat-ai/small-webrtc-transport": "^1.9.0",
2828
"@pipecat-ai/daily-transport": "^1.6.0",
29-
"@pipecat-ai/voice-ui-kit": "^0.7.1",
29+
"@pipecat-ai/voice-ui-kit": "^0.8.0",
3030
"react": "^19.1.0",
3131
"react-dom": "^19.1.0"
3232
}

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "pipecat-ai-small-webrtc-prebuilt"
7-
version = "2.2.0"
7+
version = "2.3.0"
88
description = "A simple, ready-to-use client for testing the SmallWebRTCTransport."
99
license = { text = "BSD 2-Clause License" }
1010
readme = "README.md"

test/bot-cascade.py

Lines changed: 57 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,17 @@
44
# SPDX-License-Identifier: BSD 2-Clause License
55
#
66

7+
import asyncio
78
import os
89

910
from dotenv import load_dotenv
1011
from loguru import logger
12+
from pipecat.adapters.schemas.function_schema import FunctionSchema
13+
from pipecat.adapters.schemas.tools_schema import ToolsSchema
1114
from pipecat.audio.turn.smart_turn.local_smart_turn_v3 import LocalSmartTurnAnalyzerV3
1215
from pipecat.audio.vad.silero import SileroVADAnalyzer
1316
from pipecat.audio.vad.vad_analyzer import VADParams
14-
from pipecat.frames.frames import LLMRunFrame
17+
from pipecat.frames.frames import LLMRunFrame, TTSSpeakFrame
1518
from pipecat.pipeline.pipeline import Pipeline
1619
from pipecat.pipeline.runner import PipelineRunner
1720
from pipecat.pipeline.task import PipelineParams, PipelineTask
@@ -20,18 +23,29 @@
2023
LLMContextAggregatorPair,
2124
LLMUserAggregatorParams,
2225
)
26+
from pipecat.processors.frameworks.rtvi import RTVIFunctionCallReportLevel, RTVIObserverParams
2327
from pipecat.runner.types import RunnerArguments
2428
from pipecat.runner.utils import create_transport
2529
from pipecat.services.cartesia.tts import CartesiaTTSService
2630
from pipecat.services.deepgram.stt import DeepgramSTTService
27-
from pipecat.services.deepgram.tts import DeepgramTTSService
31+
from pipecat.services.llm_service import FunctionCallParams
2832
from pipecat.services.openai.llm import OpenAILLMService
2933
from pipecat.transports.base_transport import BaseTransport, TransportParams
3034
from pipecat.turns.user_stop import TurnAnalyzerUserTurnStopStrategy
3135
from pipecat.turns.user_turn_strategies import UserTurnStrategies
3236

3337
load_dotenv(override=True)
3438

39+
40+
async def fetch_weather_from_api(params: FunctionCallParams):
41+
await asyncio.sleep(1)
42+
await params.result_callback({"conditions": "nice", "temperature": "75"})
43+
44+
45+
async def fetch_restaurant_recommendation(params: FunctionCallParams):
46+
await params.result_callback({"name": "The Golden Dragon"})
47+
48+
3549
# We use lambdas to defer transport parameter creation until the transport
3650
# type is selected at runtime.
3751
transport_params = {
@@ -51,26 +65,56 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments):
5165
api_key=os.getenv("CARTESIA_API_KEY"),
5266
voice_id="71a7ad14-091c-4e8e-a314-022ece01c121", # British Reading Lady
5367
)
54-
# tts = DeepgramTTSService(api_key=os.getenv("DEEPGRAM_API_KEY"), voice="aura-2-andromeda-en")
5568

5669
llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"))
5770

71+
llm.register_function("get_current_weather", fetch_weather_from_api)
72+
llm.register_function("get_restaurant_recommendation", fetch_restaurant_recommendation)
73+
74+
@llm.event_handler("on_function_calls_started")
75+
async def on_function_calls_started(service, function_calls):
76+
await tts.queue_frame(TTSSpeakFrame("Let me check on that."))
77+
78+
weather_function = FunctionSchema(
79+
name="get_current_weather",
80+
description="Get the current weather",
81+
properties={
82+
"location": {
83+
"type": "string",
84+
"description": "The city and state, e.g. San Francisco, CA",
85+
},
86+
"format": {
87+
"type": "string",
88+
"enum": ["celsius", "fahrenheit"],
89+
"description": "The temperature unit to use. Infer this from the user's location.",
90+
},
91+
},
92+
required=["location", "format"],
93+
)
94+
restaurant_function = FunctionSchema(
95+
name="get_restaurant_recommendation",
96+
description="Get a restaurant recommendation",
97+
properties={
98+
"location": {
99+
"type": "string",
100+
"description": "The city and state, e.g. San Francisco, CA",
101+
},
102+
},
103+
required=["location"],
104+
)
105+
tools = ToolsSchema(standard_tools=[weather_function, restaurant_function])
106+
58107
messages = [
59108
{
60109
"role": "system",
61110
"content": "You are a helpful LLM in a WebRTC call. Your goal is to demonstrate your capabilities in a succinct way. Your output will be spoken aloud, so avoid special characters that can't easily be spoken, such as emojis or bullet points. Respond to what the user said in a creative and helpful way.",
62111
},
63112
]
64113

65-
context = LLMContext(messages)
114+
context = LLMContext(messages, tools)
66115
user_aggregator, assistant_aggregator = LLMContextAggregatorPair(
67116
context,
68-
user_params=LLMUserAggregatorParams(
69-
user_turn_strategies=UserTurnStrategies(
70-
stop=[TurnAnalyzerUserTurnStopStrategy(turn_analyzer=LocalSmartTurnAnalyzerV3())]
71-
),
72-
vad_analyzer=SileroVADAnalyzer(params=VADParams(stop_secs=0.2)),
73-
),
117+
user_params=LLMUserAggregatorParams(vad_analyzer=SileroVADAnalyzer()),
74118
)
75119

76120
pipeline = Pipeline(
@@ -92,6 +136,9 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments):
92136
enable_usage_metrics=True,
93137
),
94138
idle_timeout_secs=runner_args.pipeline_idle_timeout_secs,
139+
rtvi_observer_params=RTVIObserverParams(
140+
function_call_report_level={"*": RTVIFunctionCallReportLevel.FULL}
141+
),
95142
)
96143

97144
@task.rtvi.event_handler("on_client_ready")

test/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.1.0"
44
description = "Quickstart example for building voice AI bots with Pipecat"
55
requires-python = ">=3.10"
66
dependencies = [
7-
"pipecat-ai[google,openai,cartesia,deepgram,silero,webrtc,runner,local-smart-turn-v3]>=0.0.101",
7+
"pipecat-ai[google,openai,cartesia,deepgram,silero,webrtc,runner]>=0.0.103",
88
"pipecat-ai-small-webrtc-prebuilt"
99
]
1010

test/uv.lock

Lines changed: 16 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)