OutputParser that parses LLMResult into the top likely string.
| 4 | |
| 5 | |
| 6 | class 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 |
no outgoing calls