-
Notifications
You must be signed in to change notification settings - Fork 15.7k
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
Pydantic validation error on angchain_community.chat_models.ChatLiteLLMRouter #27455
Comments
It works as expected for me when removing the constructor in the class: class ChatLiteLLMRouter(ChatLiteLLM):
"""LiteLLM Router as LangChain Model."""
router: Any
#def __init__(self, *, router: Any, **kwargs: Any) -> None:
# """Construct Chat LiteLLM Router."""
# super().__init__(**kwargs)
# self.router = router |
Hello @pppazos! We're a group of students from the University of Toronto, and we're interested in investigating this issue further and making a PR to fix it. Do you have any additional information regarding this issue? While we were able to replicate it, we didn't get the exact error message but it seems close to the error you got. I have attached an image of the error we got below and would appreciate if you could review it. If you have no extra information, we can begin working on this as soon as you confirm and will have a PR ready by mid-November. |
Thanks @Aarya2004 , No additional info on my side. |
Hi @pppazos @Aarya2004 @duodecanol @bburgin @baskaryan @mackong The routing for a specific model is also not functioning. We have configured three models here, small, medium and large.
router = Router(model_list=model_list) chat.invoke("Capital of india") Instead of using large model mistral.mixtral-8x7b-instruct-v0:1, its using small model mistral.mistral-small-2402-v1:0. Even in the source code, its selecting the first model from the list, instead of selecting user passed model. |
The issue has been reported earlier, but it has been closed by GitHub BOT. |
Checked other resources
Example Code
ChatLiteLLMRouter
Error Message and Stack Trace (if applicable)
pydantic_core._pydantic_core.ValidationError: 1 validation error for ChatLiteLLMRouter
router
Field required [type=missing, input_value={'name': None, 'cache': N...ogether_ai_api_key': ''}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.9/v/missing
Description
I'm trying to create an instance of ChatLiteLLMRouter object, passing the required parameter router as:
expected: the ChatLiteLLMRouter object is created
actual: exception raised because do not detect router parameter being passed:
System Info
System Information
Package Information
Optional packages not installed
Other Dependencies
The text was updated successfully, but these errors were encountered: