Home / Function/ _validate_prompt() — langchain Function Reference

_validate_prompt() — langchain Function Reference

Architecture documentation for the _validate_prompt() function in base.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  d000def0_46e2_6f87_6b0d_194f128f4c54["_validate_prompt()"]
  37cb2b60_9ae1_7f39_46a1_1f7d0156c75f["OpenAIMultiFunctionsAgent"]
  d000def0_46e2_6f87_6b0d_194f128f4c54 -->|defined in| 37cb2b60_9ae1_7f39_46a1_1f7d0156c75f
  style d000def0_46e2_6f87_6b0d_194f128f4c54 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/langchain_classic/agents/openai_functions_multi_agent/base.py lines 128–136

    def _validate_prompt(self) -> Self:
        prompt: BasePromptTemplate = self.prompt
        if "agent_scratchpad" not in prompt.input_variables:
            msg = (
                "`agent_scratchpad` should be one of the variables in the prompt, "
                f"got {prompt.input_variables}"
            )
            raise ValueError(msg)
        return self

Subdomains

Frequently Asked Questions

What does _validate_prompt() do?
_validate_prompt() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/agents/openai_functions_multi_agent/base.py.
Where is _validate_prompt() defined?
_validate_prompt() is defined in libs/langchain/langchain_classic/agents/openai_functions_multi_agent/base.py at line 128.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free