Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -48,10 +48,7 @@ def multi_perspective_brainstorming(query: str) -> str:
|
|
48 |
all_ideas.extend([f"{perspective['focus']}: {idea.strip()}" for idea in ideas if idea.strip()])
|
49 |
|
50 |
# Rank the ideas by simulating a consensus
|
51 |
-
ranking_prompt = (
|
52 |
-
f"From the following list of ideas, rank the top 5 based on creativity, feasibility, and impact for '{query}':\n"
|
53 |
-
f"{'\n'.join(all_ideas)}"
|
54 |
-
)
|
55 |
ranked_response = openai.chat.completions.create(
|
56 |
model="gpt-4o-mini",
|
57 |
messages=[
|
@@ -90,10 +87,7 @@ def realtime_collaborative_assistant(query: str) -> str:
|
|
90 |
expert_opinions.append(f"{expert['role']}: {response.choices[0].message.content}")
|
91 |
|
92 |
# Synthesize the responses into a cohesive answer
|
93 |
-
synthesis_prompt = (
|
94 |
-
f"Synthesize the following expert opinions into a concise, well-rounded response to the query '{query}':\n"
|
95 |
-
f"{'\n'.join(expert_opinions)}"
|
96 |
-
)
|
97 |
final_response = openai.chat.completions.create(
|
98 |
model="gpt-4o-mini",
|
99 |
messages=[
|
|
|
48 |
all_ideas.extend([f"{perspective['focus']}: {idea.strip()}" for idea in ideas if idea.strip()])
|
49 |
|
50 |
# Rank the ideas by simulating a consensus
|
51 |
+
ranking_prompt = "From the following list of ideas, rank the top 5 based on creativity, feasibility, and impact for '" + query + "':\n" + "\n".join(all_ideas)
|
|
|
|
|
|
|
52 |
ranked_response = openai.chat.completions.create(
|
53 |
model="gpt-4o-mini",
|
54 |
messages=[
|
|
|
87 |
expert_opinions.append(f"{expert['role']}: {response.choices[0].message.content}")
|
88 |
|
89 |
# Synthesize the responses into a cohesive answer
|
90 |
+
synthesis_prompt = "Synthesize the following expert opinions into a concise, well-rounded response to the query '" + query + "':\n" + "\n".join(expert_opinions)
|
|
|
|
|
|
|
91 |
final_response = openai.chat.completions.create(
|
92 |
model="gpt-4o-mini",
|
93 |
messages=[
|