More specific types (e.g. for IDE autocomplete of model names) #26071
davidgilbertson
announced in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Checked
Feature request
If I use the OpenAI package directly, I get very useful auto-complete. For example, with for model names.

But when I use LangChain, there is very little auto-complete.

PyCharm:
VS Code:

Part of this is Pydantic's fault, so for PyCharm at least one needs to install the Pydantic plugin to get proper autocomplete.
But with that done, there's still the problem that LangChain types the
model_name
as simplystr
which is too broad. It would be better if this, and all such types, used the correct type from the underlying package.Motivation
I'm new to LangChain and I'm finding that this makes life a little bit more painful than using the base package (e.g. OpenAI) because I lose helpful autocomplete.
Proposal (If applicable)
OpenAI make certain types available, so if you use these types in the definition of the LangChain classes:
You get proper auto-complete in the IDE, speeding development.
I'm using
model
as an example here, but really the feature request is better types wherever types can be better so that switching to LangChain isn't a step backwards in developer experience.Beta Was this translation helpful? Give feedback.
All reactions