Spaces:
Sleeping
Sleeping
Commit
·
da1776b
1
Parent(s):
96b0973
Updated main.py
Browse files
main.py
CHANGED
|
@@ -33,7 +33,7 @@ def business_chat(msg: UserMessage):
|
|
| 33 |
|
| 34 |
|
| 35 |
@app.post("/brainstrom")
|
| 36 |
-
def
|
| 37 |
query: List[str], # sent as JSON body
|
| 38 |
preferred_topics: Optional[list] = [],
|
| 39 |
images: Optional[List[UploadFile]] = [], # ✅ Optional UploadFile list
|
|
@@ -48,6 +48,7 @@ def run_graph(
|
|
| 48 |
'images': image_base64_list,
|
| 49 |
'latest_preferred_topics':preferred_topics,
|
| 50 |
'business_details': (lambda d: d['business_details'] if 'business_details' in d else {})(stored_data)
|
|
|
|
| 51 |
},
|
| 52 |
config={"configurable": {"thread_id": thread_id}})
|
| 53 |
stored_data['brainstroming_response']=result
|
|
@@ -57,7 +58,6 @@ def run_graph(
|
|
| 57 |
'response': result,
|
| 58 |
}
|
| 59 |
|
| 60 |
-
|
| 61 |
@app.post("/generate-final-story")
|
| 62 |
def generate_final_story_endpoint():
|
| 63 |
final_story = generate_final_story(stored_data["brainstroming_response"])
|
|
|
|
| 33 |
|
| 34 |
|
| 35 |
@app.post("/brainstrom")
|
| 36 |
+
def brainstroming_endpoint(
|
| 37 |
query: List[str], # sent as JSON body
|
| 38 |
preferred_topics: Optional[list] = [],
|
| 39 |
images: Optional[List[UploadFile]] = [], # ✅ Optional UploadFile list
|
|
|
|
| 48 |
'images': image_base64_list,
|
| 49 |
'latest_preferred_topics':preferred_topics,
|
| 50 |
'business_details': (lambda d: d['business_details'] if 'business_details' in d else {})(stored_data)
|
| 51 |
+
|
| 52 |
},
|
| 53 |
config={"configurable": {"thread_id": thread_id}})
|
| 54 |
stored_data['brainstroming_response']=result
|
|
|
|
| 58 |
'response': result,
|
| 59 |
}
|
| 60 |
|
|
|
|
| 61 |
@app.post("/generate-final-story")
|
| 62 |
def generate_final_story_endpoint():
|
| 63 |
final_story = generate_final_story(stored_data["brainstroming_response"])
|