Skip to content

Codestral with self-correction : Failed import of pydantic v1 #232

@gh4ag

Description

@gh4ag

Context

Cookbook recipe: "Codestral with self-correction"

In https://github.com/mistralai/cookbook/blob/main/third_party/langchain/langgraph_code_assistant_mistral.ipynb

Issue

When running the notebook with the predefined !pip install, the following import fails:

from langchain_core.pydantic_v1 import BaseModel, Field

Fix

Replace from langchain_core.pydantic_v1 import BaseModel, Field with the following

from pydantic.v1 import BaseModel, Field

Test

Notebook on Colab run successfully after fix implementation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions