[memory refactor][3/n] Introduce RAGToolRuntime as a specialized sub-protocol#832
Merged
[memory refactor][3/n] Introduce RAGToolRuntime as a specialized sub-protocol#832
Conversation
ashwinb
commented
Jan 21, 2025
llama_stack/apis/tools/rag_tool.py
Outdated
Contributor
Author
There was a problem hiding this comment.
this has been move from provider configuration to call-time parameter which is the correct abstraction level
ashwinb
commented
Jan 21, 2025
llama_stack/apis/tools/tools.py
Outdated
Contributor
Author
There was a problem hiding this comment.
will update this in all other tool runtimes
dineshyv
reviewed
Jan 21, 2025
Contributor
There was a problem hiding this comment.
we do not have the toolgroup namespacing for tool names like "rag_tool.query_context". are we adding toolgroup namespacing here? if so, should we add the same for other toolgroups?
Contributor
Author
There was a problem hiding this comment.
yeah that's a fair point. I will update this / revert it.
dineshyv
reviewed
Jan 22, 2025
llama_stack/providers/inline/agents/meta_reference/agent_instance.py
Outdated
Show resolved
Hide resolved
raghotham
approved these changes
Jan 22, 2025
2bf253c to
9282794
Compare
45fb353 to
5297aef
Compare
ashwinb
added a commit
to llamastack/llama-stack-client-python
that referenced
this pull request
Jan 22, 2025
See See llamastack/llama-stack#827 for the broader design. See llamastack/llama-stack#832 for the main corresponding Llama Stack PR. ## Test Plan (running client-sdk tests)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
See #827 for the broader design.
Third part:
tool_runtime.rag_tool.query_context()andtool_runtime.rag_tool.insert_documents()methods work smoothly with complete type safety. To that end, we introduce a sub-resource pathtool-runtime/rag-tool/and make changes to the resolver to make things work.Note that we must make sure the client SDKs are able to handle this subresource complexity also. Stainless has support for subresources, so this should be possible but beware.
Test Plan
Our RAG test is sad (doesn't actually test for actual RAG output) but I verified that the implementation works. I will work on fixing the RAG test afterwards.
pytest -s -v tests/agents/test_agents.py -k "rag and together" --safety-shield=meta-llama/Llama-Guard-3-8B