File tree Expand file tree Collapse file tree 3 files changed +6
-31
lines changed Expand file tree Collapse file tree 3 files changed +6
-31
lines changed Original file line number Diff line number Diff line change @@ -157,7 +157,9 @@ const ChatV2Content = () => {
157
157
const { usage, limit } = userStatus
158
158
const tokenUsageExceeded = usage >= limit
159
159
160
- if ( tokenUsageExceeded && activeModel !== FREE_MODEL ) {
160
+ const acualModel = ( promptInfo . type === 'saved' ? promptInfo . model : null ) ?? activeModel
161
+
162
+ if ( tokenUsageExceeded && acualModel !== FREE_MODEL ) {
161
163
enqueueSnackbar ( t ( 'chat:errorInstructions' ) , { variant : 'error' } )
162
164
handleCancel ( )
163
165
return
@@ -191,7 +193,7 @@ const ChatV2Content = () => {
191
193
chatScroll . beginAutoscroll ( )
192
194
193
195
const generationInfo : MessageGenerationInfo = {
194
- model : activeModel ,
196
+ model : acualModel ,
195
197
promptInfo,
196
198
}
197
199
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
import z from 'zod/v4'
2
2
import type { ChatToolDef } from './tools'
3
- import { validModels } from '../config'
3
+ import { ValidModelNameSchema , validModels } from '../config'
4
4
5
5
/**
6
6
* Event emitted when text is added to a chat message
@@ -65,7 +65,7 @@ export const MessageGenerationInfoSchema = z.object({
65
65
id : z . string ( ) ,
66
66
name : z . string ( ) ,
67
67
systemMessage : z . string ( ) . optional ( ) ,
68
- model : z . string ( ) . optional ( ) . nullable ( ) ,
68
+ model : ValidModelNameSchema . optional ( ) . nullable ( ) ,
69
69
temperature : z . number ( ) . min ( 0 ) . max ( 1 ) . optional ( ) . nullable ( ) ,
70
70
} ) ,
71
71
z . object ( {
You can’t perform that action at this time.
0 commit comments