ADK - RAG Tool Not Invoked When Function Calling Tools Are Present
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 38/100
Direzione di ricerca
Inizia in oci/addons/adk/agent.py:567-586 con _sync_function_tools_to_remote(), quindi traccia la sua chiamata a _sync_local_and_remote_tools(). Riproduci le quattro varianti di configurazione descritte nell’issue, in particolare chiamando il metodo con tools=[], e verifica che RAG Tools vengano invocati e che vengano restituite citazioni quando sono presenti Function Calling Tools locali.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
When both Function Calling Tools and RAG Tools are associated with an agent, the RAG Tool is not invoked via ADK, even when explicitly instructed.
However, the same agent configuration works correctly when accessed via the Generative AI Agents Service Web UI console.
Current behavior:
- RAG Tools alone: Work correctly and return citations
- RAG Tools + Function Calling Tools which is defined on local: RAG Tools are not invoked
- Web UI with same configuration(After local tools were sync and regisitered: RAG Tools work correctly even with Function Calling Tools present
Reproduction Steps
- Create a RAG Tool on the Agents Service console
- Create an Agent with both a Function Calling Tool and the RAG Tool:
from oci.addons.adk import Agent, AgentClient, tool
from typing import Dict
@tool
def get_weather(location: str) -> Dict[str, str]:
"""Get the weather for a given location."""
return {"location": location, "temperature": 72, "unit": "F"}
client = AgentClient(
auth_type="security_token",
profile="DEFAULT",
region="us-phoenix-1",
)
agent = Agent(
client=client,
agent_endpoint_id="ocid1.genaiagentendpoint.oc1....",
instructions="You MUST use the RAG tool to search the Knowledge Base for EVERY question.",
tools=[get_weather] # Function Calling Tool present
)
agent.setup()
input = "What is Generative AI Agent Service. Please search it in the knowledge base."
response = agent.run(input)
response.pretty_print()
Cause of this Issue
The _sync_function_tools_to_remote() method in agent.setup() appears to be the cause of this issue.
The following test results demonstrate the issue:
- Without
agent.setup(): RAG tool invoked successfully - With
_sync_agent_to_remote()only: RAG tool invoked successfully - With
_sync_agent_to_remote()+_sync_rag_tools_to_remote()(skipping_sync_function_tools_to_remote()): RAG tool invoked successfully - With
_sync_function_tools_to_remote()called (even withtools=[]): RAG tool NOT invoked - With full
agent.setup(): RAG tool NOT invoked
Even when tools=[] (no local Function Calling Tools), calling _sync_function_tools_to_remote() prevents RAG tool invocation.
This suggests the method execution itself, not tool addition/deletion, is the problem.
The _sync_function_tools_to_remote() method calls _sync_local_and_remote_tools(), which synchronizes Function Calling Tools. Even when no tools are added or deleted, the execution of this method appears to trigger a state change in the Agents Service that affects tool selection logic, causing RAG Tools to be deprioritized or ignored.
Code Reference: oci/addons/adk/agent.py:567-586 - _sync_function_tools_to_remote() method
- Lingua principale
- Python
- Stelle
- 474
- Fork
- 321
- Merge medio
- 23m
- PR unite (30g)
- 4
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di oracle/oci-python-sdk
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
oracle/oci-python-sdk#890 · 3 commenti ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
oracle/oci-python-sdk#879 · 3 commenti ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 66/100
oracle/oci-python-sdk#878 ·
-
SDK
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
oracle/oci-python-sdk#861 · 5 commenti ·
-
SDK
Difficoltà 2/5 1-3 ore Idoneità per principianti 48/100
oracle/oci-python-sdk#852 ·
Tutte le issue di oracle/oci-python-sdk
Issue simili
-
area: harness bug status: needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Human-Agent-Society/reef#625 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 80/100
learningequality/kolibri#15351 · 2 commenti ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Name consistency Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
eellak/triplestore#65 · 1 commento ·