Agent Human Avatar Plugin#5340
Conversation
…s in pyproject.toml
…tarSession - Changed environment variable name in README from LEMONSLICE_IMAGE_URL to AGENTHUMAN_AVATAR for clarity. - Enhanced logging messages in api.py and avatar.py to include the [agenthuman] prefix for better traceability.
- Added retry mechanism in the session creation process to handle transient API connection errors. - Improved error logging to provide better insights during failures.
- Removed the check for the AGENTHUMAN_AVATAR environment variable in the AgentHumanAPI class. - This change simplifies the avatar handling logic by allowing a default avatar to be used if none is provided.
- Improved session management in AgentHumanAPI by adding ownership tracking for the aiohttp.ClientSession. - Enhanced error handling during session creation to provide clearer feedback on unexpected API response structures. - Updated AvatarSession to use session_id instead of conversation_id for better clarity in session management.
- Updated exception handling in the AgentHumanAPI class to catch both APIStatusError and AgentHumanException, ensuring more robust error management during API interactions.
- Enhanced exception handling in the AgentHumanAPI class to separately manage APIStatusError and AgentHumanException. - Added logging for non-retryable APIStatusError to provide better insights during failures. - Adjusted retry logic to ensure proper handling of exceptions and maintain clarity in error reporting.
- Simplified the construction of the room payload in the AgentHumanAPI class by consolidating the room dictionary into a single line for improved readability.
…nthuman/api.py Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
- Updated the retry loop in the AgentHumanAPI class to include an additional iteration, ensuring that the maximum retry count is correctly applied during session creation attempts. - This change aims to improve the reliability of session establishment by allowing one more retry in case of transient errors.
- Bumped version of livekit-plugins-agenthuman and livekit-agents to 1.5.2 in their respective pyproject.toml files. - Updated provides-extras in uv.lock to include new dependencies. - Ensured consistency across plugin dependencies for improved compatibility.
|
Hello @davidzhao, could you please review the PR? |
|
@longcw @theomonnom Are there anything else you need me to do for the merge? |
…ality and ensure proper session start (livekit#5504)
tinalenguyen
left a comment
There was a problem hiding this comment.
i tested it out and the avatar didn't work as well with interruptions, it likely has to do with how the backend is clearing the buffer or sending playback_finished. i tested the avatar using the livekit playground and the transcript is flushed before all the audio is played out.
could you try to repro this behavior and let me know if you could resolve it? let me know if you have any questions!
| ```bash | ||
| # AgentHuman Config | ||
| export AGENTHUMAN_API_KEY="..." | ||
| export AGENTHUMAN_AVATAR="..." # Avatar ID or publicly accessible image url for the avatar. |
There was a problem hiding this comment.
could we split this into two separate variables, something like:
AGENTHUMAN_AVATAR_ID="..."
AGENTHUMAN_IMAGE_URL="..."
There was a problem hiding this comment.
this also applies to the parameters in AvatarSession
| logger.info( | ||
| "[agenthuman] session.state received: state=%s reason=%s", | ||
| payload.get("state"), | ||
| payload.get("reason", ""), |
There was a problem hiding this comment.
i think we can optionally include reason, for example this log wouldn't need it or a blank space:
[agenthuman] session.state received: state=ready reason=
This PR adds an integration plugin for Agent Human, enabling real-time AI avatars in LiveKit agent sessions.
Overview
Agent Human provides live, lipsynced avatars that convert agent voice output into expressive video. This plugin connects LiveKit agents to Agent Human and publishes the resulting avatar stream back into the room.
Integration Docs: https://docs.agenthuman.com/documentation/livekit/overview
Live demo on our website: https://agenthuman.com (demo running on LiveKit actually)