Skip to content

Feature Request: Support node_properties/relationship_properties in LLMGraphTransformer for LLMs without native function calling #40

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
dhiaaeddine16 opened this issue Feb 2, 2025 · 3 comments

Comments

@dhiaaeddine16
Copy link

The LLMGraphTransformer class currently blocks usage of node_properties and relationship_properties parameters when using LLMs that lack native function calling capabilities. This restriction forces users to choose between:

  • Using lightweight/OSS LLMs without structured property enforcement, or
  • Requiring expensive/closed models with function calling support.
@pbrady
Copy link

pbrady commented Feb 3, 2025

I believe this would be addressed by #39 .

@dhiaaeddine16
Copy link
Author

Issue #39 is indeed useful for models that support function calling since it can help fix some formatting errors when specifying the method for with_structured_output. However, it's important to note that not all models support function calling due to provider constraints. For example, when using ToGher AI with the model meta-llama/Llama-3.3-70B-Instruct-Turbo-Free, you might encounter the following error:

BadRequestError: Error code: 400 - {'id': '', 'error': {'message': 'meta-llama/Llama-3.3-70B-Instruct-Turbo-Free is not supported for JSON mode/function calling', 'type': 'invalid_request_error', 'param': None, 'code': 'constraints_model'}}

Additionally, setting the parameter ignore_tool_usage to False forces the system to avoid using function calling.

Given these constraints, there is a clear need to implement a new prompt or mechanism that can gracefully handle models without function calling support. This new prompt should enable structured outputs without relying on function calling, ensuring compatibility with a broader range of models. Additionally, it must include the extraction of both node_properties and relationship_properties, so that users can still obtain detailed and structured data even when using models that do not natively support function calling.

@dhiaaeddine16
Copy link
Author

take a look at: LLMGraphTransformer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants