Skip to content

Add agentic call#34

Merged
codingjoe merged 19 commits intomainfrom
agent
Mar 15, 2026
Merged

Add agentic call#34
codingjoe merged 19 commits intomainfrom
agent

Conversation

@codingjoe
Copy link
Copy Markdown
Owner

Close #26

@codingjoe codingjoe self-assigned this Mar 15, 2026
Copilot AI review requested due to automatic review settings March 15, 2026 14:51
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 15, 2026

Codecov Report

❌ Patch coverage is 94.49686% with 35 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.02%. Comparing base (4d0335d) to head (5101e79).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
voip/__main__.py 74.46% 24 Missing ⚠️
voip/ai.py 90.90% 11 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #34      +/-   ##
==========================================
+ Coverage   93.69%   94.02%   +0.32%     
==========================================
  Files          16       23       +7     
  Lines        1348     1690     +342     
==========================================
+ Hits         1263     1589     +326     
- Misses         85      101      +16     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an AI-capable call stack to the VoIP library by splitting “audio-only” vs “AI” responsibilities, introducing agentic call handling (Whisper → Ollama → Pocket TTS), and refactoring RTP call handling to dispatch parsed RTP packets.

Changes:

  • Introduce voip.ai with TranscribeCall and AgentCall (new ai extra), and extend the CLI with an agent command.
  • Refactor call handling around voip.rtp.RTPCall + parsed RTPPacket delivery, and extend AudioCall with outbound encoding/packetization.
  • Update docs/navigation and optional dependencies to reflect the new module split.

Reviewed changes

Copilot reviewed 30 out of 30 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
voip/types.py Replaces digest enums with a new ByteSerializableObject protocol used by message/packet types.
voip/stun.py Docstring/logic tweaks; tightens STUN request guard and adds an assertion before callback.
voip/srtp.py Documentation formatting + RFC reference-style links.
voip/sip/types.py Adds SIP digest algorithm/QoP enums; minor docstring formatting changes.
voip/sip/protocol.py Switches call handler type to RTPCall and updates many docstrings/links.
voip/sip/messages.py Makes Message implement ByteSerializableObject; docstring/link updates.
voip/sip/__init__.py Adds re-exports (Message, Request, Response, SessionInitiationProtocol, CallerID) and RFC link docstring.
voip/sdp/types.py Expands docstrings and updates inline references in SDP types.
voip/sdp/messages.py Docstring/link updates; removes redundant __bytes__ docstring.
voip/sdp/__init__.py Adds RFC 4566 reference-style link docstring.
voip/rtp.py Introduces RTPCall and RTPPacket.__bytes__; RTP mux now dispatches parsed packets to packet_received.
voip/call.py Removes the old Call base class module.
voip/audio.py Drops Whisper code from audio; adds outbound encoding/packetization + per-packet decode path.
voip/ai.py New AI module: VAD-based transcription + Ollama/Pocket-TTS agent responder.
voip/__main__.py Refactors CLI structure (sip group holds AOR/options); adds agent command and shared connect helper.
tests/test_rtp.py Updates tests to use RTPCall + packet_received and validates RTPPacket serialization.
tests/test_main.py Updates CLI invocation style and adds agent CLI test coverage; stubs AI deps.
tests/test_call.py Ports tests to RTPCall and send_packet; adds SRTP encryption assertion.
tests/test_audio.py Reworks tests to cover encoding/packetization/resampling and removes Whisper tests from audio.
tests/test_ai.py New comprehensive tests for TranscribeCall and AgentCall.
tests/sip/test_protocol.py Updates SIP protocol tests to use RTPCall and packet_received semantics.
pyproject.toml Splits extras into audio vs ai; CLI extra now includes AI deps.
mkdocs.yml Reorganizes nav to include Calls/SDP/SIP/RTP under “API Reference”.
docs/sip.md Switches to module-level mkdocstrings entry for voip.sip.
docs/sdp.md New module doc page for voip.sdp.
docs/rtp.md Switches to module-level mkdocstrings entry for voip.rtp.
docs/calls.md Updates calls documentation to reference RTPCall, AudioCall, and AI calls.
README.md Updates CLI usage/examples; updates Python API example to TranscribeCall; adds Ollama link.
.pre-commit-config.yaml Adds a ty type-check hook (excluded for tests; skipped in CI).
.github/copilot-instructions.md Allows Markdown links in docstrings and clarifies docstring conventions.

You can also share your feedback on Copilot code review. Take the survey.

@codingjoe
Copy link
Copy Markdown
Owner Author

@copilot open a new pull request to apply changes based on the comments in this thread

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 15, 2026

@codingjoe I've opened a new pull request, #35, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI added a commit that referenced this pull request Mar 15, 2026
@codingjoe codingjoe merged commit 986f405 into main Mar 15, 2026
22 checks passed
@codingjoe codingjoe deleted the agent branch March 15, 2026 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add more AI tools

3 participants