Skip to content

Fix missing inclusion of neo4j_schema in custom prompt generation #256

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

Merged
merged 2 commits into from
Feb 3, 2025

Conversation

koyonkym
Copy link
Contributor

@koyonkym koyonkym commented Jan 23, 2025

Description

Fixed the Text2CypherRetriever initialization method so that the instance can hold neo4j_schema when custom_prompt is provided.

I assume some users might want to make a custom prompt based on DEFAULT_TEMPLATE, leaving parameters in it. When initializing the class with neo4j_schema, examples, and custom_prompt like above then searching query_text without prompt_params, examples is embedded in the prompt, but neo4j_schema is not. So I fixed this behavior so that both parameters are embedded in the prompt, which is more consistent.

Type of Change

  • New feature
  • Bug fix
  • Breaking change
  • Documentation update
  • Project configuration change

Complexity

Complexity: Low

How Has This Been Tested?

  • Unit tests
  • E2E tests
  • Manual tests

Checklist

The following requirements should have been met (depending on the changes in the branch):

  • Documentation has been updated
  • Unit tests have been updated
  • E2E tests have been updated
  • Examples have been updated
  • New files have copyright header
  • CLA (https://neo4j.com/developer/cla/) has been signed
  • CHANGELOG.md updated if appropriate

@koyonkym koyonkym requested a review from a team as a code owner January 23, 2025 14:08
@stellasia stellasia self-assigned this Jan 24, 2025
Copy link
Contributor

@stellasia stellasia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @koyonkym , Thank you for this PR, I think it makes sense indeed to use the schema when it's provided, similarly to the other parameters.

I think you need to rebase to fix the e2e tests (there was an issue with them that has been fixed after you opened your PR), after that we should be able to merge.

@koyonkym koyonkym force-pushed the fix/schema-in-t2c-custom-prompt branch from b04898c to 1b0f2e2 Compare January 30, 2025 13:08
@stellasia stellasia merged commit 1921dd5 into neo4j:main Feb 3, 2025
7 checks passed
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

Successfully merging this pull request may close these issues.

2 participants