pvanand commited on
Commit
4336878
1 Parent(s): 355c471

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +5 -9
main.py CHANGED
@@ -91,10 +91,6 @@ 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 ImageInput(BaseModel):
95
- user_input: str = Query(default="market research", description="input query to output images")
96
- num_images: int = Query(default=5, description="Number of image links to output (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")
@@ -110,10 +106,10 @@ async def create_topics(input: TopicInput):
110
 
111
  @app.post("/generate_report")
112
  async def create_report(input: ReportInput):
113
- report = generate_report(input.topic, input.description) # You'll need to implement this function
114
  return {"report": report}
115
 
116
- @app.post("/get_images")
117
- async def get_images(input: ImageInput):
118
- images = get_images(input.user_input, input.num_images)
119
- 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 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")
 
106
 
107
  @app.post("/generate_report")
108
  async def create_report(input: ReportInput):
109
+ report = generate_report(input.topic, input.description)
110
  return {"report": report}
111
 
112
+ @app.post("/generate_report")
113
+ async def fetch_images(input: TopicInput):
114
+ images = get_images(input.topic, input.num_topics)
115
+ return {"images": images}