Update app.py
Browse files
app.py
CHANGED
|
@@ -231,7 +231,7 @@ class QuestionAnsweringAgent(CodeAgent):
|
|
| 231 |
CalculatorTool(),
|
| 232 |
ImageRetrievalTool(session=http_session)
|
| 233 |
]
|
| 234 |
-
|
| 235 |
effective_model = model
|
| 236 |
if effective_model is None:
|
| 237 |
openai_api_key = os.environ.get('OPENAI_API_KEY')
|
|
@@ -246,11 +246,12 @@ class QuestionAnsweringAgent(CodeAgent):
|
|
| 246 |
super().__init__(
|
| 247 |
model=effective_model,
|
| 248 |
tools=tools,
|
| 249 |
-
system_prompt=CONFIG.AGENT_SYSTEM_PROMPT,
|
| 250 |
-
additional_authorized_imports=["PIL"],
|
| 251 |
max_steps=CONFIG.AGENT_MAX_STEPS,
|
| 252 |
verbosity_level=CONFIG.AGENT_VERBOSITY_LEVEL
|
| 253 |
)
|
|
|
|
| 254 |
logger.info(f"QuestionAnsweringAgent initialized with model: {CONFIG.OPENAI_MODEL_ID}.")
|
| 255 |
|
| 256 |
async def process_question(self, question_text: str) -> Tuple[str, str]:
|
|
|
|
| 231 |
CalculatorTool(),
|
| 232 |
ImageRetrievalTool(session=http_session)
|
| 233 |
]
|
| 234 |
+
|
| 235 |
effective_model = model
|
| 236 |
if effective_model is None:
|
| 237 |
openai_api_key = os.environ.get('OPENAI_API_KEY')
|
|
|
|
| 246 |
super().__init__(
|
| 247 |
model=effective_model,
|
| 248 |
tools=tools,
|
| 249 |
+
system_prompt=CONFIG.AGENT_SYSTEM_PROMPT, # This is critical
|
| 250 |
+
additional_authorized_imports=["PIL"], # Make sure PIL is in requirements if actually needed by LLM code
|
| 251 |
max_steps=CONFIG.AGENT_MAX_STEPS,
|
| 252 |
verbosity_level=CONFIG.AGENT_VERBOSITY_LEVEL
|
| 253 |
)
|
| 254 |
+
|
| 255 |
logger.info(f"QuestionAnsweringAgent initialized with model: {CONFIG.OPENAI_MODEL_ID}.")
|
| 256 |
|
| 257 |
async def process_question(self, question_text: str) -> Tuple[str, str]:
|