diff --git a/agents/my_basic_agent_1_2_9.py b/agents/my_basic_agent_1_2_9.py
index 000e53b..0931ef8 100644
--- a/agents/my_basic_agent_1_2_9.py
+++ b/agents/my_basic_agent_1_2_9.py
@@ -103,7 +103,7 @@ DEFAULT_INSTRUCTIONS = """# 角色
- 一次询问一个问题
- 不要在你的回复中使用 emojis, asterisks, markdown, 或其他特殊字符
- 不同阶段直接的过渡语句自然
-- 你已经说过下面的开场白所以不需要重复说:“您好,这里是无锡交警,我将为您远程处理交通事故。请将人员撤离至路侧安全区域,开启危险报警双闪灯、放置三角警告牌、做好安全防护,谨防二次事故伤害。若您已经准备好了,请点击继续办理,如需人工服务,请说转人工。”
+- 你已经说过下面的开场白,用户点击继续办理说明已经认可,所以不需要重复说:“您好,这里是无锡交警,我将为您远程处理交通事故。请将人员撤离至路侧安全区域,开启危险报警双闪灯、放置三角警告牌、做好安全防护,谨防二次事故伤害。若您已经准备好了,请点击继续办理,如需人工服务,请说转人工。”
"""
DEFAULT_TALKING_MODE = 'push_to_talk'
@@ -1030,6 +1030,7 @@ async def entrypoint(ctx: JobContext, avatar_dispatcher_url: str = None, vision_
logger.info("Using default DeepSeek backend")
llm = openai.LLM.with_deepseek(
model='deepseek-chat',
+ temperature=0.1
)
session = AgentSession(
diff --git a/src/components/playground/PhoneSimulator.tsx b/src/components/playground/PhoneSimulator.tsx
index a8ed4f0..cf81601 100644
--- a/src/components/playground/PhoneSimulator.tsx
+++ b/src/components/playground/PhoneSimulator.tsx
@@ -715,7 +715,7 @@ export function PhoneSimulator({
>
- Call Agent
+ 呼叫智能体
@@ -725,7 +725,7 @@ export function PhoneSimulator({
>
- {currentVoiceId === "BV001_streaming" ? "Female Voice" : "Male Voice"}
+ {currentVoiceId === "BV001_streaming" ? "女性声音" : "男性声音"}
{showVoiceMenu && (
@@ -745,7 +745,7 @@ export function PhoneSimulator({
: "text-white"
}`}
>
- Female Voice
+ 女性声音
{currentVoiceId === "BV001_streaming" && }
- Male Voice
+ 男性声音
{currentVoiceId === "BV002_streaming" && (
)}
@@ -1198,6 +1198,20 @@ export function PhoneSimulator({
)}
+
+ {/* Fallback: Show End Call Button when in push-to-talk mode but no agent/audio */}
+ {phoneMode === "normal" &&
+ isPushToTalkMode &&
+ !voiceAssistant.agent && (
+
+ )}
)
diff --git a/src/components/playground/Playground.tsx b/src/components/playground/Playground.tsx
index 4324204..49df031 100644
--- a/src/components/playground/Playground.tsx
+++ b/src/components/playground/Playground.tsx
@@ -479,21 +479,34 @@ export default function Playground({
]);
const instructionsContent = (
-
-
+ <>
+
+
+
+ {
+ const userSettings = { ...config.settings };
+ userSettings.theme_color = color;
+ setUserSettings(userSettings);
+ }}
+ />
+
+ >
);
const handleRpcCall = useCallback(async () => {
@@ -516,13 +529,13 @@ export default function Playground({
const settingsTileContent = useMemo(() => {
return (
- {config.description && (
+ {/* {config.description && (
{config.description}
- )}
+ )} */}
-
+ {/*
-
+ */}
-
+ {/*
-
+ */}
-
+ {/*
-
+ */}
{roomState === ConnectionState.Connected &&
config.settings.inputs.screen && (
@@ -725,19 +738,6 @@ export default function Playground({
)}
-
-
- {
- const userSettings = { ...config.settings };
- userSettings.theme_color = color;
- setUserSettings(userSettings);
- }}
- />
-
-
{config.show_qr && (
@@ -748,7 +748,6 @@ export default function Playground({
);
}, [
- config.description,
config.settings,
config.show_qr,
localParticipant,
@@ -842,7 +841,7 @@ export default function Playground({
return (
<>
-
+ /> */}
)}
-
{settingsTileContent}
-
+ */}
>
);
diff --git a/src/components/playground/PlaygroundTile.tsx b/src/components/playground/PlaygroundTile.tsx
index e21edcc..9b3b0d9 100644
--- a/src/components/playground/PlaygroundTile.tsx
+++ b/src/components/playground/PlaygroundTile.tsx
@@ -100,7 +100,18 @@ export const PlaygroundTabbedTile: React.FC
= ({
padding: `${contentPadding * 4}px`,
}}
>
- {tabs[activeTab].content}
+ {tabs.map((tab, index) => (
+
+ {tab.content}
+
+ ))}
);
diff --git a/src/transcriptions/TranscriptionTile.tsx b/src/transcriptions/TranscriptionTile.tsx
index f2129d3..98f0288 100644
--- a/src/transcriptions/TranscriptionTile.tsx
+++ b/src/transcriptions/TranscriptionTile.tsx
@@ -11,7 +11,7 @@ import {
Track,
TranscriptionSegment,
} from "livekit-client";
-import { useEffect, useState } from "react";
+import { useEffect, useState, useRef } from "react";
export function TranscriptionTile({
agentAudioTrack,
@@ -30,39 +30,51 @@ export function TranscriptionTile({
participant: localParticipant.localParticipant,
});
- const [transcripts, setTranscripts] = useState>(
- new Map(),
- );
const [messages, setMessages] = useState([]);
const { chatMessages, send: sendChat } = useChat();
+ const transcriptMapRef = useRef>(new Map());
- // store transcripts
+ // Build messages from segments and chat - always rebuild from current state
useEffect(() => {
+ const transcriptMap = transcriptMapRef.current;
+
+ // Process agent segments - update existing or add new
if (agentAudioTrack) {
- agentMessages.segments.forEach((s) =>
- transcripts.set(
+ agentMessages.segments.forEach((s) => {
+ const existing = transcriptMap.get(s.id);
+ transcriptMap.set(
s.id,
segmentToChatMessage(
s,
- transcripts.get(s.id),
+ existing,
agentAudioTrack.participant,
),
- ),
- );
+ );
+ });
}
- localMessages.segments.forEach((s) =>
- transcripts.set(
+ // Process local segments - update existing or add new
+ localMessages.segments.forEach((s) => {
+ const existing = transcriptMap.get(s.id);
+ transcriptMap.set(
s.id,
segmentToChatMessage(
s,
- transcripts.get(s.id),
+ existing,
localParticipant.localParticipant,
),
- ),
- );
+ );
+ });
- const allMessages = Array.from(transcripts.values());
+ // Build all messages
+ const allMessages: ChatMessageType[] = [];
+
+ // Add all transcript messages
+ transcriptMap.forEach((msg) => {
+ allMessages.push(msg);
+ });
+
+ // Add chat messages
for (const msg of chatMessages) {
const isAgent = agentAudioTrack
? msg.from?.identity === agentAudioTrack.participant?.identity
@@ -79,6 +91,7 @@ export function TranscriptionTile({
name = "Unknown";
}
}
+
allMessages.push({
name,
message: msg.message,
@@ -86,10 +99,11 @@ export function TranscriptionTile({
isSelf: isSelf,
});
}
+
+ // Sort by timestamp
allMessages.sort((a, b) => a.timestamp - b.timestamp);
setMessages(allMessages);
}, [
- transcripts,
chatMessages,
localParticipant.localParticipant,
agentAudioTrack?.participant,