Skip to content

Conversation

@aksg87
Copy link
Collaborator

@aksg87 aksg87 commented Aug 3, 2025

Description

Add OpenAI language model support to LangExtract as an additional cloud-based LLM option alongside Gemini. The implementation maintains feature parity with existing backends. Implementation of schema constraints for OpenAI is pending.

Fixes #16

Feature

How Has This Been Tested?

$ python -m pytest tests/inference_test.py::TestOpenAILanguageModel -v
$ tox

All tests pass on Python 3.10 and 3.11. Also tested with live API calls and inspected HTML outputs on README examples.

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.
    • README documentation updated with OpenAI usage examples and configuration
  • 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 aksg87 force-pushed the feature/add-oai-inference branch from 722e7f3 to 8289b3a Compare August 3, 2025 17:19
@aksg87 aksg87 self-assigned this Aug 3, 2025
@aksg87 aksg87 merged commit c8ef723 into main Aug 3, 2025
3 checks passed
@aksg87 aksg87 deleted the feature/add-oai-inference branch August 4, 2025 01:57
aksg87 added a commit that referenced this pull request Aug 21, 2025
feat: Add OpenAI language model support
sinnaj referenced this pull request in sinnaj/langextract Sep 3, 2025
feat: Add OpenAI language model support
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.

LangExtract incompatible with modern OpenAI SDK (v1.x) - ImportError on 'error' module

1 participant