Spaces:
Sleeping
Sleeping
apple muncy
commited on
Commit
Β·
b4d5a38
1
Parent(s):
abedc83
add more logging to app.py
Browse filesSigned-off-by: apple muncy <[email protected]>
app.py
CHANGED
@@ -91,13 +91,14 @@ app.add_middleware(CORSMiddleware, allow_origins=["*"])
|
|
91 |
async def get_agent():
|
92 |
"""Get or create Agent instance"""
|
93 |
print("π€ get_agent() called...")
|
|
|
94 |
global agent_instance
|
95 |
if agent_instance is None and HF_TOKEN:
|
96 |
print("π§ Creating new Agent instance...")
|
97 |
print(f"π HF_TOKEN present: {bool(HF_TOKEN)}")
|
98 |
print(f"π€ Model: {HF_MODEL}")
|
99 |
print(f"π Provider: {DEFAULT_PROVIDER}")
|
100 |
-
|
101 |
try:
|
102 |
agent_instance = Agent(
|
103 |
model=HF_MODEL,
|
@@ -116,7 +117,9 @@ async def get_agent():
|
|
116 |
],
|
117 |
)
|
118 |
print("β
Agent instance created successfully")
|
|
|
119 |
print("π§ Loading tools...")
|
|
|
120 |
await agent_instance.load_tools()
|
121 |
print("β
Tools loaded successfully")
|
122 |
except Exception as e:
|
|
|
91 |
async def get_agent():
|
92 |
"""Get or create Agent instance"""
|
93 |
print("π€ get_agent() called...")
|
94 |
+
logger.info('get_agent() called...')
|
95 |
global agent_instance
|
96 |
if agent_instance is None and HF_TOKEN:
|
97 |
print("π§ Creating new Agent instance...")
|
98 |
print(f"π HF_TOKEN present: {bool(HF_TOKEN)}")
|
99 |
print(f"π€ Model: {HF_MODEL}")
|
100 |
print(f"π Provider: {DEFAULT_PROVIDER}")
|
101 |
+
logger.info('Creating new Agent instance...')
|
102 |
try:
|
103 |
agent_instance = Agent(
|
104 |
model=HF_MODEL,
|
|
|
117 |
],
|
118 |
)
|
119 |
print("β
Agent instance created successfully")
|
120 |
+
logger.info('Creating new Agent instance...')
|
121 |
print("π§ Loading tools...")
|
122 |
+
logger.info('Loading tools...')
|
123 |
await agent_instance.load_tools()
|
124 |
print("β
Tools loaded successfully")
|
125 |
except Exception as e:
|