ShipBit / slickgpt

SlickGPT is a light-weight "use-your-own-API-key" web client for the OpenAI API written in Svelte. It offers GPT-4 integration, a userless share feature and other superpowers.
https://slickgpt.vercel.app
MIT License
464 stars 97 forks source link

bugfix: error loading chats with a deleted model #105

Closed xmoiduts closed 4 months ago

xmoiduts commented 4 months ago
[generated by claude-3-opus using slick-zy-gpt fork]
When a model is deleted from SlickGPT, attempting to load existing
chats that used the deleted model would result in an error. This is
because the code assumes the model object always exists.

This commit adds a check to see if the model for a chat still exists
when loading it. If the model is gone, it will:

1. Show a warning toast to the user explaining the model was deleted
and that we are falling back to the default model.

image

(The model name is experimental)

2. Set the chat's model to the default model specified in
`defaultOpenAiSettings`. This allows the chat to still load and
be usable.

This could be a temporary fix to prevent errors and data loss.

fixes #104

vercel[bot] commented 4 months ago

@xmoiduts is attempting to deploy a commit to the ShipBit Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] commented 4 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
slickgpt ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 31, 2024 11:14am