Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] Update SDK to return BaseResponse version 3.0 and new trace tree format #2251

Conversation

aybruhm
Copy link
Member

@aybruhm aybruhm commented Nov 13, 2024

Description:

This PR updates the SDK to remove the legacy inline trace tree format to the new improved format, and refactors the web code to enhance compatibility with the updated SDK.

Related Issue

Closes AGE-1285

… base response to use new trace tree format
- Update version for backward-compatible response (`string` and `funcResponse`)
- Update base response trace type to be compatible with the trace tree format from the SDK
- Remove condition check for version value in `isBaseResponse`
@aybruhm aybruhm requested review from bekossy and jp-agenta November 13, 2024 13:31
Copy link

vercel bot commented Nov 13, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
agenta ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 19, 2024 2:11pm
agenta-documentation ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 19, 2024 2:11pm

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Nov 13, 2024
@dosubot dosubot bot added enhancement New feature or request SDK labels Nov 13, 2024
… `CreateSpan` model, and update usage attribute in types
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Nov 13, 2024
…3.0 and improve nested value extraction

- Added handling for version 3.0 response structure.
- Introduced a helper function `get_nested_value` to safely retrieve nested values from dictionaries.
- Updated trace latency calculation for version 3.0 with microsecond precision.
- Enhanced handling of missing or unexpected fields in the response.
- Ensured backward compatibility with version 2.0 and generic responses.
Copy link
Contributor

@jp-agenta jp-agenta left a comment

Choose a reason for hiding this comment

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

@aybruhm
Regarding the SDK, you might want to check apis.fastapi.models.py and AgentaNodesResponse/AgentaTreesResponse/AgentaRootsResponse to use in trace in BaseResponse/

Copy link
Contributor

@jp-agenta jp-agenta left a comment

Choose a reason for hiding this comment

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

@aybruhm
Regarding the SDK, you might want to check core.observability.service and ingest and query to make sure that the different processing steps are all there, including connect_children()/calculate_costs()/cumulate_costs()/cumulate_tokens()

Copy link
Contributor

@jp-agenta jp-agenta left a comment

Choose a reason for hiding this comment

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

Left a single comment.
Non-blocking but I'd argue that it's important.

…e-baseresponse-version-3.0

(frontend)[Age-1286]: Update web UI to use BaseResponse version 3.0 in the Playground
@aybruhm aybruhm merged commit df10790 into feature-observability/inline-traces Nov 19, 2024
8 of 10 checks passed
@aybruhm aybruhm deleted the feature/age-1285-inline-traces-update-sdk-to-return-baseresponse-version30 branch November 19, 2024 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request SDK size:XXL This PR changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants