Comments (8)
@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.
try add "module": "commonjs" in your tsconfig.json file ?
from typechat.
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.
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.
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.
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.
@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.
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)
- How to handle multiple languages?
- How to model classical NLU intents and entities(slots)?
- Design Meeting Notes (2023-10-23) HOT 1
- Design Meeting Notes (2023-10-30)
- Design Meeting Notes (2023-11-06)
- Suggestion prompt to return UnknownText HOT 1
- getting started example? HOT 3
- should we read interface as a text file? HOT 2
- error when using translate function
- Streaming HOT 1
- Feat: Add support for Vision API and Input Images
- Add `@dataclass` support to Python
- Ensure Python compatibility back to 3.11 HOT 2
- Implement some snapshot testing for our Python schema translation HOT 1
- Provide helper function parity between TS and Python HOT 1
- Use a chat session as context
- How to log the prompt generated by typechat? HOT 2
- [FEATURE REQUEST] Ollama compatibility
- when will v0.1.0 be released to npm? HOT 5
- docs/examples.md links are broken HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from typechat.