-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Loading System Purposes from JSON file, overriding default data.ts va… #128
Conversation
syberkitten
commented
Jun 19, 2023
- Add Teacher and Default system purposes, update API host, and load systemPurposes from JSON file
- Add .env.* to .gitignore
- Modify src/data.ts to load systemPurposes from systemPurposes.json
- Add Teacher and Default system purposes in systemPurposes.json
…lues, allows to extend without changing sourcecode. - Add Teacher and Default system purposes, update API host, and load systemPurposes from JSON file - Add .env.* to .gitignore - Modify src/data.ts to load systemPurposes from systemPurposes.json - Add Teacher and Default system purposes in systemPurposes.json
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Hi Guys, by the way It may be preferred to put the systemPurposes.json inside the env vars section Basically this idea comes from the fact that I'm using BigAGI in tandem with another Ideas are welcome and I'll be glad to assist... ) |
Thanks @syberkitten, good idea, smart implementation. Do you know whether the loading code runs at build time or runtime, and client or server? that 'require' is dark magic to me :) |
Another question @syberkitten: what do you think if we had the current SystemPurposes inside the JSON, with maybe 1-2 as fallback in case the JSON is loaded incorrectly? This would allow for greater customization, since the current impl wouldn't allow removal, only add/override. Also, there's an 'invisible' list of IDs in the store-purposes... maybe that should be loaded from a JSON the first time.. |
Thanks for the feedback @enricoros When the code is bundled and built, the server will attempt to load the I will also add the JSON validation and error handling so that if the json is malformed An error will be printed As to the second question I'll give it a further dive and get back to you :) |
@enricoros can you please specify which fallback purposes would you have as fallback?? |
Good point, no need for those. Sorry for the lag, I had a few other changes to bring in before this. I've tried and it works. |
I'm also a fan of being able to drop in agent purposes with a JSON and to be able to back it up easily and share. 🔥 |
… folder instead of the root folder.
- Updated bpTileSize values in PurposeSelector.tsx - Imported system-purposes.json in store-purposes.ts - Updated hiddenPurposeIDs in usePurposeStore function - Updated title in SystemPurposes object in data.ts - Updated systemPurposesJson and validatedSystemPurposes in data.ts
Ok, I've made final changes to the Pull Request including these features:
Let me know if you have other remarks or ideas, looking forward to see this in as I've already started working on more stuff, so next PR is coming soon.... :) |
… different breakpoints.
…, added try-catch block to handle file import error, and updated default state and toggleHiddenPurposeId action.
Hi @enricoros and @DeFiFoFum |
@syberkitten This looks like a great start, but I would hope that users who are not building the application themselves would be able to upload their own custom configs (and also be able to save and back them up). |
Hi @DeFiFoFum Other then this, I wish is to be able to customize both branding as well. Some of the features here (for my use case) are not really needed, but they are "backed" |
@syberkitten I started merging this, but then went down a rabbit hole of trying to make an editing system. So can't merge yet as I wanted. I started using Zod for type validation, then did an overlay (instead of append) of the purposes, then renamed to personas, then changed the data structure, move to a 'zustand store' for user customization, etc etc.. -- basically, tried to boil the ocean and aren't done yet. I should probably land a minimal version of your patch first, and then restart with the big personas change. |
Hi @syberkitten, closing this as will be tracked with a new system of making personas dynamic. #35 |