Code Monkey home page Code Monkey logo

Comments (10)

iwtu avatar iwtu commented on September 24, 2024 1

I found it. It's very unintuitive. pydantic-settings v1.99 is for pydantic v2.

from anthropic-sdk-python.

rattrayalex avatar rattrayalex commented on September 24, 2024

This is happening because a previous version of this library did not pin our version of pydantic to version <2, which released breaking changes.

It looks like you're on 0.3.1 of this library; this was fixed in 0.3.2, and the latest release is 0.3.4, which I recommend upgrading to.

from anthropic-sdk-python.

iwtu avatar iwtu commented on September 24, 2024

It looks like that pydantic-settings is causing the problem.

from anthropic-sdk-python.

rattrayalex avatar rattrayalex commented on September 24, 2024

We're looking into adding support for pydantic v2, but ensuring thorough support is not trivial.

In the meantime, I recommend upgrading to anthropic version 0.3.4, which should cause your pydantic version to fall back to 1.9.x. Does that work for you?

from anthropic-sdk-python.

iwtu avatar iwtu commented on September 24, 2024

without pydantic-settings yes.

But the following requirements files will install pydantic 2.0.3.
Also interesting about this file that if you swich order pydantic-settings and anthropic, then pip install -r will throw some weird error.

openai
beautifulsoup4
fastapi
google-cloud-aiplatform
uvicorn[standard]
gunicorn
pydantic-settings
anthropic

from anthropic-sdk-python.

rattrayalex avatar rattrayalex commented on September 24, 2024

You may want to pin pydantic-settings to a version <2, like this:

pydantic-settings==1.99

from anthropic-sdk-python.

iwtu avatar iwtu commented on September 24, 2024

I tried. It didn't help :/

from anthropic-sdk-python.

rattrayalex avatar rattrayalex commented on September 24, 2024

Sorry to hear that; Python dependency management can be a pain. You might try using poetry to produce a poetry.lock file, which could help you discover the reason that pydantic v2 is still being used, and fix it.

If this problem persists after you have successfully downgraded to use pydantic v1 in your project, please reopen this issue and include the new values of pip show anthropic and pip show pydantic.

from anthropic-sdk-python.

rattrayalex avatar rattrayalex commented on September 24, 2024

Glad to hear you figured it out! What version of pydantic-settings worked correctly for you?

from anthropic-sdk-python.

iwtu avatar iwtu commented on September 24, 2024

I needed only simple call so instead of fighting all this I replaced it with HTTP request :)

from anthropic-sdk-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.