Spaces:
Sleeping
Sleeping
Update main.py
Browse files
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)
|
| 114 |
return {"report": report}
|
| 115 |
|
| 116 |
-
@app.post("/
|
| 117 |
-
async def
|
| 118 |
-
images = get_images(input.
|
| 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}
|