ADK - RAG Tool Not Invoked When Function Calling Tools Are Present
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 38/100
Línea de trabajo
Comienza en oci/addons/adk/agent.py:567-586 con _sync_function_tools_to_remote() y luego sigue su llamada a _sync_local_and_remote_tools(). Reproduce las cuatro variantes de configuración descritas en el issue, especialmente al llamar al método con tools=[], y verifica que se invoquen RAG Tools y se devuelvan citas cuando haya Function Calling Tools locales.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- Python
- Estrellas
- 473
- Forks
- 322
- Merge medio
- 30 min
- PR fusionados (30 d)
- 4
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de oracle/oci-python-sdk
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
oracle/oci-python-sdk#890 · 3 comentarios ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
oracle/oci-python-sdk#879 · 3 comentarios ·
-
Example uses non-existent APIPosiblemente ocupada @reginaldalfret la tomó hace 4 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 66/100
oracle/oci-python-sdk#878 ·
-
SDK
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
oracle/oci-python-sdk#861 · 5 comentarios ·
-
SDK
Dificultad 2/5 1-3 horas Aptitud para principiantes 48/100
oracle/oci-python-sdk#852 ·
Todos los issues de oracle/oci-python-sdk
Issues similares
-
Performance: deprecated DeviceEntry.config_entries access blocks the event loop for tens of secondsAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
tuya/tuya_cloud_ha_bridge#14 ·
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
semantica-agi/semantica#1968 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
agent: ready area: submission priority: high type: docs
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
dkritarth/scopewatch#213 ·
Los mantenedores suelen responder en 1 día
-
Broken link in RELEASE.mdPosiblemente ocupada @Jah-yee la tomó hoy. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
sphinx-contrib/httpdomain#143 ·
Los mantenedores suelen responder en 1 día