11import 'server-only' ;
2- import { ProvideAIAnnotationsToolSchema , ProvideLinksToolSchema } from './schemas' ;
2+ import { ProvideAnswerConfidenceToolSchema , ProvideLinksToolSchema } from './schemas' ;
33
44import type { CoreMessage } from 'ai' ;
55import type { z } from 'zod' ;
@@ -40,8 +40,8 @@ export const generateQaModeResponse = async ({
4040 provideRecordsConsidered : {
4141 parameters : ProvideRecordsConsideredToolSchema ,
4242 } ,
43- provideAIAnnotations : {
44- parameters : ProvideAIAnnotationsToolSchema ,
43+ provideAnswerConfidence : {
44+ parameters : ProvideAnswerConfidenceToolSchema ,
4545 } ,
4646 provideLinks : {
4747 parameters : ProvideLinksToolSchema ,
@@ -50,16 +50,16 @@ export const generateQaModeResponse = async ({
5050 toolChoice : 'auto' ,
5151 } ) ;
5252
53- const aiAnnotations = toolCalls . find ( toolCall => toolCall . toolName === 'provideAIAnnotations ' ) ?. args
54- . aiAnnotations as z . infer < typeof ProvideAIAnnotationsToolSchema > [ 'aiAnnotations ' ] ;
53+ const answerConfidence = toolCalls . find ( toolCall => toolCall . toolName === 'provideAnswerConfidence ' ) ?. args
54+ . answerConfidence as z . infer < typeof ProvideAnswerConfidenceToolSchema > [ 'answerConfidence ' ] ;
5555 const recordsConsidered = toolCalls . find ( toolCall => toolCall . toolName === 'provideRecordsConsidered' ) ?. args
5656 . recordsConsidered as z . infer < typeof ProvideRecordsConsideredToolSchema > [ 'recordsConsidered' ] ;
5757 const links = toolCalls . find ( toolCall => toolCall . toolName === 'provideLinks' ) ?. args . links as z . infer <
5858 typeof ProvideLinksToolSchema
5959 > [ 'links' ] ;
6060
6161 return {
62- aiAnnotations ,
62+ answerConfidence ,
6363 text,
6464 recordsConsidered,
6565 links,
0 commit comments