Skip to content

Commit 94f9728

Browse files
committed
use the sessions's tools settings
1 parent 1231d5c commit 94f9728

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

llm-service/app/services/chat/streaming_chat.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ def build_streamer(
194194
query_configuration,
195195
chat_messages,
196196
crew_events_queue=crew_events_queue,
197+
session=session
197198
)
198199
return condensed_question, data_source_id, streaming_chat_response
199200

llm-service/app/services/query/agents/crewai_querier.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def assemble_crew(
134134
)
135135
research_tools.append(crewai_retriever_tool)
136136

137-
# Create a search tool if needed
137+
# Create a search tool if needed # TODO: fix this because we don't use configuration.tools any more!
138138
search_tool = None
139139
if configuration.tools and "search" in configuration.tools:
140140
search_tool = SerperDevTool()

llm-service/app/services/query/querier.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
poison_pill,
4949
)
5050
from .crew_events import CrewEvent
51+
from ..metadata_apis.session_metadata_api import Session
5152

5253
if TYPE_CHECKING:
5354
from ..chat.utils import RagContext
@@ -118,13 +119,14 @@ def streaming_query(
118119
configuration: QueryConfiguration,
119120
chat_messages: list[ChatMessage],
120121
crew_events_queue: Queue[CrewEvent],
122+
session: Session
121123
) -> StreamingAgentChatResponse:
122124
mcp_tools: list[BaseTool] = []
123125
all_adapters: list[MCPServerAdapter] = []
124126

125127
# Add adapters for each tool specified in the configuration
126-
if configuration.tools:
127-
for tool_name in configuration.tools:
128+
if session.query_configuration and session.query_configuration.selected_tools:
129+
for tool_name in session.query_configuration.selected_tools:
128130
try:
129131
adapter = get_mcp_server_adapter(tool_name)
130132
print(f"Adding adapter for tool: {adapter}")

0 commit comments

Comments
 (0)