-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
feature: add new playground events #4280
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Introduce `PlaygroundEvent` base class and specific event types: `MessageEvent`, `ErrorEvent`, `WarningEvent`, `InfoEvent`, and `TokenEvent`. - Implement `ContentBlock` class for flexible content handling. - Add factory functions to create different event types. - Utilize Pydantic for data validation and serialization.
- Introduce `_session_id` attribute in the graph base class. - Implement getter and setter for `session_id` property. - Update chat API to set `session_id` from inputs if available.
- Integrate `create_event_by_type` to generate playground events. - Add try-except block to handle `TypeError` during event creation and log the error using `loguru`. - Raise any other exceptions encountered during event creation.
- Introduced `send_message` method to handle message sending with optional formatting and content blocks. - Implemented `_store_message`, `_send_message_event`, and `_should_stream_message` for message storage and event management. - Added `_update_stored_message` and `_stream_message` to support message streaming and updating. - Included `_handle_async_iterator` and `_process_chunk` for processing message chunks from iterators.
- Introduced `PlaygroundEvent` type to manage different event types such as message, error, warning, info, and token. - Implemented `handlePlaygroundEvent` function to process and update chat history based on event type. - Enhanced file parsing logic to handle empty strings and parsing errors. - Added default values for `background_color` and `text_color` in chat messages.
- Enable new IO modal in feature flags - Update imports and remove unused code in newChatMessage component - Add error icon and error message in ChatMessage component - Update lockChat icon position in newChatView component - Import OctagonAlert icon in styleUtils
Cristhianzl
approved these changes
Nov 4, 2024
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.
lgtm
Cristhianzl
reviewed
Nov 4, 2024
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.
lgtm
.../IOModal/components/chatView/chatInput/components/buttonSendWrapper/newButtonSendWrapper.tsx
Show resolved
Hide resolved
.../IOModal/components/chatView/chatMessage/components/editMessageField/newEditMessageField.tsx
Show resolved
Hide resolved
…ponent.spec.ts, sliderComponent.spec.ts, tableInputComponent.spec.ts, stop-button-playground.spec.ts, generalBugs-shard-7.spec.ts): enable tests that were previously skipped to ensure proper functionality and coverage. Remove outdated comments and update test descriptions for clarity.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
enhancement
New feature or request
lgtm
This PR has been approved by a maintainer
size:XXL
This PR changes 1000+ lines, ignoring generated files.
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 extend the messages funcionalities and create new types of events in the playground