artificialguybr commited on
Commit
55d8c0e
1 Parent(s): ae1288e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -0
app.py CHANGED
@@ -88,7 +88,13 @@ def generate_knowledge_graph(api_key, user_input):
88
 
89
  response_data = completion.choices[0]["message"]["function_call"]["arguments"]
90
  print(response_data)
 
 
91
 
 
 
 
 
92
  # Visualizar o conhecimento usando Graphviz
93
  print("Gerando o conhecimento usando Graphviz...")
94
  dot = Digraph(comment="Knowledge Graph")
 
88
 
89
  response_data = completion.choices[0]["message"]["function_call"]["arguments"]
90
  print(response_data)
91
+ print("Type of response_data:", type(response_data))
92
+ print("Value of response_data:", response_data)
93
 
94
+ # Convert to dictionary if it's a string
95
+ if isinstance(response_data, str):
96
+ response_data = json.loads(response_data)
97
+
98
  # Visualizar o conhecimento usando Graphviz
99
  print("Gerando o conhecimento usando Graphviz...")
100
  dot = Digraph(comment="Knowledge Graph")