Skip to content

Commit 55d3a1c

Browse files
Merge pull request #188 from neo4j-labs/googlellmfix1
Fix JSON location in google llm
2 parents 0c0e6bd + 8e1728a commit 55d3a1c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

backend/src/gemini_llm.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def _extract_relationships(
158158
if not raw_schema["parsed"]:
159159
try:
160160
argument_json = json.loads(
161-
raw_schema["raw"].additional_kwargs["tool_calls"][0]["function"][
161+
raw_schema["raw"].additional_kwargs["function_call"][
162162
"arguments"
163163
]
164164
)
@@ -323,10 +323,10 @@ def get_graph_from_Gemini(model_version,
323323
nodes = [Node(id=id, type=type) for id,type in unique_nodes]
324324
graph_document[0].nodes=list(nodes)
325325

326-
for node in graph_document[0].nodes:
327-
node.id = node.id.title().replace(' ','_')
326+
#for node in graph_document[0].nodes:
327+
# node.id = node.id.title().replace(' ','_')
328328
#replace all non alphanumeric characters and spaces with underscore
329-
node.type = re.sub(r'[^\w]+', '_', node.type.capitalize())
329+
# node.type = re.sub(r'[^\w]+', '_', node.type.capitalize())
330330
graph_document_list.append(graph_document[0])
331331

332332
graph.add_graph_documents(graph_document_list)

0 commit comments

Comments
 (0)