pvanand commited on
Commit
a59f7d5
1 Parent(s): e0b71ff

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +6 -2
main.py CHANGED
@@ -91,6 +91,10 @@ class TopicInput(BaseModel):
91
  num_topics: int = Query(default=5, description="Number of subtopics to generate (default: 5)")
92
  previous_queries: list[str] = Query(default=[], description="List of previous queries for context")
93
 
 
 
 
 
94
  class ReportInput(BaseModel):
95
  topic: str = Query(default="market research",description="The main topic for the report")
96
  description: str = Query(default="",description="A brief description of the topic")
@@ -110,6 +114,6 @@ async def create_report(input: ReportInput):
110
  return {"report": report}
111
 
112
  @app.post("/get_images")
113
- async def fetch_images(input: TopicInput):
114
- images = get_images(input.topic, input.num_topics)
115
  return {"images": images}
 
91
  num_topics: int = Query(default=5, description="Number of subtopics to generate (default: 5)")
92
  previous_queries: list[str] = Query(default=[], description="List of previous queries for context")
93
 
94
+ class imageInput(BaseModel):
95
+ user_input: str = Query(default="market research", description="input query to generate subtopics")
96
+ num_images: int = Query(default=5, description="Number of subtopics to generate (default: 5)")
97
+
98
  class ReportInput(BaseModel):
99
  topic: str = Query(default="market research",description="The main topic for the report")
100
  description: str = Query(default="",description="A brief description of the topic")
 
114
  return {"report": report}
115
 
116
  @app.post("/get_images")
117
+ async def fetch_images(input: imageInput):
118
+ images = get_images(input.topic, input.num_images)
119
  return {"images": images}