wishwakankanamg commited on
Commit
db970aa
·
1 Parent(s): 5f42028
Files changed (4) hide show
  1. __pycache__/graph.cpython-310.pyc +0 -0
  2. app.log +0 -0
  3. graph.py +42 -13
  4. logging-config.json +3 -3
__pycache__/graph.cpython-310.pyc CHANGED
Binary files a/__pycache__/graph.cpython-310.pyc and b/__pycache__/graph.cpython-310.pyc differ
 
app.log CHANGED
The diff for this file is too large to render. See raw diff
 
graph.py CHANGED
@@ -212,27 +212,31 @@ async def assistant_node(state: GraphProcessingState, config=None):
212
  async def guidance_node(state: GraphProcessingState, config=None):
213
  # Use logger.debug() for verbose debugging information
214
  # This allows you to control its visibility via logging configuration
215
- logger.debug("--- Guidance Node ---")
216
 
217
  # Log the entire state as a dictionary (Pydantic's .model_dump())
218
  # This is very comprehensive. For large states, consider logging parts.
219
  # logger.debug(f"Full State: {state.model_dump(mode='json')}") # mode='json' makes it JSON-serializable
220
  # Or for a more Pythonic dict:
221
- logger.debug(f"Full State Dict: {state.model_dump()}")
222
 
223
 
224
- logger.debug(f"Prompt: {state.prompt}")
225
- logger.debug(f"Tools Enabled: {state.tools_enabled}")
226
- logger.debug(f"Search Enabled: {state.search_enabled}")
227
- logger.debug(f"Next Stage: {state.next_stage}")
 
 
 
228
 
229
  # Log boolean completion flags
230
- logger.debug(f"Idea Complete: {state.idea_complete}")
231
- logger.debug(f"Brainstorming Complete: {state.brainstorming_complete}")
232
- logger.debug(f"Planning Complete: {state.planning_complete}")
233
- logger.debug(f"Drawing Complete: {state.drawing_complete}")
234
- logger.debug(f"Product Searching Complete: {state.product_searching_complete}")
235
- logger.debug(f"Purchasing Complete: {state.purchasing_complete}")
 
236
 
237
  # Prepare context: stage completion statuses
238
  stage_order = ["brainstorming", "planning", "drawing", "product_searching", "purchasing"]
@@ -297,7 +301,32 @@ def assistant_routing(state: GraphProcessingState) -> str:
297
  return "assistant_node"
298
 
299
  def guidance_routing(state: GraphProcessingState) -> str:
300
- print('guidance router invoked')
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
301
  next_stage = state.next_stage
302
  if next_stage == "brainstorming":
303
  return "assistant_node"
 
212
  async def guidance_node(state: GraphProcessingState, config=None):
213
  # Use logger.debug() for verbose debugging information
214
  # This allows you to control its visibility via logging configuration
215
+ print("\n--- Guidance Node (Debug via print) ---") # Added a newline for clarity
216
 
217
  # Log the entire state as a dictionary (Pydantic's .model_dump())
218
  # This is very comprehensive. For large states, consider logging parts.
219
  # logger.debug(f"Full State: {state.model_dump(mode='json')}") # mode='json' makes it JSON-serializable
220
  # Or for a more Pythonic dict:
221
+ # print(f"Full State Dict: {state.model_dump()}")
222
 
223
 
224
+ print(f"Prompt: {state.prompt}")
225
+ print(f"Message: {state.messages}")
226
+
227
+ print(f"Tools Enabled: {state.tools_enabled}")
228
+ print(f"Search Enabled: {state.search_enabled}")
229
+ print(f"Next Stage: {state.next_stage}")
230
+
231
 
232
  # Log boolean completion flags
233
+ print(f"Idea Complete: {state.idea_complete}")
234
+ print(f"Brainstorming Complete: {state.brainstorming_complete}")
235
+ print(f"Planning Complete: {state.planning_complete}")
236
+ print(f"Drawing Complete: {state.drawing_complete}")
237
+ print(f"Product Searching Complete: {state.product_searching_complete}")
238
+ print(f"Purchasing Complete: {state.purchasing_complete}")
239
+ print("--- End Guidance Node Debug ---") # Added for clarity
240
 
241
  # Prepare context: stage completion statuses
242
  stage_order = ["brainstorming", "planning", "drawing", "product_searching", "purchasing"]
 
301
  return "assistant_node"
302
 
303
  def guidance_routing(state: GraphProcessingState) -> str:
304
+ # Use logger.debug() for verbose debugging information
305
+ # This allows you to control its visibility via logging configuration
306
+ print("\n--- Guidance Node (Debug via print) ---") # Added a newline for clarity
307
+
308
+ # Log the entire state as a dictionary (Pydantic's .model_dump())
309
+ # This is very comprehensive. For large states, consider logging parts.
310
+ # logger.debug(f"Full State: {state.model_dump(mode='json')}") # mode='json' makes it JSON-serializable
311
+ # Or for a more Pythonic dict:
312
+ # print(f"Full State Dict: {state.model_dump()}")
313
+
314
+
315
+ print(f"Prompt: {state.prompt}")
316
+ print(f"Message: {state.messages}")
317
+ print(f"Tools Enabled: {state.tools_enabled}")
318
+ print(f"Search Enabled: {state.search_enabled}")
319
+ print(f"Next Stage: {state.next_stage}")
320
+
321
+
322
+ # Log boolean completion flags
323
+ print(f"Idea Complete: {state.idea_complete}")
324
+ print(f"Brainstorming Complete: {state.brainstorming_complete}")
325
+ print(f"Planning Complete: {state.planning_complete}")
326
+ print(f"Drawing Complete: {state.drawing_complete}")
327
+ print(f"Product Searching Complete: {state.product_searching_complete}")
328
+ print(f"Purchasing Complete: {state.purchasing_complete}")
329
+ print("--- End Guidance Node Debug ---") # Added for clarity
330
  next_stage = state.next_stage
331
  if next_stage == "brainstorming":
332
  return "assistant_node"
logging-config.json CHANGED
@@ -10,13 +10,13 @@
10
  "handlers": {
11
  "console": {
12
  "class": "logging.StreamHandler",
13
- "level": "DEBUG",
14
  "formatter": "verbose"
15
  },
16
  "file": {
17
  "class": "logging.FileHandler",
18
  "filename": "app.log",
19
- "level": "DEBUG",
20
  "formatter": "verbose",
21
  "encoding": "utf-8"
22
  }
@@ -29,7 +29,7 @@
29
  }
30
  },
31
  "root": {
32
- "level": "DEBUG",
33
  "handlers": ["console", "file"]
34
  }
35
  }
 
10
  "handlers": {
11
  "console": {
12
  "class": "logging.StreamHandler",
13
+ "level": "INFO",
14
  "formatter": "verbose"
15
  },
16
  "file": {
17
  "class": "logging.FileHandler",
18
  "filename": "app.log",
19
+ "level": "INFO",
20
  "formatter": "verbose",
21
  "encoding": "utf-8"
22
  }
 
29
  }
30
  },
31
  "root": {
32
+ "level": "INFO",
33
  "handlers": ["console", "file"]
34
  }
35
  }