File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -47,11 +47,14 @@ export const personaResumeInquiryTool: ToolConfig<
4747 transformResponse : async ( response ) => {
4848 const data = await parsePersonaResponse ( response )
4949 const sessionToken = data . meta ?. [ 'session-token' ]
50+ if ( typeof sessionToken !== 'string' || sessionToken . length === 0 ) {
51+ throw new Error ( 'Persona did not return a session token; check the inquiry status' )
52+ }
5053 return {
5154 success : true ,
5255 output : {
5356 inquiry : mapInquiry ( asResource ( data . data ) ) ,
54- sessionToken : typeof sessionToken === 'string' ? sessionToken : null ,
57+ sessionToken,
5558 } ,
5659 }
5760 } ,
@@ -66,7 +69,6 @@ export const personaResumeInquiryTool: ToolConfig<
6669 type : 'string' ,
6770 description :
6871 'Session token for the new inquiry session, used to continue the flow in embedded SDKs' ,
69- optional : true ,
7072 } ,
7173 } ,
7274}
Original file line number Diff line number Diff line change @@ -283,7 +283,7 @@ export interface PersonaListInquiriesResponse extends ToolResponse {
283283export interface PersonaResumeInquiryResponse extends ToolResponse {
284284 output : {
285285 inquiry : PersonaInquiry
286- sessionToken : string | null
286+ sessionToken : string
287287 }
288288}
289289
You can’t perform that action at this time.
0 commit comments