Home / Function/ _parse_string_eval_output() — langchain Function Reference

_parse_string_eval_output() — langchain Function Reference

Architecture documentation for the _parse_string_eval_output() function in eval_chain.py from the langchain codebase.

Function python LangChainCore Runnables calls 1 called by 2

Entity Profile

Dependency Diagram

graph TD
  b91be59a_7ef5_038f_5ebf_96d2d077aa5f["_parse_string_eval_output()"]
  514ad815_2197_8c98_58ac_640cc349a6ab["eval_chain.py"]
  b91be59a_7ef5_038f_5ebf_96d2d077aa5f -->|defined in| 514ad815_2197_8c98_58ac_640cc349a6ab
  c8ae767c_58c1_d764_8793_0d3dfcb69a27["_prepare_output()"]
  c8ae767c_58c1_d764_8793_0d3dfcb69a27 -->|calls| b91be59a_7ef5_038f_5ebf_96d2d077aa5f
  a793cd45_183a_2ae3_7247_435d172fa959["_prepare_output()"]
  a793cd45_183a_2ae3_7247_435d172fa959 -->|calls| b91be59a_7ef5_038f_5ebf_96d2d077aa5f
  21a82aa0_b2c0_86fc_987b_e439fa1cc378["_get_score()"]
  b91be59a_7ef5_038f_5ebf_96d2d077aa5f -->|calls| 21a82aa0_b2c0_86fc_987b_e439fa1cc378
  style b91be59a_7ef5_038f_5ebf_96d2d077aa5f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/langchain_classic/evaluation/qa/eval_chain.py lines 55–74

def _parse_string_eval_output(text: str) -> dict:
    """Parse the output text.

    Args:
        text: The output text to parse.

    Returns:
        The parsed output.
    """
    reasoning = text.strip()
    parsed_scores = _get_score(reasoning)
    if parsed_scores is None:
        value, score = None, None
    else:
        value, score = parsed_scores
    return {
        "reasoning": reasoning,
        "value": value,
        "score": score,
    }

Domain

Subdomains

Calls

Frequently Asked Questions

What does _parse_string_eval_output() do?
_parse_string_eval_output() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/evaluation/qa/eval_chain.py.
Where is _parse_string_eval_output() defined?
_parse_string_eval_output() is defined in libs/langchain/langchain_classic/evaluation/qa/eval_chain.py at line 55.
What does _parse_string_eval_output() call?
_parse_string_eval_output() calls 1 function(s): _get_score.
What calls _parse_string_eval_output()?
_parse_string_eval_output() is called by 2 function(s): _prepare_output, _prepare_output.

Analyze Your Own Codebase

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

Try Supermodel Free