-
Notifications
You must be signed in to change notification settings - Fork 6
Do not expose providers api #84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neat!
And you are tagging the wrong person 😸 |
Oups |
That wouldn't prevent a plugin to access |
you don't have access to the |
The |
Actually I wonder if it won't break the WebLLM provider, since some of its methods may not be available anymore. |
7b5a19f
to
bf01624
Compare
…able to modify the 'exposeChatModel' flag
@trungleduc @jtpio there is now a flag to allow exposing the whole model API when registering the provider. ai/src/default-providers/index.ts Line 157 in d075ec5
To prevents being able to modify this flag, the |
Co-authored-by: Duc Trung Le <leductrungxf@gmail.com>
Thanks @brichet! Yes exposing less things sounds good. |
This PR avoids exposing the chat or LLM model API, to avoid exposing API keys or other secrets that are exposed in langchain model (e.g. https://github.com/langchain-ai/langchainjs/blob/1846bdbb0fbe88c0981d11bfc5e302d2756565f2/libs/langchain-mistralai/src/chat_models.ts#L911).
The chat model only expose a
stream()
wrapper, and the completer model expose afetch()
wrapper.cc. @trungleduc who first catches this issue and suggest a workaround.