parse_result() — langchain Function Reference
Architecture documentation for the parse_result() function in output_parsers.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 226e3323_bb76_2676_e692_4e21f7ba7236["parse_result()"] 617f1d3c_0a13_7080_d8ee_1f0a677a61a0["ReasoningJsonOutputParser"] 226e3323_bb76_2676_e692_4e21f7ba7236 -->|defined in| 617f1d3c_0a13_7080_d8ee_1f0a677a61a0 9a2ae530_422d_2fd8_fa7d_2515e0623c7c["parse_result()"] 9a2ae530_422d_2fd8_fa7d_2515e0623c7c -->|calls| 226e3323_bb76_2676_e692_4e21f7ba7236 9a2ae530_422d_2fd8_fa7d_2515e0623c7c["parse_result()"] 226e3323_bb76_2676_e692_4e21f7ba7236 -->|calls| 9a2ae530_422d_2fd8_fa7d_2515e0623c7c b2204b0d_d186_cc64_ba3a_c35b30d16454["strip_think_tags()"] 226e3323_bb76_2676_e692_4e21f7ba7236 -->|calls| b2204b0d_d186_cc64_ba3a_c35b30d16454 style 226e3323_bb76_2676_e692_4e21f7ba7236 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/partners/perplexity/langchain_perplexity/output_parsers.py lines 46–64
def parse_result(self, result: list[Generation], *, partial: bool = False) -> Any:
"""Parse the result of an LLM call to a JSON object.
Args:
result: The result of the LLM call.
partial: Whether to parse partial JSON objects.
If `True`, the output will be a JSON object containing
all the keys that have been returned so far.
If `False`, the output will be the full JSON object.
Returns:
The parsed JSON object.
Raises:
OutputParserException: If the output is not valid JSON.
"""
text = result[0].text
text = strip_think_tags(text)
return super().parse_result([Generation(text=text)], partial=partial)
Domain
Subdomains
Called By
Source
Frequently Asked Questions
What does parse_result() do?
parse_result() is a function in the langchain codebase, defined in libs/partners/perplexity/langchain_perplexity/output_parsers.py.
Where is parse_result() defined?
parse_result() is defined in libs/partners/perplexity/langchain_perplexity/output_parsers.py at line 46.
What does parse_result() call?
parse_result() calls 2 function(s): parse_result, strip_think_tags.
What calls parse_result()?
parse_result() is called by 1 function(s): parse_result.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free