Add a new field to allow commands to be persistent between messages #2018
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new feature to support persistent commands in the chat message composer. The most important changes include updates to the type definitions, state management, and UI components to handle persistent commands.
Persistent Commands Feature:
backend/chainlit/types.py
: Added apersistent
field to theCommandDict
class to indicate whether a command should be persistent.libs/react-client/src/types/command.ts
: Added apersistent
field to theICommand
interface to support the new persistent command feature.State Management:
frontend/src/state/chat.ts
: Introduced a new Recoil statepersistentCommandState
to manage the persistent command.frontend/src/components/chat/MessageComposer/index.tsx
: Updated theMessageComposer
component to use the newpersistentCommandState
for managing the selected command.UI Components:
frontend/src/components/chat/MessageComposer/CommandButtons.tsx
: Added akey
prop to theTooltip
component to ensure proper rendering of command buttons.frontend/src/components/chat/MessageComposer/Input.tsx
: Modified thereset
function to only clear the selected command if it is not persistent.