Rename builtin::memory -> builtin::rag

This commit is contained in:
Ashwin Bharambe 2025-01-22 20:22:51 -08:00
parent 597869a2aa
commit f3d8864c36
66 changed files with 184 additions and 184 deletions

View file

@ -81,7 +81,7 @@ def make_random_string(length: int = 8):
TOOLS_ATTACHMENT_KEY_REGEX = re.compile(r"__tools_attachment__=(\{.*?\})")
MEMORY_QUERY_TOOL = "query_from_memory"
WEB_SEARCH_TOOL = "web_search"
MEMORY_GROUP = "builtin::memory"
RAG_TOOL_GROUP = "builtin::rag"
class ChatAgent(ShieldRunnerMixin):
@ -391,7 +391,7 @@ class ChatAgent(ShieldRunnerMixin):
session_id, documents, input_messages, tool_defs
)
if MEMORY_GROUP in toolgroups and len(input_messages) > 0:
if RAG_TOOL_GROUP in toolgroups and len(input_messages) > 0:
with tracing.span(MEMORY_QUERY_TOOL) as span:
step_id = str(uuid.uuid4())
yield AgentTurnResponseStreamChunk(
@ -403,7 +403,7 @@ class ChatAgent(ShieldRunnerMixin):
)
)
args = toolgroup_args.get(MEMORY_GROUP, {})
args = toolgroup_args.get(RAG_TOOL_GROUP, {})
vector_db_ids = args.get("vector_db_ids", [])
query_config = args.get("query_config")
if query_config:
@ -509,7 +509,7 @@ class ChatAgent(ShieldRunnerMixin):
tools=[
tool
for tool in tool_defs.values()
if tool_to_group.get(tool.tool_name, None) != MEMORY_GROUP
if tool_to_group.get(tool.tool_name, None) != RAG_TOOL_GROUP
],
tool_prompt_format=self.agent_config.tool_prompt_format,
stream=True,
@ -756,7 +756,7 @@ class ChatAgent(ShieldRunnerMixin):
for tool_def in tools.data:
if (
toolgroup_name.startswith("builtin")
and toolgroup_name != MEMORY_GROUP
and toolgroup_name != RAG_TOOL_GROUP
):
tool_name = tool_def.identifier
built_in_type = BuiltinTool.brave_search

View file

@ -152,7 +152,7 @@ class MockToolGroupsAPI:
toolgroup_id=MEMORY_TOOLGROUP,
tool_host=ToolHost.client,
description="Mock tool",
provider_id="builtin::memory",
provider_id="builtin::rag",
parameters=[],
)
]
@ -260,7 +260,7 @@ async def get_chat_agent(get_agents_impl):
return await impl.get_agent(response.agent_id)
MEMORY_TOOLGROUP = "builtin::memory"
MEMORY_TOOLGROUP = "builtin::rag"
CODE_INTERPRETER_TOOLGROUP = "builtin::code_interpreter"

View file

@ -19,7 +19,7 @@ def available_providers() -> List[ProviderSpec]:
return [
InlineProviderSpec(
api=Api.tool_runtime,
provider_type="inline::memory-runtime",
provider_type="inline::rag-runtime",
pip_packages=[],
module="llama_stack.providers.inline.tool_runtime.memory",
config_class="llama_stack.providers.inline.tool_runtime.memory.config.MemoryToolRuntimeConfig",

View file

@ -184,7 +184,7 @@ class TestAgents:
agent_config = AgentConfig(
**{
**common_params,
"toolgroups": ["builtin::memory"],
"toolgroups": ["builtin::rag"],
"tool_choice": ToolChoice.auto,
}
)

View file

@ -22,8 +22,8 @@ def tool_runtime_memory_and_search() -> ProviderFixture:
return ProviderFixture(
providers=[
Provider(
provider_id="memory-runtime",
provider_type="inline::memory-runtime",
provider_id="rag-runtime",
provider_type="inline::rag-runtime",
config={},
),
Provider(
@ -47,8 +47,8 @@ def tool_runtime_memory_and_search() -> ProviderFixture:
@pytest.fixture(scope="session")
def tool_group_input_memory() -> ToolGroupInput:
return ToolGroupInput(
toolgroup_id="builtin::memory",
provider_id="memory-runtime",
toolgroup_id="builtin::rag",
provider_id="rag-runtime",
)