Repository navigation
Code Generation Tool - #718
Conversation
✅ Deploy Preview for thingweb-playground ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
egekorkan
left a comment
There was a problem hiding this comment.
Initial review based on git diff
- Netlify previews are failing due to dependencies. Not sure how the CI tests are passing if the problem is so basic :D
- For the tests, did you also do tests with a live Thing? like your coffee machine example or http://plugfest.thingweb.io/http-data-schema-thing ?
869d86c to
39bae0d
Compare
egekorkan
left a comment
There was a problem hiding this comment.
- Web package is working nicely.
- CLI:
- tsx as a dependency is missing
- Modbus and javascript is not working? Or is the base not used to detect protocol?
- When the output prompt step comes and I put a path,
~/Downloadsdoes not work
However, given that the CLI will live in td-tools, we can still go ahead and fix the issues in the commits to that repo
be40612 to
66470ea
Compare
Could you please share your inputs? Modbus serial works fine for me. |
The path input was only relative. I added support for absolute path inputs and an interactive mode for selecting the file or folder to ease the input. Could you test that again please? |
This is working. Modbus in Javascript with the following TD does not work. It is generated from https://github.com/wot-oss/thingmodels/blob/main/siemens/siemens/3nacom-fuse/v1.0.0-20240802121832-3b18ae135fbc.tm.json but use the attachment. The generation results in a prompt even though we have modbus binding |
|
@egekorkan I have refactored the code and improved the protocol detection. Now it should work fine. |
ab66335 to
3996fe6
Compare
|
I think the feature is ready to move to the td-tools and further improvements can be done there. I still see some frictions like fetch showing up even for modbus but that can be an improvement. @bobur-khay can you make a PR with only the core tooling in td-tools? |
|
It was only in Playground so it is fine for now :) |
|
Copied the package to eclipse-thingweb/td-tools#77 Will remove it from this PR once the other one is merged |
|
@bobur-khay the package is published at https://www.npmjs.com/package/@thingweb/code-gen |
|
There was a publish problem for the code-gen package. Fixed it here eclipse-thingweb/td-tools#80 |
12390e5 to
c8708bf
Compare
|
Ready for final review |
egekorkan
left a comment
There was a problem hiding this comment.
Also some basic tests are needed. the actual tool is ofc tested in td-tools but would be nice to test if the console gets populated with code
Tests added |
|
@bobur-khay could you resolve the conflicts? Otherwise good to go after enough review time |
mvp for generate prompt mvp for algorithmic approach overall mvp new generators dynamic client refactoring initial generators cleanup mvp tests copy button vitest version change visual test fix change the dependency to file location fix test Readme file license update test revert test updated package-lock add typescript to dependencies update lock file package lock update fix hidden input bars for build post-rebase fix netlify tests rebase fix rebase lost change tsx dependency interactive path input readme update fix modbus refactoring update package-lock update package-lock mvp package-lock fix race condition in tests revert express version tests Update packages/web/src/scripts/code-gen.js
d32db4f to
8dcb6cd
Compare
|
conflicts resolved |


This is a take over of PR: eclipse-thingweb/td-tools#61
The goal is to create a package of a code generation tool that creates a protocol specific code snippet in a chosen library of a programming language and integrate it to the playground.
Taking over the previous PR I could not make it run and had a different vision of the use of AI generation:
The Bring Your Own Token principal requires the playground of either:
In both cases the user needs a developer account in their respective LLM provider and has to know how to generate the token which reduces UX imo. Therefore, after discussing this with @egekorkan I implemented another concept where the tool generates a prompt that user can paste in an LLM of their own choice:
The tool is inside of this repository for now for testing purposes. Later it can be moved to the
td-toolsrepository.