feat: galileo adk to natively support custom retriever tools#482
feat: galileo adk to natively support custom retriever tools#482
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #482 +/- ##
==========================================
+ Coverage 81.85% 82.55% +0.70%
==========================================
Files 96 106 +10
Lines 9164 10269 +1105
==========================================
+ Hits 7501 8478 +977
- Misses 1663 1791 +128
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
8ec9edd to
50a5891
Compare
3937b2b to
1693801
Compare
| documents = convert_to_documents(output, "output") | ||
| redacted_documents = convert_to_documents(redacted_output, "redacted_output") | ||
| return super().add_retriever_span( | ||
| id=uuid.uuid4(), | ||
| input=input, |
There was a problem hiding this comment.
TraceBuilder.add_retriever_span repeats the same convert_to_documents + kwargs construction that already lives in GalileoLogger.add_retriever_span (src/galileo/logger/logger.py:1167‑1185), so we now maintain two copies of the retriever-span argument prep. Can we add a helper such as def build_retriever_span_kwargs(input, output, redacted_input=None, redacted_output=None, name=None, duration_ns=None, created_at=None, metadata=None, tags=None, status_code=None, step_number=None) -> dict[str, Any] (maybe in galileo.utils.retrievers), have both callers use it to get documents/redacted_documents + the common dict, and then pass the shared kwargs to their respective super().add_retriever_span + post-processing?
Finding type: Code Dedup and Conventions
- Apply fix with Baz
User description
Shortcut:
https://app.shortcut.com/galileo/story/55769/galileo-adk-to-support-retriever-tools
Tests:
Generated description
Below is a concise technical summary of the changes proposed in this PR:
Introduces native support for custom retriever tools by providing a
@galileo_retrieverdecorator and enhanced detection logic within theGalileoObserver. These changes allow the ADK to distinguish between standard tools and retrievers, enabling RAG-specific quality metrics and improved trace visualization.SpanManagerandTraceBuilderto handle 'retriever' node types and correctly format document outputs for RAG metrics.Modified files (5)
Latest Contributors(2)
@galileo_retrieverdecorator and updateGalileoObserverto detect custom and built-in ADK retrieval tools.Modified files (5)
Latest Contributors(2)