apple muncy commited on
Commit
b4d5a38
Β·
1 Parent(s): abedc83

add more logging to app.py

Browse files

Signed-off-by: apple muncy <[email protected]>

Files changed (1) hide show
  1. app.py +4 -1
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: