Skip to content

fix: remove broken and unused imports in LangGraph codestral notebook#246

Open
yaowubarbara wants to merge 1 commit intomistralai:mainfrom
yaowubarbara:fix/langgraph-codestral-imports
Open

fix: remove broken and unused imports in LangGraph codestral notebook#246
yaowubarbara wants to merge 1 commit intomistralai:mainfrom
yaowubarbara:fix/langgraph-codestral-imports

Conversation

@yaowubarbara
Copy link
Copy Markdown

Fixes #232, fixes #231

Changes

The langgraph_code_assistant_mistral.ipynb notebook had several import issues:

  1. Broken import (Codestral with self-correction : Failed import of pydantic v1 #232): from langchain_core.pydantic_v1 import BaseModel, Field fails because pydantic_v1 was removed in recent langchain-core versions. BaseModel and Field are already correctly imported from pydantic earlier in the notebook, so this line is both broken and redundant.

  2. Unused code (Codestral with self-correction - ChatPromptTemplate.from_messages not used #231): ChatPromptTemplate was imported and used to create code_gen_prompt_claude, but this variable is never referenced anywhere else in the notebook.

  3. Other unused imports: itemgetter, RunnablePassthrough, and PromptTemplate are imported but never used.

All removals confirmed to not affect notebook execution (verified against the code flow).

- Remove broken `from langchain_core.pydantic_v1 import BaseModel, Field`
  (module removed in recent langchain-core versions)
- Remove unused `ChatPromptTemplate` import and `code_gen_prompt_claude` variable
- Remove other unused imports: `itemgetter`, `RunnablePassthrough`, `PromptTemplate`

Fixes mistralai#232, fixes mistralai#231
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Codestral with self-correction : Failed import of pydantic v1 Codestral with self-correction - ChatPromptTemplate.from_messages not used

1 participant