Skip to content

Conversation

aksg87
Copy link
Collaborator

@aksg87 aksg87 commented Aug 14, 2025

Description

Updates kwargs handling across all provider models to properly merge stored and runtime parameters. Runtime kwargs take precedence over initialization kwargs, allowing dynamic configuration overrides.

Fixes #136

Bug fix

How Has This Been Tested?

All tests pass including live API and Ollama integration tests:

$ pytest tests/inference_test.py -v
$ tox -e format
$ tox -e lint-src,lint-tests
$ tox -e live-api
$ tox -e ollama-integration

Checklist:

  • I have read and acknowledged Google's Open Source
    Code of conduct.
  • I have read the
    Contributing
    page, and I either signed the Google
    Individual CLA
    or am covered by my company's
    Corporate CLA.
  • I have discussed my proposed solution with code owners in the linked
    issue(s) and we have agreed upon the general approach.
  • I have made any needed documentation changes, or noted in the linked
    issue(s) that documentation elsewhere needs updating.
  • I have added tests, or I have ensured existing tests cover the changes
  • I have followed
    Google's Python Style Guide
    and ran pylint over the affected code.

aksg87 added 3 commits August 13, 2025 21:30
Resolves initialization order bug where provider kwargs were lost.
Runtime kwargs now properly override stored defaults.

- Add merge_kwargs() to base class
- Filter None values to prevent SDK errors
- Support provider-specific params (stop, top_p, top_logprobs)
- Add test coverage
@github-actions github-actions bot added the size/L Pull request with 600-1000 lines changed label Aug 14, 2025
@aksg87 aksg87 self-assigned this Aug 14, 2025
Copy link

⚠️ Branch Update Required

Your branch is 1 commits behind main. Please update your branch to ensure CI checks run with the latest code:

git fetch origin main
git merge origin/main
git push

Note: Enable "Allow edits by maintainers" to allow automatic updates.

@aksg87 aksg87 merged commit 39dcce3 into main Aug 14, 2025
14 checks passed
aksg87 added a commit that referenced this pull request Aug 21, 2025
* Fix kwargs passthrough for all providers

Resolves initialization order bug where provider kwargs were lost.
Runtime kwargs now properly override stored defaults.

- Add merge_kwargs() to base class
- Filter None values to prevent SDK errors
- Support provider-specific params (stop, top_p, top_logprobs)
- Add test coverage

* Update OpenAI JSON mode to not require fence output
sinnaj pushed a commit to sinnaj/langextract that referenced this pull request Sep 3, 2025
* Fix kwargs passthrough for all providers

Resolves initialization order bug where provider kwargs were lost.
Runtime kwargs now properly override stored defaults.

- Add merge_kwargs() to base class
- Filter None values to prevent SDK errors
- Support provider-specific params (stop, top_p, top_logprobs)
- Add test coverage

* Update OpenAI JSON mode to not require fence output
aksg87 added a commit that referenced this pull request Sep 12, 2025
* Fix kwargs passthrough for all providers

Resolves initialization order bug where provider kwargs were lost.
Runtime kwargs now properly override stored defaults.

- Add merge_kwargs() to base class
- Filter None values to prevent SDK errors
- Support provider-specific params (stop, top_p, top_logprobs)
- Add test coverage

* Update OpenAI JSON mode to not require fence output
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/L Pull request with 600-1000 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Impossible to use ollama kwargs

1 participant