Skip to content

Commit 1f5b8eb

Browse files
authored
Fix bug in Text2cypher custom prompt option (#115)
1 parent 3f705c7 commit 1f5b8eb

File tree

15 files changed

+272
-135
lines changed

15 files changed

+272
-135
lines changed

CHANGELOG.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
# @neo4j/neo4j-graphrag-python
22

33
## Next
4+
### Added
5+
- Add `template` validation in `PromptTemplate` class upon construction.
6+
- `custom_prompt` arg is now converted to `Text2CypherTemplate` class within the `Text2CypherRetriever.get_search_results` method.
7+
- `Text2CypherTemplate` and `RAGTemplate` prompt templates now require `query_text` arg and will error if it is not present. Previous `query_text` aliases may be used, but will warn of deprecation.
8+
- Fix bug in `Text2CypherRetriever` using `custom_prompt` arg where the `search` method would not inject the `query_text` content.
9+
- Add feature to include kwargs in `Text2CypherRetriever.search()` that will be injected into a custom prompt, if provided.
10+
- Add validation to `custom_prompt` parameter of `Text2CypherRetriever` to ensure that `query_text` placeholder exists in prompt.
411

512
## 0.6.3
613
### Changed
@@ -13,10 +20,6 @@
1320
- Updated documentation to include OpenAI and Vertex AI embeddings classes.
1421
- Added google-cloud-aiplatform as an optional dependency for Vertex AI embeddings.
1522

16-
### Fixed
17-
- Make `pygraphviz` an optional dependency - it is now only required when calling `pipeline.draw`.
18-
19-
2023
## 0.6.2
2124

2225
### Fixed
@@ -125,4 +128,4 @@
125128
### Fixed
126129

127130
- Updated documentation to include new custom exceptions.
128-
- Improved the use of Pydantic for input data validation for retriever objects.
131+
- Improved the use of Pydantic for input data validation for retriever objects.

docs/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,4 +191,4 @@ xml:
191191
pseudoxml:
192192
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
193193
@echo
194-
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
194+
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."

docs/source/api.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,4 +383,4 @@ PipelineStatusUpdateError
383383
=========================
384384

385385
.. autoclass:: neo4j_graphrag.experimental.pipeline.exceptions.PipelineStatusUpdateError
386-
:show-inheritance:
386+
:show-inheritance:

docs/source/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,4 +302,4 @@ Indices and tables
302302

303303
* :ref:`genindex`
304304
* :ref:`modindex`
305-
* :ref:`search`
305+
* :ref:`search`

docs/source/types.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,4 @@ SchemaRelation
8181
SchemaConfig
8282
============
8383

84-
.. autoclass:: neo4j_graphrag.experimental.components.schema.SchemaConfig
84+
.. autoclass:: neo4j_graphrag.experimental.components.schema.SchemaConfig

docs/source/user_guide_kg_builder.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,4 +409,4 @@ It is possible to create a custom writer using the `KGWriter` interface:
409409
The `validate_call` decorator is required when the input parameter contain a `pydantic` model.
410410

411411

412-
See :ref:`kgwritermodel` and :ref:`kgwriter` in API reference.
412+
See :ref:`kgwritermodel` and :ref:`kgwriter` in API reference.

docs/source/user_guide_pipeline.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,4 +130,4 @@ can be added to the canvas by setting `hide_unused_outputs` to `False`:
130130
Here is an example of final result:
131131

132132
.. image:: images/pipeline_full.png
133-
:alt: Pipeline visualisation
133+
:alt: Pipeline visualisation

docs/source/user_guide_rag.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -772,4 +772,4 @@ Drop a Vector Index
772772
773773
# Connect to Neo4j database
774774
driver = GraphDatabase.driver(URI, auth=AUTH)
775-
drop_index_if_exists(driver, INDEX_NAME)
775+
drop_index_if_exists(driver, INDEX_NAME)

poetry.lock

Lines changed: 57 additions & 55 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,4 +108,4 @@ module = [
108108
"sentence_transformers.*",
109109
"conftest",
110110
]
111-
ignore_missing_imports = true
111+
ignore_missing_imports = true

0 commit comments

Comments
 (0)