MCPcopy
hub / github.com/langchain-ai/langchain / StrOutputParser

Class StrOutputParser

libs/core/langchain_core/output_parsers/string.py:6–26  ·  view source on GitHub ↗

OutputParser that parses LLMResult into the top likely string.

Source from the content-addressed store, hash-verified

4
5
6class StrOutputParser(BaseTransformOutputParser[str]):
7 """OutputParser that parses LLMResult into the top likely string."""
8
9 @classmethod
10 def is_lc_serializable(cls) -> bool:
11 """Return whether this class is serializable."""
12 return True
13
14 @classmethod
15 def get_lc_namespace(cls) -> List[str]:
16 """Get the namespace of the langchain object."""
17 return ["langchain", "schema", "output_parser"]
18
19 @property
20 def _type(self) -> str:
21 """Return the output parser type for serialization."""
22 return "default"
23
24 def parse(self, text: str) -> str:
25 """Returns the input text with no changes."""
26 return text

Callers 15

chain.pyFile · 0.90
multi_modal_rag_chainFunction · 0.90
chain.pyFile · 0.90
chain.pyFile · 0.90
chain.pyFile · 0.90
chain.pyFile · 0.90
chain.pyFile · 0.90
chain.pyFile · 0.90
multi_modal_rag_chainFunction · 0.90
chain.pyFile · 0.90
chain.pyFile · 0.90
chain.pyFile · 0.90

Calls

no outgoing calls