DO NOT MERGE: Add Poe Client to fastapi_poe #168
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add “sample client” for talking to other Poe bots
This PR introduces a brand‑new, high‑level client API on top of the existing stream/request primitives, so that
consumers of fastapi_poe can easily call other Poe bots without wiring up SSE‐streams by hand.
What’s in this change
1. Expose top‑level Poe and PoeAsync client classes
Tweaks to init.py to include the two new client entrypoints in the public API:
src/fastapi_poe/init.py
2. New client.py module (≈178 lines)
Implements:
3. Comprehensive tests (tests/test_client.py, ≈150 lines)
Covers:
Why these changes
Before this PR, library users had to manually stitch together SSE streams, handle tool calls, retries, error
reporting, etc.
The new Poe/PoeAsync client packages all of that logic into a simple, documented façade so you can write:
or its async equivalent with PoeAsync.