chore: Refactor error handling in OutputParser for improved readability (#3985)
Refactor: improve readability of error handling in OutputParser
This commit is contained in:
parent
0d2a03920d
commit
e710b457c3
1 changed files with 4 additions and 4 deletions
|
|
@ -34,11 +34,11 @@ class OutputParserComponent(Component):
|
|||
def build_parser(self) -> OutputParser:
|
||||
if self.parser_type == "CSV":
|
||||
return CommaSeparatedListOutputParser()
|
||||
else:
|
||||
raise ValueError("Unsupported or missing parser")
|
||||
msg = "Unsupported or missing parser"
|
||||
raise ValueError(msg)
|
||||
|
||||
def format_instructions(self) -> Message:
|
||||
if self.parser_type == "CSV":
|
||||
return Message(text=CommaSeparatedListOutputParser().get_format_instructions())
|
||||
else:
|
||||
raise ValueError("Unsupported or missing parser")
|
||||
msg = "Unsupported or missing parser"
|
||||
raise ValueError(msg)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue