Skip to content

coral-web: update first turn suggestions #225

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

Merged
merged 2 commits into from
Jun 18, 2024

Conversation

wujessica
Copy link
Contributor

@wujessica wujessica commented Jun 17, 2024

Description:

This PR adds in the new first turn suggestion design and prompts. It filters out prompts that use tools when all the tools it needs are not available.

Secondly, it fixes some behaviours to do with navigating between conversations and carrying over tools and files by properly resetting them. Specifically, between existing conversations and new conversations, we should always be resetting fileIds state since files are tied to conversations. tools should be reset between existing conversations since we do not currently save our last used tools in the conversation history so persisting them would be inaccurate and confusing BUT tools may be persisted across navigating from an existing conversation to a new one for convenience.

Untitled.mov
Screen.Recording.2024-06-17.at.3.27.42.PM.mov

AI Description

This PR makes changes to the Coral Web interface, specifically to the Avatar, CitationDocument, Files, Tools, Composer, ComposerError, ComposerFiles, ComposerToolbar, DragDropFileUploadOverlay, EnabledDataSources, ConversationListHeader, FileError, FirstTurnSuggestions, IconButton, MessageContent, MessageFile, StartModes, UploadedFile, and UploadingFile components.

  • Avatar.tsx:
    • Exports BotAvatar as a React component.
  • CitationDocument.tsx:
    • Removes the toLowerCase() method from the toolId prop in the CitationDocumentHeader and CitationDocumentSnippet components.
  • Files.tsx:
    • Imports Checkbox and useDefaultFileLoaderTool from '@/components/Shared' and '@/hooks/files', respectively.
    • Adds setParams and composerFiles to the destructured object from useParamsStore.
    • Adds deleteComposerFile to the destructured object from useFilesStore.
    • Adds the handleToggle function, which updates the fileIds state based on the provided fileId.
  • Tools.tsx:
    • Renames the onToolToggle function to handleToolToggle.
    • Updates the handleToolToggle function to use the new handleToggle function name.
  • Composer.tsx:
    • Removes the entire file.
  • ComposerError.tsx:
    • Adds a new file that imports React, FileError, useFilesStore, and cn from 'react', '@/components/FileError', '@/stores', and '@/utils', respectively.
    • Exports ComposerError as a React component that renders an error message for file upload errors.
  • ComposerFiles.tsx:
    • Adds a new file that imports React, MessageFile, useFilesStore, and cn from 'react', '@/components/MessageFile', '@/stores', and '@/utils', respectively.
    • Exports ComposerFiles as a React component that displays files prepared for upload with the next chat request.
  • ComposerToolbar.tsx:
    • Adds a new file that imports React, useRef, EnabledDataSources, IconButton, IconName, ACCEPTED_FILE_TYPES, and cn from 'react', '@/components/IconButton', '@/components/Shared', '@/constants', and '@/utils', respectively.
    • Exports ComposerToolbar as a React component that includes a file input field, a toolbar action button, and enabled data sources.
  • DragDropFileUploadOverlay.tsx:
    • Adds a new file that imports React, DragDropFileInput, ACCEPTED_FILE_TYPES, useFocusFileInput, useSettingsStore, and cn from 'react', '@/components/Shared', '@/constants', '@/hooks/actions', '@/stores', and '@/utils', respectively.
    • Exports DragDropFileUploadOverlay as a React component that handles file uploads via drag and drop.
  • EnabledDataSources.tsx:
    • Adds a new file that imports React, Icon, IconName, Text, useDefaultFileLoaderTool, useListFiles, useConversationStore, useFilesStore, useParamsStore, ConfigurableParams, and cn from 'react', '@/components/Shared', '@/constants', '@/hooks/files', '@/stores', '@/stores/slices/paramsSlice', and '@/utils', respectively.
    • Exports EnabledDataSources as a React component that renders enabled data sources in the composer toolbar.
  • ConversationListHeader.tsx:
    • Updates the useCitationsStore, useConversationStore, and useSettingsStore imports to also include useParamsStore.
  • FileError.tsx:
    • Adds a new file that imports React, useMemo, Text, and cn from 'react', '@/components/Shared', and '@/utils', respectively.
    • Exports FileError as a React component that renders an error message for file upload issues.
  • FirstTurnSuggestions.tsx:
    • Adds a new file that imports React, useMemo, Transition, ButtonGroup, TOOL_CALCULATOR_ID, TOOL_INTERNET_SEARCH_ID, TOOL_PYTHON_INTERPRETER_ID, useListTools, useParamsStore, ConfigurableParams, and cn from 'react', '@headlessui/react', '@/components/ButtonGroup', '@/constants', '@/hooks/tools', '@/stores/slices/paramsSlice', and '@/utils', respectively.
    • Exports FirstTurnSuggestions as a React component that displays clickable suggestions for the user's first turn in the conversation.
  • IconButton.tsx:
    • Updates the React, BasicButton, Icon, IconName, and cn imports to also include Target, Text, Tooltip, and cx from 'react', '@/components/Shared', and 'classnames', respectively.
    • Updates the Props interface to include an optional tooltipLabel and a size with a default value of `'md'.
    • Updates the IconButton component to include an optional tooltipLabel prop and to use cx for class name generation.
    • Wraps the iconButton element in a Tooltip component when a tooltipLabel is provided.
  • MessageContent.tsx:
    • Updates the UploadedFile component to MessageFile.
  • MessageFile.tsx:
    • Adds a new file that imports React, Icon, Skeleton, Text, cn, getFileExtension, and formatFileSize from 'react', '@/components/Shared', and '@/utils', respectively.
    • Exports MessageFile as a React component that renders a file card in a chat message or composer.
  • StartModes.tsx:
    • Removes the entire file.
  • UploadedFile.tsx:
    • Removes the entire file.
  • UploadingFile.tsx:
    • Removes the entire file.

@wujessica wujessica marked this pull request as ready for review June 17, 2024 21:31
Base automatically changed from jw/new-composer-changes-pt-1 to main June 18, 2024 14:34
@wujessica wujessica force-pushed the jw/new-composer-changes-pt-2 branch from c303f9f to 6887510 Compare June 18, 2024 17:25
@wujessica wujessica merged commit fa31069 into main Jun 18, 2024
3 checks passed
@wujessica wujessica deleted the jw/new-composer-changes-pt-2 branch June 18, 2024 18:23
sanal-cohere added a commit that referenced this pull request Jun 21, 2024
* Initial commit for Compass Tool

* coral-web: update first turn suggestions (#225)

* Addressed comments on the previous commit

* Added custom_context to parse and filters to search

* Formatting changes

* feat(assistant): Update conversation header (#229)

* feat(assistant): Update conversation header

* feat(assistant): Update conversation header

* update tooltip

* fix IconButton import

* Setup: fix dependencies (#243)

* feat(toolkit): show conversation list on with agents list (#231)

* Setup: remove redundant dependency (#244)

* Improve Auth guide (#235)

improve auth guide

* coral-web: create agent + agent base form (#212)

* create new agent form

* render agents list

* link back to base agent page

* perform post submission actions

* move input labels outside of input borders

* move submit button

* gen client

* factor out agent base form

* use default content type

* list custom agents

* check if agent name is unique

* and deployment + env variables to agent form

* add deployments

* clean up

* add submit modal

* push to new agent page on create success

* only show available deployments

* remove deployments dropdown

* feat: List Assistants returned from API (#242)

* feat: list agents from BE

* Update src/interfaces/coral_web/src/components/Conversation/MessagingContainer.tsx

Co-authored-by: misspia-cohere <[email protected]>

---------

Co-authored-by: misspia-cohere <[email protected]>

* nits

---------

Co-authored-by: Khalil Najjar <[email protected]>

* Propagate should_store logic to the File upload logic (#247)

should_store logic to the attach_files_to_messages

* [backend] passing in agent when calling streaming chat (#237)

* initial chat changes

* need to test

* done

* Remove old test

* default model for agents right now

* Organizations DB models, CRUD and tests   (#238)

* Organizations initial commit

* Organizations initial commit

* Organizations initial commit - sync main

* Organizations initial commit - sync main - blacked

* Organizations initial commit - sync main - lint

* Organizations initial commit - sync main - tests

* Organizations initial commit - sync main - tests

* Organizations initial commit - review fixes

* Organizations initial commit - review fixes

* Split up display name and name for Tools  (#241)

* CHange

* change

* coral-web: update assistant (#248)

* create new agent form

* render agents list

* link back to base agent page

* perform post submission actions

* move input labels outside of input borders

* move submit button

* gen client

* factor out agent base form

* check if agent name is unique

* and deployment + env variables to agent form

* add deployments

* clean up

* remove deployments dropdown

* init agent page

* create agent drawer

* use agent form

* add update agent request

* add get agent request

* fix rebase errors

* remove model from agent form

* add agent drawer to conversation

* remove unused componenets

* use new agent name for update success message

* fix(toolkit): Address code feedback + improvements (#249)

address code feedback improvements

---------

Co-authored-by: Khalil Najjar <[email protected]>

* feat(toolkit): add/remove recently used agents (#250)

* feat(toolkit): add/remove recently used agents

* merge main

* Add a walkthrough guide of the toolkit  (#251)

* GUide

* Chang

* Change

* Change

* Update docs/walkthrough/walkthrough.md

Co-authored-by: Luísa Moura <[email protected]>

* Update walkthrough.md

---------

Co-authored-by: Luísa Moura <[email protected]>

* coral-web: fix agent info panel opening by default (#253)

cast isEditAgentPanelOpen to boolean

* [backend] enforce agent update with user-id (#246)

* updates

* remove client changes

* remove logs

* use better header user id check

* fix validators

* typo

* Metrics: add middleware (#185)

* Metrics: add middleware

* add chat calls

* merge

* lint

* make it async

* add user id

* add more fields

* add retry and duration

* add meta

* comments

* fix tests

* improve error handling

* rename fields

* match spec

* comments

* clean code

* only create loop when theres endpoint

* add assistant id to chat

* feat(toolkit): show assistant welcome message (#255)

* feat(toolkit): show assistant welcome message

* feat(toolkit): show assistant welcome message

* frontend: Login, logout, and account creation (#179)

* add login page components

* Add Register page and hooks for auth

* Add the register page and connect all the frontend elements

* Redirect to /login if the token expires and clean up some console errors

* Add error messages for failed logins

* frontend: Add Single Sign-on to Toolkit (#227)

* Add Google SSO login plus OpenID components

* Dynamically set SSO login buttons and show or hide username and password based on auth_strategies

---------

Co-authored-by: Tianjing Li <[email protected]>

* fix startup event

* Fix build errors and update the API client

* Fix tests by adding missing env vars

Add test OIDC_WELL_KNOWN_ENDPOINT var to fixtures

* Add a walkthrough guide of the toolkit  (#251)

* GUide

* Chang

* Change

* Change

* Update docs/walkthrough/walkthrough.md

Co-authored-by: Luísa Moura <[email protected]>

* Update walkthrough.md

---------

Co-authored-by: Luísa Moura <[email protected]>

* coral-web: fix agent info panel opening by default (#253)

cast isEditAgentPanelOpen to boolean

* [backend] enforce agent update with user-id (#246)

* updates

* remove client changes

* remove logs

* use better header user id check

* fix validators

* typo

* Metrics: add middleware (#185)

* Metrics: add middleware

* add chat calls

* merge

* lint

* make it async

* add user id

* add more fields

* add retry and duration

* add meta

* comments

* fix tests

* improve error handling

* rename fields

* match spec

* comments

* clean code

* only create loop when theres endpoint

* add assistant id to chat

* feat(toolkit): show assistant welcome message (#255)

* feat(toolkit): show assistant welcome message

* feat(toolkit): show assistant welcome message

---------

Co-authored-by: misspia-cohere <[email protected]>
Co-authored-by: Tianjing Li <[email protected]>
Co-authored-by: Beatrix De Wilde <[email protected]>
Co-authored-by: Luísa Moura <[email protected]>
Co-authored-by: misspia-cohere <[email protected]>
Co-authored-by: Scott <[email protected]>
Co-authored-by: Khalil Najjar <[email protected]>

* fix(toolkit): UX/UI improvements (#257)

* Add error troubleshooting (#262)

* Update chat.py

---------

Co-authored-by: Jessica Wu <[email protected]>
Co-authored-by: Khalil Najjar <[email protected]>
Co-authored-by: Luísa Moura <[email protected]>
Co-authored-by: Tomeu <[email protected]>
Co-authored-by: Tianjing Li <[email protected]>
Co-authored-by: misspia-cohere <[email protected]>
Co-authored-by: Eugene P <[email protected]>
Co-authored-by: Scott <[email protected]>
Co-authored-by: Beatrix De Wilde <[email protected]>
Co-authored-by: Alex W <[email protected]>
Co-authored-by: misspia-cohere <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants