Home / Function/ test_retry_output_parser_parse_with_prompt() — langchain Function Reference

test_retry_output_parser_parse_with_prompt() — langchain Function Reference

Architecture documentation for the test_retry_output_parser_parse_with_prompt() function in test_retry.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  e689549f_5779_dbbd_c20e_195d2cf8738a["test_retry_output_parser_parse_with_prompt()"]
  7d3a9c30_27db_60ef_9fa4_456f3a99ca3b["test_retry.py"]
  e689549f_5779_dbbd_c20e_195d2cf8738a -->|defined in| 7d3a9c30_27db_60ef_9fa4_456f3a99ca3b
  style e689549f_5779_dbbd_c20e_195d2cf8738a fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/tests/unit_tests/output_parsers/test_retry.py lines 37–48

def test_retry_output_parser_parse_with_prompt() -> None:
    n: int = 5  # Success on the (n+1)-th attempt
    base_parser = SuccessfulParseAfterRetries(attemp_count_before_success=n)
    parser = RetryOutputParser[str](
        parser=base_parser,
        retry_chain=RunnablePassthrough(),
        max_retries=n,  # n times to retry, that is, (n+1) times call
        legacy=False,
    )
    actual = parser.parse_with_prompt("completion", StringPromptValue(text="dummy"))
    assert actual == "parsed"
    assert base_parser.parse_count == n + 1

Domain

Subdomains

Frequently Asked Questions

What does test_retry_output_parser_parse_with_prompt() do?
test_retry_output_parser_parse_with_prompt() is a function in the langchain codebase, defined in libs/langchain/tests/unit_tests/output_parsers/test_retry.py.
Where is test_retry_output_parser_parse_with_prompt() defined?
test_retry_output_parser_parse_with_prompt() is defined in libs/langchain/tests/unit_tests/output_parsers/test_retry.py at line 37.

Analyze Your Own Codebase

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

Try Supermodel Free