Skip to content

Migrate SDK to new agent-stack API response format#2

Closed
amalshaji-plivo wants to merge 12 commits intoplivo:mainfrom
amalshaji-plivo:fix/migrate-to-new-api-response-format
Closed

Migrate SDK to new agent-stack API response format#2
amalshaji-plivo wants to merge 12 commits intoplivo:mainfrom
amalshaji-plivo:fix/migrate-to-new-api-response-format

Conversation

@amalshaji-plivo
Copy link
Contributor

Summary

  • Update test mocks and assertions to match the standardized Plivo flat JSON response format from agent-stack PR #19 (fix/api-response-cleanup)
  • POST/action endpoints now return 201 with api_id + message fields
  • List endpoints use "objects" (not "data") and "meta" with {limit, offset, total_count, previous, next}
  • GET single-resource endpoints include api_id at root
  • Update AgentResource.list() docstring to document new response shape

Verified against:

  • agent-stack/plivo-voice-core/crates/api/src/response.rsApiResponse<T> struct
  • agent-stack/plivo-voice-core/crates/api/src/models.rsPaginatedResponse, PaginationMeta, ConnectCallResponse, AssignNumberResponse
  • agent-stack/plivo-voice-core/crates/api/src/routes/ — all route handlers
  • references/plivo-python/plivo/base.pyMeta class, ListResponseObject (confirms objects/meta/api_id convention)

Test plan

  • pytest tests/ -v — all 73 tests pass
  • ruff check src/ tests/ — clean

bevenky and others added 12 commits March 4, 2026 12:55
Full async-first Python SDK with httpx transport, automatic retries,
typed WebSocket events, VoiceApp server, messaging (SMS/WhatsApp),
numbers management, 70 tests, 15 examples, and CLAUDE.md.
Point tests/codecov badges to bevenky/plivo-agent-python,
normalize double dashes to single dashes, update Audio stream
pipeline description.
Runs pytest across Python 3.10-3.13 with ruff lint,
uploads coverage to Codecov on main branch.
…ssaging examples

- Replace session.transfer() with transfer_to_number() (phone numbers)
  and transfer_to_sip() (SIP URI via Dial XML with custom headers)
- Expand send_sms.py with MMS single and multi-media examples
- Rewrite whatsapp.py with all 7 message types: text, media, template,
  interactive buttons, list, CTA URL, and location
- Add 4 new transfer tests (73 total)
Agent endpoints now use /v1/Account/{auth_id}/Agent and
/v1/Account/{auth_id}/AgentCall paths instead of /v1/Agent
and /v1/AgentCall. Add agents_base_url property to HttpTransport.
Update mock responses and assertions to match the standardized
response format from agent-stack PR #19: api_id at root, objects/meta
for lists, 201 status for POST/action endpoints.
Move src/plivo_agent/ to src/plivo_agentstack/, update all imports
across tests, examples, CI, pyproject.toml, README, and CLAUDE.md.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

2 participants