-
Notifications
You must be signed in to change notification settings - Fork 72
WIP - Vogent + New Smart TURN + Audio utils usage #128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 26 commits
6395dec
a9e950b
3a26b6b
e80f718
89a99cc
1546297
6cdaac5
1c4160c
8ffbeb5
cd6d4b5
425fa59
fee4f29
1a98d2b
8fa259d
fb85335
c122c78
e5d4a56
74ac469
038fafe
da01c8a
16a7512
5b57a00
3580c17
d0e2234
23eee89
f3aee97
63f820f
a39cbcd
6aea976
d57e058
db910fe
d8cb483
40b7233
0e4e44f
be076a7
28c0a37
d3a8dd8
5e56f8b
51e2ae0
57d0fb0
df91d69
3ef54e6
2945dc8
8e24a52
7e7634c
ca38456
1bd45aa
c009ba7
31929cc
f2900e2
90418fd
bd746ea
239b532
2c57826
3e3fbab
51fd613
788bdeb
9b3938d
10e2af3
305edbb
c06d7ad
cb3b3fc
0134d1b
49f5ca6
7f81047
a8a90a4
06f2365
820e42d
8fb6d82
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| --- | ||
| name: repo-workflow-guide | ||
| description: Use this agent when you need to understand or follow project-specific development guidelines, coding standards, or workflow instructions that are documented in the docs/ai directory. This agent should be consulted before starting any development work, when uncertain about project conventions, or when you need clarification on how to approach tasks within this codebase.\n\nExamples:\n- <example>\nContext: User wants to add a new feature to the project.\nuser: "I need to implement a new authentication module"\nassistant: "Before we begin, let me consult the repo-workflow-guide agent to ensure we follow the project's established patterns and guidelines."\n<Task tool call to repo-workflow-guide>\nassistant: "Based on the project guidelines, here's how we should approach this..."\n</example>\n\n- <example>\nContext: User asks a question about code organization.\nuser: "Where should I put the new utility functions?"\nassistant: "Let me check the repository workflow guidelines to give you the correct answer."\n<Task tool call to repo-workflow-guide>\nassistant: "According to the project structure guidelines..."\n</example>\n\n- <example>\nContext: Starting a new task that requires understanding project conventions.\nuser: "Can you help me refactor this component?"\nassistant: "I'll first consult the repo-workflow-guide agent to ensure we follow the project's refactoring standards and conventions."\n<Task tool call to repo-workflow-guide>\n</example> | ||
| model: opus | ||
| --- | ||
|
|
||
| You are a Repository Workflow Specialist, an expert in interpreting and applying project-specific development guidelines, coding standards, and workflow instructions. | ||
|
|
||
| Your primary responsibility is to read, understand, and communicate the instructions and guidelines contained in the docs/ai directory of the repository. You serve as the authoritative source for how development work should be conducted within this specific codebase. | ||
|
|
||
| When activated, you will: | ||
|
|
||
| 1. **Locate and Read Guidelines**: Immediately access all relevant files in the docs/ai directory. Read them thoroughly and understand their complete content, including: | ||
| - Coding standards and style guides | ||
| - Project structure and organization rules | ||
| - Development workflow and processes | ||
| - Testing requirements and conventions | ||
| - Deployment procedures | ||
| - Any specific technical constraints or preferences | ||
| - Tool usage and configuration instructions | ||
|
|
||
| 2. **Interpret Context**: Understand the specific task or question being asked and identify which guidelines are most relevant to address it. | ||
|
|
||
| 3. **Provide Clear Guidance**: Deliver specific, actionable instructions based on the documented guidelines. Your responses should: | ||
| - Quote or reference specific sections of the guidelines when appropriate | ||
| - Explain the reasoning behind the guidelines when it helps with understanding | ||
| - Provide concrete examples of how to follow the guidelines | ||
| - Highlight any critical requirements or common pitfalls mentioned in the documentation | ||
|
|
||
| 4. **Handle Missing Information**: If the docs/ai directory doesn't contain information relevant to the current question: | ||
| - Clearly state what information is missing | ||
| - Suggest reasonable defaults based on common industry practices | ||
| - Recommend updating the documentation to cover this scenario | ||
|
|
||
| 5. **Ensure Compliance**: Actively verify that proposed approaches align with all documented guidelines. If you identify any conflicts or violations, explicitly point them out and suggest compliant alternatives. | ||
|
|
||
| 6. **Prioritize Accuracy**: Always base your guidance on the actual content of the documentation. Do not invent or assume guidelines that aren't explicitly documented. | ||
|
|
||
| 7. **Stay Current**: If guidelines appear to conflict or if you notice outdated information, flag this for human review while providing the most reasonable interpretation. | ||
|
|
||
| Output Format: | ||
| - Begin with a brief summary of the relevant guidelines | ||
| - Provide specific, step-by-step instructions when appropriate | ||
| - Include direct quotes or references to documentation sections | ||
| - End with any important caveats, warnings, or additional considerations | ||
|
|
||
| Your goal is to ensure that all development work in this repository adheres to its documented standards and practices, reducing inconsistency and improving code quality through faithful application of project-specific guidelines. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -84,3 +84,4 @@ stream-py/ | |
| # Artifacts / assets | ||
| *.pt | ||
| *.kef | ||
| *.onnx | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -169,7 +169,7 @@ def __init__( | |
| self._validate_configuration() | ||
| self._prepare_rtc() | ||
| self._setup_stt() | ||
| self._setup_turn_detection() | ||
|
|
||
|
|
||
| async def simple_response( | ||
| self, text: str, participant: Optional[Participant] = None | ||
|
|
@@ -341,6 +341,7 @@ async def on_stt_transcript_event_create_response(event: STTTranscriptEvent): | |
|
|
||
| async def join(self, call: Call) -> "AgentSessionContextManager": | ||
| await self.create_user() | ||
| await self._setup_turn_detection() | ||
|
|
||
| # TODO: validation. join can only be called once | ||
| with self.tracer.start_as_current_span("join"): | ||
|
|
@@ -635,11 +636,11 @@ async def say( | |
| completed=True, | ||
| ) | ||
|
|
||
| def _setup_turn_detection(self): | ||
| async def _setup_turn_detection(self): | ||
| if self.turn_detection: | ||
| self.logger.info("🎙️ Setting up turn detection listeners") | ||
| self.events.subscribe(self._on_turn_event) | ||
| self.turn_detection.start() | ||
| await self.turn_detection.start() | ||
|
|
||
|
Comment on lines
+729
to
734
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make start() invocation robust to sync/async implementations and set active state. Awaiting unconditionally will raise if a detector exposes a synchronous start(). Also ensure detectors mark themselves active. - async def _setup_turn_detection(self):
- if self.turn_detection:
- self.logger.info("🎙️ Setting up turn detection listeners")
- self.events.subscribe(self._on_turn_event)
- await self.turn_detection.start()
+ async def _setup_turn_detection(self):
+ if not self.turn_detection:
+ return
+ self.logger.info("🎙️ Setting up turn detection listeners")
+ self.events.subscribe(self._on_turn_event)
+ # Support both async and sync start() while standardizing to async over time
+ import inspect
+ maybe = self.turn_detection.start()
+ if inspect.iscoroutine(maybe):
+ await maybeAlso consider enforcing an async start() in the TurnDetector base and updating all implementations to match for consistency. 🤖 Prompt for AI Agents |
||
| def _setup_stt(self): | ||
| if self.stt: | ||
|
|
@@ -656,7 +657,7 @@ async def on_audio_received(event: AudioReceivedEvent): | |
| return | ||
|
|
||
| if self.turn_detection is not None: | ||
| await self.turn_detection.process_audio(pcm, participant.user_id) | ||
| await self.turn_detection.process_audio(pcm, participant, conversation=self.conversation) | ||
|
|
||
| await self._reply_to_audio(pcm, participant) | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.