-
Notifications
You must be signed in to change notification settings - Fork 18
feat: add FallbackResponse class to core/processing/standard.py #414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
| response_exception: Optional[str] = Field(default=None, exclude=True) | ||
| """ | ||
| Stores exception messages raised from response functions wrapped in | ||
| :py:class:`~chatsky.processing.standard.AddFallbackResponses`. | ||
| """ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that this is too random of a field that is unusable in many cases.
Better approach seems to be to make this field hold last exception raised from any script function and not only responses when AddFallbackResponses is used.
class BaseScriptFunction:
async def wrapped_call(ctx):
...
except Exception as exc:
ctx.framework_data.last_exception = excPreferably in a separate PR.
| "Enables complex stats collection across multiple turns." | ||
| slot_manager: SlotManager = Field(default_factory=SlotManager) | ||
| "Stores extracted slots." | ||
| response_exception: Optional[str] = Field(default=None, exclude=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you remember why this holds repr instead of exception?
Seems like it's better to store exception since this field will not be serialized.
Description
Please describe here what changes are made and why.
Checklist
List here tasks to complete in order to mark this PR as ready for review.
To Consider
.ignorefiles, scripts (such aslint), distribution manifest (if files are added/deleted)