thecomamba / unkenny Goto Github PK
View Code? Open in Web Editor NEWA FoundryVTT module providing NPCs with artificial intelligence.
License: MIT License
A FoundryVTT module providing NPCs with artificial intelligence.
License: MIT License
All tests pass, but I am getting an Error: 400 you must provide a model parameter
We currently need to reset game, ui, etc. separately. I think we should have a central access point for
I imagine a dialogue to create and edit something like roles, which are coupled with preamble snippets. So for example I could add the role "Waterdeep-Citizen" with the snippet "You know that the local mill has been overrun by killer-dolphins.", but I could also add a role like "Pirate" with the snippet "You talk like a pirate.".
In the unkenny edit dialogue you could then add or remove an arbitrary number of roles and thus create your average waterdeep citizen, your waterdeep pirate, and your generic pirate. The snippets are prepended to the actor-specific preamble.
For the first ML test, let's start a flaks server containing an example ML-image.
Goal is a communication between Foundry-Module and ML-image
Name should not contain spaces.
When a message has the conversationWith flag, we should somehow convey that information to the uset without disrupting the look of the messages too much.
I do not feel comfortable leaving everything to manual tests, especially in a non-compiled language like JavaScript, where all errors are only found once encountered. I am sure there are frameworks to do that in the currently most popular language worldwide, I just don't know any. This issue tracks the todo to delve into that.
Export whole conversations to discord, including a character portrait. This is apparently possible via a POST request and a bot that listens for that:
https://stackoverflow.com/questions/66500989/sending-a-message-to-discord-channel-via-post-request-results-in-code-401
This might be especially interesting if we want to support several languages.
Setting up NPCs can be rather repetitive. It could benefit from prepared and hard-coded prompt snippets that can be inserted with at most two clicks. I imagine something like a selection menu right next to the prompt edit field.
This could be helpful:
https://github.com/arcanistzed/sidebar-macros
The script should update all local npm dependencies and then also update the version of the dynamically loaded models during production.
This would require a little popup menu that does not pull focus, but that listens to and intercepts Tab and Enter. It should also analyze the currently typed text and filter the offered options accordingly.
Are these case-sensitive?
Even better: make foundry recognise /[name of unkenny npc] command to address NPCs directly.
Maybe make it inherit from ActorSheet instead of FormApplication.
Needs #41.
It might be necessary for the user to create a huggingface account and store an API Token.
Or is there a model that is truly openly available, without any account creation?
This would be much preferable to the hack we currently use.
There is the ChatMessageRender hook.
One issue is that the text is scanned for chat commands, and our /alias command clashes with that.
So maybe we do the text replacement in ChatMessage, and trigger calculating the response in ChatMessageRender.
How do we know if the text contained an unkenny command?
Maybe we need to rethink if we really want to use the /alias Syntax. We are about to release breaking changes, so now would be the time to do that.
It would enhance the immersion and contextual relevance of NPC interactions to introduce world variables and specific locations for NPCs within UnKenny. For instance, if the narrative includes distinct locations like Baldur's Gate and Waterdeep, incorporating local information—events, rumors, or crises—would allow NPCs in each location to provide tailored responses reflective of their environment. This would result in a more nuanced dialogue where NPCs in Waterdeep are aware and can discuss local happenings distinct from those in Baldur's Gate.
One problem is that actors can have the same name. But maybe that's an edge case that we simply don't service.
Alternatively we work with the actor id. That's probably much easier.
Acceptance criteria:
Create a macro whenever new actor becomes (!) unkenny.
Delete the macro when that actor becomes un-unkenny.
Delete the macro when that actor is deleted.
Re-create macro if the actor name changes.
Solution 1:
Hook actions into the events above.
Solution 2:
Write an updateUnKennyMacros function that loops over all actors and macros and synchronises them.
Solution 3:
Do both, calling updateUnKennyMacros on init hook.
Api models need different input than local models.
Would be nice to be able to talk to you AI-friends via /w [] or e.g. /address thay way no macro is needed.
A preample containing references to journal entries would be very powerful. Something like You have read @"Bandit's Journal":4.
, where the text of page 4 of Bandit's Journal is inserted.
This approach has some open problems:
LLMs tend to blurt out what they know. It is not simple to design a prompt such that the Model has some information, but keeps it to itself. The question of how to do that is of ongoing interest for the cybersecurity community. If we have any ideas how to guide the user towards secrecy prompts we should incorporate them.
Downloading the models and tokenizer takes about a third of the total time needed for response generation, so let's cache them.
I think the behaviour slightly changed since the last Foundry major. Easy to fix, but I want to take this as an opportunity to implement some mocking for the ChatMessage object. This will be useful when we tackle #31.
This would probably be an extension to the ChatLog, like a button offering to delete the ConversationWith flag. And we need an "you sure" dialog.
Error message says: "module does not provide a download url that can be installed".
This is less of a hassle when testing OpenAI. And GitHub supports automatic scans for secret leaks, as far as I know.
I would really like it if Foundry is not blocked while performing heavy calculations. This might possibly help:
https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers
Should contain a field for name and for a preamble.
The model is loaded in memory on only one computer, and the clients merely send their requests.
Furthermore, the model is not downloaded on every client connect!
Is this possible in foundry?
Before going for Version 1.0, I think we should check if we are using the local models properly. Are there better models available? How can we call the model to be a chatbot instead of a mere text completion model?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.