Open th-cds opened 2 weeks ago
Thank you for addressing this issue. Would it be possible to provide an implementation or example using an OpenAI model as a baseline? This could help in identifying whether the issue lies within the model integration or the data handling within Gemini.
Hello, sure! The module LLMGraphTransformer is the same, the only thing that changes is:
from langchain_core.documents import Document
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(model_name='gpt-4o-mini',temperature=0, api_key=API_KEY)
llm_transformer = LLMGraphTransformer(llm=llm)
document = [Document(page_content='Anna was born in Australia.')]
graph_document = llm_transformer.convert_to_graph_documents(document)
Checked other resources
Example Code
Error Message and Stack Trace (if applicable)
Description
Hello, I've been trying to use LLMGraphTransformer with a model that is not from OpenAI, so I tried Google Gemini, however, I noticed that the result is always empty for nodes and relationships. So, I added this print statement of the raw_schema to check what was the reply from the LLM and I receive this error, so it looks like no Node or Relationship is created because the arguments to the DynamicGraph function are expected to be lists, but they are currently strings.
System Info
System Information
Package Information
Optional packages not installed
Other Dependencies