1
- import { ExperimentalMessage } from 'ai' ;
1
+ import { CoreMessage } from 'ai' ;
2
2
import { createAI , createStreamableUI , createStreamableValue , getMutableAIState , StreamableValue } from 'ai/rsc' ;
3
3
4
4
import { AskFollowUpQuestion } from '@/components/layout/search/block/ask-follow-up-question' ;
@@ -13,9 +13,9 @@ import { SimpleModel } from '@/types/model';
13
13
import { SearchEngineSetting , TChallengerAction } from '@/types/search' ;
14
14
import { ProviderSetting } from '@/types/settings' ;
15
15
16
- const allowProvider = [ 'OpenAI' ] as Provider [ ] ;
16
+ const AllowSearchProvider = [ 'OpenAI' ] as Provider [ ] ;
17
17
18
- const chat = async ( model : SimpleModel , messages : ExperimentalMessage [ ] ) => {
18
+ const chat = async ( model : SimpleModel , messages : CoreMessage [ ] ) => {
19
19
'use server' ;
20
20
} ;
21
21
@@ -29,7 +29,7 @@ const search = async (
29
29
) => {
30
30
'use server' ;
31
31
32
- if ( ! allowProvider . includes ( model ?. provider ) ) {
32
+ if ( ! AllowSearchProvider . includes ( model ?. provider ) ) {
33
33
return {
34
34
id : Date . now ( ) ,
35
35
isGenerating : false ,
@@ -60,7 +60,7 @@ const search = async (
60
60
const uiStream = createStreamableUI ( ) ;
61
61
const isGenerating = createStreamableValue ( true ) ;
62
62
63
- const messages : ExperimentalMessage [ ] = aiState . get ( ) as any ;
63
+ const messages : CoreMessage [ ] = aiState . get ( ) as any ;
64
64
65
65
const question = formData ?. get ( 'input' ) as string ;
66
66
@@ -69,7 +69,7 @@ const search = async (
69
69
70
70
if ( content ) {
71
71
const message = { role : 'user' , content } ;
72
- messages . push ( message as ExperimentalMessage ) ;
72
+ messages . push ( message as CoreMessage ) ;
73
73
aiState . update ( [ ...( aiState . get ( ) as any ) , message ] ) ;
74
74
}
75
75
0 commit comments