Giter Site home page Giter Site logo

ktheman / unkenny Goto Github PK

View Code? Open in Web Editor NEW

This project forked from thecomamba/unkenny

0.0 0.0 0.0 1.38 MB

A FoundryVTT module providing NPCs with artificial intelligence.

License: MIT License

Shell 2.65% JavaScript 94.59% PowerShell 0.64% Handlebars 2.12%

unkenny's Introduction

UnKenny - NPCs with artificial intelligence

About

UnKenny is a module for Foundry Virtual Tabletop. It allows you to generate a tiny dialogue with a character, by providing them with a limited AI. The idea arose during our Starfinder game, because we wanted to simulate the interaction with a robotical NPC.

Security

Be mindful which modules you enable.

If you are storing your OpenAI API key in UnKenny, you are entrusting it to us, and by extension, to FoundryVTT. The modularity of Foundry is one of its big selling points, but it is also an invitation to arbitrary code execution. Any module you install could, in principle, inject some code that steals your API key. Foundry takes some countermeasures like scoping of modules, but ultimately it is very hard to defend against attacks from within your application.

For that reason, monitor your API key usage every now and then. If ever you find a module that has stolen your key, please

Usage

Global Configuration

After enabling the module for a world, configure it in the global settings. Selecting a Large Language Model is required. If you want to use one of OpenAI's models, you will also need to set up and pay for an API key. Note that different models may have different capabilties and also different usage costs.

The other parameters are set to reasonable defaults.

UnKenny Game Settings

Actor Configuration

Open the sheet of the actor that you want to make UnKenny and click on "Modify UnKennyness".

Actor Sheet

Provide the following two inputs:

  • Alias: An UnKenny alias to refer to the actor in chat messages. Only alphanumeric characters and underscores are allowed here.
  • Preamble: This is a short description of what the character needs to know about themselves.

You may also overwrite any global settings for this actor only. If for example you want to have a particularly repetitive character, you could set the Repetition penalty to a negative value. However, most effects can also be achieved by accurately describing the character in the preamble.

UnKenny Sheet

As long as the alias is not empty, the actor is considered unkenny and can be adressed. To speak to the actor, mention them anywhere in your message using @<alias>, where <alias> is their UnKenny alias.

Your chat message is posted, and a short while later, the response generated by the large language model is posted below it. This example was generated with the GPT-4 model.

Dialogue

Any messages previously posted at or by the actor are included in the chat conversation. Note that the context size of a large language model is limited. At some point UnKenny might warn you that it starts truncating messages. To avoid that, simply clean up the chat log. Alternatively you can switch to a model with a larger context size. For OpenAi, these are usually the ones ending on 'turbo'.

Manual Installation

To manually install UnKenny (e.g. for development), copy the src/ folder of this repository to the {userData}/Data/modules/ folder of Foundry, and then rename it to 'unkenny' (the id declared in module.json).

On POSIX compliant operating systems like Linux and Mac you can alternatively use a symbolic link. It can be created via e.g.

ln -s {folder containing git repo}/UnKenny/src {Foundry user data}/Data/modules/unkenny

License

This software is distributed under the MIT license. In a nutshell this means that all code is made public, and you are free to use it without any charge.

We do not provide any guarantees for the licenses under which the models are distributed. The local models have some open source licensing, OpenAI's models are proprietary.

Acknowledgments

Some of the authors thank CarinaKt for the ongoing fruitful discussions.

Some of the authors support #TeamEmilia.

unkenny's People

Contributors

thecomamba avatar simonheidrich avatar ktheman avatar kingphilausti avatar

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.