🔧 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:
parent
049a41d25e
commit
56b23c4a1d
1 changed files with 9 additions and 0 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue