Skip to content

Commit e92d702

Browse files
committed
Add browser based audio input support
1 parent fd6f819 commit e92d702

2 files changed

Lines changed: 20 additions & 7 deletions

File tree

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[project]
22
name = "kady"
3-
version = "0.2.10"
3+
version = "0.2.11"
44
description = "Kady — K-Dense BYOK Agent"
55
readme = "README.md"
66
requires-python = ">=3.13"
77
dependencies = [
88
"fastapi>=0.133.1",
9-
"google-adk[extensions]>=1.27.4",
9+
"google-adk[extensions]>=1.27.5",
1010
"litellm[proxy]==1.82.6",
1111
"markitdown[all]>=0.1.5",
1212
"modal>=1.3.5",

web/src/app/page.tsx

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import { useSkills } from "@/lib/use-skills";
3939
import type { TurnMeta } from "@/lib/provenance";
4040
import { hasDirectoryEntries, traverseDroppedEntries } from "@/lib/directory-upload";
4141
import { useSandbox, fileCategory, type TreeNode } from "@/lib/use-sandbox";
42+
import { SpeechInput } from "@/components/ai-elements/speech-input";
4243
import {
4344
CopyIcon,
4445
CheckIcon,
@@ -473,6 +474,12 @@ function ChatInput({
473474
}
474475
}, [mentionQuery, filteredFiles, mentionSelIdx, applyMention, closeMention]);
475476

477+
const handleTranscription = useCallback((text: string) => {
478+
const current = controller.textInput.value;
479+
const sep = current && !current.endsWith(" ") && !current.endsWith("\n") ? " " : "";
480+
controller.textInput.setInput(current + sep + text);
481+
}, [controller]);
482+
476483
const isMentionOpen = mentionQuery !== null && filteredFiles.length > 0;
477484
const submitStatus = isStreaming ? "streaming" : agentStatus === "error" ? "error" : "ready";
478485

@@ -555,11 +562,17 @@ function ChatInput({
555562
<ComputeSelector selected={selectedCompute} onChange={onComputeChange} modalConfigured={modalConfigured} />
556563
<SkillsSelector skills={allSkills} selected={selectedSkills} onChange={onSkillsChange} />
557564
</div>
558-
<PromptInputSubmit
559-
className="shrink-0"
560-
status={submitStatus as "streaming" | "error" | "ready"}
561-
onStop={onStop}
562-
/>
565+
<div className="flex items-center gap-1.5 shrink-0">
566+
<SpeechInput
567+
size="icon-sm"
568+
variant="ghost"
569+
onTranscriptionChange={handleTranscription}
570+
/>
571+
<PromptInputSubmit
572+
status={submitStatus as "streaming" | "error" | "ready"}
573+
onStop={onStop}
574+
/>
575+
</div>
563576
</PromptInputFooter>
564577
</PromptInput>
565578
</div>

0 commit comments

Comments
 (0)