subashpoudel commited on
Commit
9f72bcf
·
1 Parent(s): d98138c

next commit

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. __pycache__/logger_config.cpython-311.pyc +0 -0
  2. api/__pycache__/__init__.cpython-311.pyc +0 -0
  3. api/__pycache__/backup_prompts.cpython-311.pyc +0 -0
  4. api/__pycache__/main.cpython-311.pyc +0 -0
  5. api/__pycache__/stored_data.cpython-311.pyc +0 -0
  6. api/routers/__pycache__/__init__.cpython-311.pyc +0 -0
  7. api/routers/__pycache__/brainstorm.cpython-311.pyc +0 -0
  8. api/routers/__pycache__/context_analysis.cpython-311.pyc +0 -0
  9. api/routers/__pycache__/generate_final_story.cpython-311.pyc +0 -0
  10. api/routers/__pycache__/generate_image.cpython-311.pyc +0 -0
  11. api/routers/__pycache__/human_idea_refining.cpython-311.pyc +0 -0
  12. api/routers/__pycache__/ideation.cpython-311.pyc +0 -0
  13. api/routers/__pycache__/orchestration.cpython-311.pyc +0 -0
  14. api/routers/__pycache__/show_analytics.cpython-311.pyc +0 -0
  15. api/routers/context_analysis.py +2 -1
  16. api/routers/ideation.py +4 -4
  17. api/schemas/__pycache__/__init__.cpython-311.pyc +0 -0
  18. api/schemas/__pycache__/brainstorming.cpython-311.pyc +0 -0
  19. api/schemas/__pycache__/context_analysis.cpython-311.pyc +0 -0
  20. api/schemas/__pycache__/human_idea_refining.cpython-311.pyc +0 -0
  21. api/schemas/__pycache__/orchestration.cpython-311.pyc +0 -0
  22. check.py +13 -0
  23. logs/access.log +101 -0
  24. logs/app.log +33 -0
  25. logs/errors.log +1 -0
  26. requirements.txt +1 -1
  27. src/genai/__pycache__/__init__.cpython-311.pyc +0 -0
  28. src/genai/brainstroming_agent/__pycache__/__init__.cpython-311.pyc +0 -0
  29. src/genai/brainstroming_agent/__pycache__/agent.cpython-311.pyc +0 -0
  30. src/genai/brainstroming_agent/utils/__pycache__/__init__.cpython-311.pyc +0 -0
  31. src/genai/brainstroming_agent/utils/__pycache__/nodes.cpython-311.pyc +0 -0
  32. src/genai/brainstroming_agent/utils/__pycache__/nodes.cpython-312.pyc +0 -0
  33. src/genai/brainstroming_agent/utils/__pycache__/prompts.cpython-311.pyc +0 -0
  34. src/genai/brainstroming_agent/utils/__pycache__/state.cpython-311.pyc +0 -0
  35. src/genai/brainstroming_agent/utils/__pycache__/tools.cpython-311.pyc +0 -0
  36. src/genai/brainstroming_agent/utils/__pycache__/tools.cpython-312.pyc +0 -0
  37. src/genai/brainstroming_agent/utils/__pycache__/utils.cpython-311.pyc +0 -0
  38. src/genai/context_analysis_agent/__pycache__/__init__.cpython-311.pyc +0 -0
  39. src/genai/context_analysis_agent/__pycache__/agent.cpython-311.pyc +0 -0
  40. src/genai/context_analysis_agent/agent.py +7 -2
  41. src/genai/context_analysis_agent/utils/__pycache__/__init__.cpython-311.pyc +0 -0
  42. src/genai/context_analysis_agent/utils/__pycache__/nodes.cpython-311.pyc +0 -0
  43. src/genai/context_analysis_agent/utils/__pycache__/prompts.cpython-311.pyc +0 -0
  44. src/genai/context_analysis_agent/utils/__pycache__/prompts.cpython-312.pyc +0 -0
  45. src/genai/context_analysis_agent/utils/__pycache__/state.cpython-311.pyc +0 -0
  46. src/genai/context_analysis_agent/utils/__pycache__/state.cpython-312.pyc +0 -0
  47. src/genai/context_analysis_agent/utils/__pycache__/utils.cpython-311.pyc +0 -0
  48. src/genai/context_analysis_agent/utils/nodes.py +8 -2
  49. src/genai/context_analysis_agent/utils/prompts.py +22 -15
  50. src/genai/context_analysis_agent/utils/state.py +13 -3
__pycache__/logger_config.cpython-311.pyc ADDED
Binary file (3.67 kB). View file
 
api/__pycache__/__init__.cpython-311.pyc ADDED
Binary file (182 Bytes). View file
 
api/__pycache__/backup_prompts.cpython-311.pyc ADDED
Binary file (463 Bytes). View file
 
api/__pycache__/main.cpython-311.pyc ADDED
Binary file (2.63 kB). View file
 
api/__pycache__/stored_data.cpython-311.pyc ADDED
Binary file (900 Bytes). View file
 
api/routers/__pycache__/__init__.cpython-311.pyc ADDED
Binary file (190 Bytes). View file
 
api/routers/__pycache__/brainstorm.cpython-311.pyc ADDED
Binary file (3.06 kB). View file
 
api/routers/__pycache__/context_analysis.cpython-311.pyc ADDED
Binary file (4.05 kB). View file
 
api/routers/__pycache__/generate_final_story.cpython-311.pyc ADDED
Binary file (1.93 kB). View file
 
api/routers/__pycache__/generate_image.cpython-311.pyc ADDED
Binary file (1.83 kB). View file
 
api/routers/__pycache__/human_idea_refining.cpython-311.pyc ADDED
Binary file (2.36 kB). View file
 
api/routers/__pycache__/ideation.cpython-311.pyc ADDED
Binary file (2.28 kB). View file
 
api/routers/__pycache__/orchestration.cpython-311.pyc ADDED
Binary file (2.07 kB). View file
 
api/routers/__pycache__/show_analytics.cpython-311.pyc ADDED
Binary file (1.43 kB). View file
 
api/routers/context_analysis.py CHANGED
@@ -27,8 +27,9 @@ def context_analysis(msg: UserMessage):
27
  app_logger.info('Executed context analysis agent')
28
 
29
  last_response = context_analysis_graph.messages[-1]["content"]
 
30
 
31
- if context_analysis_graph.is_complete(last_response):
32
  app_logger.info('Context analysis completed.')
33
  try:
34
  details = context_analysis_graph.extract_details()
 
27
  app_logger.info('Executed context analysis agent')
28
 
29
  last_response = context_analysis_graph.messages[-1]["content"]
30
+ print('Last-Response:', last_response)
31
 
32
+ if context_analysis_graph.is_complete(last_response) == 'complete':
33
  app_logger.info('Context analysis completed.')
34
  try:
35
  details = context_analysis_graph.extract_details()
api/routers/ideation.py CHANGED
@@ -14,7 +14,7 @@ idea_graph = agent.ideation_graph()
14
 
15
  @router.post("/ideation")
16
  def ideation_endpoint():
17
- config={"recursion_limit":15, "configurable": {"thread_id": "ideation_thread123"}}
18
  try:
19
  result = idea_graph.invoke(
20
  {
@@ -23,11 +23,11 @@ def ideation_endpoint():
23
  },
24
  config=config)
25
 
26
- stored_data['final_ideation'] = result['formatted_response'][-1]
27
- stored_data['final_ideation']=ast.literal_eval(stored_data['final_ideation'])
28
  app_logger.info('Executed the ideation pipeline.')
29
 
30
- return {'response':ast.literal_eval(result['formatted_response'][-1])}
31
 
32
  except GraphRecursionError:
33
  error_logger.error('Ideation loop ran more than specified.')
 
14
 
15
  @router.post("/ideation")
16
  def ideation_endpoint():
17
+ config={"recursion_limit":25, "configurable": {"thread_id": "ideation_thread123"}}
18
  try:
19
  result = idea_graph.invoke(
20
  {
 
23
  },
24
  config=config)
25
 
26
+ stored_data['final_ideation'] = result['top_4_ideas'][-1]
27
+ # stored_data['final_ideation']=ast.literal_eval(stored_data['final_ideation'])
28
  app_logger.info('Executed the ideation pipeline.')
29
 
30
+ return {'response':result['top_4_ideas'][-1]}
31
 
32
  except GraphRecursionError:
33
  error_logger.error('Ideation loop ran more than specified.')
api/schemas/__pycache__/__init__.cpython-311.pyc ADDED
Binary file (190 Bytes). View file
 
api/schemas/__pycache__/brainstorming.cpython-311.pyc ADDED
Binary file (804 Bytes). View file
 
api/schemas/__pycache__/context_analysis.cpython-311.pyc ADDED
Binary file (539 Bytes). View file
 
api/schemas/__pycache__/human_idea_refining.cpython-311.pyc ADDED
Binary file (695 Bytes). View file
 
api/schemas/__pycache__/orchestration.cpython-311.pyc ADDED
Binary file (678 Bytes). View file
 
check.py ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from src.genai.utils.models_loader import llm_gpt
2
+ from src.genai.ideation_agent.utils.prompts import ideator_prompt_v3
3
+ from src.genai.ideation_agent.utils.schemas import ideation_json_schema
4
+ from api.stored_data import stored_data
5
+ from langchain_core.messages import HumanMessage , SystemMessage
6
+
7
+ template =ideator_prompt_v3(stored_data['business_details'])
8
+ messages = [SystemMessage(content=template),
9
+ HumanMessage(content=f'''The business_details is\n{stored_data['business_details']}\n
10
+ The information of the image is:\n''')]
11
+
12
+ response = llm_gpt.with_structured_output(ideation_json_schema).invoke(messages)
13
+ print(response)
logs/access.log CHANGED
@@ -381,3 +381,104 @@
381
  2025-08-17 15:22:52,619 | INFO | access_logger | api\main.py:21 | Response status: 200
382
  2025-08-17 15:23:25,844 | INFO | access_logger | api\main.py:19 | Request: POST http://127.0.0.1:8000/api/ideation
383
  2025-08-17 15:24:08,120 | INFO | access_logger | api\main.py:21 | Response status: 200
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
381
  2025-08-17 15:22:52,619 | INFO | access_logger | api\main.py:21 | Response status: 200
382
  2025-08-17 15:23:25,844 | INFO | access_logger | api\main.py:19 | Request: POST http://127.0.0.1:8000/api/ideation
383
  2025-08-17 15:24:08,120 | INFO | access_logger | api\main.py:21 | Response status: 200
384
+ 2025-08-19 16:02:02,820 | INFO | access_logger | api\main.py:19 | Request: GET http://127.0.0.1:8000/docs
385
+ 2025-08-19 16:02:02,847 | INFO | access_logger | api\main.py:21 | Response status: 200
386
+ 2025-08-19 16:02:03,185 | INFO | access_logger | api\main.py:19 | Request: GET http://127.0.0.1:8000/openapi.json
387
+ 2025-08-19 16:02:03,669 | INFO | access_logger | api\main.py:21 | Response status: 200
388
+ 2025-08-19 16:02:14,935 | INFO | access_logger | api\main.py:19 | Request: POST http://127.0.0.1:8000/api/ideation
389
+ 2025-08-19 16:12:43,018 | INFO | access_logger | api\main.py:19 | Request: POST http://127.0.0.1:8000/api/ideation
390
+ 2025-08-19 16:30:36,700 | INFO | access_logger | api\main.py:19 | Request: POST http://127.0.0.1:8000/api/ideation
391
+ 2025-08-19 16:39:11,277 | INFO | access_logger | api\main.py:19 | Request: POST http://127.0.0.1:8000/api/ideation
392
+ 2025-08-19 17:15:35,457 | INFO | access_logger | api\main.py:19 | Request: POST http://127.0.0.1:8000/api/ideation
393
+ 2025-08-20 12:26:51,641 | INFO | access_logger | api\main.py:19 | Request: GET http://127.0.0.1:8000/docs
394
+ 2025-08-20 12:26:51,650 | INFO | access_logger | api\main.py:21 | Response status: 200
395
+ 2025-08-20 12:26:52,199 | INFO | access_logger | api\main.py:19 | Request: GET http://127.0.0.1:8000/openapi.json
396
+ 2025-08-20 12:26:52,324 | INFO | access_logger | api\main.py:21 | Response status: 200
397
+ 2025-08-20 12:26:58,811 | INFO | access_logger | api\main.py:19 | Request: POST http://127.0.0.1:8000/api/ideation
398
+ 2025-08-20 12:49:37,673 | INFO | access_logger | api\main.py:19 | Request: POST http://127.0.0.1:8000/api/ideation
399
+ 2025-08-20 14:02:48,043 | INFO | access_logger | api\main.py:19 | Request: GET http://127.0.0.1:8000/openapi.json
400
+ 2025-08-20 14:02:48,353 | INFO | access_logger | api\main.py:21 | Response status: 200
401
+ 2025-08-20 14:04:00,398 | INFO | access_logger | api\main.py:19 | Request: POST http://127.0.0.1:8000/api/ideation
402
+ 2025-08-20 14:18:25,067 | INFO | access_logger | api\main.py:19 | Request: POST http://127.0.0.1:8000/api/ideation
403
+ 2025-08-20 14:19:26,780 | INFO | access_logger | api\main.py:21 | Response status: 200
404
+ 2025-08-20 14:22:59,676 | INFO | access_logger | api\main.py:19 | Request: GET http://127.0.0.1:8000/docs
405
+ 2025-08-20 14:22:59,678 | INFO | access_logger | api\main.py:21 | Response status: 200
406
+ 2025-08-20 14:23:02,148 | INFO | access_logger | api\main.py:19 | Request: GET http://127.0.0.1:8000/openapi.json
407
+ 2025-08-20 14:23:02,477 | INFO | access_logger | api\main.py:21 | Response status: 200
408
+ 2025-08-20 14:34:06,588 | INFO | access_logger | api\main.py:19 | Request: POST http://127.0.0.1:8000/api/ideation
409
+ 2025-08-20 14:41:22,386 | INFO | access_logger | api\main.py:19 | Request: POST http://127.0.0.1:8000/api/ideation
410
+ 2025-08-20 14:42:13,807 | INFO | access_logger | api\main.py:21 | Response status: 200
411
+ 2025-08-20 15:48:39,672 | INFO | access_logger | api\main.py:19 | Request: GET http://127.0.0.1:8000/openapi.json
412
+ 2025-08-20 15:48:40,001 | INFO | access_logger | api\main.py:21 | Response status: 200
413
+ 2025-08-20 15:48:46,301 | INFO | access_logger | api\main.py:19 | Request: POST http://127.0.0.1:8000/api/ideation
414
+ 2025-08-20 15:49:43,697 | INFO | access_logger | api\main.py:21 | Response status: 200
415
+ 2025-08-22 15:13:40,245 | INFO | access_logger | api\main.py:19 | Request: GET http://127.0.0.1:8000/docs
416
+ 2025-08-22 15:13:40,339 | INFO | access_logger | api\main.py:21 | Response status: 200
417
+ 2025-08-22 15:13:41,295 | INFO | access_logger | api\main.py:19 | Request: GET http://127.0.0.1:8000/openapi.json
418
+ 2025-08-22 15:13:42,007 | INFO | access_logger | api\main.py:21 | Response status: 200
419
+ 2025-08-22 15:14:26,827 | INFO | access_logger | api\main.py:19 | Request: POST http://127.0.0.1:8000/api/context-analysis
420
+ 2025-08-22 15:14:26,928 | INFO | access_logger | api\main.py:21 | Response status: 200
421
+ 2025-08-22 15:14:46,025 | INFO | access_logger | api\main.py:19 | Request: POST http://127.0.0.1:8000/api/context-analysis
422
+ 2025-08-22 15:14:46,028 | INFO | access_logger | api\main.py:21 | Response status: 200
423
+ 2025-08-22 15:15:05,845 | INFO | access_logger | api\main.py:19 | Request: POST http://127.0.0.1:8000/api/context-analysis
424
+ 2025-08-22 15:15:05,847 | INFO | access_logger | api\main.py:21 | Response status: 200
425
+ 2025-08-22 15:15:35,529 | INFO | access_logger | api\main.py:19 | Request: POST http://127.0.0.1:8000/api/context-analysis
426
+ 2025-08-22 15:15:35,531 | INFO | access_logger | api\main.py:21 | Response status: 200
427
+ 2025-08-22 15:15:57,354 | INFO | access_logger | api\main.py:19 | Request: POST http://127.0.0.1:8000/api/context-analysis
428
+ 2025-08-22 15:15:57,361 | INFO | access_logger | api\main.py:21 | Response status: 200
429
+ 2025-08-22 15:16:10,105 | INFO | access_logger | api\main.py:19 | Request: POST http://127.0.0.1:8000/api/context-analysis
430
+ 2025-08-22 15:16:10,108 | INFO | access_logger | api\main.py:21 | Response status: 200
431
+ 2025-08-22 15:16:58,064 | INFO | access_logger | api\main.py:19 | Request: POST http://127.0.0.1:8000/api/context-analysis
432
+ 2025-08-22 15:16:58,067 | INFO | access_logger | api\main.py:21 | Response status: 200
433
+ 2025-08-22 15:17:22,771 | INFO | access_logger | api\main.py:19 | Request: POST http://127.0.0.1:8000/api/context-analysis
434
+ 2025-08-22 15:17:22,773 | INFO | access_logger | api\main.py:21 | Response status: 200
435
+ 2025-08-22 15:18:03,110 | INFO | access_logger | api\main.py:19 | Request: POST http://127.0.0.1:8000/api/context-analysis
436
+ 2025-08-22 15:18:03,113 | INFO | access_logger | api\main.py:21 | Response status: 200
437
+ 2025-08-22 15:18:29,059 | INFO | access_logger | api\main.py:19 | Request: POST http://127.0.0.1:8000/api/context-analysis
438
+ 2025-08-22 15:18:29,061 | INFO | access_logger | api\main.py:21 | Response status: 200
439
+ 2025-08-22 15:20:52,901 | INFO | access_logger | api\main.py:19 | Request: POST http://127.0.0.1:8000/api/context-analysis
440
+ 2025-08-22 15:20:52,904 | INFO | access_logger | api\main.py:21 | Response status: 200
441
+ 2025-08-22 16:03:29,119 | INFO | access_logger | api\main.py:19 | Request: POST http://127.0.0.1:8000/api/context-analysis
442
+ 2025-08-22 16:03:29,213 | INFO | access_logger | api\main.py:21 | Response status: 200
443
+ 2025-08-22 16:03:43,890 | INFO | access_logger | api\main.py:19 | Request: POST http://127.0.0.1:8000/api/context-analysis
444
+ 2025-08-22 16:03:43,893 | INFO | access_logger | api\main.py:21 | Response status: 200
445
+ 2025-08-22 16:03:57,411 | INFO | access_logger | api\main.py:19 | Request: POST http://127.0.0.1:8000/api/context-analysis
446
+ 2025-08-22 16:03:57,413 | INFO | access_logger | api\main.py:21 | Response status: 200
447
+ 2025-08-22 16:04:11,077 | INFO | access_logger | api\main.py:19 | Request: POST http://127.0.0.1:8000/api/context-analysis
448
+ 2025-08-22 16:04:11,080 | INFO | access_logger | api\main.py:21 | Response status: 200
449
+ 2025-08-22 16:04:22,746 | INFO | access_logger | api\main.py:19 | Request: POST http://127.0.0.1:8000/api/context-analysis
450
+ 2025-08-22 16:04:22,749 | INFO | access_logger | api\main.py:21 | Response status: 200
451
+ 2025-08-22 16:04:37,207 | INFO | access_logger | api\main.py:19 | Request: POST http://127.0.0.1:8000/api/context-analysis
452
+ 2025-08-22 16:04:37,284 | INFO | access_logger | api\main.py:21 | Response status: 200
453
+ 2025-08-22 16:04:52,517 | INFO | access_logger | api\main.py:19 | Request: POST http://127.0.0.1:8000/api/context-analysis
454
+ 2025-08-22 16:04:52,519 | INFO | access_logger | api\main.py:21 | Response status: 200
455
+ 2025-08-22 16:05:23,142 | INFO | access_logger | api\main.py:19 | Request: POST http://127.0.0.1:8000/api/context-analysis
456
+ 2025-08-22 16:05:23,144 | INFO | access_logger | api\main.py:21 | Response status: 200
457
+ 2025-08-22 16:05:42,717 | INFO | access_logger | api\main.py:19 | Request: POST http://127.0.0.1:8000/api/context-analysis
458
+ 2025-08-22 16:05:42,719 | INFO | access_logger | api\main.py:21 | Response status: 200
459
+ 2025-08-22 16:28:12,070 | INFO | access_logger | api\main.py:19 | Request: POST http://127.0.0.1:8000/api/context-analysis
460
+ 2025-08-22 16:28:12,096 | INFO | access_logger | api\main.py:21 | Response status: 200
461
+ 2025-08-22 16:32:35,078 | INFO | access_logger | api\main.py:19 | Request: POST http://127.0.0.1:8000/api/context-analysis
462
+ 2025-08-22 16:32:35,170 | INFO | access_logger | api\main.py:21 | Response status: 200
463
+ 2025-08-22 16:32:47,773 | INFO | access_logger | api\main.py:19 | Request: POST http://127.0.0.1:8000/api/context-analysis
464
+ 2025-08-22 16:32:47,775 | INFO | access_logger | api\main.py:21 | Response status: 200
465
+ 2025-08-22 16:32:59,712 | INFO | access_logger | api\main.py:19 | Request: POST http://127.0.0.1:8000/api/context-analysis
466
+ 2025-08-22 16:32:59,714 | INFO | access_logger | api\main.py:21 | Response status: 200
467
+ 2025-08-22 16:33:23,642 | INFO | access_logger | api\main.py:19 | Request: POST http://127.0.0.1:8000/api/context-analysis
468
+ 2025-08-22 16:33:23,644 | INFO | access_logger | api\main.py:21 | Response status: 200
469
+ 2025-08-22 16:33:34,480 | INFO | access_logger | api\main.py:19 | Request: POST http://127.0.0.1:8000/api/context-analysis
470
+ 2025-08-22 16:33:34,482 | INFO | access_logger | api\main.py:21 | Response status: 200
471
+ 2025-08-22 16:33:45,378 | INFO | access_logger | api\main.py:19 | Request: POST http://127.0.0.1:8000/api/context-analysis
472
+ 2025-08-22 16:33:45,380 | INFO | access_logger | api\main.py:21 | Response status: 200
473
+ 2025-08-22 16:34:02,049 | INFO | access_logger | api\main.py:19 | Request: POST http://127.0.0.1:8000/api/context-analysis
474
+ 2025-08-22 16:34:02,051 | INFO | access_logger | api\main.py:21 | Response status: 200
475
+ 2025-08-22 16:34:16,163 | INFO | access_logger | api\main.py:19 | Request: POST http://127.0.0.1:8000/api/context-analysis
476
+ 2025-08-22 16:34:16,165 | INFO | access_logger | api\main.py:21 | Response status: 200
477
+ 2025-08-22 16:34:30,074 | INFO | access_logger | api\main.py:19 | Request: POST http://127.0.0.1:8000/api/context-analysis
478
+ 2025-08-22 16:34:30,076 | INFO | access_logger | api\main.py:21 | Response status: 200
479
+ 2025-08-22 16:34:49,371 | INFO | access_logger | api\main.py:19 | Request: POST http://127.0.0.1:8000/api/context-analysis
480
+ 2025-08-22 16:34:49,373 | INFO | access_logger | api\main.py:21 | Response status: 200
481
+ 2025-08-22 16:40:10,586 | INFO | access_logger | api\main.py:19 | Request: POST http://127.0.0.1:8000/api/context-analysis
482
+ 2025-08-22 16:40:10,680 | INFO | access_logger | api\main.py:21 | Response status: 200
483
+ 2025-08-22 16:45:45,350 | INFO | access_logger | api\main.py:19 | Request: POST http://127.0.0.1:8000/api/context-analysis
484
+ 2025-08-22 16:45:46,127 | INFO | access_logger | api\main.py:21 | Response status: 200
logs/app.log CHANGED
@@ -33,3 +33,36 @@
33
  2025-08-17 14:13:45,517 | INFO | app_logger | api\routers\show_analytics.py:14 | Influencer Analytics returned by orchestrator.
34
  2025-08-17 15:22:52,597 | INFO | app_logger | api\routers\show_analytics.py:14 | Influencer Analytics returned by orchestrator.
35
  2025-08-17 15:24:08,119 | INFO | app_logger | api\routers\ideation.py:28 | Executed the ideation pipeline.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  2025-08-17 14:13:45,517 | INFO | app_logger | api\routers\show_analytics.py:14 | Influencer Analytics returned by orchestrator.
34
  2025-08-17 15:22:52,597 | INFO | app_logger | api\routers\show_analytics.py:14 | Influencer Analytics returned by orchestrator.
35
  2025-08-17 15:24:08,119 | INFO | app_logger | api\routers\ideation.py:28 | Executed the ideation pipeline.
36
+ 2025-08-20 14:42:13,597 | INFO | app_logger | api\routers\ideation.py:28 | Executed the ideation pipeline.
37
+ 2025-08-20 15:49:43,187 | INFO | app_logger | api\routers\ideation.py:28 | Executed the ideation pipeline.
38
+ 2025-08-22 15:14:30,556 | INFO | app_logger | api\routers\context_analysis.py:27 | Executed context analysis agent
39
+ 2025-08-22 15:14:47,390 | INFO | app_logger | api\routers\context_analysis.py:27 | Executed context analysis agent
40
+ 2025-08-22 15:15:08,142 | INFO | app_logger | api\routers\context_analysis.py:27 | Executed context analysis agent
41
+ 2025-08-22 15:15:37,181 | INFO | app_logger | api\routers\context_analysis.py:27 | Executed context analysis agent
42
+ 2025-08-22 15:15:58,251 | INFO | app_logger | api\routers\context_analysis.py:27 | Executed context analysis agent
43
+ 2025-08-22 15:16:11,455 | INFO | app_logger | api\routers\context_analysis.py:27 | Executed context analysis agent
44
+ 2025-08-22 15:16:59,158 | INFO | app_logger | api\routers\context_analysis.py:27 | Executed context analysis agent
45
+ 2025-08-22 15:17:26,486 | INFO | app_logger | api\routers\context_analysis.py:27 | Executed context analysis agent
46
+ 2025-08-22 15:18:06,522 | INFO | app_logger | api\routers\context_analysis.py:27 | Executed context analysis agent
47
+ 2025-08-22 15:18:30,038 | INFO | app_logger | api\routers\context_analysis.py:27 | Executed context analysis agent
48
+ 2025-08-22 15:20:54,775 | INFO | app_logger | api\routers\context_analysis.py:27 | Executed context analysis agent
49
+ 2025-08-22 16:03:31,947 | INFO | app_logger | api\routers\context_analysis.py:27 | Executed context analysis agent
50
+ 2025-08-22 16:03:45,991 | INFO | app_logger | api\routers\context_analysis.py:27 | Executed context analysis agent
51
+ 2025-08-22 16:03:59,045 | INFO | app_logger | api\routers\context_analysis.py:27 | Executed context analysis agent
52
+ 2025-08-22 16:04:12,079 | INFO | app_logger | api\routers\context_analysis.py:27 | Executed context analysis agent
53
+ 2025-08-22 16:04:24,354 | INFO | app_logger | api\routers\context_analysis.py:27 | Executed context analysis agent
54
+ 2025-08-22 16:04:38,884 | INFO | app_logger | api\routers\context_analysis.py:27 | Executed context analysis agent
55
+ 2025-08-22 16:04:54,600 | INFO | app_logger | api\routers\context_analysis.py:27 | Executed context analysis agent
56
+ 2025-08-22 16:05:24,378 | INFO | app_logger | api\routers\context_analysis.py:27 | Executed context analysis agent
57
+ 2025-08-22 16:05:46,373 | INFO | app_logger | api\routers\context_analysis.py:27 | Executed context analysis agent
58
+ 2025-08-22 16:28:13,344 | INFO | app_logger | api\routers\context_analysis.py:27 | Executed context analysis agent
59
+ 2025-08-22 16:32:37,212 | INFO | app_logger | api\routers\context_analysis.py:27 | Executed context analysis agent
60
+ 2025-08-22 16:32:48,691 | INFO | app_logger | api\routers\context_analysis.py:27 | Executed context analysis agent
61
+ 2025-08-22 16:33:01,635 | INFO | app_logger | api\routers\context_analysis.py:27 | Executed context analysis agent
62
+ 2025-08-22 16:33:24,859 | INFO | app_logger | api\routers\context_analysis.py:27 | Executed context analysis agent
63
+ 2025-08-22 16:33:35,725 | INFO | app_logger | api\routers\context_analysis.py:27 | Executed context analysis agent
64
+ 2025-08-22 16:33:46,403 | INFO | app_logger | api\routers\context_analysis.py:27 | Executed context analysis agent
65
+ 2025-08-22 16:34:03,128 | INFO | app_logger | api\routers\context_analysis.py:27 | Executed context analysis agent
66
+ 2025-08-22 16:34:17,796 | INFO | app_logger | api\routers\context_analysis.py:27 | Executed context analysis agent
67
+ 2025-08-22 16:34:33,195 | INFO | app_logger | api\routers\context_analysis.py:27 | Executed context analysis agent
68
+ 2025-08-22 16:34:51,470 | INFO | app_logger | api\routers\context_analysis.py:27 | Executed context analysis agent
logs/errors.log CHANGED
@@ -1 +1,2 @@
1
  2025-08-13 12:14:46,509 | ERROR | error_logger | Error while showing analytics: retrieve_data_for_analytics() missing 1 required positional argument: 'business_details'
 
 
1
  2025-08-13 12:14:46,509 | ERROR | error_logger | Error while showing analytics: retrieve_data_for_analytics() missing 1 required positional argument: 'business_details'
2
+ 2025-08-20 14:19:20,731 | ERROR | error_logger | api\routers\ideation.py:33 | Ideation loop ran more than specified.
requirements.txt CHANGED
@@ -2,7 +2,7 @@
2
  langgraph
3
  langsmith
4
  langchain_groq
5
- pydantic
6
  datasets
7
  faiss-cpu
8
  dotenv
 
2
  langgraph
3
  langsmith
4
  langchain_groq
5
+ pydantic==2.11.7
6
  datasets
7
  faiss-cpu
8
  dotenv
src/genai/__pycache__/__init__.cpython-311.pyc ADDED
Binary file (188 Bytes). View file
 
src/genai/brainstroming_agent/__pycache__/__init__.cpython-311.pyc ADDED
Binary file (208 Bytes). View file
 
src/genai/brainstroming_agent/__pycache__/agent.cpython-311.pyc ADDED
Binary file (2.34 kB). View file
 
src/genai/brainstroming_agent/utils/__pycache__/__init__.cpython-311.pyc ADDED
Binary file (214 Bytes). View file
 
src/genai/brainstroming_agent/utils/__pycache__/nodes.cpython-311.pyc ADDED
Binary file (7.45 kB). View file
 
src/genai/brainstroming_agent/utils/__pycache__/nodes.cpython-312.pyc CHANGED
Binary files a/src/genai/brainstroming_agent/utils/__pycache__/nodes.cpython-312.pyc and b/src/genai/brainstroming_agent/utils/__pycache__/nodes.cpython-312.pyc differ
 
src/genai/brainstroming_agent/utils/__pycache__/prompts.cpython-311.pyc ADDED
Binary file (8.25 kB). View file
 
src/genai/brainstroming_agent/utils/__pycache__/state.cpython-311.pyc ADDED
Binary file (2.63 kB). View file
 
src/genai/brainstroming_agent/utils/__pycache__/tools.cpython-311.pyc ADDED
Binary file (3.67 kB). View file
 
src/genai/brainstroming_agent/utils/__pycache__/tools.cpython-312.pyc CHANGED
Binary files a/src/genai/brainstroming_agent/utils/__pycache__/tools.cpython-312.pyc and b/src/genai/brainstroming_agent/utils/__pycache__/tools.cpython-312.pyc differ
 
src/genai/brainstroming_agent/utils/__pycache__/utils.cpython-311.pyc ADDED
Binary file (6.13 kB). View file
 
src/genai/context_analysis_agent/__pycache__/__init__.cpython-311.pyc ADDED
Binary file (211 Bytes). View file
 
src/genai/context_analysis_agent/__pycache__/agent.cpython-311.pyc ADDED
Binary file (4.51 kB). View file
 
src/genai/context_analysis_agent/agent.py CHANGED
@@ -1,10 +1,12 @@
1
  import logging
 
2
  from langgraph.graph import StateGraph, MessagesState, START, END
3
  from langgraph.checkpoint.memory import MemorySaver
4
- from .utils.state import State
5
  from .utils.nodes import IntroductionNode
6
  from .utils.utils import DetailsExtractor
7
  from src.genai.utils.models_loader import llm_gpt
 
8
 
9
 
10
  business_state = State()
@@ -37,7 +39,10 @@ class IntroductionChatbot:
37
 
38
 
39
  def is_complete(self, latest_response: str) -> bool:
40
- return "Thanks for providing all your required business details" in latest_response
 
 
 
41
 
42
  def extract_details(self):
43
  response = DetailsExtractor(business_state.interactions).run()
 
1
  import logging
2
+ from langchain_core.messages import SystemMessage , HumanMessage
3
  from langgraph.graph import StateGraph, MessagesState, START, END
4
  from langgraph.checkpoint.memory import MemorySaver
5
+ from .utils.state import State, CompletionFormatter
6
  from .utils.nodes import IntroductionNode
7
  from .utils.utils import DetailsExtractor
8
  from src.genai.utils.models_loader import llm_gpt
9
+ from .utils.prompts import completion_check_prompt
10
 
11
 
12
  business_state = State()
 
39
 
40
 
41
  def is_complete(self, latest_response: str) -> bool:
42
+ messages = [SystemMessage(content=completion_check_prompt()),HumanMessage(content=f'''The response of assistant is: {latest_response}''')]
43
+ response = llm_gpt.with_structured_output(CompletionFormatter).invoke(messages)
44
+ print('Completion response:', response.completion)
45
+ return response.completion
46
 
47
  def extract_details(self):
48
  response = DetailsExtractor(business_state.interactions).run()
src/genai/context_analysis_agent/utils/__pycache__/__init__.cpython-311.pyc ADDED
Binary file (217 Bytes). View file
 
src/genai/context_analysis_agent/utils/__pycache__/nodes.cpython-311.pyc ADDED
Binary file (1.68 kB). View file
 
src/genai/context_analysis_agent/utils/__pycache__/prompts.cpython-311.pyc ADDED
Binary file (3.49 kB). View file
 
src/genai/context_analysis_agent/utils/__pycache__/prompts.cpython-312.pyc CHANGED
Binary files a/src/genai/context_analysis_agent/utils/__pycache__/prompts.cpython-312.pyc and b/src/genai/context_analysis_agent/utils/__pycache__/prompts.cpython-312.pyc differ
 
src/genai/context_analysis_agent/utils/__pycache__/state.cpython-311.pyc ADDED
Binary file (3.14 kB). View file
 
src/genai/context_analysis_agent/utils/__pycache__/state.cpython-312.pyc CHANGED
Binary files a/src/genai/context_analysis_agent/utils/__pycache__/state.cpython-312.pyc and b/src/genai/context_analysis_agent/utils/__pycache__/state.cpython-312.pyc differ
 
src/genai/context_analysis_agent/utils/__pycache__/utils.cpython-311.pyc ADDED
Binary file (4.13 kB). View file
 
src/genai/context_analysis_agent/utils/nodes.py CHANGED
@@ -1,6 +1,7 @@
1
  from langchain_core.messages import SystemMessage
2
  from src.genai.utils.models_loader import llm_gpt
3
  from .prompts import introduction_prompt
 
4
 
5
 
6
  class IntroductionNode:
@@ -10,8 +11,13 @@ class IntroductionNode:
10
  def run(self, state, llm):
11
  template = introduction_prompt
12
  messages = [SystemMessage(content=template)] + state["messages"]
13
- response = llm.invoke(messages)
14
- return {"messages": [response]}
 
 
 
 
 
15
 
16
 
17
 
 
1
  from langchain_core.messages import SystemMessage
2
  from src.genai.utils.models_loader import llm_gpt
3
  from .prompts import introduction_prompt
4
+ from .state import ConversationFormatter
5
 
6
 
7
  class IntroductionNode:
 
11
  def run(self, state, llm):
12
  template = introduction_prompt
13
  messages = [SystemMessage(content=template)] + state["messages"]
14
+ response = llm.with_structured_output(ConversationFormatter).invoke(messages)
15
+ print('The response:', response)
16
+ print('Type of response:', type(response))
17
+ if 'True' in response.complete:
18
+ return {'messages':['completed']}
19
+ else:
20
+ return {"messages": [response.response]}
21
 
22
 
23
 
src/genai/context_analysis_agent/utils/prompts.py CHANGED
@@ -1,38 +1,45 @@
1
  introduction_prompt = '''
2
- You are a business assistant who collects only valid and relevant data.
 
3
  Your job is to gather details from business owners in a friendly and conversational manner to understand their business better. Ask in very easy and short way.
4
  No matter what the user asks, you have to say to user that we have to collect these details first and only you can move forward.
5
  If user asks you for some other queries related to influencers, marketing, video ideas etc or anything. Don't say i'm not here to help you. Just say, First i will collect your all the details and only can help you analyzing your details.
6
  You have to say user to be patient until al the details are collected.
7
 
8
  We need these details:
9
- 1. Business Type (e.g., e-commerce, SaaS, consulting),
10
  2. Platform(s) used (e.g., website, app, Instagram),
11
  3. Target Audience (who are their customers or clients),
12
  4. Business Goals (short-term or long-term objectives),
13
  5. Offerings (products or services they provide),
14
- 6. Challenges faced (any current business problems or limitations).
 
 
15
 
16
  Keep interacting until all valid details are collected.
17
 
18
  VERY IMPORTANT: Once all valid details are received, say: '**Thanks for providing all your required business details.**'
19
 
 
 
 
20
  '''
21
 
 
 
 
 
 
 
 
 
 
 
22
 
23
  def details_extract_prompt(interactions):
24
- return( f''' You're provided with the messages of business interactions between the user and assistant.
25
- Extract the following details of the business from the conversation in the form of dictionary. Don't give any further explanations either in the beginning or ending of the response.
26
- The details you have to extract are:\n
27
-
28
- ----------********---------------
29
- "business_type": "...",
30
- "platform": "...",
31
- "target_audience": "...",
32
- "business_goals": "...",
33
- "offerings": "...",
34
- "Challenges_faced": "..."
35
- ----------********---------------
36
 
37
  Now, start doing your work:\n
38
  The conversation is:\n{interactions}\n
 
1
  introduction_prompt = '''
2
+ You are a business assistant who collects only valid and relevant data of the brands.
3
+ Those brands connects with influencers to grow their business.
4
  Your job is to gather details from business owners in a friendly and conversational manner to understand their business better. Ask in very easy and short way.
5
  No matter what the user asks, you have to say to user that we have to collect these details first and only you can move forward.
6
  If user asks you for some other queries related to influencers, marketing, video ideas etc or anything. Don't say i'm not here to help you. Just say, First i will collect your all the details and only can help you analyzing your details.
7
  You have to say user to be patient until al the details are collected.
8
 
9
  We need these details:
10
+ 1. Business Type and Name (e.g., e-commerce, SaaS, consulting),
11
  2. Platform(s) used (e.g., website, app, Instagram),
12
  3. Target Audience (who are their customers or clients),
13
  4. Business Goals (short-term or long-term objectives),
14
  5. Offerings (products or services they provide),
15
+ 6. Devices used to create the videos.(smart phones , camera , high end gadgets etc.)
16
+ 7. Challenges faced (any current business problems or limitations).
17
+ 8. Lastly, ask about any queries or details that the business wants to say regarding their video idea and content creation. This is kind of additional details.
18
 
19
  Keep interacting until all valid details are collected.
20
 
21
  VERY IMPORTANT: Once all valid details are received, say: '**Thanks for providing all your required business details.**'
22
 
23
+ Give the output in structured format like this:
24
+ response: Your complete response here for details collection
25
+ complete: True or False. If the details extraction is completed, return True. If not completed return False.
26
  '''
27
 
28
+ def completion_check_prompt():
29
+ return f'''
30
+ You are a perfect checker who checks whether the assistant has ended the conversation with user or not by analyzing it's response.
31
+ If the assistant has ended the conversation , it will say the message: **Thanks for providing your required business details** or something thank you message like this.
32
+ The assistant will not further ask any questions if the conversation is completed. If the assistant is asking any question , it means the conversation is not completed.
33
+ So you are working as an indicator here who gives the signal whether the conversation is **completed** or **not completed**.
34
+
35
+ Output Format:
36
+ Just give the output in one word. Either **completed** or **not completed**.
37
+ '''
38
 
39
  def details_extract_prompt(interactions):
40
+ return( f''' You're provided with the messages of business interactions between the business and AI assistant.
41
+ Extract the following details of the business from the conversation as it is. Don't trim or simplify any of the business details. You must not have to lose any information.
42
+ No problem if the details are long, but give the business details as it is from the conversation.
 
 
 
 
 
 
 
 
 
43
 
44
  Now, start doing your work:\n
45
  The conversation is:\n{interactions}\n
src/genai/context_analysis_agent/utils/state.py CHANGED
@@ -10,9 +10,19 @@ class DetailsFormatter(BaseModel):
10
  '''
11
  Format the details from the business interaction of User and Assistant
12
  '''
13
- business_type: str = Field(description="The type of the business")
14
- platform: str = Field(description="The platform used for the business")
15
  target_audience: str = Field(description="The target audience of the business")
16
  business_goals: str = Field(description="The business goals of the business")
17
  offerings: str = Field(description="The offerings of the business")
18
- Challenges_faced: str = Field(description="The challenges faced by the business")
 
 
 
 
 
 
 
 
 
 
 
10
  '''
11
  Format the details from the business interaction of User and Assistant
12
  '''
13
+ business_type_or_name: str = Field(description="The type or name of the business.")
14
+ platform: str = Field(description="The platform used for the promotion of business")
15
  target_audience: str = Field(description="The target audience of the business")
16
  business_goals: str = Field(description="The business goals of the business")
17
  offerings: str = Field(description="The offerings of the business")
18
+ devices_used_to_create_videos: str = Field(description="The devices used to create videos.")
19
+ Challenges_faced: str = Field(description="The challenges faced by the business")
20
+ additional_informations: str = Field(description="Additional queries or details regarding the video or idea creation.")
21
+
22
+ class CompletionFormatter(BaseModel):
23
+ completion: str = Field(description="Just the one word result: **completed** or **not completed**")
24
+
25
+ class ConversationFormatter(BaseModel):
26
+ response: str = Field(description="The entire response of the assistant.")
27
+ complete: str = Field(description= "Return 'True' if the details extraction is completed. Return 'False' if not completed.")
28
+