fix(agents-api): Fix prompt render, codec and task execution #478
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.
Signed-off-by: Diwank Tomer [email protected]
Summary:
This PR refactors template rendering, improves exception handling, and updates test configurations in the agents-api module.
Key points:
agents-api/agents_api/common/utils/template.py
: Replacedrender_template_chatml
andrender_template_parts
withrender_template_nested
to handle nested lists/dicts.agents-api/agents_api/dependencies/developer_id.py
: Removed assertion forx_developer_id
in non-multi-tenant mode.agents-api/agents_api/models/agent/delete_agent.py
: Updated exception handling forQueryException
to checke.resp["display"]
.agents-api/agents_api/models/agent/get_agent.py
: Similar exception handling update asdelete_agent.py
.agents-api/agents_api/models/user/get_user.py
: Similar exception handling update asdelete_agent.py
.agents-api/agents_api/worker/codec.py
: Added logging for encoding errors inPydanticEncodingPayloadConverter
.agents-api/agents_api/workflows/task_execution.py
: Improved error handling inrun
function by converting exceptions to strings.agents-api/pyproject.toml
: AddedPYTHONPATH
to test environment variables.agents-api/tests/fixtures.py
: Adjusted test fixtures to respectmulti_tenant_mode
.agents-api/tests/test_execution_workflow.py
: Updated test to check forchoices
inresult
.Generated with ❤️ by ellipsis.dev