Skip to content

feat: expose use_structured_output in SimpleKGPipeline#483

Open
HemantSudarshan wants to merge 1 commit intoneo4j:mainfrom
HemantSudarshan:feat/expose-use-structured-output-in-simple-kg-pipeline
Open

feat: expose use_structured_output in SimpleKGPipeline#483
HemantSudarshan wants to merge 1 commit intoneo4j:mainfrom
HemantSudarshan:feat/expose-use-structured-output-in-simple-kg-pipeline

Conversation

@HemantSudarshan
Copy link

Expose the existing use_structured_output option through SimpleKGPipeline so callers can enable structured output for both automatic schema extraction and entity extraction without dropping to lower-level components.

Structured output significantly improves extraction reliability when using compatible LLMs (like OpenAI and VertexAI).

Closes #478

Type of Change

  • New feature
  • Documentation update

Complexity: Low

How Has This Been Tested?

  • Unit tests
  • Manual tests

Verification details:

  • Added config-level tests checking structured output forwarding to LLMEntityRelationExtractor and SchemaFromTextExtractor.
  • Added public-API tests ensuring the SimpleKGPipeline constructor accepts and validates the parameter.
  • Ran targeted tests:
    uv run pytest tests/unit/experimental/pipeline/config/template_pipeline/test_simple_kg_builder.py tests/unit/experimental/pipeline/test_kg_builder.py -v (35 passed)
  • Ran linting and type checking (Ruff & Mypy) on modified source files (Clean / 0 issues).
  • Confirmed docs build correctly: uv run sphinx-build -b html docs/source docs/_build/html

(Note: Full repository test suite passes locally minus pre-existing optional dependency skips for langchain, openai, anthropic which run in CI).

Checklist

  • Documentation updated
  • Unit tests updated
  • CHANGELOG updated
  • CLA signed (Check this if applicable)

Expose the existing use_structured_output option through SimpleKGPipeline
so callers can enable structured output for both automatic schema extraction
and entity extraction without dropping to lower-level components.

Closes neo4j#478
@HemantSudarshan HemantSudarshan requested a review from a team as a code owner March 8, 2026 16:42
@NathalieCharbel
Copy link
Contributor

Hi @HemantSudarshan, thanks for taking the time to work on this!

We recently opened another PR that enables structured output by default for SimpleKGPipeline whenever the underlying LLM interface and model support it.

If that PR addresses the issue you were trying to solve, it might make sense to close this one to avoid duplication. Thanks again for the contribution!

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.

feat: Expose use_structured_output in SimpleKGPipeline constructor

2 participants