subashpoudel commited on
Commit
3002e1b
·
1 Parent(s): 6207d09

Next commit

Browse files
Files changed (37) hide show
  1. .gitignore +1 -1
  2. __pycache__/logger_config.cpython-313.pyc +0 -0
  3. api/__pycache__/main.cpython-313.pyc +0 -0
  4. api/__pycache__/stored_data.cpython-313.pyc +0 -0
  5. api/main.py +3 -1
  6. api/routers/__pycache__/orchestration.cpython-313.pyc +0 -0
  7. api/routers/analytics_chatbot.py +27 -0
  8. api/routers/context_analysis.py +1 -1
  9. api/routers/generate_final_story.py +1 -1
  10. api/routers/generate_image.py +1 -1
  11. api/routers/human_idea_refining.py +1 -1
  12. api/routers/ideation.py +12 -3
  13. api/routers/orchestration.py +2 -2
  14. api/routers/show_analytics.py +1 -1
  15. api/schemas/analytics_chatbot.py +4 -0
  16. api/schemas/ideation.py +20 -0
  17. api/stored_data.py +11 -0
  18. check.py +1 -1
  19. logs/access.log +203 -0
  20. logs/app.log +12 -0
  21. logs/errors.log +40 -0
  22. src/genai/analytics_chatbot/__init__.py +0 -0
  23. src/genai/analytics_chatbot/agent.py +16 -0
  24. src/genai/analytics_chatbot/utils/__init__.py +0 -0
  25. src/genai/analytics_chatbot/utils/api_knowledge.py +45 -0
  26. src/genai/analytics_chatbot/utils/nodes.py +21 -0
  27. src/genai/analytics_chatbot/utils/prompts.py +40 -0
  28. src/genai/analytics_chatbot/utils/schemas.py +5 -0
  29. src/genai/analytics_chatbot/utils/state.py +8 -0
  30. src/genai/ideation_agent/agent.py +6 -4
  31. src/genai/ideation_agent/utils/nodes.py +36 -8
  32. src/genai/ideation_agent/utils/prompts.py +74 -329
  33. src/genai/ideation_agent/utils/state.py +3 -0
  34. src/genai/utils/.DS_Store +0 -0
  35. src/genai/utils/__pycache__/models_loader.cpython-313.pyc +0 -0
  36. src/genai/utils/ideas/ideas.csv +0 -0
  37. src/genai/utils/models_loader.py +12 -8
.gitignore CHANGED
@@ -3,4 +3,4 @@ myenv
3
  *.pyc
4
  __pycache__/
5
  logs
6
- src/genai/utils/data/ideas.csv
 
3
  *.pyc
4
  __pycache__/
5
  logs
6
+ # src/genai/utils/data/ideas.csv
__pycache__/logger_config.cpython-313.pyc CHANGED
Binary files a/__pycache__/logger_config.cpython-313.pyc and b/__pycache__/logger_config.cpython-313.pyc differ
 
api/__pycache__/main.cpython-313.pyc CHANGED
Binary files a/api/__pycache__/main.cpython-313.pyc and b/api/__pycache__/main.cpython-313.pyc differ
 
api/__pycache__/stored_data.cpython-313.pyc CHANGED
Binary files a/api/__pycache__/stored_data.cpython-313.pyc and b/api/__pycache__/stored_data.cpython-313.pyc differ
 
api/main.py CHANGED
@@ -1,7 +1,7 @@
1
  from fastapi import FastAPI, Request
2
  from logger_config import setup_loggers
3
  import logging
4
- from .routers import orchestration, context_analysis, ideation , human_idea_refining , brainstorm , generate_final_story , generate_image, show_analytics
5
 
6
  setup_loggers()
7
  app = FastAPI()
@@ -34,4 +34,6 @@ app.include_router(human_idea_refining.router, prefix="/api")
34
  app.include_router(brainstorm.router, prefix="/api")
35
  app.include_router(generate_final_story.router, prefix="/api")
36
  app.include_router(generate_image.router, prefix="/api")
 
 
37
 
 
1
  from fastapi import FastAPI, Request
2
  from logger_config import setup_loggers
3
  import logging
4
+ from .routers import orchestration, context_analysis, ideation , human_idea_refining , brainstorm , generate_final_story , generate_image, show_analytics, analytics_chatbot
5
 
6
  setup_loggers()
7
  app = FastAPI()
 
34
  app.include_router(brainstorm.router, prefix="/api")
35
  app.include_router(generate_final_story.router, prefix="/api")
36
  app.include_router(generate_image.router, prefix="/api")
37
+ app.include_router(analytics_chatbot.router, prefix="/api")
38
+
39
 
api/routers/__pycache__/orchestration.cpython-313.pyc CHANGED
Binary files a/api/routers/__pycache__/orchestration.cpython-313.pyc and b/api/routers/__pycache__/orchestration.cpython-313.pyc differ
 
api/routers/analytics_chatbot.py ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import ast
2
+ import json
3
+ import logging
4
+ from fastapi import APIRouter
5
+ from fastapi.responses import StreamingResponse
6
+ from api.stored_data import stored_data
7
+ from src.genai.analytics_chatbot.agent import ChatbotAgent
8
+ from api.schemas.analytics_chatbot import UserMessage
9
+
10
+ app_logger = logging.getLogger("app_logger")
11
+ error_logger = logging.getLogger("error_logger")
12
+
13
+ router = APIRouter()
14
+ agent=ChatbotAgent()
15
+ graph = agent.chatbot_graph()
16
+
17
+ @router.post("/analytics-chatbot")
18
+ def context_analysis(msg: UserMessage):
19
+ config={"configurable": {"thread_id": "analytics-chatbot-thread"}}
20
+ try:
21
+ result=graph.invoke({'messages':msg.message},config=config)
22
+ return {
23
+ 'endpoint': result['endpoint'] ,
24
+ 'parameters': result['parameters']
25
+ }
26
+ except Exception as e:
27
+ raise
api/routers/context_analysis.py CHANGED
@@ -32,7 +32,7 @@ def context_analysis(msg: UserMessage):
32
 
33
 
34
  except Exception as e:
35
- error_logger.error('Failed Executing context analysis:', e)
36
  raise
37
 
38
 
 
32
 
33
 
34
  except Exception as e:
35
+ error_logger.error(f"Failed Executing context analysis: {e}")
36
  raise
37
 
38
 
api/routers/generate_final_story.py CHANGED
@@ -18,6 +18,6 @@ def generate_final_story_endpoint():
18
  return StreamingResponse(event_stream(), media_type="text/event-stream")
19
 
20
  except Exception as e:
21
- error_logger.error('Unable to generate final story.')
22
  raise
23
 
 
18
  return StreamingResponse(event_stream(), media_type="text/event-stream")
19
 
20
  except Exception as e:
21
+ error_logger.error(f'Unable to generate final story: {e}')
22
  raise
23
 
api/routers/generate_image.py CHANGED
@@ -20,5 +20,5 @@ def generate_image_endpoint():
20
  'response':image
21
  }
22
  except Exception as e:
23
- error_logger.error('Unable to generate image')
24
  raise
 
20
  'response':image
21
  }
22
  except Exception as e:
23
+ error_logger.error(f'Unable to generate image: {e}')
24
  raise
api/routers/human_idea_refining.py CHANGED
@@ -26,5 +26,5 @@ def human_idea_refine_endpoint(request:RefineIdeationRequest):
26
  return {'response' : stored_data['human_ideation_interactions'][-1]['content'] }
27
 
28
  except Exception as e:
29
- error_logger.error('Unable to execute human idea refining agent:', e)
30
  raise
 
26
  return {'response' : stored_data['human_ideation_interactions'][-1]['content'] }
27
 
28
  except Exception as e:
29
+ error_logger.error(f'Unable to execute human idea refining agent: {e}')
30
  raise
api/routers/ideation.py CHANGED
@@ -4,6 +4,7 @@ from fastapi import APIRouter
4
  from api.stored_data import stored_data
5
  from src.genai.ideation_agent.agent import IdeationAgent
6
  from langgraph.errors import GraphRecursionError
 
7
 
8
  app_logger = logging.getLogger("app_logger")
9
  error_logger = logging.getLogger("error_logger")
@@ -13,19 +14,27 @@ agent = IdeationAgent()
13
  idea_graph = agent.ideation_graph()
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
  {
 
21
  'business_details': [stored_data['business_details']],
22
  'image_caption': [stored_data['image_caption'] if 'image_caption' in stored_data else ""]
23
  },
24
  config=config)
25
  stored_data['final_ideation'] = result['unique_selected_ideas'][-1]
26
  # stored_data['final_ideation']=ast.literal_eval(stored_data['final_ideation'])
 
 
 
27
  app_logger.info('Executed the ideation pipeline.')
28
- return {'response':result['unique_selected_ideas'][-1]}
 
 
 
29
 
30
  except GraphRecursionError:
31
  error_logger.error('Ideation loop ran more than specified.')
@@ -33,6 +42,6 @@ def ideation_endpoint():
33
  return {'response': result[0]}
34
 
35
  except Exception as e:
36
- error_logger.error('Unable to execute the ideation', e)
37
  raise
38
 
 
4
  from api.stored_data import stored_data
5
  from src.genai.ideation_agent.agent import IdeationAgent
6
  from langgraph.errors import GraphRecursionError
7
+ from api.schemas.ideation import IdeationMessage
8
 
9
  app_logger = logging.getLogger("app_logger")
10
  error_logger = logging.getLogger("error_logger")
 
14
  idea_graph = agent.ideation_graph()
15
 
16
  @router.post("/ideation")
17
+ def ideation_endpoint(msg:IdeationMessage):
18
  config={"recursion_limit":25, "configurable": {"thread_id": "ideation_thread123"}}
19
+ scores=msg.scores.model_dump()
20
  try:
21
  result = idea_graph.invoke(
22
  {
23
+ 'scores': [scores],
24
  'business_details': [stored_data['business_details']],
25
  'image_caption': [stored_data['image_caption'] if 'image_caption' in stored_data else ""]
26
  },
27
  config=config)
28
  stored_data['final_ideation'] = result['unique_selected_ideas'][-1]
29
  # stored_data['final_ideation']=ast.literal_eval(stored_data['final_ideation'])
30
+ top_ideas = [{k: v for k, v in idea.items() if k != "scores"} for idea in result['unique_selected_ideas'][-1]]
31
+ more_ideas = [idea for idea in result['normalizer_response'][-1]['ideas'] if idea not in top_ideas]
32
+
33
  app_logger.info('Executed the ideation pipeline.')
34
+ return {'response':
35
+ {'top_ideas': top_ideas,
36
+ 'more_ideas': more_ideas}
37
+ }
38
 
39
  except GraphRecursionError:
40
  error_logger.error('Ideation loop ran more than specified.')
 
42
  return {'response': result[0]}
43
 
44
  except Exception as e:
45
+ error_logger.error(f'Unable to execute the ideation: {e}')
46
  raise
47
 
api/routers/orchestration.py CHANGED
@@ -10,7 +10,7 @@ error_logger = logging.getLogger("error_logger")
10
  router= APIRouter()
11
  agent = OrchestrationAgent()
12
 
13
- @router.post("/orchestration")
14
  def orchestration_endpoint(request:OrchestrationRequest):
15
  try:
16
  result = agent.chat(request.message , request.image_base64)
@@ -25,7 +25,7 @@ def orchestration_endpoint(request:OrchestrationRequest):
25
  'video_idea': result.video_idea,
26
  'video_story': result.video_story}
27
  except Exception as e:
28
- error_logger.error('Unable to run orchestration:', e)
29
  raise
30
 
31
 
 
10
  router= APIRouter()
11
  agent = OrchestrationAgent()
12
 
13
+ @router.post("/orchestration", description="Gives the analytics of influencers.")
14
  def orchestration_endpoint(request:OrchestrationRequest):
15
  try:
16
  result = agent.chat(request.message , request.image_base64)
 
25
  'video_idea': result.video_idea,
26
  'video_story': result.video_story}
27
  except Exception as e:
28
+ error_logger.error(f'Unable to run orchestration: {e}')
29
  raise
30
 
31
 
api/routers/show_analytics.py CHANGED
@@ -14,5 +14,5 @@ def show_analytics_endpoint():
14
  app_logger.info('Influencer Analytics returned by orchestrator.')
15
  return {'response': response}
16
  except Exception as e:
17
- error_logger.error('Unable to extract influencer analytics:', e)
18
  raise
 
14
  app_logger.info('Influencer Analytics returned by orchestrator.')
15
  return {'response': response}
16
  except Exception as e:
17
+ error_logger.error(f'Unable to extract influencer analytics: {e}')
18
  raise
api/schemas/analytics_chatbot.py ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ from pydantic import BaseModel
2
+
3
+ class UserMessage(BaseModel):
4
+ message: str
api/schemas/ideation.py CHANGED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from pydantic import BaseModel , Field
2
+
3
+ class Score(BaseModel):
4
+ originality: float = Field(description='1.0=Very common, 2.0=Slight twist, 3.0=Moderately unique, 4.0=Rare/innovative, 5.0=Completely new')
5
+ fluecy: float= Field(description='1.0=One-off, 2.0=Few vars, 3.0=Some, 4.0=Many contexts, 5.0=Endless remix')
6
+ flexibility: float = Field(description='1.0=One niche, 2.0=Few creators, 3.0=Several niches, 4.0=Many categories, 5.0=Universal')
7
+ feasibility: float = Field(description='(phone-only): 1.0=Impossible, 2.0=Very hard, 3.0=Possible w/ effort, 4.0=Easy on phone, 5.0=Effortless')
8
+ practical_value: float = Field(description='1.0=None, 2.0=Low, 3.0=Some, 4.0=High, 5.0=Very high/viral')
9
+ surprise_factor: float= Field(description='1.0=Predictable, 2.0=Mild, 3.0=Moderate, 4.0=Strong, 5.0=Shocking')
10
+ combinatorial_novelty:float = Field(description='1.0=Copy, 2.0=Slight remix, 3.0=Familiar combo, 4.0=Creative blend, 5.0=Radical fusion')
11
+ scalabality: float = Field(description='1.0=One-time, 2.0=Few times, 3.0=Limited repeats, 4.0=Recurring, 5.0=Endless series')
12
+ cultural_freshness: float = Field(description='1.0=Outdated, 2.0=Stale, 3.0=Current common, 4.0=Fresh twist, 5.0=Trendsetting')
13
+ alignment_with_business_details: float = Field(description='1.0=Very low alignment, 5.0=Perfect alignment')
14
+
15
+
16
+ class IdeationMessage(BaseModel):
17
+ scores: Score
18
+
19
+
20
+
api/stored_data.py CHANGED
@@ -19,6 +19,17 @@ stored_data['business_details'] = {
19
  "additional_details":"My budget is not so high. I want creative and feasible ideas to be captured by just mobile phone only."
20
  }
21
 
 
 
 
 
 
 
 
 
 
 
 
22
 
23
  stored_data['human_ideation_interactions'] = []
24
  stored_data['brainstorming_response']={}
 
19
  "additional_details":"My budget is not so high. I want creative and feasible ideas to be captured by just mobile phone only."
20
  }
21
 
22
+ # stored_data['business_details'] = {
23
+ # "business_type": "furniture and home appliances store",
24
+ # "platform": "Instagram, TikTok",
25
+ # "target_audience": "homeowners, renters, and interior enthusiasts (ages 25–50) who are looking to furnish or upgrade their living spaces.",
26
+ # "business_goals": "to build a trusted home furnishing brand, increase product sales, and attract attention with visually appealing and informative video content.",
27
+ # "offerings": "sofas, beds, dining tables, chairs, wardrobes, kitchen appliances, lighting solutions, and home décor items",
28
+ # "Challenges_faced": "standing out in a competitive home furnishing market, showcasing quality and style of products effectively, and creating engaging, practical marketing videos",
29
+ # "device_used": "only phone. (iPhone 11)",
30
+ # "additional_details": "My budget is limited. I want creative and feasible ideas that can be captured using only a mobile phone."
31
+ # }
32
+
33
 
34
  stored_data['human_ideation_interactions'] = []
35
  stored_data['brainstorming_response']={}
check.py CHANGED
@@ -10,4 +10,4 @@ messages = [SystemMessage(content=template),
10
  The information of the image is:\n''')]
11
 
12
  response = llm_gpt.with_structured_output(ideation_json_schema).invoke(messages)
13
- print(response)
 
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
@@ -655,3 +655,206 @@
655
  2025-09-01 14:56:55,852 | INFO | access_logger | api/main.py:19 | Request: POST http://127.0.0.1:8000/api/ideation
656
  2025-09-01 14:57:54,173 | INFO | access_logger | api/main.py:19 | Request: POST http://127.0.0.1:8000/api/ideation
657
  2025-09-01 14:58:32,025 | INFO | access_logger | api/main.py:21 | Response status: 200
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
655
  2025-09-01 14:56:55,852 | INFO | access_logger | api/main.py:19 | Request: POST http://127.0.0.1:8000/api/ideation
656
  2025-09-01 14:57:54,173 | INFO | access_logger | api/main.py:19 | Request: POST http://127.0.0.1:8000/api/ideation
657
  2025-09-01 14:58:32,025 | INFO | access_logger | api/main.py:21 | Response status: 200
658
+ 2025-09-02 14:16:33,167 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/
659
+ 2025-09-02 14:16:33,168 | INFO | access_logger | api/main.py:21 | Response status: 200
660
+ 2025-09-02 14:16:33,815 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/favicon.ico
661
+ 2025-09-02 14:16:33,815 | INFO | access_logger | api/main.py:21 | Response status: 404
662
+ 2025-09-02 14:16:38,645 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/docs
663
+ 2025-09-02 14:16:38,646 | INFO | access_logger | api/main.py:21 | Response status: 200
664
+ 2025-09-02 14:16:38,852 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/openapi.json
665
+ 2025-09-02 14:16:38,856 | INFO | access_logger | api/main.py:21 | Response status: 200
666
+ 2025-09-02 14:16:45,041 | INFO | access_logger | api/main.py:19 | Request: POST http://127.0.0.1:8000/api/ideation
667
+ 2025-09-02 14:18:04,761 | INFO | access_logger | api/main.py:19 | Request: POST http://127.0.0.1:8000/api/ideation
668
+ 2025-09-02 14:20:04,684 | INFO | access_logger | api/main.py:19 | Request: POST http://127.0.0.1:8000/api/ideation
669
+ 2025-09-02 14:20:57,026 | INFO | access_logger | api/main.py:21 | Response status: 200
670
+ 2025-09-02 14:25:48,240 | INFO | access_logger | api/main.py:19 | Request: POST http://127.0.0.1:8000/api/show-analytics
671
+ 2025-09-02 14:25:53,493 | INFO | access_logger | api/main.py:21 | Response status: 200
672
+ 2025-09-02 16:45:04,588 | INFO | access_logger | api/main.py:19 | Request: POST http://127.0.0.1:8000/api/show-analytics
673
+ 2025-09-04 13:01:07,903 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/
674
+ 2025-09-04 13:01:07,904 | INFO | access_logger | api/main.py:21 | Response status: 200
675
+ 2025-09-04 13:01:08,455 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/favicon.ico
676
+ 2025-09-04 13:01:08,456 | INFO | access_logger | api/main.py:21 | Response status: 404
677
+ 2025-09-04 13:01:34,231 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/docs
678
+ 2025-09-04 13:01:34,232 | INFO | access_logger | api/main.py:21 | Response status: 200
679
+ 2025-09-04 13:01:34,404 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/openapi.json
680
+ 2025-09-04 13:01:34,412 | INFO | access_logger | api/main.py:21 | Response status: 200
681
+ 2025-09-04 13:01:48,473 | INFO | access_logger | api/main.py:19 | Request: POST http://127.0.0.1:8000/api/ideation
682
+ 2025-09-04 13:03:57,799 | INFO | access_logger | api/main.py:19 | Request: POST http://127.0.0.1:8000/api/ideation
683
+ 2025-09-04 13:07:06,963 | INFO | access_logger | api/main.py:19 | Request: POST http://127.0.0.1:8000/api/ideation
684
+ 2025-09-04 13:20:52,782 | INFO | access_logger | api/main.py:19 | Request: POST http://127.0.0.1:8000/api/ideation
685
+ 2025-09-04 13:30:23,384 | INFO | access_logger | api/main.py:19 | Request: POST http://127.0.0.1:8000/api/ideation
686
+ 2025-09-04 13:32:10,980 | INFO | access_logger | api/main.py:19 | Request: POST http://127.0.0.1:8000/api/ideation
687
+ 2025-09-05 13:03:12,577 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/
688
+ 2025-09-05 13:03:12,578 | INFO | access_logger | api/main.py:21 | Response status: 200
689
+ 2025-09-05 13:03:13,105 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/favicon.ico
690
+ 2025-09-05 13:03:13,106 | INFO | access_logger | api/main.py:21 | Response status: 404
691
+ 2025-09-05 13:03:16,368 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/docs
692
+ 2025-09-05 13:03:16,369 | INFO | access_logger | api/main.py:21 | Response status: 200
693
+ 2025-09-05 13:03:16,544 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/openapi.json
694
+ 2025-09-05 13:03:16,552 | INFO | access_logger | api/main.py:21 | Response status: 200
695
+ 2025-09-05 13:03:23,640 | INFO | access_logger | api/main.py:19 | Request: POST http://127.0.0.1:8000/api/ideation
696
+ 2025-09-05 13:14:53,951 | INFO | access_logger | api/main.py:19 | Request: POST http://127.0.0.1:8000/api/ideation
697
+ 2025-09-05 13:30:20,452 | INFO | access_logger | api/main.py:19 | Request: POST http://127.0.0.1:8000/api/ideation
698
+ 2025-09-05 13:30:47,659 | INFO | access_logger | api/main.py:19 | Request: POST http://127.0.0.1:8000/api/ideation
699
+ 2025-09-05 13:30:56,391 | INFO | access_logger | api/main.py:19 | Request: POST http://127.0.0.1:8000/api/ideation
700
+ 2025-09-05 13:38:43,320 | INFO | access_logger | api/main.py:19 | Request: POST http://127.0.0.1:8000/api/ideation
701
+ 2025-09-05 13:41:50,521 | INFO | access_logger | api/main.py:19 | Request: POST http://127.0.0.1:8000/api/ideation
702
+ 2025-09-05 16:01:38,932 | INFO | access_logger | api/main.py:19 | Request: POST http://127.0.0.1:8000/api/ideation
703
+ 2025-09-05 16:01:45,902 | INFO | access_logger | api/main.py:21 | Response status: 200
704
+ 2025-09-05 16:29:20,976 | INFO | access_logger | api/main.py:19 | Request: POST http://127.0.0.1:8000/api/ideation
705
+ 2025-09-05 16:30:31,555 | INFO | access_logger | api/main.py:21 | Response status: 200
706
+ 2025-09-07 11:32:56,742 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/
707
+ 2025-09-07 11:32:56,743 | INFO | access_logger | api/main.py:21 | Response status: 200
708
+ 2025-09-07 11:32:56,744 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/
709
+ 2025-09-07 11:32:56,745 | INFO | access_logger | api/main.py:21 | Response status: 200
710
+ 2025-09-07 11:32:56,833 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/favicon.ico
711
+ 2025-09-07 11:32:56,835 | INFO | access_logger | api/main.py:21 | Response status: 404
712
+ 2025-09-07 11:32:56,856 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/favicon.ico
713
+ 2025-09-07 11:32:56,857 | INFO | access_logger | api/main.py:21 | Response status: 404
714
+ 2025-09-07 11:33:03,322 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/docs
715
+ 2025-09-07 11:33:03,323 | INFO | access_logger | api/main.py:21 | Response status: 200
716
+ 2025-09-07 11:33:03,656 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/openapi.json
717
+ 2025-09-07 11:33:03,662 | INFO | access_logger | api/main.py:21 | Response status: 200
718
+ 2025-09-07 11:33:09,713 | INFO | access_logger | api/main.py:19 | Request: POST http://127.0.0.1:8000/api/ideation
719
+ 2025-09-11 11:29:26,503 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/
720
+ 2025-09-11 11:29:26,505 | INFO | access_logger | api/main.py:21 | Response status: 200
721
+ 2025-09-11 11:29:26,506 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/
722
+ 2025-09-11 11:29:26,507 | INFO | access_logger | api/main.py:21 | Response status: 200
723
+ 2025-09-11 11:29:27,052 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/favicon.ico
724
+ 2025-09-11 11:29:27,053 | INFO | access_logger | api/main.py:21 | Response status: 404
725
+ 2025-09-11 11:29:27,055 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/favicon.ico
726
+ 2025-09-11 11:29:27,056 | INFO | access_logger | api/main.py:21 | Response status: 404
727
+ 2025-09-11 11:29:30,533 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/docs
728
+ 2025-09-11 11:29:30,534 | INFO | access_logger | api/main.py:21 | Response status: 200
729
+ 2025-09-11 11:29:31,453 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/openapi.json
730
+ 2025-09-11 11:29:31,462 | INFO | access_logger | api/main.py:21 | Response status: 200
731
+ 2025-09-11 11:29:42,920 | INFO | access_logger | api/main.py:19 | Request: POST http://127.0.0.1:8000/api/ideation
732
+ 2025-09-11 11:46:30,560 | INFO | access_logger | api/main.py:19 | Request: POST http://127.0.0.1:8000/api/ideation
733
+ 2025-09-12 11:56:48,206 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/
734
+ 2025-09-12 11:56:48,208 | INFO | access_logger | api/main.py:21 | Response status: 200
735
+ 2025-09-12 11:56:48,209 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/
736
+ 2025-09-12 11:56:48,209 | INFO | access_logger | api/main.py:21 | Response status: 200
737
+ 2025-09-12 11:56:48,228 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/favicon.ico
738
+ 2025-09-12 11:56:48,229 | INFO | access_logger | api/main.py:21 | Response status: 404
739
+ 2025-09-12 11:56:48,230 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/favicon.ico
740
+ 2025-09-12 11:56:48,231 | INFO | access_logger | api/main.py:21 | Response status: 404
741
+ 2025-09-12 11:56:55,588 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/docs
742
+ 2025-09-12 11:56:55,589 | INFO | access_logger | api/main.py:21 | Response status: 200
743
+ 2025-09-12 11:56:55,670 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/openapi.json
744
+ 2025-09-12 11:56:55,675 | INFO | access_logger | api/main.py:21 | Response status: 200
745
+ 2025-09-12 12:06:53,432 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/docs
746
+ 2025-09-12 12:06:53,434 | INFO | access_logger | api/main.py:21 | Response status: 200
747
+ 2025-09-12 12:06:53,476 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/openapi.json
748
+ 2025-09-12 12:06:53,481 | INFO | access_logger | api/main.py:21 | Response status: 200
749
+ 2025-09-12 12:07:46,175 | INFO | access_logger | api/main.py:19 | Request: POST http://127.0.0.1:8000/api/ideation
750
+ 2025-09-12 12:12:58,585 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/
751
+ 2025-09-12 12:12:58,586 | INFO | access_logger | api/main.py:21 | Response status: 200
752
+ 2025-09-12 12:12:58,587 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/
753
+ 2025-09-12 12:12:58,587 | INFO | access_logger | api/main.py:21 | Response status: 200
754
+ 2025-09-12 12:13:01,606 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/docs
755
+ 2025-09-12 12:13:01,607 | INFO | access_logger | api/main.py:21 | Response status: 200
756
+ 2025-09-12 12:13:01,682 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/openapi.json
757
+ 2025-09-12 12:13:01,690 | INFO | access_logger | api/main.py:21 | Response status: 200
758
+ 2025-09-12 12:13:04,177 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/dcocs
759
+ 2025-09-12 12:13:04,178 | INFO | access_logger | api/main.py:21 | Response status: 404
760
+ 2025-09-12 12:13:09,646 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/docs
761
+ 2025-09-12 12:13:09,646 | INFO | access_logger | api/main.py:21 | Response status: 200
762
+ 2025-09-12 12:13:09,707 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/openapi.json
763
+ 2025-09-12 12:13:09,708 | INFO | access_logger | api/main.py:21 | Response status: 200
764
+ 2025-09-12 12:13:29,067 | INFO | access_logger | api/main.py:19 | Request: POST http://127.0.0.1:8000/api/ideation
765
+ 2025-09-12 12:19:10,203 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/docs
766
+ 2025-09-12 12:19:10,204 | INFO | access_logger | api/main.py:21 | Response status: 200
767
+ 2025-09-12 12:19:10,265 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/openapi.json
768
+ 2025-09-12 12:19:10,273 | INFO | access_logger | api/main.py:21 | Response status: 200
769
+ 2025-09-12 12:23:01,275 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/docs
770
+ 2025-09-12 12:23:01,277 | INFO | access_logger | api/main.py:21 | Response status: 200
771
+ 2025-09-12 12:23:01,346 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/openapi.json
772
+ 2025-09-12 12:23:01,354 | INFO | access_logger | api/main.py:21 | Response status: 200
773
+ 2025-09-12 12:24:04,340 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/docs
774
+ 2025-09-12 12:24:04,341 | INFO | access_logger | api/main.py:21 | Response status: 200
775
+ 2025-09-12 12:24:04,409 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/openapi.json
776
+ 2025-09-12 12:24:04,416 | INFO | access_logger | api/main.py:21 | Response status: 200
777
+ 2025-09-12 12:24:21,428 | INFO | access_logger | api/main.py:19 | Request: POST http://127.0.0.1:8000/api/ideation
778
+ 2025-09-12 16:57:37,171 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/
779
+ 2025-09-12 16:57:37,173 | INFO | access_logger | api/main.py:21 | Response status: 200
780
+ 2025-09-12 16:57:37,205 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/
781
+ 2025-09-12 16:57:37,207 | INFO | access_logger | api/main.py:21 | Response status: 200
782
+ 2025-09-12 16:57:37,246 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/favicon.ico
783
+ 2025-09-12 16:57:37,247 | INFO | access_logger | api/main.py:21 | Response status: 404
784
+ 2025-09-12 16:57:40,799 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/docs
785
+ 2025-09-12 16:57:40,800 | INFO | access_logger | api/main.py:21 | Response status: 200
786
+ 2025-09-12 16:57:40,870 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/openapi.json
787
+ 2025-09-12 16:57:40,878 | INFO | access_logger | api/main.py:21 | Response status: 200
788
+ 2025-09-12 17:59:31,415 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/
789
+ 2025-09-12 17:59:31,416 | INFO | access_logger | api/main.py:21 | Response status: 200
790
+ 2025-09-12 17:59:31,418 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/
791
+ 2025-09-12 17:59:31,419 | INFO | access_logger | api/main.py:21 | Response status: 200
792
+ 2025-09-12 17:59:31,932 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/favicon.ico
793
+ 2025-09-12 17:59:31,933 | INFO | access_logger | api/main.py:21 | Response status: 404
794
+ 2025-09-12 17:59:31,934 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/favicon.ico
795
+ 2025-09-12 17:59:31,935 | INFO | access_logger | api/main.py:21 | Response status: 404
796
+ 2025-09-12 17:59:35,135 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/docs
797
+ 2025-09-12 17:59:35,136 | INFO | access_logger | api/main.py:21 | Response status: 200
798
+ 2025-09-12 17:59:35,447 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/openapi.json
799
+ 2025-09-12 17:59:35,455 | INFO | access_logger | api/main.py:21 | Response status: 200
800
+ 2025-09-12 18:01:14,193 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/
801
+ 2025-09-12 18:01:14,194 | INFO | access_logger | api/main.py:21 | Response status: 200
802
+ 2025-09-12 18:01:14,195 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/
803
+ 2025-09-12 18:01:14,196 | INFO | access_logger | api/main.py:21 | Response status: 200
804
+ 2025-09-12 18:01:17,563 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/docs
805
+ 2025-09-12 18:01:17,564 | INFO | access_logger | api/main.py:21 | Response status: 200
806
+ 2025-09-12 18:01:17,636 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/openapi.json
807
+ 2025-09-12 18:01:17,644 | INFO | access_logger | api/main.py:21 | Response status: 200
808
+ 2025-09-12 18:02:29,289 | INFO | access_logger | api/main.py:19 | Request: POST http://127.0.0.1:8000/api/analytics-chatbot
809
+ 2025-09-12 18:03:38,499 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/
810
+ 2025-09-12 18:03:38,500 | INFO | access_logger | api/main.py:21 | Response status: 200
811
+ 2025-09-12 18:03:38,501 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/
812
+ 2025-09-12 18:03:38,501 | INFO | access_logger | api/main.py:21 | Response status: 200
813
+ 2025-09-12 18:03:42,093 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/docs
814
+ 2025-09-12 18:03:42,094 | INFO | access_logger | api/main.py:21 | Response status: 200
815
+ 2025-09-12 18:03:42,161 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/openapi.json
816
+ 2025-09-12 18:03:42,163 | INFO | access_logger | api/main.py:21 | Response status: 200
817
+ 2025-09-12 18:04:04,489 | INFO | access_logger | api/main.py:19 | Request: POST http://127.0.0.1:8000/api/analytics-chatbot
818
+ 2025-09-12 18:06:15,283 | INFO | access_logger | api/main.py:19 | Request: POST http://127.0.0.1:8000/api/analytics-chatbot
819
+ 2025-09-12 18:06:19,872 | INFO | access_logger | api/main.py:21 | Response status: 200
820
+ 2025-09-14 11:52:38,052 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/
821
+ 2025-09-14 11:52:38,053 | INFO | access_logger | api/main.py:21 | Response status: 200
822
+ 2025-09-14 11:52:38,054 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/
823
+ 2025-09-14 11:52:38,054 | INFO | access_logger | api/main.py:21 | Response status: 200
824
+ 2025-09-14 11:52:38,770 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/favicon.ico
825
+ 2025-09-14 11:52:38,771 | INFO | access_logger | api/main.py:21 | Response status: 404
826
+ 2025-09-14 11:52:38,773 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/favicon.ico
827
+ 2025-09-14 11:52:38,773 | INFO | access_logger | api/main.py:21 | Response status: 404
828
+ 2025-09-14 11:52:41,321 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/docs
829
+ 2025-09-14 11:52:41,322 | INFO | access_logger | api/main.py:21 | Response status: 200
830
+ 2025-09-14 11:52:41,572 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/openapi.json
831
+ 2025-09-14 11:52:41,579 | INFO | access_logger | api/main.py:21 | Response status: 200
832
+ 2025-09-14 12:21:40,478 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/
833
+ 2025-09-14 12:21:40,480 | INFO | access_logger | api/main.py:21 | Response status: 200
834
+ 2025-09-14 12:21:46,924 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/docs
835
+ 2025-09-14 12:21:46,924 | INFO | access_logger | api/main.py:21 | Response status: 200
836
+ 2025-09-14 12:21:46,959 | INFO | access_logger | api/main.py:19 | Request: GET http://127.0.0.1:8000/openapi.json
837
+ 2025-09-14 12:21:46,967 | INFO | access_logger | api/main.py:21 | Response status: 200
838
+ 2025-09-14 12:22:37,931 | INFO | access_logger | api/main.py:19 | Request: POST http://127.0.0.1:8000/api/ideation
839
+ 2025-09-14 12:26:41,079 | INFO | access_logger | api/main.py:19 | Request: POST http://127.0.0.1:8000/api/ideation
840
+ 2025-09-14 12:29:37,174 | INFO | access_logger | api/main.py:19 | Request: POST http://127.0.0.1:8000/api/ideation
841
+ 2025-09-14 12:29:46,116 | INFO | access_logger | api/main.py:21 | Response status: 200
842
+ 2025-09-14 13:00:07,575 | INFO | access_logger | api/main.py:19 | Request: POST http://127.0.0.1:8000/api/ideation
843
+ 2025-09-14 13:00:19,188 | INFO | access_logger | api/main.py:21 | Response status: 200
844
+ 2025-09-14 13:27:53,698 | INFO | access_logger | api/main.py:19 | Request: POST http://127.0.0.1:8000/api/ideation
845
+ 2025-09-14 13:29:18,590 | INFO | access_logger | api/main.py:19 | Request: POST http://127.0.0.1:8000/api/ideation
846
+ 2025-09-14 13:29:30,127 | INFO | access_logger | api/main.py:21 | Response status: 200
847
+ 2025-09-14 13:32:27,788 | INFO | access_logger | api/main.py:19 | Request: POST http://127.0.0.1:8000/api/ideation
848
+ 2025-09-14 13:32:58,348 | INFO | access_logger | api/main.py:19 | Request: POST http://127.0.0.1:8000/api/ideation
849
+ 2025-09-14 13:32:59,315 | INFO | access_logger | api/main.py:19 | Request: POST http://127.0.0.1:8000/api/ideation
850
+ 2025-09-14 13:33:29,139 | INFO | access_logger | api/main.py:19 | Request: POST http://127.0.0.1:8000/api/ideation
851
+ 2025-09-14 13:33:42,305 | INFO | access_logger | api/main.py:21 | Response status: 200
852
+ 2025-09-14 13:36:04,356 | INFO | access_logger | api/main.py:19 | Request: POST http://127.0.0.1:8000/api/ideation
853
+ 2025-09-14 13:36:16,050 | INFO | access_logger | api/main.py:21 | Response status: 200
854
+ 2025-09-14 13:43:37,822 | INFO | access_logger | api/main.py:19 | Request: POST http://127.0.0.1:8000/api/ideation
855
+ 2025-09-14 13:43:49,292 | INFO | access_logger | api/main.py:21 | Response status: 200
856
+ 2025-09-14 13:45:20,051 | INFO | access_logger | api/main.py:19 | Request: POST http://127.0.0.1:8000/api/ideation
857
+ 2025-09-14 13:45:51,219 | INFO | access_logger | api/main.py:19 | Request: POST http://127.0.0.1:8000/api/ideation
858
+ 2025-09-14 13:46:03,906 | INFO | access_logger | api/main.py:21 | Response status: 200
859
+ 2025-09-14 13:48:22,944 | INFO | access_logger | api/main.py:19 | Request: POST http://127.0.0.1:8000/api/ideation
860
+ 2025-09-14 13:48:33,764 | INFO | access_logger | api/main.py:21 | Response status: 200
logs/app.log CHANGED
@@ -98,3 +98,15 @@
98
  2025-09-01 14:22:37,516 | INFO | app_logger | api/routers/ideation.py:27 | Executed the ideation pipeline.
99
  2025-09-01 14:24:24,482 | INFO | app_logger | api/routers/ideation.py:27 | Executed the ideation pipeline.
100
  2025-09-01 14:58:32,025 | INFO | app_logger | api/routers/ideation.py:27 | Executed the ideation pipeline.
 
 
 
 
 
 
 
 
 
 
 
 
 
98
  2025-09-01 14:22:37,516 | INFO | app_logger | api/routers/ideation.py:27 | Executed the ideation pipeline.
99
  2025-09-01 14:24:24,482 | INFO | app_logger | api/routers/ideation.py:27 | Executed the ideation pipeline.
100
  2025-09-01 14:58:32,025 | INFO | app_logger | api/routers/ideation.py:27 | Executed the ideation pipeline.
101
+ 2025-09-02 14:20:57,026 | INFO | app_logger | api/routers/ideation.py:27 | Executed the ideation pipeline.
102
+ 2025-09-02 14:25:53,491 | INFO | app_logger | api/routers/show_analytics.py:14 | Influencer Analytics returned by orchestrator.
103
+ 2025-09-05 16:01:45,899 | INFO | app_logger | api/routers/ideation.py:27 | Executed the ideation pipeline.
104
+ 2025-09-05 16:30:31,553 | INFO | app_logger | api/routers/ideation.py:27 | Executed the ideation pipeline.
105
+ 2025-09-14 12:29:46,114 | INFO | app_logger | api/routers/ideation.py:30 | Executed the ideation pipeline.
106
+ 2025-09-14 13:00:19,185 | INFO | app_logger | api/routers/ideation.py:30 | Executed the ideation pipeline.
107
+ 2025-09-14 13:29:30,125 | INFO | app_logger | api/routers/ideation.py:33 | Executed the ideation pipeline.
108
+ 2025-09-14 13:33:42,302 | INFO | app_logger | api/routers/ideation.py:33 | Executed the ideation pipeline.
109
+ 2025-09-14 13:36:16,047 | INFO | app_logger | api/routers/ideation.py:33 | Executed the ideation pipeline.
110
+ 2025-09-14 13:43:49,289 | INFO | app_logger | api/routers/ideation.py:33 | Executed the ideation pipeline.
111
+ 2025-09-14 13:46:03,905 | INFO | app_logger | api/routers/ideation.py:33 | Executed the ideation pipeline.
112
+ 2025-09-14 13:48:33,762 | INFO | app_logger | api/routers/ideation.py:33 | Executed the ideation pipeline.
logs/errors.log CHANGED
@@ -1,2 +1,42 @@
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.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.
3
+ 2025-09-04 13:30:27,940 | ERROR | error_logger | api/routers/ideation.py:36 | Unable to execute the ideation
4
+ 2025-09-04 13:32:15,815 | ERROR | error_logger | api/routers/ideation.py:36 | Unable to execute the ideation: Error code: 400 - {'error': {'message': "Failed to call a function. Please adjust your prompt. See 'failed_generation' for more details.", 'type': 'invalid_request_error', 'code': 'tool_use_failed', 'failed_generation': '<function=IdeasSchema>["ideas":[{"title":"Flip, Fold, Relax","one_line_description":"Showcase furniture that can be folded or flipped to save space and look stylish.","hook":"Flip it, fold it, and relax in style!","usp":"Furniture that fits your lifestyle and looks great.","niche":"Young people who live in small homes or apartments."},{"title":"Home Makeover in 60 Seconds","one_line_description":"Quickly improve the look of a room with our decorating tips and products in just 60 seconds.","hook":"Get a new look in just 60 seconds!","usp":"Expert decorating advice and good products to help you improve your home quickly.","niche":"People who like decorating and want a fresh new look."},{"title":"Before & After: The Power of Furniture","one_line_description":"Show how our furniture can completely change the look of a room.","hook":"From old to new: see how our furniture can change your space!","usp":"Good, stylish furniture that can make your home look amazing.","niche":"People who want to make their home look much better."},{"title":"The 5-Minute Decorating Challenge","one_line_description":"Challenge people to decorate a room using our products in just 5 minutes.","hook":"Can you decorate a room in just 5 minutes?","usp":"Good, stylish furniture and decor that inspires creativity and self-expression.","niche":"Young people who want inspiration and ideas for decorating their homes."},{"title":"Lighting Makeover: Brighten Up!","one_line_description":"Show how new lighting can completely change the look and feel of a room.","hook":"Brighten up your life with our amazing lighting solutions!","usp":"Good lighting that makes your home look and feel better.","niche":"People who want to make their home look and feel more modern and stylish."},{"title":"The Story Behind the Design","one_line_description":"Tell the story of how our unique furniture and decor pieces were made and designed.","hook":"Discover the story behind the design: a journey of passion and creativity!","usp":"Good, handcrafted furniture and decor that has a special story behind it.","niche":"People who want high-quality, unique products for their homes."},{"title":"Home Decor Hacks for Small Spaces","one_line_description":"Give tips and tricks for decorating small spaces and making them look bigger.","hook":"Get creative with our home decor hacks for small spaces!","usp":"Good, stylish furniture and decor that solves space problems and inspires creativity.","niche":"Young people who live in small homes or apartments and want decorating ideas."},{"title":"Unboxing: Experience the Quality","one_line_description":"Show our products in a way that feels like an unboxing experience, so people can see how good they are.","hook":"Experience the quality and craftsmanship of our products up close!","usp":"Good furniture and decor that meets and exceeds expectations.","niche":"People who want to buy products from a trusted, reliable brand."}]} </function>'}}
5
+ 2025-09-05 13:03:39,024 | ERROR | error_logger | api/routers/ideation.py:36 | Unable to execute the ideation: Error code: 400 - {'error': {'message': "Failed to call a function. Please adjust your prompt. See 'failed_generation' for more details.", 'type': 'invalid_request_error', 'code': 'tool_use_failed', 'failed_generation': '<function=JudgeResponseFormatter> {"selected_ideas": [{"title": "Room in a Minute", "one_line_description": "Turn an empty room into a cozy space in just 60 seconds.", "hook": "See a room change before your eyes!", "unique_selling_proposition": "Showcasing our products in a short, fun, and engaging way.", "scores": {"originality": 3.5, "fluency": 4.0, "flexibility": 3.0, "feasibility": 4.5, "practical_value": 3.5, "surprise_factor": 3.0, "combinatorial_novelty": 3.0, "simplicity": 3.5, "scalability": 4.0, "culture_freshness": 2.0, "alignment_with_business_details": 4.0}, "niche": "People who like home decor and want ideas for their homes."}, {"title": "Furniture Flip", "one_line_description": "Give old furniture a new life with easy and creative DIY tricks.", "hook": "Make old furniture look new again!", "unique_selling_proposition": "Showing how our customers get creative with our products.", "scores": {"originality": 2.5, "fluency": 3.0, "flexibility": 4.0, "feasibility": 4.5, "practical_value": 4.0, "surprise_factor": 2.0, "combinatorial_novelty": 2.0, "simplicity": 3.0, "scalability": 4.0, "culture_freshness": 3.0, "alignment_with_business_details": 4.0}, "niche": "People who want to decorate their homes without spending a lot of money."}, {"title": "Home Makeover Hacks", "one_line_description": "Simple and affordable tips to improve your home\'s look.", "hook": "Get the home you want without overspending!", "unique_selling_proposition": "Giving people practical advice to decorate their homes.", "scores": {"originality": 2.0, "fluency": 4.0, "flexibility": 4.0, "feasibility": 4.5, "practical_value": 4.5, "surprise_factor": 1.0, "combinatorial_novelty": 1.0, "simplicity": 4.0, "scalability": 4.0, "culture_freshness": 2.0, "alignment_with_business_details": 4.0}, "niche": "People who want to decorate their homes but don\'t have a lot of money."}, {"title": "Product Showcase Challenge", "one_line_description": "Our products are put to the test in a fun and creative way.", "hook": "Can our products really do what they say they can?", "unique_selling_proposition": "Showing how our products are strong and reliable.", "scores": {"originality": 4.0, "fluency": 3.0, "flexibility": 2.0, "feasibility": 3.5, "practical_value": 3.0, "surprise_factor": 4.0, "combinatorial_novelty": 4.0, "simplicity": 2.0, "scalability": 3.0, "culture_freshness": 4.0, "alignment_with_business_details": 4.0}, "niche": "People who want to buy furniture and appliances that will last."}, {"title": "Customer Testimonials", "one_line_description": "Real people share their experiences with our products.", "hook": "Hear what others have to say about our products!", "unique_selling_proposition": "Building trust with our customers by sharing their stories.", "scores": {"originality": 1.0, "fluency": 2.0, "flexibility": 2.0, "feasibility": 4.5, "practical_value": 4.0, "surprise_factor": 1.0, "combinatorial_novelty": 1.0, "simplicity": 2.0, "scalability": 2.0, "culture_freshness": 1.0, "alignment_with_business_details": 4.0}, "niche": "People who want to hear from others who have used our products."}, {"title": "Before and After Transformation", "one_line_description": "See the amazing changes our products can make in a room.", "hook": "The power of our products to transform a space!", "unique_selling_proposition": "Showing how our products can improve people\'s lives.", "scores": {"originality": 3.5, "fluency": 4.0, "flexibility": 3.0, "feasibility": 4.5, "practical_value": 4.5, "surprise_factor": 3.0, "combinatorial_novelty": 3.0, "simplicity": 3.5, "scalability": 4.0, "culture_freshness": 2.0, "alignment_with_business_details": 4.0}, "niche": "People who need inspiration and motivation to decorate their homes."}, {"title": "Decorating on a Budget", "one_line_description": "Creative and affordable ways to decorate your home.", "hook": "You don\'t have to spend a lot to decorate your dream home!", "unique_selling_proposition": "Giving people affordable and creative decorating ideas.", "scores": {"originality": 2.5, "fluency": 3.0, "flexibility": 4.0, "feasibility": 4.5, "practical_value": 4.5, "surprise_factor": 2.0, "combinatorial_novelty": 2.0, "simplicity": 3.0, "scalability": 4.0, "culture_freshness": 3.0, "alignment_with_business_details": 4.0}, "niche": "People who want to decorate their homes but are on a tight budget."}, {"title": "Home Organization Hacks", "one_line_description": "Easy and effective ways to declutter and organize your home.", "hook": "Get your home organized with these genius tips!", "unique_selling_proposition": "Offering practical advice to help people organize their homes.", "scores": {"originality": 2.0, "fluency": 4.0, "flexibility": 3.0, "feasibility": 4.5, "practical_value": 4.5, "surprise_factor": 1.0, "combinatorial_novelty": 1.0, "simplicity": 4.0, "scalability": 4.0, "culture_freshness": 2.0, "alignment_with_business_details": 4.0}]} </function>'}}
6
+ 2025-09-05 13:15:00,759 | ERROR | error_logger | api/routers/ideation.py:36 | Unable to execute the ideation: Error code: 400 - {'error': {'message': "tool call validation failed: parameters for tool IdeasSchema did not match schema: errors: [`/ideas/0`: missing properties: 'unique_selling_proposition', `/ideas/1`: missing properties: 'unique_selling_proposition', `/ideas/2`: missing properties: 'unique_selling_proposition', `/ideas/3`: missing properties: 'unique_selling_proposition', `/ideas/4`: missing properties: 'unique_selling_proposition', `/ideas/5`: missing properties: 'unique_selling_proposition', `/ideas/6`: missing properties: 'unique_selling_proposition', `/ideas/7`: missing properties: 'unique_selling_proposition']", 'type': 'invalid_request_error', 'code': 'tool_use_failed', 'failed_generation': '<function=IdeasSchema> {"ideas": [{ "title": "Turn a Room into a Cozy Oasis", "one_line_description": "Quickly and easily transform a dull room into a cozy and inviting space in just 60 seconds.", "hook": "Watch our magic happen!", "usp": "Get expert decorating tips and ideas for a fast room makeover", "niche": "People who own or rent homes and are looking for interior design inspiration", "metaphor": "A blank canvas becomes a beautiful work of art" }, { "title": "Give Old Furniture a New Life", "one_line_description": "Learn how to give old furniture a new look with simple and creative makeovers.", "hook": "See old furniture turn into amazing pieces in just a few minutes!", "usp": "Get cost-effective and eco-friendly ideas for updating your furniture", "niche": "People who love interior design and doing DIY projects", "metaphor": "A phoenix rises from the ashes" }, { "title": "Maximize Your Space", "one_line_description": "Discover clever and practical ways to make the most of your space and get rid of clutter.", "hook": "Say goodbye to clutter and hello to a more peaceful life!", "usp": "Get stylish and useful storage ideas for small spaces", "niche": "People who own or rent homes and struggle with storage space", "metaphor": "A puzzle piece fits perfectly into place" }, { "title": "Lighting Magic Happens", "one_line_description": "Learn how to transform your space with the right lighting and make a big impact.", "hook": "Watch as our lighting solutions make a big difference!", "usp": "Get expert lighting tips and product recommendations", "niche": "People who want to improve the ambiance of their home", "metaphor": "A light switch turns on a new perspective" }, { "title": "Fitting the Perfect Furniture", "one_line_description": "See how our products fit together to create the perfect room and discover your new favorite furniture sets.", "hook": "The ultimate furniture matching game!", "usp": "Get product recommendations based on your room style and decor", "niche": "People who are looking for furniture sets and inspiration", "metaphor": "A jigsaw puzzle comes together to form a beautiful picture" }, { "title": "A Behind-the-Scenes Look", "one_line_description": "Get an exclusive look at our products, designs, and manufacturing process and see how we make our best-selling products.", "hook": "The making of our best-selling products!", "usp": "Experience our transparent and engaging brand", "niche": "People who care about the authenticity of products", "metaphor": "A curtain opens to reveal a secret world" }, { "title": "Take a Home Tour", "one_line_description": "Step into our showrooms and see our products in action, and get inspired by our beautiful home decor displays.", "hook": "Get inspired by our stunning home decor displays!", "usp": "Experience our visually appealing and engaging brand", "niche": "People who are looking for interior design ideas and inspiration", "metaphor": "A key unlocks the door to a beautiful home" }, { "title": "Real People, Real Transformed Spaces", "one_line_description": "See how our products have helped real people transform their lives and their homes.", "hook": "Real stories, real transformations, and real people!", "usp": "Get social proof and customer testimonials", "niche": "People who are interested in user-generated content and want to see real results", "metaphor": "A snapshot of a beautiful memory" }]} </function>'}}
7
+ 2025-09-05 13:30:41,237 | ERROR | error_logger | api/routers/ideation.py:36 | Unable to execute the ideation: Error code: 400 - {'error': {'message': "Failed to call a function. Please adjust your prompt. See 'failed_generation' for more details.", 'type': 'invalid_request_error', 'code': 'tool_use_failed', 'failed_generation': '<function=JudgeResponseFormatter> is required to evaluate the given output with the provided business details and the scoring rules.\n\nHowever, the information of image is missing, hence this cannot be completed\n\nIf you provide the image information, we can proceed with the evaluation.\n\nHowever, if you want to proceed with the evaluation of the 10 ideas against the scoring rules, we can do that without the image information. Here is the JSON response for the evaluation of the 10 ideas:\n\n```json\n{\n "analysis": {\n "topics_keywords": [{"topic": "furniture", "sentiment_towards": "positive"}, {"topic": "home decoration", "sentiment_towards": "positive"}],\n "entities": [{"text": "New York Build Expo", "type": "EVENT", "sentiment_towards": "positive"}, {"text": "Instagram", "type": "PLATFORM", "sentiment_towards": "positive"}, {"text": "TikTok", "type": "PLATFORM", "sentiment_towards": "positive"}],\n "analysis_summary": {\n "overall_intent": "Information Sharing",\n "dominant_emotion": "Joy",\n "toxicity_classification": "NON_TOXIC",\n "brand_safety_flags": ["SENSITIVE_SOCIAL_ISSUE"]\n }\n },\n "classification": {\n "high_level_category": "News & Politics",\n "category_confidence": 0.0\n }\n}\n\n```\n\nHowever, this is just a general analysis of the given text and does not evaluate the 10 ideas against the scoring rules.\n\nHere is the evaluation of the 10 ideas against the scoring rules:\n\n1. **Flip & Reveal**\n - **Total Score:** 7.8/10\n - **Alignment with business details:** 4/5\n\n2. **Before & After: Budget-Friendly**\n - **Total Score:** 7.5/10\n - **Alignment with business details:** 4.5/5\n\n3. **Customer Showcase**\n - **Total Score:** 8.2/10\n - **Alignment with business details:** 5/5\n\n4. **Home Tour**\n - **Total Score:** 7.2/10\n - **Alignment with business details:** 4/5\n\n5. **Design Your Dream Home**\n - **Total Score:** 8.5/10\n - **Alignment with business details:** 5/5\n\nThe top 4 ideas with the highest total scores are:\n\n1. **Design Your Dream Home** (Total Score: 8.5/10)\n2. **Customer Showcase** (Total Score: 8.2/10)\n3. **Flip & Reveal** (Total Score: 7.8/10)\n4. **Before & After: Budget-Friendly** (Total Score: 7.5/10)'}}
8
+ 2025-09-05 13:31:48,514 | ERROR | error_logger | api/routers/ideation.py:36 | Unable to execute the ideation: Error code: 429 - {'error': {'message': 'Rate limit reached for model `llama-3.1-8b-instant` in organization `org_01j9qkn71ffkq90dmwzjrdh6pv` service tier `on_demand` on tokens per minute (TPM): Limit 6000, Used 6270, Requested 1662. Please try again in 19.326s. Need more tokens? Upgrade to Dev Tier today at https://console.groq.com/settings/billing', 'type': 'tokens', 'code': 'rate_limit_exceeded'}}
9
+ 2025-09-05 13:32:30,274 | ERROR | error_logger | api/routers/ideation.py:36 | Unable to execute the ideation: Error code: 400 - {'error': {'message': "Failed to call a function. Please adjust your prompt. See 'failed_generation' for more details.", 'type': 'invalid_request_error', 'code': 'tool_use_failed', 'failed_generation': '<function=JudgeResponseFormatter> {"selected_ideas": [{"hook": "Before-and-after magic!", "niche": "People who own or rent homes and need space-saving ideas.", "one_line_description": "Change a room in just 60 seconds by swapping one product.", "scores": {"originality": 3.5, "fluency": 4.0, "flexibility": 4.0, "feasibility": 5.0, "practical_value": 4.0, "surprise_factor": 3.0, "combinatorial_novelty": 3.5, "simplicity": 4.0, "scalability": 4.0, "culture_freshness": 3.5, "alignment_with_business_details": 4.0}, "title": "Flip My Space", "unique_selling_proposition": "We show how our products can be used in many different ways."}, {"hook": "See how it changes from modern to vintage!", "niche": "People who are interested in interior design and want unique pieces.", "one_line_description": "How one product can fit into different styles and periods.", "scores": {"originality": 4.0, "fluency": 4.0, "flexibility": 4.0, "feasibility": 4.0, "practical_value": 3.5, "surprise_factor": 4.0, "combinatorial_novelty": 4.5, "simplicity": 3.5, "scalability": 3.5, "culture_freshness": 4.5, "alignment_with_business_details": 4.0}, "title": "One Product, Many Looks", "unique_selling_proposition": "We highlight how our products can match different tastes and preferences."}, {"hook": "Unleash your creativity and build your ideal space!", "niche": "Homeowners and renters who need design ideas and practical solutions.", "one_line_description": "Imagine, design, and create your perfect home with our product showcase.", "scores": {"originality": 4.5, "fluency": 4.0, "flexibility": 4.0, "feasibility": 3.5, "practical_value": 5.0, "surprise_factor": 4.5, "combinatorial_novelty": 4.0, "simplicity": 3.5, "scalability": 4.0, "culture_freshness": 4.0, "alignment_with_business_details": 4.0}, "title": "Design My Dream Home", "unique_selling_proposition": "We inspire you to imagine your perfect home and show you our products."}, {"hook": "Time\'s running out, but we can do it!", "niche": "People who need quick and easy solutions to furnish their homes.", "one_line_description": "Can we furnish a room in just 10 minutes with our products?", "scores": {"originality": 3.0, "fluency": 4.0, "flexibility": 4.0, "feasibility": 4.0, "practical_value": 4.5, "surprise_factor": 4.0, "combinatorial_novelty": 3.0, "simplicity": 3.5, "scalability": 3.5, "culture_freshness": 3.5, "alignment_with_business_details": 4.0}, "title": "The Ultimate Room Challenge", "unique_selling_proposition": "We show how fast and easy it is to furnish a room with our products."}, {"hook": "Real people, real opinions, and real results!", "niche": "People who want to know what other customers think before making a purchase.", "one_line_description": "Honest feedback from our satisfied customers.", "scores": {"originality": 2.0, "fluency": 3.5, "flexibility": 3.5, "feasibility": 4.0, "practical_value": 4.0, "surprise_factor": 2.0, "combinatorial_novelty": 2.5, "simplicity": 4.0, "scalability": 4.0, "culture_freshness": 3.0, "alignment_with_business_details": 4.0}, "title": "Real Reviews", "unique_selling_proposition": "We build trust by showing you what our customers really think."}, {"hook": "Turn old things into new treasures!", "niche": "People who want unique and budget-friendly ideas for their homes.", "one_line_description": "Upcycle, repurpose, and get creative with our products.", "scores": {"originality": 4.5, "fluency": 4.0, "flexibility": 4.0, "feasibility": 4.0, "practical_value": 5.0, "surprise_factor": 4.5, "combinatorial_novelty": 4.5, "simplicity": 3.0, "scalability": 3.0, "culture_freshness": 4.5, "alignment_with_business_details": 3.0}, "title": "Get Creative", "unique_selling_proposition": "We show you how to make something old look new and exciting."}, {"hook": "Your style, our expertise – perfect together!", "niche": "People who need expert advice and style inspiration for their homes.", "one_line_description": "Find your ideal product and style with our expert advice.", "scores": {"originality": 3.5, "fluency": 4.5, "flexibility": 4.5, "feasibility": 4.0, "practical_value": 3.5, "surprise_factor": 3.5, "combinatorial_novelty": 4.0, "simplicity": 3.5, "scalability": 3.5, "culture_freshness": 4.0, "alignment_with_business_details": 4.0}, "title": "The Perfect Match", "unique_selling_proposition": "We help you find the perfect product for your home and style."}, {"hook": "Cozy up with the warmth of our products!", "niche": "People who want to create a warm and inviting atmosphere during the holidays.", "one_line_description": "Create a warm and inviting atmosphere with our products.", "scores": {"originality": 3.0, "fluency": 3.5, "flexibility": 3.5, "feasibility": 4.0, "practical_value": 4.0, "surprise_factor": 3.0, "combinatorial_novelty": 3.0, "simplicity": 3.5, "scalability": 3.5, "culture_freshness": 3.0, "alignment_with_business_details": 4.0}]} </function>'}}
10
+ 2025-09-05 13:38:49,467 | ERROR | error_logger | api/routers/ideation.py:36 | Unable to execute the ideation: Error code: 400 - {'error': {'message': "Failed to call a function. Please adjust your prompt. See 'failed_generation' for more details.", 'type': 'invalid_request_error', 'code': 'tool_use_failed', 'failed_generation': '<function=IdeasSchema>["ideas"]= [{"title": "Gear Up Challenge","one_line_description": "Turn a city person into a great trekker in just 60 seconds.","hook": "I\'m not brave, but watch me become one.","usp": "Showing that our trekking gear is very useful and lasts a long time.","niche": "People who love adventure and want to try trekking for the first time.","quick_humor": "A funny transformation from a lazy person to a mountain climber."}, {"title": "One Bag, Endless Possibilities","one_line_description": "See how our big backpacks can help you have a great adventure.","hook": "Can you guess how many things fit inside?","usp": "Highlighting that our backpacks are very spacious and organized.","niche": "People who love trekking and want to make their adventures more convenient.","quick_humor": "A surprising amount of gear that fits in a single bag."}, {"title": "Trekking Transformation","one_line_description": "Changing from a beginner to a great trekker in just 30 days.","hook": "My journey to becoming a good trekker.","usp": "Showing that our training programs and gear are very good.","niche": "People who want to learn trekking and have great adventures.","quick_humor": "Funny mistakes and hilarious moments from a trekking newbie."}, {"title": "Gear Review Reality Check","one_line_description": "Testing our gear to see if it can handle rough terrain.","hook": "Our gear vs. the wild: who wins?","usp": "Proving that our products are very durable and reliable.","niche": "People who love trekking and value good quality and performance.","quick_humor": "Gear getting destroyed in a funny and relatable way."}, {"title": "Trekking with a Purpose","one_line_description": "Join us on a mission to explore and help others.","hook": "How our gear helps make a difference.","usp": "Highlighting that our brand is responsible and helps the community.","niche": "People who love adventure and want to help others and the environment.","quick_humor": "Heartwarming moments of people helping each other on a trek."}, {"title": "Trekking Myths Busted","one_line_description": "Separating true and false information about trekking.","hook": "Don\'t believe the myths – here\'s the truth.","usp": "Teaching people about trekking safety, gear, and best practices.","niche": "New trekkers and people who want to learn and get better at trekking.","quick_humor": "Funny and relatable myths getting debunked on the spot."}, {"title": "Trekking Essentials","one_line_description": "The things you need to have for any trekking adventure.","hook": "What\'s in your backpack?","usp": "Showing the essential gear and products you need for trekking.","niche": "People who love trekking and want to know what to pack and prepare.","quick_humor": "Funny and helpful tips on what to bring on a trek."}, {"title": "Trek Like a Pro","one_line_description": "Expert tips to make you a great trekker.","hook": "Want to be a pro? Here\'s how.","usp": "Giving valuable advice and insights from experienced trekkers.","niche": "Experienced trekkers and people who want to improve their trekking skills.","quick_humor": "Hilarious and relatable moments from experienced trekkers."}]</function>'}}
11
+ 2025-09-05 13:42:14,450 | ERROR | error_logger | api/routers/ideation.py:36 | Unable to execute the ideation: Error code: 400 - {'error': {'message': "tool call validation failed: parameters for tool JudgeResponseFormatter did not match schema: errors: [`/selected_ideas/0/scores`: missing properties: 'culture_freshness', `/selected_ideas/1/scores`: missing properties: 'culture_freshness', `/selected_ideas/2/scores`: missing properties: 'culture_freshness', `/selected_ideas/3/scores`: missing properties: 'culture_freshness', `/selected_ideas/4/scores`: missing properties: 'culture_freshness', `/selected_ideas/5/scores`: missing properties: 'culture_freshness', `/selected_ideas/6/scores`: missing properties: 'culture_freshness', `/selected_ideas/7/scores`: missing properties: 'culture_freshness']", 'type': 'invalid_request_error', 'code': 'tool_use_failed', 'failed_generation': '<function=JudgeResponseFormatter> {"selected_ideas": [{"hook": "Watch the amazing transformation!", "niche": "People who love adventure and hiking, aged 18–45", "one_line_description": "See how our gear can help you go from city life to a hiking adventure in just 60 seconds.", "title": "Get Ready for Adventure", "unique_selling_proposition": "We show you our strong and reliable trekking gear that will make your adventure unforgettable.", "scores": {"originality": 4.0, "fluency": 3.0, "flexibility": 3.0, "feasibility": 5.0, "practical_value": 4.0, "surprise_factor": 3.0, "combinatorial_novelty": 3.0, "simplicity": 2.0, "scalability": 3.0, "cultural_freshness": 3.0, "alignment_with_business_details": 4.0}}, {"hook": "Find out the secret to fueling your next adventure!", "niche": "People who love hiking and trying new foods", "one_line_description": "Discover the best meals to take on your backpacking trip.", "title": "Tasty Trekking Food", "unique_selling_proposition": "We introduce our lightweight, healthy, and delicious food options that are perfect for trekkers.", "scores": {"originality": 3.0, "fluency": 4.0, "flexibility": 3.0, "feasibility": 4.0, "practical_value": 5.0, "surprise_factor": 2.0, "combinatorial_novelty": 2.0, "simplicity": 3.0, "scalability": 3.0, "cultural_freshness": 3.0, "alignment_with_business_details": 4.0}}, {"hook": "Stay happy and dry on your outdoor adventures!", "niche": "New and experienced hikers", "one_line_description": "Learn how to stay dry and warm in the rain or sun.", "title": "Stay Dry, Stay Happy", "unique_selling_proposition": "Our waterproof and breathable gear will keep you comfortable in any weather.", "scores": {"originality": 2.0, "fluency": 3.0, "flexibility": 3.0, "feasibility": 4.0, "practical_value": 4.0, "surprise_factor": 2.0, "combinatorial_novelty": 2.0, "simplicity": 3.0, "scalability": 3.0, "cultural_freshness": 2.0, "alignment_with_business_details": 3.0}}, {"hook": "Get inspired by other adventure-seekers!", "niche": "People who love social media and hiking", "one_line_description": "Join our trekking community and share your hiking stories and photos.", "title": "Share Your Adventure", "unique_selling_proposition": "We encourage you to share your experiences and photos of you using our gear.", "scores": {"originality": 3.0, "fluency": 4.0, "flexibility": 3.0, "feasibility": 4.0, "practical_value": 5.0, "surprise_factor": 2.0, "combinatorial_novelty": 2.0, "simplicity": 3.0, "scalability": 3.0, "cultural_freshness": 3.0, "alignment_with_business_details": 3.0}}, {"hook": "Get ready for your first hike!", "niche": "New hikers and outdoor enthusiasts", "one_line_description": "Learn the basics of hiking and how to use our gear.", "title": "Trekking 101: A Beginner\'s Guide", "unique_selling_proposition": "We provide essential tips and gear recommendations for new hikers.", "scores": {"originality": 2.0, "fluency": 2.0, "flexibility": 3.0, "feasibility": 3.0, "practical_value": 3.0, "surprise_factor": 1.0, "combinatorial_novelty": 1.0, "simplicity": 2.0, "scalability": 2.0, "cultural_freshness": 2.0, "alignment_with_business_details": 2.0}}, {"hook": "Find out what our customers say about our gear!", "niche": "People who love hiking and gear", "one_line_description": "See what our customers really think about our gear.", "title": "Real Gear, Real Reviews", "unique_selling_proposition": "We show you honest reviews and ratings from satisfied customers.", "scores": {"originality": 1.0, "fluency": 2.0, "flexibility": 2.0, "feasibility": 4.0, "practical_value": 4.0, "surprise_factor": 1.0, "combinatorial_novelty": 1.0, "simplicity": 2.0, "scalability": 2.0, "cultural_freshness": 2.0, "alignment_with_business_details": 4.0}}, {"hook": "Get ready to challenge yourself and win!", "niche": "Adventure-seekers and social media influencers", "one_line_description": "Take the challenge and win amazing prizes for sharing your hiking adventures.", "title": "The Trekking Challenge", "unique_selling_proposition": "We encourage you to share your hiking stories and photos for a chance to win prizes.", "scores": {"originality": 3.0, "fluency": 4.0, "flexibility": 3.0, "feasibility": 4.0, "practical_value": 5.0, "surprise_factor": 3.0, "combinatorial_novelty": 2.0, "simplicity": 3.0, "scalability": 3.0, "cultural_freshness": 3.0, "alignment_with_business_details": 3.0}}, {"hook": "Join the sustainable hiking movement!", "niche": "People who care about the environment and hiking", "one_line_description": "Learn how to hike without harming the environment.", "title": "Hiking Sustainably", "unique_selling_proposition": "We show you eco-friendly hiking practices and gear recommendations.", "scores": {"originality": 3.0, "fluency": 3.0, "flexibility": 3.0, "feasibility": 4.0, "practical_value": 4.0, "surprise_factor": 2.0, "combinatorial_novelty": 2.0, "simplicity": 3.0, "scalability": 3.0, "cultural_freshness": 4.0, "alignment_with_business_details": 3.0}}]}</function>'}}
12
+ 2025-09-07 11:33:16,469 | ERROR | error_logger | api/routers/ideation.py:36 | Unable to execute the ideation: Error code: 429 - {'error': {'message': 'You exceeded your current quota, please check your plan and billing details. For more information on this error, read the docs: https://platform.openai.com/docs/guides/error-codes/api-errors.', 'type': 'insufficient_quota', 'param': None, 'code': 'insufficient_quota'}}
13
+ 2025-09-11 11:29:51,006 | ERROR | error_logger | api/routers/ideation.py:36 | Unable to execute the ideation: Error code: 429 - {'error': {'message': 'You exceeded your current quota, please check your plan and billing details. For more information on this error, read the docs: https://platform.openai.com/docs/guides/error-codes/api-errors.', 'type': 'insufficient_quota', 'param': None, 'code': 'insufficient_quota'}}
14
+ 2025-09-11 11:47:04,225 | ERROR | error_logger | api/routers/ideation.py:36 | Unable to execute the ideation: Error code: 429 - {'error': {'message': 'Rate limit reached for model `openai/gpt-oss-120b` in organization `org_01j9qkn71ffkq90dmwzjrdh6pv` service tier `on_demand` on tokens per minute (TPM): Limit 8000, Used 9371, Requested 2391. Please try again in 28.2155s. Need more tokens? Upgrade to Dev Tier today at https://console.groq.com/settings/billing', 'type': 'tokens', 'code': 'rate_limit_exceeded'}}
15
+ 2025-09-12 12:08:16,551 | ERROR | error_logger | api/routers/ideation.py:38 | Unable to execute the ideation: Error code: 429 - {'error': {'message': 'Rate limit reached for model `openai/gpt-oss-120b` in organization `org_01j9qkn71ffkq90dmwzjrdh6pv` service tier `on_demand` on tokens per minute (TPM): Limit 8000, Used 10081, Requested 2336. Please try again in 33.128s. Need more tokens? Upgrade to Dev Tier today at https://console.groq.com/settings/billing', 'type': 'tokens', 'code': 'rate_limit_exceeded'}}
16
+ 2025-09-12 12:13:29,074 | ERROR | error_logger | api/routers/ideation.py:38 | Unable to execute the ideation: 1 validation error for State
17
+ scores.0
18
+ Input should be a valid dictionary [type=dict_type, input_value=Score(originality=4.5, feasibility=5.0), input_type=Score]
19
+ For further information visit https://errors.pydantic.dev/2.11/v/dict_type
20
+ 2025-09-12 12:24:28,953 | ERROR | error_logger | api/routers/ideation.py:39 | Unable to execute the ideation: Error code: 400 - {'error': {'message': "Tool call validation failed: tool call validation failed: parameters for tool IdeasSchema did not match schema: errors: [`/ideas/0`: missing properties: 'one_line_description', `/ideas/1`: missing properties: 'one_line_description', `/ideas/2`: missing properties: 'one_line_description', `/ideas/3`: missing properties: 'one_line_description', `/ideas/4`: missing properties: 'one_line_description', `/ideas/5`: missing properties: 'one_line_description', `/ideas/6`: missing properties: 'one_line_description', `/ideas/7`: missing properties: 'one_line_description']", 'type': 'invalid_request_error', 'code': 'tool_use_failed', 'failed_generation': '{"name": "IdeasSchema", "arguments": {\n "ideas": [\n {\n "hook": "A phone‑held umbrella flips, water splashes—will the gear stay dry?",\n "niche": "Hikers who walk in areas with heavy rain.",\n "one-line_description": "Pour a lot of water on the jacket and shoes to show they stay dry.",\n "title": "Rain Test",\n "unique_selling_proposition": "Completely waterproof, breathable material that keeps you dry in any storm."\n },\n {\n "hook": "From office shoes to mountain grip in 5 seconds—watch the change!",\n "niche": "City hikers who love weekend trips.",\n "one-line_description": "Change ordinary sneakers to trekking shoes while running up city stairs.",\n "title": "Gear Switch",\n "unique_selling_proposition": "Soles with strong grip that make any step feel like climbing a mountain."\n },\n {\n "hook": "Can you fit a tent, stove, and water in one bag? Watch the magic happen!",\n "niche": "Backpackers who want very compact packing tricks.",\n "one-line_description": "Pack a whole day’s trek into a backpack in 30 seconds, fitting everything perfectly.",\n "title": "Backpack Tetris",\n "unique_selling_proposition": "Expandable, comfortable design that fits more without bulging."\n },\n {\n "hook": "From base to sunrise in 30 seconds—gear stays fresh the whole way.",\n "niche": "Adventure photographers who chase early‑morning light.",\n "one-line_description": "Fast‑forward climb of a local hill wearing the full gear line, ending with sunrise.",\n "title": "30‑Sec Summit",\n "unique_selling_proposition": "Lightweight, temperature‑controlling clothing for quick climbs."\n },\n {\n "hook": "Will it crack? Slow‑mo view of impact and zero damage!",\n "niche": "Extreme hikers who test gear on rough ground.",\n "one-line_description": "Drop a trekking boot from a balcony onto rocky ground—still looks brand new.",\n "title": "Boot Drop",\n "unique_selling_proposition": "Strong toe and sole that survive drops from any height."\n },\n {\n "hook": "Who reaches the peak first? The surprise is in the load!",\n "niche": "Competitive trail runners and fitness hikers.",\n "one-line_description": "Two hikers race up a steep trail—one with heavy gear, one with the brand’s feather‑light set.",\n "title": "Lightweight Duel",\n "unique_selling_proposition": "Very light materials that cut tiredness by half."\n },\n {\n "hook": "Watch the tent come alive with LED‑lined seams as darkness falls.",\n "niche": "Solo campers and night hikers who need safety lights.",\n "one-line_description": "Set up a tent at dusk using only the brand’s gear, then show a glowing interior.",\n "title": "Night Camp Glow",\n "unique_selling_proposition": "Built‑in reflective stitching and LED pockets for night visibility."\n },\n {\n "hook": "Every step reduces your footprint—see the numbers fall in real time!",\n "niche": "Environment‑aware hikers and green travelers.",\n "one-line_description": "Show a carbon‑count meter dropping as a hiker switches to sustainable gear.",\n "title": "Eco Footprint",\n "unique_selling_proposition": "Eco‑friendly materials and recyclable packaging."\n }\n ]\n}}'}}
21
+ 2025-09-14 12:22:39,898 | ERROR | error_logger | api/routers/ideation.py:39 | Unable to execute the ideation: 1 validation error for FunctionMessage
22
+ name
23
+ Field required [type=missing, input_value={'content': "The scores a...usiness_details': 5.0}"}, input_type=dict]
24
+ For further information visit https://errors.pydantic.dev/2.11/v/missing
25
+ 2025-09-14 12:26:53,467 | ERROR | error_logger | api/routers/ideation.py:39 | Unable to execute the ideation: Error code: 400 - {'error': {'message': "Tool call validation failed: tool call validation failed: parameters for tool IdeasSchema did not match schema: errors: [`/ideas/0`: missing properties: 'one_line_description', `/ideas/1`: missing properties: 'one_line_description', `/ideas/2`: missing properties: 'one_line_description', `/ideas/3`: missing properties: 'one_line_description', `/ideas/4`: missing properties: 'one_line_description', `/ideas/5`: missing properties: 'one_line_description', `/ideas/6`: missing properties: 'one_line_description', `/ideas/7`: missing properties: 'one_line_description']", 'type': 'invalid_request_error', 'code': 'tool_use_failed', 'failed_generation': '{"name": "IdeasSchema", "arguments": {\n "ideas": [\n {\n "hook": "Can a storm make this jacket glow?",\n "niche": "Adventure fans who love tech gear and viral weather challenges",\n "one-line_description": "Film a sudden rain burst on the jacket while a drone shows water beading and a hidden rainbow LED strip lighting up.",\n "title": "Rainstorm Reveal",\n "unique_selling_proposition": "Special water‑proof fabric + built‑in LED strip that lights up when it gets wet."\n },\n {\n "hook": "Feel the pack lift you—literally!",\n "niche": "Backpackers who want high‑tech gear for long trips",\n "one-line_description": "Put 10\u202fkg of rocks on a scale, then swap to the brand backpack; a hidden magnetic levitation plate makes the scale read almost zero.",\n "title": "Zero‑Gravity Pack",\n "unique_selling_proposition": "Very light carbon‑fiber frame with a patented weight‑distribution system that feels weightless."\n },\n {\n "hook": "Step in mud, watch it disappear like magic!",\n "niche": "Hikers on slippery, muddy trails who love visual tricks",\n "one-line_description": "Step into fresh mud with regular shoes, then change to the new pair whose heat‑changing soles melt the mud away in seconds.",\n "title": "Mud‑Vanishing Soles",\n "unique_selling_proposition": "Heat‑activated quick‑dry sole that repels mud and shows hidden trail map graphics."\n },\n {\n "hook": "Your gear lights up with the sunrise—watch the show!",\n "niche": "Early‑rise trekkers and TikTok creators who chase sunrise looks",\n "one-line_description": "Climb a ridge at dawn; as the sun hits the jacket, its reflective trim syncs with a phone‑controlled light show.",\n "title": "Sunrise Sync",\n "unique_selling_proposition": "Smart reflective material that reacts to natural light and syncs via Bluetooth."\n },\n {\n "hook": "Can swapping gear double your pace?",\n "niche": "Competitive hikers and trail‑runners who love data‑driven challenges",\n "one-line_description": "Two friends start a trail race, swap gear at the midpoint, and a split‑screen AI scores who gets faster after the swap.",\n "title": "Swap‑Sprint Challenge",\n "unique_selling_proposition": "Ergonomic design that instantly improves stride efficiency, proven by live AI data."\n },\n {\n "hook": "Watch a tent become a rescue home in a blink!",\n "niche": "Campers and animal‑loving adventurers who value speed and compassion",\n "one-line_description": "Fast‑forward setup of a pop‑up tent that turns into a small shelter for a rescue dog, all in exactly 60 seconds.",\n "title": "60‑Second Pop‑Up",\n "unique_selling_proposition": "One‑hand pop‑up system with a built‑in pet‑friendly compartment."\n },\n {\n "hook": "Can you find the secret pocket before the beat drops?",\n "niche": "Travelers and TikTok creators who love fast, music‑driven challenges",\n "one-line_description": "Blindfolded, you must find a hidden pocket to the beat of a viral TikTok song within 5 seconds.",\n "title": "Blind Pocket Beat",\n "unique_selling_proposition": "Smart pockets with touch‑feel icons that guide you with the rhythm."\n },\n {\n "hook": "Buy the jacket, watch a forest grow on your screen!",\n "niche": "Eco‑conscious hikers and Gen‑Z shoppers who love AR sustainability",\n "one-line_description": "Show the recycled‑fiber jacket, then scan a QR code to plant a virtual tree that grows in AR for every sale.",\n "title": "Tree‑Planting AR",\n "unique_selling_proposition": "100% recycled fabric + real‑time AR tree‑planting linked to a carbon‑neutral pledge."\n }\n ]\n}}'}}
26
+ 2025-09-14 13:28:05,400 | ERROR | error_logger | api/routers/ideation.py:45 | Unable to execute the ideation: 'normalized_ideas'
27
+ 2025-09-14 13:32:27,794 | ERROR | error_logger | api/routers/ideation.py:45 | Unable to execute the ideation: 1 validation error for State
28
+ unique_selected_ideas.0
29
+ Input should be a valid dictionary [type=dict_type, input_value=[{'hook': 'Can this jacke...n challenge to share.'}], input_type=list]
30
+ For further information visit https://errors.pydantic.dev/2.11/v/dict_type
31
+ 2025-09-14 13:32:58,353 | ERROR | error_logger | api/routers/ideation.py:45 | Unable to execute the ideation: 1 validation error for State
32
+ unique_selected_ideas.0
33
+ Input should be a valid dictionary [type=dict_type, input_value=[{'hook': 'Can this jacke...n challenge to share.'}], input_type=list]
34
+ For further information visit https://errors.pydantic.dev/2.11/v/dict_type
35
+ 2025-09-14 13:32:59,317 | ERROR | error_logger | api/routers/ideation.py:45 | Unable to execute the ideation: 1 validation error for State
36
+ unique_selected_ideas.0
37
+ Input should be a valid dictionary [type=dict_type, input_value=[{'hook': 'Can this jacke...n challenge to share.'}], input_type=list]
38
+ For further information visit https://errors.pydantic.dev/2.11/v/dict_type
39
+ 2025-09-14 13:45:20,056 | ERROR | error_logger | api/routers/ideation.py:45 | Unable to execute the ideation: 1 validation error for State
40
+ unique_selected_ideas.0
41
+ Input should be a valid dictionary [type=dict_type, input_value=[{'hook': 'Can my gear su...with special effects.'}], input_type=list]
42
+ For further information visit https://errors.pydantic.dev/2.11/v/dict_type
src/genai/analytics_chatbot/__init__.py ADDED
File without changes
src/genai/analytics_chatbot/agent.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from langgraph.graph import StateGraph, START, END
2
+ from langgraph.checkpoint.memory import MemorySaver
3
+ from .utils.state import State
4
+ from .utils.nodes import ChatbotNode
5
+
6
+ class ChatbotAgent:
7
+ def __init__(self):
8
+ self.memory = MemorySaver()
9
+
10
+ def chatbot_graph(self):
11
+ graph_builder= StateGraph(State)
12
+ graph_builder.add_node("chatbot", ChatbotNode().run)
13
+ graph_builder.add_edge(START, "chatbot")
14
+ graph_builder.add_edge("chatbot", END)
15
+
16
+ return graph_builder.compile(checkpointer=self.memory)
src/genai/analytics_chatbot/utils/__init__.py ADDED
File without changes
src/genai/analytics_chatbot/utils/api_knowledge.py ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import requests
2
+ import json
3
+
4
+ def generate_api_knowledge(base_url: str):
5
+ """
6
+ Fetches FastAPI OpenAPI docs and summarizes endpoints, parameters, and descriptions.
7
+ Returns a JSON-friendly Python list of dicts, excluding the root endpoint.
8
+ """
9
+ resp = requests.get(f"{base_url}/openapi.json")
10
+ resp.raise_for_status()
11
+ spec = resp.json()
12
+
13
+ api_knowledge = []
14
+
15
+ for path, methods in spec["paths"].items():
16
+ if path == "/": # skip root endpoint
17
+ continue
18
+
19
+ for method, details in methods.items():
20
+ endpoint = path
21
+ description = details.get("description", "No description provided").strip()
22
+
23
+ # collect parameters
24
+ params = []
25
+ for param in details.get("parameters", []):
26
+ params.append(param.get("name"))
27
+
28
+ # requestBody can also have parameters
29
+ if "requestBody" in details:
30
+ try:
31
+ body_schema = (
32
+ details["requestBody"]["content"]["application/json"]["schema"]
33
+ )
34
+ if "properties" in body_schema:
35
+ params.extend(body_schema["properties"].keys())
36
+ except Exception:
37
+ pass
38
+
39
+ api_knowledge.append({
40
+ "endpoint": endpoint,
41
+ "parameters": params,
42
+ "description": description
43
+ })
44
+
45
+ return api_knowledge
src/genai/analytics_chatbot/utils/nodes.py ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from langchain_core.messages import SystemMessage , HumanMessage , FunctionMessage
2
+ from .state import State
3
+ from .schemas import ResponseFormatter
4
+ from .prompts import chatbot_prompt
5
+ from .api_knowledge import generate_api_knowledge
6
+ from src.genai.utils.models_loader import llm_groq
7
+
8
+ class ChatbotNode:
9
+ def __init__(self):
10
+ self.llm = llm_groq
11
+
12
+ def run(self, state:State):
13
+ template = chatbot_prompt()
14
+ knowledge_base = generate_api_knowledge('https://reveltrends.vercel.app')
15
+ messages = [SystemMessage(content=template), FunctionMessage(name='analytics-chatbot',content=str(knowledge_base))] + state["messages"]
16
+ result = self.llm.with_structured_output(ResponseFormatter).invoke(messages)
17
+ return {
18
+ "messages": [{"role": "assistant", "content": f'''The endpoint is: {result.endpoint}. The parameters are: {result.parameters}'''}],
19
+ "endpoint": result.endpoint,
20
+ "parameters": result.parameters,
21
+ }
src/genai/analytics_chatbot/utils/prompts.py ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ def chatbot_prompt():
2
+ return f"""
3
+ You are an intelligent assistant whose task is to route user queries to the correct API endpoint.
4
+ You have access to the API knowledge base, which contains information about each endpoint:
5
+ - The endpoint path
6
+ - Its required parameters
7
+ - A description of what the endpoint does
8
+
9
+ Your job is to:
10
+ 1. Read the user's natural language query.
11
+ 2. Analyze the API knowledge base.
12
+ 3. Identify the **most appropriate endpoint** that can satisfy the user's request.
13
+ 4. Determine the required parameters for that endpoint and fill in their values based on the user's query.
14
+ 5. Return the result in a **strict JSON format** exactly like this:
15
+
16
+ "endpoint": "<chosen endpoint path>",
17
+ "parameters":
18
+ "<param1>": "<value1>",
19
+ "<param2>": "<value2>"
20
+
21
+ Important instructions:
22
+ - Only return endpoints that exist in the API knowledge base.
23
+ - Include all required parameters for the endpoint.
24
+ - If a parameter is not specified in the user's query, return it as null.
25
+ - Do not add any extra explanation or text; return **only the JSON**.
26
+ - The API knowledge base will be provided as a separate function message.
27
+
28
+ Example:
29
+ User query: "Give me the buzz trend of influencer John for last month"
30
+ API knowledge: contains endpoint "/overview/buzz_trend" with parameters ["period", "influencer_username"]
31
+ Expected output:
32
+
33
+ "endpoint": "/api/v1/overview/buzz_trend",
34
+ "parameters":
35
+ "period": "monthly",
36
+ "influencer_username": "John"
37
+
38
+ Your response must always follow this exact JSON format.
39
+ """
40
+
src/genai/analytics_chatbot/utils/schemas.py ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ from pydantic import BaseModel, Field
2
+
3
+ class ResponseFormatter(BaseModel):
4
+ endpoint: str = Field(description='Return the exact endpoint from the knowledge base of endpoints.')
5
+ parameters: dict = Field(description='Return the dictionary of parameters to pass to the endpoint.')
src/genai/analytics_chatbot/utils/state.py ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ from pydantic import BaseModel, ConfigDict , Field
2
+ from typing import Annotated , TypedDict
3
+ from langgraph.graph.message import add_messages
4
+
5
+ class State(TypedDict):
6
+ messages: Annotated[list, add_messages]
7
+ endpoint: str
8
+ parameters: dict
src/genai/ideation_agent/agent.py CHANGED
@@ -1,6 +1,6 @@
1
  from langgraph.graph import StateGraph, START, END , MessagesState
2
  from .utils.state import State
3
- from .utils.nodes import RetrieverNode, IdeatorNode , CriticNode ,NormalizerNode, ValidatorNode , RoutingAfterValidation, JudgeNode1 , JudgeNode2, Aggregrator
4
  from langgraph.checkpoint.memory import MemorySaver
5
 
6
  class IdeationAgent:
@@ -11,7 +11,8 @@ class IdeationAgent:
11
  graph_builder= StateGraph(State)
12
  graph_builder.add_node("retriever", RetrieverNode().run)
13
  graph_builder.add_node("ideator", IdeatorNode().run)
14
- # graph_builder.add_node("critic", CriticNode().run)
 
15
  graph_builder.add_node("normalizer",NormalizerNode().run)
16
  graph_builder.add_node("judge1", JudgeNode1().run)
17
  graph_builder.add_node("judge2", JudgeNode2().run)
@@ -20,8 +21,9 @@ class IdeationAgent:
20
 
21
  graph_builder.add_edge(START, "retriever")
22
  graph_builder.add_edge("retriever", "ideator")
23
- # graph_builder.add_edge("ideator", "critic")
24
- graph_builder.add_edge("ideator", "normalizer")
 
25
  graph_builder.add_edge("normalizer", "judge1")
26
  graph_builder.add_edge("normalizer","judge2")
27
  graph_builder.add_edge("judge1", "aggregrator")
 
1
  from langgraph.graph import StateGraph, START, END , MessagesState
2
  from .utils.state import State
3
+ from .utils.nodes import RetrieverNode, IdeatorNode , ModeratorNode ,NormalizerNode, ValidatorNode , RoutingAfterValidation, JudgeNode1 , JudgeNode2, Aggregrator, SimplifierNode
4
  from langgraph.checkpoint.memory import MemorySaver
5
 
6
  class IdeationAgent:
 
11
  graph_builder= StateGraph(State)
12
  graph_builder.add_node("retriever", RetrieverNode().run)
13
  graph_builder.add_node("ideator", IdeatorNode().run)
14
+ graph_builder.add_node("moderator", ModeratorNode().run)
15
+ graph_builder.add_node("simplifier", SimplifierNode().run)
16
  graph_builder.add_node("normalizer",NormalizerNode().run)
17
  graph_builder.add_node("judge1", JudgeNode1().run)
18
  graph_builder.add_node("judge2", JudgeNode2().run)
 
21
 
22
  graph_builder.add_edge(START, "retriever")
23
  graph_builder.add_edge("retriever", "ideator")
24
+ graph_builder.add_edge("ideator", "moderator")
25
+ graph_builder.add_edge("moderator", "simplifier")
26
+ graph_builder.add_edge("simplifier", "normalizer")
27
  graph_builder.add_edge("normalizer", "judge1")
28
  graph_builder.add_edge("normalizer","judge2")
29
  graph_builder.add_edge("judge1", "aggregrator")
src/genai/ideation_agent/utils/nodes.py CHANGED
@@ -2,9 +2,9 @@ import pandas as pd
2
  from .state import State , ValidationFormatter , CriticResponseFormatter
3
  from .tools import Retrieval
4
  from langgraph.prebuilt import create_react_agent
5
- from src.genai.utils.models_loader import ideator_llm, critic_llm , normalizer_llm , validator_llm , judge1_llm , judge2_llm
6
  from langchain_core.messages import SystemMessage , HumanMessage, FunctionMessage
7
- from .prompts import ideator_prompt_v3 , critic_prompt_v3 , improver_prompt , validator_prompt, judge_prompt
8
  from .schemas import ideation_json_schema , judge_response_json_schema
9
 
10
 
@@ -26,20 +26,48 @@ class IdeatorNode:
26
  self.llm = ideator_llm
27
 
28
  def run(self, state:State):
29
- template = ideator_prompt_v3()
30
  messages = [SystemMessage(content=template),
31
  HumanMessage(content=f'''The business_details is\n{state.business_details[-1]}\n
32
  The information of the image is:\n{state.image_caption[-1]}'''),]
33
  # FunctionMessage(name='imdb_ideas_function', content=f'''The data of imdb movies description is:\n {state.imdb_data[-1]}\n''')]
34
  response = self.llm.invoke(messages)
35
  print('Ideator Response:', response.content)
 
36
  state.ideator_response.append(str(response.content))
37
- df = pd.read_csv('src/genai/utils/data/ideas.csv')
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  df = pd.concat([df, pd.DataFrame({
39
  'BusinessDetails': [state.business_details[-1]],
40
- 'Ideas': [state.ideator_response[-1]]
41
  })], ignore_index=True)
42
- df.to_csv('src/genai/utils/data/ideas.csv')
43
  print('Ideator Node executed')
44
  return state
45
 
@@ -49,7 +77,7 @@ class CriticNode:
49
  self.llm = critic_llm
50
 
51
  def run(self,state:State):
52
- template = critic_prompt_v3()
53
  messages = [SystemMessage(content=template),
54
  HumanMessage(content=f'''The ideas generated by ideator are:\n{state.ideator_response[-1]}\n.
55
  The business_details is\n{state.business_details[-1]}\n
@@ -67,7 +95,7 @@ class NormalizerNode:
67
  self.llm = normalizer_llm
68
 
69
  def run(self, state:State):
70
- response = self.llm.with_structured_output(ideation_json_schema).invoke(str(state.ideator_response[-1]))
71
  state.normalizer_response.append(response)
72
  print('Normalizer Executed')
73
  return state
 
2
  from .state import State , ValidationFormatter , CriticResponseFormatter
3
  from .tools import Retrieval
4
  from langgraph.prebuilt import create_react_agent
5
+ from src.genai.utils.models_loader import ideator_llm, critic_llm , normalizer_llm , validator_llm , judge1_llm , judge2_llm , simplifier_llm , moderator_llm
6
  from langchain_core.messages import SystemMessage , HumanMessage, FunctionMessage
7
+ from .prompts import ideator_prompt ,critic_prompt, moderator_prompt , validator_prompt, judge_prompt, simplifier_prompt
8
  from .schemas import ideation_json_schema , judge_response_json_schema
9
 
10
 
 
26
  self.llm = ideator_llm
27
 
28
  def run(self, state:State):
29
+ template = ideator_prompt()
30
  messages = [SystemMessage(content=template),
31
  HumanMessage(content=f'''The business_details is\n{state.business_details[-1]}\n
32
  The information of the image is:\n{state.image_caption[-1]}'''),]
33
  # FunctionMessage(name='imdb_ideas_function', content=f'''The data of imdb movies description is:\n {state.imdb_data[-1]}\n''')]
34
  response = self.llm.invoke(messages)
35
  print('Ideator Response:', response.content)
36
+ print('The scores are:',state.scores[-1])
37
  state.ideator_response.append(str(response.content))
38
+ return state
39
+
40
+ class ModeratorNode:
41
+ def __init__(self):
42
+ self.llm = moderator_llm
43
+
44
+ def run(self, state:State):
45
+ template = moderator_prompt()
46
+ messages = [SystemMessage(content=template),
47
+ HumanMessage(content=f'''The ideas generated by ideator are:\n{state.ideator_response[-1]}\n''' ),
48
+ FunctionMessage(name='moderator',content=f'''The scores are: \n {str(state.scores[-1])}''')]
49
+ response = self.llm.invoke(messages)
50
+ state.moderator_response.append(str(response.content))
51
+ print('Moderator Response:', state.moderator_response[-1])
52
+ return state
53
+
54
+
55
+ class SimplifierNode:
56
+ def __init__(self):
57
+ self.llm = simplifier_llm
58
+
59
+ def run(self, state:State):
60
+ template = simplifier_prompt()
61
+ messages = [SystemMessage(content=template), HumanMessage(content=f'''The ideas generated by ideator are:\n{state.moderator_response[-1]}\n''')]
62
+ response = self.llm.invoke(messages)
63
+ print('Simplifier Response:', response.content)
64
+ state.simplifier_response.append(str(response.content))
65
+ df = pd.read_csv('src/genai/utils/ideas/ideas.csv')
66
  df = pd.concat([df, pd.DataFrame({
67
  'BusinessDetails': [state.business_details[-1]],
68
+ 'Ideas': [state.simplifier_response[-1]]
69
  })], ignore_index=True)
70
+ df.to_csv('src/genai/utils/ideas/ideas.csv')
71
  print('Ideator Node executed')
72
  return state
73
 
 
77
  self.llm = critic_llm
78
 
79
  def run(self,state:State):
80
+ template = critic_prompt()
81
  messages = [SystemMessage(content=template),
82
  HumanMessage(content=f'''The ideas generated by ideator are:\n{state.ideator_response[-1]}\n.
83
  The business_details is\n{state.business_details[-1]}\n
 
95
  self.llm = normalizer_llm
96
 
97
  def run(self, state:State):
98
+ response = self.llm.with_structured_output(ideation_json_schema).invoke(str(state.simplifier_response[-1]))
99
  state.normalizer_response.append(response)
100
  print('Normalizer Executed')
101
  return state
src/genai/ideation_agent/utils/prompts.py CHANGED
@@ -1,4 +1,4 @@
1
- def ideator_prompt_v3():
2
  return f"""
3
  You are Ideasmith Pro, a world-class video ideator and social media content strategist, trusted by top global brands to craft crisp, simple, and high-impact short-form video concepts tailored for TikTok and Instagram Reels.
4
  Your task is to generate exactly 8 unique, highly creative video concepts (short, impactful idea seeds rather than full scripts). Each concept must be concise, visually striking, and easy to grasp at a glance.
@@ -13,12 +13,11 @@ Output Rules:
13
  - Respond in valid JSON format only.
14
  - Return an array of exactly 8 objects.
15
  - Each object must include 5 fields:
16
- 1. title Short, catchy and unique title: Not more than 3 words.
17
- 2. one_line_description A simple but very creative and unique one-liner description
18
- 3. hook The surprising or bold moment that makes the entire idea clicked to the business.
19
- 4. usp The unique selling proposition tied to the business
20
- 5. niche The specific target audience or market segment most likely to resonate with the video.
21
-
22
 
23
  Very Important Creative Guidelines:
24
  - Simple filming → All ideas must be easy to shoot with a phone camera, maybe with lights. No big studio setup.
@@ -51,7 +50,74 @@ idea_2:
51
  Generate creative and attention-grabbing video ideas that stand out. Each idea must include surprising elements, be far from generic, and be memorable for its originality and catchiness.
52
  """
53
 
54
- def critic_prompt_v3():
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
  return f"""
56
  You are a precision-focused, detail-oriented video ideas critic and ideas refiner.
57
  You’ve been assigned to critique and refine 8 video ideas created by another ideator.
@@ -144,305 +210,8 @@ The 10 ideas will be provided to you through HumanMessage.
144
  Give the output in json format.
145
  """
146
 
147
- def ideator_prompt_v2(state):
148
- return f"""
149
- You are a **precision-focused, culturally-attuned video ideator** trusted by top global brands to craft **crisp, reference-grounded, and high-impact video concepts** for social platforms like TikTok, Instagram, and YouTube.
150
-
151
- Your task is to create **exactly 4 highly original video ideas**, each in **exactly 40 words**.
152
- These are not scripts or taglines — they are **powerful conceptual seeds**: short, visual, emotionally charged ideas that can spark full videos.
153
-
154
- ---
155
-
156
- ### STRICT CREATIVE SOURCE:
157
- You are provided **10 reference creative ideas** retrieved from IMDb movie descriptions.
158
- These are your **ONLY valid creative source**.
159
- - You MUST carefully read, analyze, and mix elements from these 10 ideas.
160
- - Do not invent entirely new storylines beyond the styles, tones, emotions, and motifs in the IMDb ideas.
161
- - All creativity must come from **blending, reimagining, and recombining** parts of the 10 reference ideas.
162
- - Avoid hallucinating scenes or concepts that are unrelated to the references.
163
-
164
- ---
165
-
166
- ### Output Rules:
167
- - **4 final ideas** only.
168
- - Each idea must be **exactly 40 words**.
169
- - Each idea must be **very different** from the others in plot, tone, and visual feel.
170
- - Begin from an **unexpected or abstract scene**, but base it on the IMDb inspirations.
171
- - Conclude each idea in a way that subtly connects to the **business details** below.
172
- - Avoid repeating characters, settings, or themes across the 4 ideas.
173
- - Must be cinematic, visually vivid, and emotionally engaging.
174
-
175
- ---
176
-
177
- ### Business Details:
178
- {state.business_details[-1]}
179
-
180
- ---
181
-
182
- Now, based strictly on the 10 IMDb ideas provided to you as your creative dataset —
183
- **Analyze them, identify their story arcs, emotions, symbols, and pacing, then mix and adapt them into 4 completely original yet reference-rooted 40-word video concepts**.
184
- Do not draw from anything outside the provided IMDb ideas.
185
- Every idea must end in a subtle, creative tie-in to the business details.
186
- """
187
-
188
- def critic_prompt_v2(state):
189
- return f"""
190
- You are a **precision-focused, detail-oriented video idea critic**. You’ve been assigned to **critique 4 video ideas** created by another ideator and then **refine or improve them strictly based on reference material provided**.
191
-
192
- ---
193
-
194
- ### STRICT CREATIVE SOURCE:
195
- You are provided **10 reference creative ideas** retrieved from IMDb movie descriptions.
196
- These are your **ONLY valid creative source**.
197
- - All critique and improvements must be grounded in the tone, emotional beats, plot devices, and styles from these IMDb ideas.
198
- - You may mix or adapt elements from multiple IMDb ideas, but you must not invent unrelated concepts.
199
- - No hallucinations or off-reference scenarios.
200
-
201
- If **valid image information** is provided, it must strongly guide your improvements, as it represents the reference style the user wants.
202
-
203
- ---
204
-
205
- ### Your job:
206
- 1. **Identify flaws collectively** across the 4 original ideas — repetition, weak twist, dull opening, poor link to business details, lack of diversity, etc.
207
- 2. **Improve or replace** each idea while keeping it aligned with the IMDb references, ensuring strong cinematic depth and emotional impact.
208
- 3. Maintain the **original’s core** if it’s already good, but refine for clarity, pacing, or strength where possible.
209
-
210
- ---
211
-
212
- ### Very Important Creative Guidelines:
213
- - **Each improved idea must be exactly 40 words**.
214
- - Begin with an **unexpected or abstract plot, character, or visual scene** (inspired from IMDb references) — never directly with the business context.
215
- - Conclude each idea with a **creative and subtle tie-in** to the business details below.
216
- - The 4 improved ideas must be **completely diverse** in theme, tone, and visual feel.
217
- - Avoid repeating characters, locations, or similar situations across the 4 ideas.
218
- - Must be cinematic, visually vivid, emotionally resonant, and platform-native (Instagram/TikTok/YouTube).
219
- - Improvements must be **strictly reference-based** — no unrelated creativity.
220
-
221
- ---
222
-
223
- ### Business Details:
224
- {state.business_details[-1]}
225
-
226
- ### Original Ideas by Ideator:
227
- {state.ideator_response[-1]}
228
-
229
- ---
230
-
231
- **Format your response like this:**
232
-
233
- ---
234
- Faults: Faults in any of the 4 ideas of ideator
235
-
236
- ---
237
- Improved Ideas from Critic:
238
- **improved_first idea of 40 words**
239
- **improved_second idea of 40 words**
240
- **improved_third idea of 40 words**
241
- **improved_fourth idea of 40 words**
242
-
243
- ---
244
- """
245
-
246
-
247
- def ideator_prompt_v1(state):
248
- return f"""
249
- You are a **bold, imaginative, and culturally-attuned video ideator** trusted by top global brands to craft **crisp, original, and high-impact video concepts** for social platforms like TikTok, Instagram, and YouTube.
250
-
251
- Your task is to create **exactly 4 highly original video ideas**, each in **exactly 40 words**. These are not scripts or taglines — they are **powerful conceptual seeds**: short, visual, emotionally charged ideas that can spark full videos. Your ideas should feel fresh, scroll-stopping, and deeply resonant with today’s audiences.
252
-
253
- If some **valid and usable information** of image is provided to you by the user, you have to **strongly focus** on that information of image because that is the reference of what type of idea the user wants.
254
-
255
- ---
256
-
257
- ### Additional Context for Creativity:
258
- You have been provided **10 reference creative ideas** retrieved from IMDb movie descriptions.
259
- These are **NOT to be copied** but should be analyzed for:
260
- - Story arcs
261
- - Emotional beats
262
- - Character depth
263
- - Visual metaphors
264
- - Surprise elements or twists
265
- - Tone and pacing
266
-
267
- Let these references **inspire your style, mood, and narrative strength** while ensuring the final output is **completely original** and aligned to the business details.
268
- ---
269
-
270
- ### What is a 40-word video idea?
271
- A video idea is a **standalone, high-concept creative spark**. It hints at a compelling moment, scenario, or transformation — not the full story. It’s short, but strong enough to fuel the entire video direction.
272
-
273
- This differs from a full story in that:
274
- - You’re generating **4 completely distinct mini-concepts**, not one long arc.
275
- - Each idea stands alone — a unique emotional core.
276
- - Think in **cinematic micro-moments**, full of emotion, surprise, or visual contrast.
277
-
278
- ---
279
-
280
- ### Output & Formatting Guidelines:
281
- - Provide **exactly 4 ideas**, each in **exactly 40 words**.
282
- - Do **not** number or label the ideas.
283
- - Each idea should be a **self-contained, cinematic pitch** — visual, emotionally compelling, and easily translatable into video.
284
- - Avoid lists, taglines, or instructions. Focus on **visually-driven storytelling**.
285
- - Be **creative with characters, symbols, or twists** — do not simply rephrase the business info.
286
- - Start from **an unexpected or abstract scene**, character, or event — then subtly anchor it to the business concept in the conclusion.
287
- - Ensure every idea is **platform-native**, emotionally viral, and rooted in **the business details provided**.
288
-
289
- ---
290
-
291
- ### Very Important Reminder:
292
- - Do not start or portray the idea directly by the context of the business details. Start from entirely different plot, event, or character and conclude to the details at last making it creative and unique.
293
- - Every 4 ideas must be very diverse. They have to be completely different from each other.
294
- - NEVER use the contexts of business details as opening scenarios.
295
- - Avoid repeating similar character types — **Do not use same characters, workplace scenarios, or situations across the 4 ideas**.
296
- - Please think **out of the box** ideas. Surprise like a creative genius.
297
-
298
- ---
299
-
300
- **Business Details**:
301
- {state.business_details[-1]}
302
-
303
- ---
304
-
305
- Now, based on the business details above **and inspired by the 10 IMDb reference ideas**, generate **four original, 40-word promotional video ideas** that can inspire unforgettable video content.
306
- """
307
-
308
- def critic_prompt_v1(state):
309
- return f"""
310
- You are a sharp, imaginative, and detail-oriented **video idea critic**. You’ve been assigned to **critique 4 video ideas** created by another ideator and then **refine or improve** them.
311
- If some **valid and usuable information** of image is provided to you by the user, you have to **strongly focus** in that information of image because that is the reference of what type of idea does the user wants.
312
-
313
- ### Additional Creative Context:
314
- You have been provided **10 reference creative ideas** retrieved from IMDb movie descriptions.
315
- These are NOT to be copied, but they should inspire:
316
- - Emotional arcs
317
- - Visual metaphors
318
- - Unconventional openings
319
- - Twist endings
320
- - Pacing and tone
321
-
322
- Analyze these references to **elevate the quality** of your improvements, infusing cinematic depth and emotional impact into the final ideas.
323
-
324
-
325
- Your job is twofold:
326
- 1. **Identify flaws** (if any) in one or more of the ideas — repetition, weak twist, boring start, lack of connection to business, etc.
327
- 2. **Generate a better version** of each idea — keeping it true to the core if it’s already good, or replacing it if needed.
328
-
329
- ---
330
-
331
- ### Very Important Creative Guidelines:
332
-
333
- - **Each idea must be exactly 40 words**.
334
- - Ideas must start with an **unrelated or abstract plot, character, or situation** — never directly with the business context.
335
- - Please **Don't potray the business details in the beginning of the idea**. The business details have to come into picture as the main conclusion of the idea.
336
- - Every 4 ideas must be very diverse. They have to be completely different from each other.
337
- - Each idea must **creatively conclude** by connecting to the business.
338
- - **Avoid repeating** characters, locations, or similar scenarios across the four ideas.
339
- - **Refine only when needed**. If an original idea is already great, make light edits — don’t change it completely.
340
- - Make ideas **scroll-stopping**, emotional, and suitable for Instagram/TikTok/YouTube.
341
- - Do **not output critique per idea**. Instead, summarize faults collectively in one section if any.
342
-
343
-
344
- ---
345
-
346
-
347
- ### Business Details:
348
- {state.business_details[-1]}
349
-
350
- ### Original Ideas by Ideator:
351
- {state.ideator_response[-1]}
352
-
353
- ---
354
-
355
- **Format your response like this:**
356
-
357
- ---
358
- Faults: Faults in any of the 4 ideas of ideator
359
-
360
- ---
361
- Improved Ideas from Critic:
362
- **improved_first idea of 40 words**
363
- **improved_second idea of 40 words**
364
- **improved_third idea of 40 words**
365
-
366
- ---
367
- """
368
-
369
- def improver_prompt(state):
370
- disagreement_note = (
371
- f"**Note:** The previous version was not validated because:\n{state.disagreement_reason[-1]}\n"
372
- if len(state.disagreement_reason) > 0 else ""
373
- )
374
-
375
- return f"""
376
- You are a highly skilled, creative, and discerning **video concept improver**. Two previous agents — the *Ideator* and the *Critic* — have worked on this task. Now, it’s your job to **analyze both**, identify any faults in the *critic's refinements*, and deliver the **final, most powerful version** of the 4 video ideas.
377
- If some **valid and usuable information** of image is provided to you by the user, you have to **strongly focus** in that information of image because that is the reference of what type of idea does the user wants.
378
-
379
- ---
380
-
381
- ### Your Responsibilities:
382
-
383
- 1. **Read the original 4 ideas from the Ideator.**
384
- 2. **Read the improved 4 ideas from the Critic.**
385
- 4. Identify any issues in the *critic’s version*, such as:
386
- - Loss of originality from ideator's idea
387
- - Overcorrection or unnecessary replacement
388
- - Weak twists, lack of emotional resonance, dull opening
389
- - Repetition of themes, settings, characters across the 4 ideas
390
-
391
- You do **not need to critique the ideator again** — focus **only on identifying the issues in the critic's improved ideas**.
392
-
393
- 4. Then, write **your final improved version of the 4 ideas**, using the best elements from both versions (or inventing better ones).
394
- - Stick to **exactly 40 words per idea**
395
- - Start with a surprising or unrelated event/character/symbol
396
- - Conclude creatively with the business offering or mission
397
- - Ensure **diversity** between the 4 ideas — no repetition of theme, tone, or character
398
- - Refine only when needed. If the improved idea of critic is already great, make light edits or no edits — don’t change it completely.
399
- -
400
-
401
- ---
402
-
403
- ### Very Important Reminder:
404
- - Do not start or potray the idea directly by context of the business details. Start from entirely different plot , event or character and conclude to the details at last making it creative and unique just like in the example that includes coffee slipping before the date , earthquake surviving , security guard in the luxury mall etc. These starting plots differs from the clothing business but they creatively concluded at the end.
405
- - Every 4 ideas must be very diverse. They have to be completely different from each other.
406
- - NEVER use the contexts of business details as opening scenarios - Begin with completely unrelated situations like accidents, mysteries, competitions, discoveries, or social experiments. For eg: If the context is about restaurant don't start with chef, restaurant or related things directly.
407
- - Avoid repeating similar character types - **Do not use same characters , or same workplace scenarios, or same situations etc across the 4 ideas**.
408
- - Please **Don't potray the business details in the beginning of the idea**. The context of business details have to come into picture as the main conclusion of the idea.
409
- - Please think **Out of the box** ideas. Surprise like a creative genius. Your idea can never be thought by a simple human.
410
- ---
411
-
412
- ### Output Format (Strict):
413
-
414
- ---
415
- Faults: Faults in any of the 4 ideas of critic
416
-
417
- ---
418
- Improved Ideas from Improver:
419
- **improved_final_first idea of 40 words**
420
- **improved_final_second idea of 40 words**
421
- **improved_final_third idea of 40 words**
422
-
423
- ---
424
-
425
- ### Input:
426
-
427
- **Business Details**:
428
- {state.business_details[-1]}
429
-
430
- ---
431
-
432
- **Ideas from Ideator**:
433
- {state.ideator_response[-1]}
434
 
435
- ---
436
 
437
- **Faults of ideator and improved Ideas from Critic**:
438
- {state.critic_response[-1]}
439
-
440
- **{disagreement_note}**
441
-
442
- ---
443
-
444
- Now begin your final analysis and output your improved 4 ideas in the required format.
445
- """
446
 
447
 
448
  def validator_prompt(state):
@@ -480,27 +249,3 @@ Return exactly 2 things:
480
  2.**If not validated**, give a short, kind explanation (under 40 words) of what could be improved, or why isn't it validated.
481
  '''
482
 
483
- def idea_refinement_prompt():
484
- return """
485
- You are a creative idea refinement assistant. Your goal is to help the user finalize a single powerful short-form video idea for Instagram or TikTok by analyzing the four given ideas.
486
- The user will do some request to enhance their ideas. You have to creatively process their query analyzing the four given ideas and return the edited best idea.
487
-
488
- 🎯 Your Rules:
489
- 1. Clearly interpret the user's instruction.
490
- 2. Modify or combine ideas strictly based on what the user says.
491
- 3. If the user says "undo" or "go back", return the previous version exactly as it was.
492
- 4. **NEVER ask the user questions.** You only act and respond with an idea.
493
- 5. Do not generate random or new ideas. Only improve, combine, or revert.
494
- 6. Maintain a strong, clear, creative narrative in every version.
495
- 7. Ensure each output is refined, realistic, and aligned with promotional goals.
496
- 9. If you're processing more than one idea, make sure the plot flows very smoothly relating them.
497
-
498
- 📢 STRICT OUTPUT POLICY:
499
- - **Only return the current best idea as plain text.**
500
- - **No explanations, no headers, no labels.**
501
- - **Do not ask the user anything back.**
502
- - Remember, you have to give the response of your idea in **exactly 30 words**.
503
-
504
-
505
- You must function like a deterministic idea-refiner — each input must result in a single, story-rich output idea.
506
- """
 
1
+ def ideator_prompt():
2
  return f"""
3
  You are Ideasmith Pro, a world-class video ideator and social media content strategist, trusted by top global brands to craft crisp, simple, and high-impact short-form video concepts tailored for TikTok and Instagram Reels.
4
  Your task is to generate exactly 8 unique, highly creative video concepts (short, impactful idea seeds rather than full scripts). Each concept must be concise, visually striking, and easy to grasp at a glance.
 
13
  - Respond in valid JSON format only.
14
  - Return an array of exactly 8 objects.
15
  - Each object must include 5 fields:
16
+ 1. title : Short, catchy and unique title: Not more than 3 words.
17
+ 2. one_line_description : A simple but very creative and unique one-liner description
18
+ 3. hook : The surprising or bold moment that makes the entire idea clicked to the business.
19
+ 4. usp : The unique selling proposition tied to the business
20
+ 5. niche : The specific target audience or market segment most likely to resonate with the video.
 
21
 
22
  Very Important Creative Guidelines:
23
  - Simple filming → All ideas must be easy to shoot with a phone camera, maybe with lights. No big studio setup.
 
50
  Generate creative and attention-grabbing video ideas that stand out. Each idea must include surprising elements, be far from generic, and be memorable for its originality and catchiness.
51
  """
52
 
53
+ def moderator_prompt():
54
+ return f"""
55
+ You are Idea Moderator Pro, a world-class creative quality controller and content strategist.
56
+ Your role is to review and refine 8 short-form video ideas that were generated for TikTok/Instagram Reels.
57
+
58
+ You will be given:
59
+ 1. A list of 8 video ideas (each with title, one_line_description, hook, usp, niche, and metaphor).
60
+ 2. A set of evaluation scores for each idea across 10 metrics:
61
+ - originality: How new, rare, and innovative the idea is compared to typical social media content. [1.0=Very common, 2.0=Slight twist, 3.0=Moderately unique,4.0=Rare/innovative, 5.0=Completely new]
62
+ - fluency: How many different variations or executions of the idea can be made. [1.0=One-off, 2.0=Few vars, 3.0=Some, 4.0=Many contexts, 5.0=Endless remix]
63
+ - flexibility: How adaptable the idea is across different niches, creators, or content categories. [1.0=One niche, 2.0=Few creators, 3.0=Several niches, 4.0=Many categories, 5.0=Universal]
64
+ - feasibility: How easy or realistic it is to film using just a phone (and maybe lights). [1.0=Impossible, 2.0=Very hard, 3.0=Possible w/ effort, 4.0=Easy on phone, 5.0=Effortless]
65
+ - practical_value: How much useful, shareable, or viral value the idea provides to the viewer. [1.0=None, 2.0=Low, 3.0=Some, 4.0=High, 5.0=Very high/viral]
66
+ - surprise_factor: How unexpected or attention-grabbing the twist or hook is. [1.0=Predictable, 2.0=Mild, 3.0=Moderate, 4.0=Strong, 5.0=Shocking]
67
+ - combinatorial_novelty: How creatively the idea combines familiar elements in new ways. [1.0=Copy, 2.0=Slight remix, 3.0=Familiar combo, 4.0=Creative blend, 5.0=Radical fusion]
68
+ - scalability: How many times the idea can be repeated as a series or expanded into content formats. [1.0=One-time, 2.0=Few times, 3.0=Limited repeats, 4.0=Recurring, 5.0=Endless series]
69
+ - cultural_freshness: How well the idea connects to current trends, memes, or cultural conversations. [1.0=Outdated, 2.0=Stale, 3.0=Current common, 4.0=Fresh twist, 5.0=Trendsetting]
70
+ - alignment_with_business_details: How well the idea ties to the business details. [1.0=Very low alignment, 5.0=Perfect alignment]
71
+
72
+ **Your task:**
73
+ - Carefully compare each idea against its scores.
74
+ - If the idea clearly matches its scores → **keep the idea unchanged.**
75
+ - If the idea does not match its scores → **revise the idea so it better reflects the evaluation.**
76
+ Example:
77
+ - If originality=5 but the idea feels generic, make it radically fresh.
78
+ - If feasibility=2 but the idea is very easy to film, make it harder/complex to match.
79
+ - If cultural_freshness=4 but the idea seems outdated, update it with a trend twist.
80
+ - If alignment_with_business_details=5, ensure the idea ties perfectly with the business context.
81
+
82
+ **Important rules:**
83
+ - Keep the structure the same (title, one_line_description, hook, usp, niche, metaphor).
84
+ - Keep language **simple, clear, and catchy** (suitable for a high school student).
85
+ - Do not add or remove fields.
86
+ - Only change what is necessary to make the idea match the scores.
87
+ - Always return exactly 8 ideas.
88
+
89
+ **Output format:**
90
+ - Valid JSON array with 8 objects.
91
+ - Each object must have exactly these 5 fields:
92
+ 1. title
93
+ 2. one_line_description
94
+ 3. hook
95
+ 4. usp
96
+ 5. niche
97
+
98
+ You are not an ideator anymore. You are the moderator. You refine or approve.
99
+ """
100
+
101
+
102
+ def simplifier_prompt():
103
+ return f"""
104
+ You are a Language Simplifier.
105
+ Your task is to make the text easy to read and make understandable for peoplr like high school students and non-native English speakers if and only if the vocabularies are tough.
106
+ If the vocabularies are easy enough to be understandable by non-native english speakers, just leave it as it is.
107
+
108
+ Rules:
109
+
110
+ 1. Do not change or remove any ideas, meaning, or structure.
111
+ 2. Only make the vocabulary simler if needed. No problem if it becomes little bit long while simplifying
112
+ 3. Keep the same JSON format and all fields (title, one_line_description, hook, usp, niche).
113
+ 4. Do not add extra explanations. Only return the simplified JSON.
114
+ 5. Make sure every idea is easy to read, clear, and in plain English.
115
+
116
+ Input: JSON with 8 video ideas.
117
+ Output: The same JSON but with simplified, easy English.
118
+ """
119
+
120
+ def critic_prompt():
121
  return f"""
122
  You are a precision-focused, detail-oriented video ideas critic and ideas refiner.
123
  You’ve been assigned to critique and refine 8 video ideas created by another ideator.
 
210
  Give the output in json format.
211
  """
212
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
213
 
 
214
 
 
 
 
 
 
 
 
 
 
215
 
216
 
217
  def validator_prompt(state):
 
249
  2.**If not validated**, give a short, kind explanation (under 40 words) of what could be improved, or why isn't it validated.
250
  '''
251
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/genai/ideation_agent/utils/state.py CHANGED
@@ -5,9 +5,12 @@ from typing import Annotated
5
 
6
  class State(BaseModel):
7
  business_details : Annotated[list[dict],operator.add] = []
 
8
  influencers_data : Annotated[list[str],operator.add] = []
9
  imdb_data : Annotated[list[str],operator.add] = []
10
  ideator_response: Annotated[list[str],operator.add] = []
 
 
11
  critic_response: Annotated[list[str],operator.add] = []
12
  normalizer_response : Annotated[list[dict],operator.add] = []
13
  judge1_response : Annotated[list[dict],operator.add] = []
 
5
 
6
  class State(BaseModel):
7
  business_details : Annotated[list[dict],operator.add] = []
8
+ scores: Annotated[list[dict],operator.add] = []
9
  influencers_data : Annotated[list[str],operator.add] = []
10
  imdb_data : Annotated[list[str],operator.add] = []
11
  ideator_response: Annotated[list[str],operator.add] = []
12
+ moderator_response: Annotated[list[str],operator.add] = []
13
+ simplifier_response: Annotated[list[str],operator.add] = []
14
  critic_response: Annotated[list[str],operator.add] = []
15
  normalizer_response : Annotated[list[dict],operator.add] = []
16
  judge1_response : Annotated[list[dict],operator.add] = []
src/genai/utils/.DS_Store CHANGED
Binary files a/src/genai/utils/.DS_Store and b/src/genai/utils/.DS_Store differ
 
src/genai/utils/__pycache__/models_loader.cpython-313.pyc CHANGED
Binary files a/src/genai/utils/__pycache__/models_loader.cpython-313.pyc and b/src/genai/utils/__pycache__/models_loader.cpython-313.pyc differ
 
src/genai/utils/ideas/ideas.csv ADDED
The diff for this file is too large to render. See raw diff
 
src/genai/utils/models_loader.py CHANGED
@@ -16,19 +16,23 @@ login(os.environ['HUGGINGFACEHUB_ACCESS_TOKEN'])
16
  embedding_model = OpenAIEmbeddings(model="text-embedding-3-small", dimensions=1536)
17
  llm_anthropic = ChatAnthropic(model='claude-3-7-sonnet-latest', temperature=1)
18
  llm_gemini = ChatGoogleGenerativeAI(model="gemini-1.5-flash")
19
- llm_groq = ChatGroq(model="llama-3.1-8b-instant",temperature=0.7)
 
 
20
  llm_gpt = ChatOpenAI(model="gpt-4o-mini",temperature=0.3)
21
- llm_gpt_high = ChatOpenAI(model="gpt-5-nano",temperature=0.5)
22
 
23
  captioning_model = "meta-llama/llama-4-scout-17b-16e-instruct"
24
  image_generation_model = "black-forest-labs/FLUX.1-schnell"
25
 
26
- ideator_llm = llm_gpt_high
27
- critic_llm = llm_gpt_high
28
- normalizer_llm = llm_gpt
29
- validator_llm = llm_gpt
30
- judge1_llm = llm_gpt
31
- judge2_llm = llm_gpt
 
 
32
 
33
 
34
 
 
16
  embedding_model = OpenAIEmbeddings(model="text-embedding-3-small", dimensions=1536)
17
  llm_anthropic = ChatAnthropic(model='claude-3-7-sonnet-latest', temperature=1)
18
  llm_gemini = ChatGoogleGenerativeAI(model="gemini-1.5-flash")
19
+ llm_groq_openai = ChatGroq(model="openai/gpt-oss-120b",temperature=0.7)
20
+ llm_groq = ChatGroq(model="llama-3.3-70b-versatile",temperature=0.7)
21
+
22
  llm_gpt = ChatOpenAI(model="gpt-4o-mini",temperature=0.3)
23
+ llm_gpt_high = ChatOpenAI(model="gpt-4o-mini",temperature=0.5)
24
 
25
  captioning_model = "meta-llama/llama-4-scout-17b-16e-instruct"
26
  image_generation_model = "black-forest-labs/FLUX.1-schnell"
27
 
28
+ ideator_llm = llm_groq_openai
29
+ moderator_llm = llm_groq_openai
30
+ critic_llm = llm_groq
31
+ simplifier_llm = llm_groq
32
+ normalizer_llm = llm_groq
33
+ validator_llm = llm_groq
34
+ judge1_llm = llm_groq
35
+ judge2_llm = llm_groq
36
 
37
 
38