Spaces:
Running
Running
Fix: Append uuid to mock persona names to prevent TinyTroupe naming collision
Browse files- backend/gradio_app.py +1 -1
- backend/routers/api.py +2 -2
backend/gradio_app.py
CHANGED
|
@@ -34,7 +34,7 @@ def run_simulation(sim_name, content_input, content_format, num_personas_sim, fo
|
|
| 34 |
job_registry.create_job(job_id)
|
| 35 |
|
| 36 |
# We mock fetch some personas for this UI interaction based on the count requested
|
| 37 |
-
mock_personas_data = [{"name": f"Agent {i}", "occupation": "Reviewer"} for i in range(int(num_personas_sim))]
|
| 38 |
|
| 39 |
tinytroupe_manager.run_simulation_async(
|
| 40 |
job_id,
|
|
|
|
| 34 |
job_registry.create_job(job_id)
|
| 35 |
|
| 36 |
# We mock fetch some personas for this UI interaction based on the count requested
|
| 37 |
+
mock_personas_data = [{"name": f"Agent {i}_{job_id[:4]}", "occupation": "Reviewer"} for i in range(int(num_personas_sim))]
|
| 38 |
|
| 39 |
tinytroupe_manager.run_simulation_async(
|
| 40 |
job_id,
|
backend/routers/api.py
CHANGED
|
@@ -18,8 +18,8 @@ async def start_simulation(request: SimulationRequest, background_tasks: Backgro
|
|
| 18 |
# In a real scenario, fetch personas from a DB/storage based on request.focus_group_id
|
| 19 |
# Here we simulate fetching 2 personas for the given focus group
|
| 20 |
mock_personas_data = [
|
| 21 |
-
{"name": "Tech Founder
|
| 22 |
-
{"name": "Tech Founder
|
| 23 |
]
|
| 24 |
|
| 25 |
background_tasks.add_task(
|
|
|
|
| 18 |
# In a real scenario, fetch personas from a DB/storage based on request.focus_group_id
|
| 19 |
# Here we simulate fetching 2 personas for the given focus group
|
| 20 |
mock_personas_data = [
|
| 21 |
+
{"name": f"Tech Founder 1_{job_id[:4]}", "occupation": "Software Engineer"},
|
| 22 |
+
{"name": f"Tech Founder 2_{job_id[:4]}", "occupation": "Product Manager"}
|
| 23 |
]
|
| 24 |
|
| 25 |
background_tasks.add_task(
|