Skip to content
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

828 streamline change chat model request #883

Merged
merged 14 commits into from
Apr 2, 2024

Conversation

pmarsh-scottlogic
Copy link
Contributor

@pmarsh-scottlogic pmarsh-scottlogic commented Mar 28, 2024

Description

Previously we would set the chat model in the backend. If that was sucessful, then the frontend would send a further request to add an info message to the history. Now the backend generates this info message and forwards it to the frontend.

Notes

  • Changes CHAT_MODEL enum to CHAT_MODEL_ID string literal type.
  • Adds this type to the frontend for type safety
  • Adds extra validation to handleSetModel backend method, to check that the model is valid.
  • Adds unit tests for handleSetModel

Checklist

Have you done the following?

  • Linked the relevant Issue
  • Added tests
  • Ensured the workflow steps are passing

Copy link
Member

@chriswilty chriswilty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think our tokens-per-model have not been kept up to date, but otherwise this all looks fine 👌

backend/src/controller/modelController.ts Show resolved Hide resolved
backend/src/models/chat.ts Show resolved Hide resolved
backend/src/utils/token.ts Outdated Show resolved Hide resolved
Copy link
Member

@chriswilty chriswilty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Niiiice 👌

@pmarsh-scottlogic pmarsh-scottlogic merged commit 4f31e75 into dev Apr 2, 2024
4 checks passed
@pmarsh-scottlogic pmarsh-scottlogic deleted the 828-streamline-change-chat-model-request branch April 2, 2024 08:38
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.

Stop adding messages to backend history via frontend 🛠🛠
2 participants