Skip to content

Conversation

@telackey
Copy link

@telackey telackey commented Dec 12, 2025

Change Description

Add a new, basic LangExtract-based recognizer class that is generic. The current implementations focus on ollama or azure support. This one instantiates an lx.ModelConfig from the yaml, so that it can specify different providers and custom configurations (eg, developed using Ollama via a LiteLLM OpenAI proxy).

Issue reference

Fixes #XX

Checklist

  • I have reviewed the contribution guidelines
  • I have signed the CLA (if required)
  • My code includes unit tests
  • All unit tests and lint checks pass locally
  • My PR contains documentation updates / additions if required

@telackey telackey marked this pull request as ready for review December 12, 2025 21:10
@RonShakutai RonShakutai self-requested a review December 13, 2025 13:11
Copy link
Collaborator

@RonShakutai RonShakutai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What a great PR !
he lx_factory.ModelConfig approach is elegant !

left a few comments to finalize it

@telackey
Copy link
Author

Good comments! I'm happy to make the requested changes, but it may need to be late this week or early next.

@RonShakutai
Copy link
Collaborator

Good comments! I'm happy to make the requested changes, but it may need to be late this week or early next.

No worries, whenever you get a chance :)
Thanks again for your great contribution!

@SharonHart
Copy link
Contributor

@telackey
This branch also needs rebasing to main, sorry for that

@RonShakutai
Copy link
Collaborator

Good comments! I'm happy to make the requested changes, but it may need to be late this week or early next.

Hi :) @telackey
Are you still planning to complete this PR?

@telackey
Copy link
Author

telackey commented Jan 5, 2026

Yes, the holidays just intervened.

@SharonHart
Copy link
Contributor

same here with This branch is out-of-date with the base branch

@RonShakutai
Copy link
Collaborator

Yes, the holidays just intervened.

We're really like this PR,
Do you think you'll be able to wrap it up in the next month, or would you rather we take it from here?

@telackey
Copy link
Author

Yes, in fact I'm going to take a look at it today. I'll keep you posted.

* Address comments

* Replace ollama_langextract_recognizer with basic_langextract_recognizer.

* Replace ollama_langextract_recognizer with basic_langextract_recognizer.

* Replace ollama_langextract_recognizer with basic_langextract_recognizer.

* Working so far

* Working so far

* Working so far

* remove dead code

* bad comment

---------

Co-authored-by: Kassymkhan Bekbolatov <[email protected]>
@telackey
Copy link
Author

I replaced the OllamaLangExtractRecognizer with this one. I haven't had a chance to run the e2e tests yet, but the basic unit tests are passing and I think I addressed all the questions.

One wrinkle is that there is a chicken/egg problem at the moment with the extract_params being loaded from the config, but the config file is read in the parent class. My inelegant workaround is to update the extract_params again after the parent constructor is finished. It is a bit wonky, but it works.

I will take a look at the e2e tests on Monday. At the very least this should be much closer to what you were hoping for.

@telackey
Copy link
Author

Oh, all the defaults match the previous Ollama recognizer defaults, so it should be a low risk change in some ways, but it does mean yaml/config changes.

telackey and others added 2 commits January 26, 2026 17:39
* Replace ollama_langextract_recognizer with basic_langextract_recognizer.

* Fix LangExtract error

---------

Co-authored-by: Kassymkhan Bekbolatov <[email protected]>
@telackey telackey requested a review from RonShakutai January 26, 2026 23:52
@telackey
Copy link
Author

@RonShakutai e2e tests are updated. Should be ready for a second look.

@telackey
Copy link
Author

Fixed ruff

@telackey
Copy link
Author

telackey commented Jan 27, 2026

The explicit calls to:

  lx.providers.load_builtins_once()
  lx.providers.load_plugins_once()

Are to work around this bug: google/langextract#331

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants