Skip to content

feat(llm): GeminiLLM declares supports_structured_output = True#573

Closed
matteomedioli wants to merge 1 commit into
mainfrom
matteo/gemini-structured-output-flag
Closed

feat(llm): GeminiLLM declares supports_structured_output = True#573
matteomedioli wants to merge 1 commit into
mainfrom
matteo/gemini-structured-output-flag

Conversation

@matteomedioli

@matteomedioli matteomedioli commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Description

GeminiLLM already supports structured output (via response_schema / response_mime_type), but never declared the supports_structured_output capability flag. Pipeline components that check the flag saw False and fell back to prompt-based JSON.

This PR sets the flag to True.

Breaking for pipeline users: SimpleKGPipeline, SchemaFromTextExtractor, and LLMEntityRelationExtractor now enable structured output by default with GeminiLLM. To keep the previous behavior, construct the extractors with use_structured_output=False. The changelog documents this with the same wording as the equivalent AnthropicLLM change.

Split out of #571 so that refactor stays strictly behavior-neutral. Independent of the #565#572 stack — can merge before or after it.

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

  • Documentation has been updated
  • Unit tests have been updated
  • Examples have been updated
  • CLA (https://neo4j.com/developer/cla/) has been signed
  • CHANGELOG.md updated

GeminiLLM already implements structured output via
response_schema/response_mime_type but never set the capability flag,
so SchemaFromTextExtractor / LLMEntityRelationExtractor /
SimpleKGPipeline saw False and fell back to prompt-based JSON.

Behavior change for pipeline users (structured output now on by
default with GeminiLLM), documented as breaking in the changelog with
the same remediation wording as the AnthropicLLM flag change.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

1 participant