🐛 fix(custom_component.py): improve error message formatting for type hint error in build method
The error message for a type hint error in the build method was improved to provide clearer instructions. The traceback message was updated to suggest using PromptTemplate instead of Prompt type. This change improves the readability and usability of the error message.
This commit is contained in:
parent
f506fd1625
commit
5ec118cc6f
1 changed files with 4 additions and 1 deletions
|
|
@ -102,7 +102,10 @@ class CustomComponent(Component, extra=Extra.allow):
|
|||
status_code=400,
|
||||
detail={
|
||||
"error": "Type hint Error",
|
||||
"traceback": "Prompt type is not supported in the build method. Try using PromptTemplate instead.",
|
||||
"traceback": (
|
||||
"Prompt type is not supported in the build method."
|
||||
" Try using PromptTemplate instead."
|
||||
),
|
||||
},
|
||||
)
|
||||
return args
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue