mgbam commited on
Commit
d68e573
·
verified ·
1 Parent(s): 41863b5

Update agent.py

Browse files
Files changed (1) hide show
  1. agent.py +14 -7
agent.py CHANGED
@@ -2,20 +2,27 @@
2
  import os
3
  from langchain_google_genai import ChatGoogleGenerativeAI
4
  from langchain.agents import AgentExecutor, create_structured_chat_agent
5
- # from langchain_google_genai import HarmBlockThreshold, HarmCategory # Optional for safety
6
-
7
  from langchain_core.prompts import ChatPromptTemplate, MessagesPlaceholder
8
  from langchain_core.messages import AIMessage, HumanMessage, SystemMessage
9
 
10
- # --- Import your defined tools ---
11
- from tools.bioportal_tool import BioPortalLookupTool, BioPortalInput
12
- from tools.gemini_tool import GeminiTool, GeminiInput # For using Gemini as a specific sub-task tool
13
- from tools.umls_tool import UMLSLookupTool, UMLSInput
14
- from tools.quantum_treatment_optimizer_tool import QuantumTreatmentOptimizerTool, QuantumOptimizerInput # Assuming this path and model name
 
 
 
 
 
 
 
15
 
16
  from config.settings import settings
17
  from services.logger import app_logger
18
 
 
 
19
  # --- Initialize LLM (Gemini) ---
20
  try:
21
  # Ensure GOOGLE_API_KEY is set in your environment (HuggingFace Secrets)
 
2
  import os
3
  from langchain_google_genai import ChatGoogleGenerativeAI
4
  from langchain.agents import AgentExecutor, create_structured_chat_agent
 
 
5
  from langchain_core.prompts import ChatPromptTemplate, MessagesPlaceholder
6
  from langchain_core.messages import AIMessage, HumanMessage, SystemMessage
7
 
8
+ # --- Import your defined tools FROM THE 'tools' PACKAGE ---
9
+ from tools import ( # This now relies on tools/__init__.py
10
+ BioPortalLookupTool,
11
+ # GeminiTool, # Uncomment if you decide to use it
12
+ UMLSLookupTool,
13
+ QuantumTreatmentOptimizerTool,
14
+ # You might not need to import the Input schemas here if the tools use them internally
15
+ # and the agent only needs the tool instances.
16
+ # BioPortalInput, GeminiInput, UMLSInput, QuantumOptimizerInput
17
+ )
18
+ # If QuantumOptimizerInput is needed for type hinting or direct use in agent.py:
19
+ from tools import QuantumOptimizerInput # Or from tools.quantum_treatment_optimizer_tool import QuantumOptimizerInput
20
 
21
  from config.settings import settings
22
  from services.logger import app_logger
23
 
24
+ # ... (rest of your agent.py file) ...
25
+
26
  # --- Initialize LLM (Gemini) ---
27
  try:
28
  # Ensure GOOGLE_API_KEY is set in your environment (HuggingFace Secrets)