🔧 chore(types.py): add missing return statement in _built_object_repr method of PromptVertex

📝 docs(types.py): improve readability and add clarity to the _built_object_repr method of PromptVertex
The _built_object_repr method of PromptVertex was missing a return statement when the condition in the if statement was not met. This commit adds the missing return statement to ensure the method always returns a value. Additionally, the commit improves the documentation of the method to provide better readability and clarity.
This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-07-06 15:22:47 -03:00
commit 56b23c4a1d

View file

@ -201,6 +201,15 @@ class PromptVertex(Vertex):
self._build()
return self._built_object
def _built_object_repr(self):
if self.artifacts and hasattr(self._built_object, "format"):
# We'll build the prompt with the artifacts
# to show the user what the prompt looks like
# with the variables filled in
return self._built_object.format(**self.artifacts)
else:
super()._built_object_repr()
class OutputParserVertex(Vertex):
def __init__(self, data: Dict):