Skip to content

Codestral with self-correction - ChatPromptTemplate.from_messages not used #231

@gh4ag

Description

@gh4ag

Files

Cookbook recipe: "Codestral with self-correction"

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

Issue
The following code is not used:

code_gen_prompt_claude = ChatPromptTemplate.from_messages(
    [
        (
            "system", 
            """You are a coding assistant. Ensure any code you provide can be executed with all required imports and variables \n
            defined. Structure your answer: 1) a prefix describing the code solution, 2) the imports, 3) the functioning code block.
            \n Here is the user question:""",
        ),
        ("placeholder", "{messages}"),
    ]
)

And thus, this import can also be removed:

from langchain_core.prompts import ChatPromptTemplate

Tests

I ran the code in Colab, and it runs successfully without the dead code.

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