Home / Function/ parse_with_prompt() — langchain Function Reference

parse_with_prompt() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  d97a6bfb_f3ed_2b91_c78a_12e82e20d44b["parse_with_prompt()"]
  e155cd04_a39d_263a_c7f3_32e5830d204b["BaseOutputParser"]
  d97a6bfb_f3ed_2b91_c78a_12e82e20d44b -->|defined in| e155cd04_a39d_263a_c7f3_32e5830d204b
  56267ba8_64a1_3881_bcb1_b91b56f2cf8b["parse()"]
  d97a6bfb_f3ed_2b91_c78a_12e82e20d44b -->|calls| 56267ba8_64a1_3881_bcb1_b91b56f2cf8b
  style d97a6bfb_f3ed_2b91_c78a_12e82e20d44b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/output_parsers/base.py lines 311–328

    def parse_with_prompt(
        self,
        completion: str,
        prompt: PromptValue,  # noqa: ARG002
    ) -> Any:
        """Parse the output of an LLM call with the input prompt for context.

        The prompt is largely provided in the event the `OutputParser` wants to retry or
        fix the output in some way, and needs information from the prompt to do so.

        Args:
            completion: String output of a language model.
            prompt: Input `PromptValue`.

        Returns:
            Structured output.
        """
        return self.parse(completion)

Domain

Subdomains

Calls

Frequently Asked Questions

What does parse_with_prompt() do?
parse_with_prompt() is a function in the langchain codebase, defined in libs/core/langchain_core/output_parsers/base.py.
Where is parse_with_prompt() defined?
parse_with_prompt() is defined in libs/core/langchain_core/output_parsers/base.py at line 311.
What does parse_with_prompt() call?
parse_with_prompt() calls 1 function(s): parse.

Analyze Your Own Codebase

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

Try Supermodel Free