Code Monkey home page Code Monkey logo

Comments (8)

joe-soboleski-visiontree avatar joe-soboleski-visiontree commented on June 15, 2024 1

@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?

from typechat.

weykon avatar weykon commented on June 15, 2024

try add "module": "commonjs" in your tsconfig.json file ?

from typechat.

Githamza avatar Githamza commented on June 15, 2024

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."

from typechat.

LennonReid avatar LennonReid commented on June 15, 2024

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.

from typechat.

Githamza avatar Githamza commented on June 15, 2024

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

from typechat.

BryceEWatson avatar BryceEWatson commented on June 15, 2024

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.

from typechat.

Githamza avatar Githamza commented on June 15, 2024

@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

from typechat.

DanielRosenwasser avatar DanielRosenwasser commented on June 15, 2024

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.

from typechat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.