Skip to content
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

[langchain_community.llms.xinference]: fix xinference client error #29195

Closed
wants to merge 3 commits into from

Conversation

TheSongg
Copy link
Contributor

  • PR title: [langchain_community.llms.xinference]: fix error and support stream method

  • PR message:

  • The old code raised an ValidationError: pydantic_core._pydantic_core.ValidationError: 1 validation error for Xinference when import Xinference from xinference.py. This issue has been resolved by adjusting it's type and default value.

      File "/media/vdc/python/lib/python3.10/site-packages/pydantic/main.py", line 212, in __init__
      validated_self = self.__pydantic_validator__.validate_python(data, self_instance=self)
      pydantic_core._pydantic_core.ValidationError: 1 validation error for Xinference
      client
        Field required [type=missing, input_value={'server_url': 'http://10...t4', 'model_kwargs': {}}, input_type=dict]
        For further information visit https://errors.pydantic.dev/2.9/v/missing
    
  • tests:

     from langchain_community.llms import Xinference
     llm = Xinference(
       server_url="http://0.0.0.0:9997", # replace your xinference server url
      model_uid={model_uid}  # replace model_uid with the model UID return from launching the model
       )
    

@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jan 14, 2025
Copy link

vercel bot commented Jan 14, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
langchain ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 15, 2025 1:46am

@dosubot dosubot bot added community Related to langchain-community 🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature labels Jan 14, 2025
@ccurme
Copy link
Collaborator

ccurme commented Jan 14, 2025

You'll need to update the code to handle the None case: https://github.com/langchain-ai/langchain/actions/runs/12765427066/job/35579660741?pr=29195

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature community Related to langchain-community size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
Status: Closed
Development

Successfully merging this pull request may close these issues.

2 participants