Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -15,12 +15,12 @@ topic = st.text_input("Enter a topic to generate mind map:", "")
|
|
| 15 |
|
| 16 |
def generate_mindmap(topic):
|
| 17 |
prompt = f"Create a simple, structured mind map for the topic '{topic}'. Use bullet points to show sub-topics and indentation for hierarchy."
|
| 18 |
-
response = openai.
|
| 19 |
model="gpt-3.5-turbo",
|
| 20 |
messages=[{"role": "user", "content": prompt}],
|
| 21 |
temperature=0.7
|
| 22 |
)
|
| 23 |
-
return response
|
| 24 |
|
| 25 |
def build_graph_from_text(text):
|
| 26 |
G = nx.Graph()
|
|
|
|
| 15 |
|
| 16 |
def generate_mindmap(topic):
|
| 17 |
prompt = f"Create a simple, structured mind map for the topic '{topic}'. Use bullet points to show sub-topics and indentation for hierarchy."
|
| 18 |
+
response = openai.chat.completions.create(
|
| 19 |
model="gpt-3.5-turbo",
|
| 20 |
messages=[{"role": "user", "content": prompt}],
|
| 21 |
temperature=0.7
|
| 22 |
)
|
| 23 |
+
return response.choices[0].message.content
|
| 24 |
|
| 25 |
def build_graph_from_text(text):
|
| 26 |
G = nx.Graph()
|