The agent engineering platform.
Python agentsaiai-agentsanthropicchatgptdeepagentsenterpriseframeworkgeminigenerative-ailangchainlanggraphllmmultiagentopen-sourceopenaipydanticpythonragtypescript
Docs: Change to async llm graph transformer (#31126)
Tomaz Bratanic6b6750967a3a
diff --git a/docs/docs/how_to/graph_constructing.ipynb b/docs/docs/how_to/graph_constructing.ipynbindex 44df5e99d7..5d33db58c4 100644--- a/docs/docs/how_to/graph_constructing.ipynb+++ b/docs/docs/how_to/graph_constructing.ipynb@@ -167,7 +167,7 @@"She was, in 1906, the first woman to become a professor at the University of Paris.\n","\"\"\"\n","documents = [Document(page_content=text)]\n",- "graph_documents = llm_transformer.convert_to_graph_documents(documents)\n",+ "graph_documents = await llm_transformer.aconvert_to_graph_documents(documents)\n","print(f\"Nodes:{graph_documents[0].nodes}\")\n","print(f\"Relationships:{graph_documents[0].relationships}\")"]@@ -205,7 +205,7 @@" allowed_nodes=[\"Person\", \"Country\", \"Organization\"],\n"," allowed_relationships=[\"NATIONALITY\", \"LOCATED_IN\", \"WORKED_AT\", \"SPOUSE\"],\n",")\n",- "graph_documents_filtered = llm_transformer_filtered.convert_to_graph_documents(\n",+ "graph_documents_filtered = await llm_transformer_filtered.aconvert_to_graph_documents(\n"," documents\n",")\n","print(f\"Nodes:{graph_documents_filtered[0].nodes}\")\n",@@ -245,7 +245,9 @@" allowed_nodes=[\"Person\", \"Country\", \"Organization\"],\n"," allowed_relationships=allowed_relationships,\n",")\n",- "graph_documents_filtered = llm_transformer_tuple.convert_to_graph_documents(documents)\n",+ "graph_documents_filtered = await llm_transformer_tuple.aconvert_to_graph_documents(\n",+ " documents\n",+ ")\n","print(f\"Nodes:{graph_documents_filtered[0].nodes}\")\n","print(f\"Relationships:{graph_documents_filtered[0].relationships}\")"]@@ -289,7 +291,9 @@" allowed_relationships=[\"NATIONALITY\", \"LOCATED_IN\", \"WORKED_AT\", \"SPOUSE\"],\n"," node_properties=[\"born_year\"],\n",")\n",- "graph_documents_props = llm_transformer_props.convert_to_graph_documents(documents)\n",+ "graph_documents_props = await llm_transformer_props.aconvert_to_graph_documents(\n",+ " documents\n",+ ")\n","print(f\"Nodes:{graph_documents_props[0].nodes}\")\n","print(f\"Relationships:{graph_documents_props[0].relationships}\")"]