@@ -10,6 +10,8 @@ import {
1010 provideAnswerConfidenceSchema ,
1111 salesSignalType ,
1212 detectedSalesSignal ,
13+ supportSignalType ,
14+ detectedSupportSignal ,
1315} from '@/utils/inkeep' ;
1416import { zodToJsonSchema } from 'zod-to-json-schema' ;
1517import { CONTACT_SALES_URL } from '@/consts/externalLinks' ;
@@ -103,59 +105,97 @@ export const useInkeepSettings = ({
103105 'Pharse Match' ,
104106 ] ,
105107 getTools : ( ) => [
108+ // {
109+ // type: 'function',
110+ // function: {
111+ // name: 'provideAnswerConfidence',
112+ // description:
113+ // 'Determine how confident the AI assistant was and whether or not to escalate to humans.',
114+ // parameters: zodToJsonSchema(provideAnswerConfidenceSchema),
115+ // },
116+ // renderMessageButtons: ({ args }) => {
117+ // const confidence = args.answerConfidence;
118+ // if (['not_confident', 'no_sources', 'other'].includes(confidence)) {
119+ // return [
120+ // {
121+ // label: 'New Issue',
122+ // icon: { builtIn: 'IoHelpBuoyOutline' },
123+ // action: {
124+ // type: 'open_link',
125+ // url: 'https://github.com/milvus-io/milvus/issues',
126+ // },
127+ // },
128+ // ];
129+ // }
130+ // return [];
131+ // },
132+ // } as ToolFunction<{
133+ // answerConfidence: string;
134+ // explanation: string;
135+ // }>,
106136 {
107137 type : 'function' ,
108138 function : {
109- name : 'provideAnswerConfidence ' ,
139+ name : 'detectSalesSignal ' ,
110140 description :
111- 'Determine how confident the AI assistant was and whether or not to escalate to humans .' ,
112- parameters : zodToJsonSchema ( provideAnswerConfidenceSchema ) ,
141+ 'Identify when users express interest in potentially purchasing a product .' ,
142+ parameters : zodToJsonSchema ( detectedSalesSignal ) ,
113143 } ,
114144 renderMessageButtons : ( { args } ) => {
115- const confidence = args . answerConfidence ;
116- if ( [ 'not_confident' , 'no_sources' , 'other' ] . includes ( confidence ) ) {
145+ // If any valid sales signal is detected, show a demo scheduling option
146+ if ( args . type && validSalesSignalTypes . includes ( args . type ) ) {
117147 return [
118148 {
119- label : 'New Issue ' ,
120- icon : { builtIn : 'IoHelpBuoyOutline ' } ,
149+ label : 'Contact Sales ' ,
150+ icon : { builtIn : 'LuCalendar ' } ,
121151 action : {
122152 type : 'open_link' ,
123- url : 'https://github.com/milvus-io/milvus/issues' ,
153+ url : ` ${ CONTACT_SALES_URL } ?contact_sales_traffic_source=milvusBot` ,
124154 } ,
125155 } ,
126156 ] ;
127157 }
128158 return [ ] ;
129159 } ,
130- } as ToolFunction < {
131- answerConfidence : string ;
132- explanation : string ;
133- } > ,
160+ } as ToolFunction < { type : string } > ,
134161 {
135162 type : 'function' ,
136163 function : {
137- name : 'detectSalesSignal ' ,
164+ name : 'detectSupportSignal ' ,
138165 description :
139- 'Identify when users express interest in potentially purchasing a product .' ,
140- parameters : zodToJsonSchema ( detectedSalesSignal ) ,
166+ 'Detect whether the user is requesting technical support or reporting an issue .' ,
167+ parameters : zodToJsonSchema ( detectedSupportSignal ) ,
141168 } ,
142169 renderMessageButtons : ( { args } ) => {
143- // If any valid sales signal is detected, show a demo scheduling option
144- if ( args . type && validSalesSignalTypes . includes ( args . type ) ) {
170+ const signal = args ?. type ;
171+ if (
172+ [
173+ 'technical_issue' ,
174+ 'deployment_and_setup' ,
175+ 'system_operations' ,
176+ 'data_and_performance' ,
177+ 'integration_and_solutions' ,
178+ 'ai_low_confidence_or_docs_missing' ,
179+ 'direct_support_request' ,
180+ ] . includes ( signal )
181+ ) {
145182 return [
146183 {
147184 label : 'Talk to Us' ,
148- icon : { builtIn : 'LuCalendar ' } ,
185+ icon : { builtIn : 'IoHelpBuoyOutline ' } ,
149186 action : {
150187 type : 'open_link' ,
151- url : ` ${ CONTACT_SALES_URL } ?contact_sales_traffic_source=milvusBot` ,
188+ url : 'https://meetings.hubspot.com/chloe-williams1/milvus-office-hour' ,
152189 } ,
153190 } ,
154191 ] ;
155192 }
156193 return [ ] ;
157194 } ,
158- } as ToolFunction < { type : string } > ,
195+ } as ToolFunction < {
196+ type : string ;
197+ explanation : string ;
198+ } > ,
159199 ] ,
160200 } ;
161201
0 commit comments