Open Githamza opened 11 months ago
try add "module": "commonjs" in your tsconfig.json file ?
it's already there
I'm getting also this error today :
"Response is not JSON:\nI'm sorry, but as an AI language model, I cannot provide a revised JSON object for this scenario as the error message suggests that the issue is with the TypeScript module and not the JSON object itself. It seems like there is an issue with the module definition or import statements in the code. Please review the code and ensure that the module is properly defined and imported."
It seems like the definition of the type is wrong.
export interface SummarizedMailItems { type:'mailSummary', summarizationLanguage: 'arabic' | 'english' | 'french' | 'spanish' summaryParagraph:string , summaryBulletpoints: [string,string,string]
} It should be export interface SummarizedMailItems { type:'mailSummary'; summarizationLanguage: 'arabic' | 'english' | 'french' | 'Spanish; summaryParagraph:string ; summaryBulletpoints: [string,string,string];
} Use a semicolon instead of a comma.
I get always the error I notice that inside the error the response contains the right json but I don't understand why I get the json validation failure { success: false, message: "JSON validation failed: File '/schema.ts' is not a module.\n'Object' only refers to a type, but is being used as a value here.\nCannot find name 'exports'.\n{\n \"paragraphSummary\": \"Discover trends in your work habits with Microsoft Viva Insights. Get insights on your work habits in areas such as focus, well-being, network, and collaboration. Protect your privacy with Viva Insights. Understand and improve your professional habits by reflecting on your work methodology. Click on Viva Insights in the Outlook ribbon to view your tasks and more.\",\n \"bulletPointsSummary\": [\n \"27 days without interruption of quiet hours\",\n \"0% of significant collaboration outside of working hours\",\n \"100% of available time for individual work in a normal week\"\n ]\n}", }
Edit : I notice that it's an old schema that I defined at the beggining
I'm getting this as well, trying to see what's wrong with the response vs. the TypeScript. It would be helpful if this error message gave more details about what was failing validation.
@BryceEWatson I have found the origin : the project was compiling ts files to js , so typechat didn't found the schema ts file. ensure that the ts model path is good when your projet compiles too
Another solution is may be to use fs library to programmatically create typescript file add add inside your interfaces
Yes, it's a bit of a gotcha - you need to copy over your TypeScript schema files or run your TypeScript source in-place with a tool like ts-node.
@Githamza / @DanielRosenwasser Im still running into this issue, can you explain a little bit more what you mean by your solution? Im a little confused about what the schema.ts file is and what changes you made so that it could still find it?
I'm using this function to get summary
Here's the schema file
I'm getting this error