Skip to content

Conversation

@jonghwanhyeon
Copy link

This PR aligns the ChatOllama implementation with LangChain Python by enhancing the withStructuredOutput() method to support native structured outputs.

Key Changes

  • withStructuredOutput() now accepts a method option with the following values:
    • "jsonSchema": Passes the JSON Schema directly to the format parameter for native structured outputs.
    • "jsonMode": Sets the format to "json" to enforce valid JSON generation.
    • "functionCalling" (default): Uses tool calling to extract structured outputs.

@changeset-bot
Copy link

changeset-bot bot commented Dec 6, 2025

⚠️ No Changeset found

Latest commit: f24eccf

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@jonghwanhyeon jonghwanhyeon force-pushed the feat-ollama-add-support-for-nativie-structured-outputs branch 2 times, most recently from bd1b5d1 to 1c411ce Compare December 6, 2025 12:35
@jonghwanhyeon jonghwanhyeon changed the title feat(ollama): Add support for native structured outputs feat(ollama): add support for native structured outputs Dec 7, 2025
@jonghwanhyeon jonghwanhyeon force-pushed the feat-ollama-add-support-for-nativie-structured-outputs branch from 1c411ce to e2a58a5 Compare December 7, 2025 07:28
@jonghwanhyeon jonghwanhyeon force-pushed the feat-ollama-add-support-for-nativie-structured-outputs branch from e2a58a5 to f24eccf Compare December 7, 2025 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant