Compare commits

...

90 Commits

Author SHA1 Message Date
veguAI
113553c306 0.29.0 (#167)
* set 0.29.0

* tweaks for dig layered history (wip)

* move director agent to directory

* relock

* remove "none" from dig_layered_history response

* determine character development

* update character sheet from character development (wip)

* org imports

* alert outdated template overrides during startup

* editor controls normalization of exposition

* dialogue formatting refactor

* fix narrator.clean_result forcing * regardless of editor fix exposition setting

* move more of the dialogue cleanup logic into the editor fix exposition handlers

* remove cruft

* change ot normal selects and add some margin

* move formatting option up

* always strip partial sentences

* separates exposition fixes from other dialogue cleanup operations, since we still want those

* add novel formatting style

* honor formatting config when no markers are supplied

* fix issue where sometimes character message formatting would miss character name

* director can now guide actors through scene analysis

* style fixes

* typo

* select correct system message on direction type

* prompt tweaks

* disable by default

* add support for dynamic instruction injection and include missing guide for internal note usage

* change favicon and also indicate business through favicon

* img

* support xtc, dry and smoothing in text gen webui

* prompt tweaks

* support xtc, dry, smoothing in koboldcpp client

* reorder

* dry, xtc and smoothing factor exposed to tabby api client

* urls to third party API documentation

* remove bos token

* add missing preset

* focal

* focal progress

* focal progress and generated suggestions progress

* fix issue with discard all suggestions

* apply suggestions

* move suggestion ux into the world state manager

* support generation options for suggestion generation

* unused import

* refactor focal to json based approach

* focal and character suggestion tweaks

* rmeove cruft

* remove cruft

* relock

* prompt tweaks

* layout spacing updates

* ux elements for removal of scenes from quick load menu

* context investigation refactor WIP

* context investigation refactor

* context investigation refactor

* context investigation refactor

* cleanup

* move scene analysis to summarizer agent

* remove deprecated context investigation logic

* context investigation refactor continued - split into separate file for easier maint

* allow direct specification of response context length

* context investigation and scene analyzation progress

* change analysis length config to number

* remove old dig-layered-history templates

* summarizer - deep analysis is only available if there is layered history

* move world_state agent to dedicated directory

* remove unused imports

* automatic character progression WIP

* character suggestions progress

* app busy flag based on agent business

* indicate suggestions in world state overview

* fix issue with user input cleanup

* move conversation agent to a dedicated submodule

* Response in action analyze_text_and_extract_context is too short #162

* move narrator agent to its own submodule

* narrator improvements WIP

* narration improvements WIP

* fix issue with regen of character exit narration

* narration improvements WIP

* prompt tweaks

* last_message_of_type can set max iterations

* fix multiline parsing

* prompt tweaks

* director guide actors based of scene analysis

* director guidance for actors

* prompt tweaks

* prompt tweaks

* prompt tweaks

* fix automatic character proposals not propagating to the ux

* fix analysis length

* support director guidance in legacy chat format

* typo

* prompt tweaks

* prompt tweaks

* error handling

* length config

* prompt tweaks

* typo

* remove cruft

* prompt tweak

* prompt tweak

* time passage style changes

* remove cruft

* deep analysis context investigations honor call limit

* refactor conversation agent long term memory to use new memory rag mixin - also streamline prompts

* tweaks to RAG mixin agent config

* fix narration highlighting

* context investgiation fixes
director narration guidance
summarization tweaks

* direactor guide narration progress
context investigation fixes that would cause looping of investigations and failure to dig into the correct layers

* prompt tweaks

* summarization improvements

* separate deep analysis chapter selection from analysis into its own prompt

* character entry and exit

* cache analysis per subtype and some narrator prompt tweaks

* separate layered history logic into its own summarizer mixin and expose some additional options

* scene can now set an overral writing style using writing style templates
narrator option to enable writing style

* narrate query writing style support

* scene tools - narrator actions refactor to handler and own component

* narrator query / look at narrations emitted as context investigation messages
refactor context investigation messaage display
scene message meta data object

* include narrative direction

* improve context investigation message prompt insert

* reorg supported parameters

* fix bug when no message history exists

* WIP make regenerate work nicely with director guidance

* WIP make regenerate work nicely with director guidance

* regenerate conversation fixes

* help text

* ux tweaks

* relock

* turn off deep analysis and context investigations by default

* long term memory options for director and summarizer

* long term memory caching

* fix summarization cache toggle not showing up in ux

* ux tweaks

* layered history summarization includes character information for mentioned characters

* deepseek client added

* Add fork button to narrator message

* analyze and guidance support for time passage narration

* cache based on message fingerprint instead of id

* configurable system prompts WIP

* configurable system prompts WIP

* client overrides for system prompts wired to ux

* system prompt overhaul

* fix issue with unknown system prompt kind

* add button to manually request dynamic choices from the director
move the generate choices logic of the director agent to its own submodule

* remove cruft

* 30 may be too long and is causing the client to disappear temporarly

* suppoert dynamic choice generate for non player characters

* enable `actor` tab for player characters

* creator agent now has access to rag tools
improve acting instruction generation

* client timeout fixes

* fix issue where scene removal menu stayed open after remove

* expose scene restore functionality to ux

* create initial restore point

* fix creator extra-context template

* didn't mean to remove this

* intro scene should be edited through world editor

* fix alert

* fix partial quotes regardless of editor setting
director guidance for conversation reminds to put speech in quotes

* fix @ instructions not being passed through to director guidance prompt

* anthropic mode list updated

* default off

* cohere model list updated

* reset actAs on next scene load

* prompt tweaks

* prompt tweaks

* prompt tweaks

* prompt tweaks

* prompt tweaks

* remove debug cruft

* relock

* docs on changing host / port

* fix issue with narrator / director actiosn not available on fresh install

* fix issue with long content classification determination result

* take this reminder to put speech into quotes out for now, it seems to do more harm than good

* fix some remaining issues with auto expositon fixes

* prompt tweaks

* prompt tweaks

* fix issue during reload

* expensive and warning ux passthrough for agent config

* layered sumamry analysation defaults to on

* what's new info block added

* docs

* what's new updated

* remove old images

* old img cleanup script

* prompt tweaks

* improve auto prompt template detection via huggingface

* add gpt-4o-realtime-preview
add gpt-4o-mini-realtime-preview

* add o1 and o3-mini

* fix o1 and o3

* fix o1 and o3

* more o1 / o3 fixes

* o3 fixes
2025-02-01 17:44:06 +02:00
Kaldigo
736e6702f5 Dockerfile Update (#174)
* Update Dockerfile

Replaced --no-dev with --only main

* Update Dockerfile

Updated command
2025-01-30 02:29:44 +02:00
veguAI
80256012ad 0.28.0 (#148)
* fix issue where saving a new scene would save into a "new scenario" directory instead instead of a relevantly named directory

* implement function to fork new scene file from specific message

* dynamic choice generation

* dynamic choice generation progress

* prompt tweaks

* disable choice generation by default
prompt tweaks

* prompt tweaks for assisted RAG tasks

* allow analyze_text_and_extract_context to include character context

* more prompt tweaks for RAG assist during conversation generation

* open director settings from dynamic action dialog

* adjust wording

* remove player choice message if the trigger message is removed (or regenerated)

* fix issue with dialogue cleaqup where narration over multiple lines would end up being marked incorrectly

* dynamic action generation custom instructions
dynamic action generation narration for sensory actions

* fix actions when acting as another character

* 0.28.0

* conversation agent: split out generation settings, add actor instructions extension, add actor instruction offset slider

* prompt tweaks

* fix ai message regenerate if generated from choice

* cruft

* layered history implementation through summarizer
summarization tweaks

* show layered history in ux

* layered history fixes and tweaks
conversation actor instruction fixes

* more summarization fixes

* fix missing actor instructions

* prompt tweaks

* prompt tweaks

* force lower case when checking sensory type

* agent modal polish
implement find-natural-scene-termination summarizer action
some summarization tweaks

* integrate find_natural_scene_termination with layered history

* collect all denouements at once

* relock

* fix some issues with screenplay type formatting in conversation agent

* cleanup

* revert layered history summarization to use max_process_tokens instead of using ai to fine scene termination as that process falls apart in layer 1 and higher, at that point every item is a scene in itself.

* implement ai assisted digging through layered history to answer queries

* dig_layered_history tweaks and improvements

* prompt tweaks

* adjust budget

* adjust budget for RAG context

* layered_history disabled by default

* prompt tweaks to reinforcement updates

* prompt tweaks

* dig layered history - response without function call to be treated as answer

* clarify style keywords to avoid bleeding into the prompt as subject matter

* fix issue with cover image updates

* fix missing dialogue from context history

* fix issue where new scenes wouldn't load

* fix crash with layered summarization

* more context history fixes

* fix assured dialogue message in context history

* prompt tweaks

* tweaks to layered history generation

* prompt tweaks

* conversation agent can dig layered history for extra context

* some fixes to dig layered history

* scene fork adjust layered history

* layered history status indication

* allow configuration of message styles and colors

* fix issue where layered history generate would get stuck on layer 0

* dig layered history default to false

* prompt tweaks

* context investigation messages

* tweaks to context investigation

* context investigation polish of UX and allow specifying trigger

* prompt tweaks

* allow hiding of ci and director messages

* wire ci shrotcut buttons

* prompt tweaks

* prompt tweaks

* carry on analysis when digging layered history

* improve quality of generate choices by anchoring to last line in the scene

* update hint message

* prompt tweaks

* change default value for max_process_tokens

* docs

* dig layered history only if there are layers

* always enforce num choices limit

* relock

* typos

* prompt tweaks

* docs for forking a scene

* prompt tweaks

* world editor rubber banding fixes follow up

* layered history cleanup fixes

* gracefully handle malformed dig() call

* handle malformed answer() call

* only generate choices if last content isn't player message

* include more context in autocomplete prompts

* prompt tweaks

* typo

* fix issue where inactive characters could not be deleted

* more character delete bugs

* dig layered history fixes

* discard empty content investigations

* fix issue with autocomplete no longer working in world editor

* prompt tweaks

* support single quotes

* prompt tweaks

* fix issue with context investigation if final message was narrator text

* Include the query in the context investigation message

* context investigvations should note when historic events occured

* instructions on how to use internal notes

* time_diff return empty string no time supplied

* prompt tweaks

* fix date calculations for historic entries

* change default values

* prompt tweaks

* fix history regenerate continuing through page reload

* reorganize websocket tasks

* allow cancelling of history regenerate

* Capitalize first letter of summarization

* include base layer in context investigations

* prompt tweaks

* fix issue where context investigations would expand too much of the history at once

* attempt to determine character knowledge during context investigation

* prompt tweaks

* prompt tweaks

* fix mising timestamps

* more context during layer history digging

* fix issue with act-as not being able to select past the first npc if a scene had more than one active npcs in it

* docs

* error handling for malformed answer call

* timestamp calculation fixes and summarization improvements

* lock message manipulation while the ux is busy

* prompt tweaks

* toggling 'log debug messages' will log all messages to console even if no filter is specified

* layered history generation cancellable from ux

* prevent loading scene while another scene is currently loading

* improvements to choice generation prompt and error handling

* prompt tweaks

* prompt tweaks

* prompt tweaks

* fix issue with successive scene load not working

* correctly display timestamps and generated layers during history regen

* summarization improvements

* clean up context investigation prompt

* prompt tweaks

* increase response token size for dig_layered_history

* define missing presets

* missing preset

* prompt tweaks

* fix simulation suite

* attach punkt download to backend start, not frontend start

* dig layered history fixes

* prompt tweaks

* fix summarize_and_pin

* more fixes for time calculations

* relock

* prompt tweaks

* remove dupe entry from layered history

* bash version of update script

* prompt tweaks

* layered history defaults to enabled

* default decreased to 0.3 chance

* fix multi character natural flow selection with clients that don't support LLM coercion

* fix simulation suite call to change a character

* typo

* remove deprecated test

* use python3

* add missing 4o models

* add proper configs for 4o models

* prompt tweaks

* update reinforcement prompt ignores context investigations

* scene.snapshot formatting and dig_layered_history ignores reinforcments

* use end date instead of start date

* Reword 'Moments ago' to 'Recently' as it is more forgiving and applicable to longer time ranges

* fix time calculation issues during summarization of new entries

* no need for scoping

* dont display as range if start and end of entry are identical

* prompt tweaks
2024-11-24 15:43:27 +02:00
veguAI
bb1cf6941b 0.27.0 (#137)
* move memory agent to directory structure

* chromadb settings rework

* memory agent improvements
embedding presets
support switching embeddings without restart
support custom sentence transformer embeddings

* toggle to hide / show disabled clients

* add memory debug tools

* chromadb no longer needs its dedicated config entry

* add missing emits

* fix initial value

* hidden disabled clients no longer cause enumeration issues with client actions

* improve memory agent error handling and hot reloading

* more memory agent error handling

* DEBUG_MEMORY_REQUESTS off

* relock

* sim suite: fix issue with removing or changing characters

* relock

* fix issue where actor dialogue editor would break with multiple characters in the scene

* remove cruft

* implement interrupt function

* margin adjustments

* fix rubber banding issue in world editor when editing certain text fields

* status notification when re-importing vectorb due to embeddings change

* properly open new client context on agent actions

* move jiggle apply to the end of prompt tune stack

* narrator agent length limit and jiggle settings added - also improve post generation cleanup

* progress story prompt improvements

* narrator prompt and cleanup tweaks

* prompt tweak

* revert

* autocomplete dialogue improvements

* Unified process (#141)

* progress to unified process

* --dev arg

* use gunicorn to serve built frontend

* gunicorn config adjustments

* remove dist from gitignore

* revert

* uvicorn instead

* save decode

* graceful shutdown

* refactor unified process

* clean up frontend log messages

* more logging fixes

* 0.27.0

* startup message

* clean up scripts a bit

* fixes to update.bat

* fixes to install.bat

* sim suite supports generation cancellation

* debug

* simplify narrator prompts

* prompt tweaks

* unified docker file

* update docker compose config for unified docker file

* cruft

* fix startup in linux docker

* download punkt so its available

* prompt tweaks

* fix bug when editing scene outline would wipe message history

* add o1 models

* add sampler, scheduler and cfg config to a1111 visualizer

* update installation docs

* visualizer configurable timeout

* memory agent docs

* docs

* relock

* relock

* fix issue where changing embeddings on immutable scene would hang

* remove debug message

* take torch install out of poetry since conditionals don't work.

* torch gets installed through some dependency so put it back into poetry, but reinstall with cuda if cuda support exists

* fix install syntax

* no need for torchvision

* torch cuda install added to linux install script

* add torch cuda install to update.bat

* docs

* docs

* relock

* fix install.sh

* handle torch+cuda install in docker

* docs

* typo
2024-09-23 12:55:34 +03:00
veguAI
2c8b4b8186 Update README.md 2024-07-26 21:51:07 +03:00
veguAI
95a17197ba 0.26.0 (#133)
* implement manually disabling and enabling clients

* relock

* fix warning spam

* start moving stuff around

* move more stuff

* start separating world state manager into more managable submodules

* character title

* scroll home to top always

* finish separating character state editor into components

* fix defered nav to character sections

* separate components for pin and contextdb managing

* fix issue with context character filter search

* fix world state manage ux state reset issues

* wsm menu refactor
allow updating character image from wsm
cover image layout fixes

* remove debug spam

* fix client deletion / disabling rubber banding issue

* deactivate / activate / delete characters through wsm

* reload character instead

* fix koboldcpp client jiggle arguments

* save scene title

* fix deferred nav

* fix issue where blanking a character detail would bug out

* some layout changes

* character import copies cover image

* remove debug message

* character import via wsm

* deactivate imported characters

* images nav option placeholder

* start move towards new world state templating system

* prompt tweak

* add templates/world-state/*.yaml

* switch to new world state template system in manager

* template editor progress

* more wsm template changes

* template applicator component

* template applicate added to attributes and details

* selective template application

* fix issue with template editing

* attribute and detail templates dont require instructions

* adjust character attributes and details template applicator integration

* add gpt-4o

add gpt-4o-2024-05-13

* autocomplete prompt and postprocessing tweaks

* prompt tweaks

* fix issue where saving a new scene could cause recent config changes to revert

* only download punkt if its not downloaded yet

* working character attribute templates

* character detail generate working
move template generate logic to worldstate.templates

* character creator first steps

* support contextual generate when character doesn't exist

* move talemate wsm templates to their own dir, add supports_spice and supports_style flags

* wsm character creator progress

* character creator progress

* character creator progress and wire up image creation in character editor

* templating progress

* contextual generate generation options

* ux tweaks

* wirte up writing style and spice to generation

* wire spice / writing style to detail generation

* notify when spice is applied

* tweaks to generation spice notifications

* add some help / information to template editor

* fix some issues with detail and attribute generation

* some context gen tweaks

* character gen tweaks

* character color changer

* link to templates form gen option ux

* gen options for dialogue example genrate

* ctrl click to max spice level

* unify spice application notification into a component for reuse

* improvements to example dialogue generation

* some refinements to character editor

* remove some old cruft from scene schema

* wsm scene editor progress

* relock

* relock

* debug message cleanup

* fix issue with tab selection when loading a scene

* scene editor progress

* centralized generation options

* pass generation settings through to character creator

* save changes from wsm view

* scene settings
save copy

* refactor world entry / states editor

* fix issue with applying non-character world state templates

* layout fixes

* allow updating of scene cover image

* move history manager to world editor

* add phi-3 base template

* dialogue cleanup improvements

* refactor scoped game-engine api

* separate legacy creator functions to own file

* remove cruft

* some cleanup and fixes

* add photo style

* remove noisy log message

* better handling of active scene

* some fixes to pin editor

* don't enforce height

* active scene context fixes

* fix intro and scene description generration

* tweak preset for scene direction and summarization tasks

* ensure memory db is open

* update frontend dependencies

* update frontend dependencies

* fix issue with prompt query_memory function returning None

* typo

* default  world state templates

* new scene creation fixes
remove legacy creator ux

* scene export

* fix scene loading from upload

* add claude 3.5 sonnet

* fix automatic client selection when the current client is disabled

* remove cruft

* agent modal extended to support multiple config panels
visual agent prompt prefixes and suffixes addeed

* fix issue with world state template group saving

* resolve attribute name issue `copy`

* RequestInput: fix form validation and keystroke submit

* support chara load from json files also refactor character loading to load.py

* implement simple act-as feature using tab to cycle through active characters in the scene

* docs progress

* tts settings tweaks

* fix issue with loading older talemate scenes

* docs progress

* fix issue with config validation on new installs

* some tweaks for agent setting modals

* default template changed to alpaca

* docs dependencies

* gemma2 template

* nemotron4 template

* docs

* docs

* docs

* change prompt template section to autocomplete

* fix agent config not loading for some agents

* allow deletion of player character

* fix some oddities with scene outline commit

* automatically active player characters and create player characters with the correct actor class

* also set the first npc created as immediately acitve

* add has_active_npcs property and re-emit message history when scene outline is updated.

* indicate when visualizer is busy in the scene tools

* check for busy instead

* prompt tweaks for movie script type dialogue format

* gemma2 prompt fixed

* scene message colors updated

* act as narrator

* move to _old

* scene message appearance tweaks

* fix rubberbanding when editing text field in agent configs

* fix autocompletionm when acting as different character or narrator

* disable autocomplete during command execution

* remove autocomplete button from scene tools

* docs

* relock

* docs

* docs

* improve context pins in dialogue context

* better approximate token count

* fix pin condition editing

* fix issue where scene save as would lose long term memory entries

* immediately clean message history when loading a new scene

* docs

* ensure intro text has formatting markers

* narrator messages written by the player can now be deleted.

* scene editor

* move docs around

* start character editor docs

* more character editor docs:

* fix some ux bugs

* fix template group deletrion not removing the file

* docs

* typos

* docs

* relock

* docs

* notify image generation errors

* linting

* gh pages workflow

* use poetry

* dont use poetry

* link to docs site

* set site_url

* add trailing slash

* fix image paths

* re-add tabbyai link

* fix image generation error triggering incorrectly

* fix intro formatting incosistencies

* remove cruft

* add time passed label to history view

* date adjustments

* tests

* add gpt-4o-mini

* fix links

* remove hard ntlk requirement for voice generation chunking

ntlk error handling

fix typo

* docs

* fix issdue with dupe character card intro text

* disable character forms while templates are being applied.

* failure during context generate no longer locks ux

* refactor client and agent status display in system bar

* llama 3.1 8b claude

* fix format

* adjustments to automcomplete dialogue instructions

* add mistral nemo

* debug info

* fix system agent status getting stuck

* readme

* readme

* fix autocomplete responses when they are framed by quotes
2024-07-26 21:43:06 +03:00
veguAI
d09f9f8ac4 Update README.md 2024-05-31 13:23:40 +03:00
vegu-ai-tools
de16feeed5 0.25.6 prep 2024-05-31 13:10:23 +03:00
veguAI
cdcc804ffa 0.25.6 (#128)
* TabbyAPI Client Addition and presets refactoring (#126)

* feat: frequency_penalty (will make tabbyAPI custom wrapper)

* feat: add FREQUENCY_PENALTY_BASE and adj. conversation template

* feat: use `client_type` of `openai_compat` to send FIXED preset

* change from client name

* feat: pass client_type into presets.configure(...)

* wip: base TabbyAPI client

* feat: add import to register TabbyAPI client

* feat: adjust `presence_penalty` so it has a range of 0.1-0.5 (higher values will likely degrade performance)

* feat: add additional samplers/settings for TabbyAPI

* feat: keep presence_penalty in a range of 0.1-0.5

* feat: keep min_p in a range of 0.05 to 0.15

* update tabbyapi.py

* feat: add MIN_P_BASE and TEMP_LAST and change to tabbyapi client only for now

* fix: add /v1 as default API route to TabbyAPI

* feat: implement CustomAPIClient to allow all TabbyAPI parameters

* fix: change to "temperature_last" instead of "temp_last"

* feat: convert presets to dictionary mappings to make cleaner/more flexible

* fix: account for original substring/in statements and remove TabbyAPI client call

* fix: move down returning token values as it realistically should never be none, so substrings wouldn't be checked

* chore: remove automatic 'token' import due to IDE

---------

Co-authored-by: vegu-ai-tools <152010387+vegu-ai-tools@users.noreply.github.com>

* tabbyapi client auto-set model name
tabbyapi client use urljoin to prevent errors when user adds trailing slash

* expose presets to config and ux for editing

* some more help text

* tweak min, max and step size for some of the inference parameter sliders

* min_p step size to 0.01

* preset editor - allow reset to defaults

* fix preset reset

* dont perist inference_defaults to config file

* only persist presets to config if they have been changed

* ensure defaults are loaded

* rename config to parameters for more clarity

* update default inference params
textgenwebui support for min_p, frequence_penalty and presence_penalty

* overridable function to clean promp params

* add `supported_parameters` class property to clients and revisit all of the clients to add any missing supported parameters

* ux tweaks

* support_parameters moved to propert function

* top p decrease step size

* only show audio stop button if there is actually audio playing

* relock

* allow setting presence and frequency penalty to 0

* lower default frequency penalty

* frequency and presence penalty step size to 0.01

* set default model to gpt-4o

---------

Co-authored-by: official-elinas <57051565+official-elinas@users.noreply.github.com>
2024-05-31 13:07:57 +03:00
Ikko Eltociear Ashimine
9a2bbd78a4 docs: update README.md (#127)
apropriate -> appropriate
2024-05-25 10:07:20 +03:00
veguAI
ddfbd6891b 0.25.5 (#121)
* oepnai compat client to /completions instead of chat/completions
openai compat client pass frequency penalty

* 0.25.5

* fix version

* remove debug message

* fix openai compat client not saving coercion settings

* openai compatible client: API handles prompt template switches over to chat/completions api

* wording

* mistral std template

* fix error when setting llm prompt template if model name contained /

* lock sentence transformers to 2.2.2 since >=2.3.0 breaks instructor model loading

* support png tEXt

* openai compat client: fix repetition_penality KeyError issue

* presence_penalty is not equal to repetition_penalty and needs its own dedicated definition

* round presence penalty randomization to one decimal place

* fix filename

* same fixes for presence_penalty ported to koboldcpp client

* kcpp client: remove a1111 setup spam
kcpp client: fixes to presence_penalty jiggle

* mistral.ai: default model 8x22b
mistral.ai: 7b and 8x7b taken out of JSON_OBJECT_RESPONSE_MODELS
2024-05-24 18:17:55 +03:00
veguAI
143dd47e02 0.25.4 (#118)
* dont run npm install during container build

* fix const var issue when ALLOWED_HOSTS is anything but `all`

* ensure docker env sets NODE_ENV to development for now

* 0.25.4

* dont mount frontend volume by default
2024-05-18 16:22:57 +03:00
veguAI
cc7cb773d1 Update README.md 2024-05-18 12:31:32 +03:00
veguAI
02c88f75a1 0.25.3 (#113)
* add gpt-4o

add gpt-4o-2024-05-13

* fix koboldcpp client jiggle arguments

* kcpp api url default port 5001

* fix repetition breaking issues with kcpp client

* use tokencount endpoint if available

* auto configure visual agent with koboldcpp

* env var config for frontend serve

* its not clear that gpt-4o is better than turbo, dont default to it yet

* 0.25.3

* handle kcpp being down during a1111 setup check

* only check a1111 setup if client is connected

* fix kcpp a1111 setup check

* fix issue where saving a new scene could cause recent config changes to revert
2024-05-15 00:31:36 +03:00
veguAI
419371e0fb Update README.md 2024-05-14 15:36:33 +03:00
veguAI
6e847bf283 Update README.md 2024-05-14 15:29:37 +03:00
veguAI
ceedd3019f Update README.md 2024-05-14 15:29:02 +03:00
veguAI
a28cf2a029 0.25.2 (#108)
* fix typo

* fix openai compat config save issue maybe

* fix api_handles_prompt_template no longer saving changes after last fix

* koboldcpp client

* default to kobold ai api

* linting

* conversation cleanup tweak

* 0.25.2

* allowed hosts to all on dev instance

* ensure numbers on parameters when sending edited values

* fix prompt parameter issues

* remove debug message
2024-05-10 21:29:29 +03:00
henk717
60cb271e30 List KoboldCpp as compatible (#104)
KoboldCpp is a great fit for TaleMate, it supports fast local generations across a variety of machines including the cloud and is compatible with both text and image gen trough the OpenAI API, and A1111 API.
2024-05-10 00:22:57 +03:00
veguAI
1874234d2c Prep 0.25.1 (#103)
* remove auto client disable

* 0.25.1
2024-05-05 23:23:30 +03:00
veguAI
ef99539e69 Update README.md 2024-05-05 22:30:24 +03:00
veguAI
39bd02722d 0.25.0 (#100)
* flip title and name in recent scenes

* fix issue where a message could not be regenerated after applying continuity error fixes

* prompt tweaks

* allow json parameters for commands

* autocomplete improvements

* dialogue cleanup fixes

* fix issue with narrate after dialogue and llama3 (and other models that don't have a line break after the user prompt in their prompt template.

* expose ability to auto generate dialogue instructions to wsm character ux

* use b64_json response type

* move tag checks up so they match first

* fix typo

* prompt tweak

* api key support

* prompt tweaks

* editable parameters in prompt debugger / tester

* allow reseting of prompt params

* codemirror for prompt editor

* prompt tweaks

* more prompt debug tool tweaks

* some extra control for `context_history`

* new analytical preset (testing)

* add `join` and `llm_can_be_coerced` to jinja env

* support factual list summaries

* prompt tweaks to continuity check and fix

* new summarization method `facts` exposed to ux

* clamp mistral ai temperature according to their new requirements

* prompt tweaks

* better parsing of fixed dialogue response

* prompt tweaks

* fix intermittent empty meta issue

* history regen status progression and small ux tweaks

* summary entries should always be condensed

* google gemini support

* relock to install google-cloud-aiplatform for vertex ai inference

* fix instruction link

* better error handling of google safety validation and allow disabling of safety validation

* docs

* clarify credentials path requirements

* tweak error line identification

* handle quota limit error

* autocomplete ux wired to assistant plugin instead of command

* autocomplete narrative editing and fixes to autocomplete during dialog edit

* main input autocomplete tweaks

* allow new lines in main input

* 0.25.0 and relock

* fix issue with autocomplete elsewhere locking out main input

* better way to determine remote service

* prompt tweak

* fix rubberbanding issue when editing character attributes

* add open mistral 8x22

* fix continuity error check summary inclusion of target entry

* docs

* default context length to 8192

* linting
2024-05-05 22:16:03 +03:00
veguAI
f0b627b900 Update README.md 2024-04-27 00:46:39 +03:00
veguAI
95ae00e01f 0.24.0 (#97)
* groq client

* adjust max token length

* more openai image download  fixes

* graphic novel style

* dialogue cleanup

* fix issue where auto-break repetition would trigger on empty responses

* reduce default convo retries to 1

* prompt tweaks

* fix some clients not handling autocomplete well

* screenplay dialogue generation tweaks

* message flags

* better cleanup of redundant change_ai_character calls

* super experimental continuity error fix mode for editor agent

* clamp temperature

* tweaks to continuity error fixing and expose to ux

* expose to ux

* allow CmdFixContinuityErrors to work even if editor has check_continuity_errors disabled

* prompt tweak

* support --endofline-- as well

* double coercion client option added

* fix issue with double coercion inserting "None" if not set

* client ux refactor to make room for coercion config

* rest of -- can be treated as *

* disable double coercion when json coercion is active since it kills accuracy

* prompt tweaks

* prompt tweaks

* show coercion status in client list

* change preset for edit_fix_continuity

* interim commit of coninuity error handling progress

* tag based presets

* special tokens to keep trailing whitespace if needed

* fix continuity errors finalized for now

* change double coercion formatting

* 0.24.0 and relock

* add groq and cohere to supported services

* linting
2024-04-27 00:24:53 +03:00
veguAI
83027b3a0f 0.23.0 (#91)
* dockerfiles and docker-compose

* containerization fixes

* docker instructions

* readme

* readme

* dont mount src by default, readme

* hf template determine fixes

* auto determine prompt template

* script to start talemate listening only to 127.0.0.1

* prompt tweaks

* auto narrate round every 3 rounds

* tweaks

* Add return to startscreen button

* Only show return to start screen button if scene is active

* improvements to character creation

* dedicated property for scene title separate fromn the save directory name

* filter out negations into negative keywords

* increase auto narrate delay

* add character portrait keyword

* summarization should ignore most recent message, as it is often regenerated.

* cohere client

* specify python3

* improve viable runpod text gen detection

* fix formatting in template preview

* cohere command-r plus template that i am not sure if correct or not

* mistral client set to decensor

* fix issue with parsing json responses

* command-r prompts updated

* use official mistralai python client

* send max_tokens

* new input autocomplete functionality

* prompt tweeaks

* llama 3 templates

* add <|eot_id|> to stopping strings

* prompt tweak

* tooltip

* llama-3 identifier

* command-r and command-r plus prompt identifiers

* text-gen-webui client tweaks to make llama3 eos tokens work correctly

* better llama-3 detection

* better llama-3 finalizing of parameters

* streamline client prompt finalizers
reduce YY model smoothing factor from 0.3 to 0.1 for text-generation-webui client

* relock

* linting

* set 0.23.0

* add new gpt-4 models

* set 0.23.0

* add note about conecting to text-gen-webui from docker

* fix openai image generation no longer working

* default to concept_art
2024-04-20 01:01:06 +03:00
veguAI
27eba3bd63 0.22.0 2024-03-29 21:41:45 +02:00
veguAI
ba64050eab 0.22.0 (#89)
* linux dev instance shortcuts

* add voice samples to gitignore

* direction mode: inner monologue

* actor direction fixes

* py script support for scene logic

* fix end_simulation call

* port sim suite logic to python

* remove dupe log

* fix typing

* section off the text

* fix end simulation command

* simulation goal, prompt tweaks

* prompt tweaks

* dialogue format improvements

* director action logged with message

* call director action log and other fixes

* generate character dialogue instructions, prompt fixes, director action ux

* fix question / answer call

* generate dialogue instructions when loading from character cards

* more dialogue format improvements

* set scene content context more reliably.

* fix innermonologue perspective

* conversation prompt should honor the client's decensor setting

* fix comfyui checkpoint list not loading

* more dialogue format fixes

* prompt tweaks

* fix sim suite group characters, prompt fixes

* npm relock

* handle inanimate objects, handle player name change issues

* don't rename details if the original name was "You"

* As the conversation goes on, dialogue instructions should be moved backwards further to have a weaker effect on immediate generations.

* add more context to character creation prompt

* fix select next talking actor when natural language flow is turned on and the LLM returns multiple character names

* prompt fixes for dialogue generation

* summarization fixes

* default to script format

* seperate dialogue prompt by formatting style, tweak conversation system prompt

* remove cruft

* add gen format to agent details

* relock

* relock

* prep 0.22.0

* add claude-3-haiku-20240307

* readme
2024-03-29 21:37:28 +02:00
veguAI
199ffd1095 Update README.md 2024-03-17 01:09:59 +02:00
veguAI
88b9fcb8bb Update README.md 2024-03-11 00:42:42 +02:00
vegu-ai-tools
2f5944bc09 remove unnecessary link 2024-03-10 18:05:33 +02:00
veguAI
abdfb1abbf WIP: Prep 0.21.0 (#83)
* cleanup

* refactor clean_dialogue

* prompt fixes

* prompt fixes

* conversation format types - movie script and chat (legacy)

* stopping strings updated

* mistral.ai client

* prompt tweaks

* mistral client return token counts

* anthropic client

* archive history emits whole object so we can inspectr time stamps

* show timestamp in history dialog

* openai compat fixes to stop trying to coerce openai url path schema and to never attempt to retrieve the model name automatically, hopefully improving compatibility with the various openai api implementations across the board

* openai compat client let api control prompt template via config option

* fix custom client configs and implement max backscroll

* fix backscroll limit

* remove debug message

* prep 0.21.0

* include model name in prompt template selection label

* use tabs for side nav in app config modal

* readme / docs

* fix issue where "No API key set" could be persisted as the selected model name to the config

* deepinfra example

* linting
2024-03-10 18:03:12 +02:00
veguAI
2f07248211 Prep 0.20.0 (#77)
* fix issue where recent save cover images would sometimes not load

* paraphrase prompt tweaks

* action_to_narration regenerate compatibility fixes

* sim suite add asnwer question instruction

* more sim suite tweaks

* refactor agent details display in agent bar

* visual agent progres (a1111 support)

* visual gen prompt tweaks

* openai compat client pass max_tokens

* world state sequential reinforcement max tokens tightened

* improve item names

* Improve item names

* attempt to remove "changed from.." notes when altering an existing character sheet

* prompt improvements for single character portraits

* visual agent progress

* fix issue where character.update wouldn't update long-term memory

* remove experimental flag for now

* add better instructions for updating existing character sheet

* background processing for agents, visual and tts

* fix selected voice not saving between restarts for elevenlabs

* lessen timeout

* clean up agent status logic

* conditional agent configs

* comfyui support

* visualization queue

* refactor visual styles, comfyui progress

* regen images
auto cover image assign
websocket handler plugin abstraction
agent websocket handler

* automatic1111 fixes
agent status and ready checks

* tweaks to character portrait prompt

* system prompt for visualize

* textgenwebui use temp smoothing on yi models

* comment out api key for now

* fixes issues with openai compat client for retaining api key and auto fixing urls

* update_reinforcment tweaks

* agent status emit from one place

* emit agent status as asyncio task

* remove debug output

* tts add openai support

* openai img gen support

* fix issue with confyui checkbox list not loading

* tts model selection for openai

* narrate_query include character sheet if character is referenced in query
improve visual character portrit generation prompt

* client implementation extra field support and runpod vllm client example

* relock

* fix issue where changing context length would cause next generation to error

* visual agent tweaks and auto gen character cover image in sim suite

* fix issue with readyness lock when there werent any clients defined

* load scene readiness fixes

* linting

* docs

* notes for the runpod vllm example
2024-02-16 13:57:45 +02:00
veguAI
9ae6fc822b Update README.md 2024-02-12 18:31:49 +02:00
veguAI
5094359c4e Update README.md 2024-02-10 23:07:30 +02:00
veguAI
28801b54bf Update README.md 2024-02-07 03:12:56 +02:00
veguAI
4d69f0e837 Update README.md 2024-02-06 09:15:55 +02:00
veguAI
d91b3f8042 Update README.md 2024-02-06 09:15:11 +02:00
veguAI
03a0ab2fcf Update README.md 2024-02-06 01:01:00 +02:00
veguAI
d860d62972 Update README.md 2024-02-06 01:00:35 +02:00
veguAI
add4893939 Prep 0.19.0 (#67)
* linting

* improve prompt devtools: test changes, show more information

* some more polish for the new promp devtools

* up default conversation gen length to 128

* openai client tweaks, talemate sets max_tokens on gpt-3.5 generations

* support new openai embeddings (and default to text-embedding-3-small)

* ux polish for character sheet and character state ux

* actor instructions

* experiment using # for context / instructions

* fix bug where regenerating history would mess up time stamps

* remove trailing ]

* prevent client ctx from being unset

* fix issue where sometimes you'd need to delete a client twice for it to disappear

* upgrade dependencies

* set 0.19.0

* fix performance degradation caused by circular loading animation

* remove coqui studio support

* fix issue when switching from unsaved creative mode to loading a scene

* third party client / agent support

* edit dialogue examples through character / actor editor

* remove "edit dialogue" action from editor - replaced by character actor instructions

* different icon for delete

* prompt adjustment for acting instructions

* adhoc context generation for character attributes and details

* add adhoc generation for character description

* contextual generation tweaks

* contextual generation for dialogue examples
fix some formatting issues

* contextual generation for world entries

* prepopulate initial recen scenarios with demo scenes
add experimental holodeck scenario

* scene info
scene experimental

* assortment of fixes for holodeck improvements

* more holodeck fixes

* refactor holodeck instructions

* rename holodeck to simulation suite

* better scene status messages

* add new gpt-3.5-turbo model, better json response coercion for older models

* allow exclusion of characters when persisting based on world state

* better error handling of world state response

* better error handling of world state response

* more simulation suite fixes

* progress color

* world state character name mapping support

* if neither quote nor asterisk is in message default to quotes

* fix rerun of new paraphrase op

* sim suite ping that ensure's characters are not aware of sim

* fixes for better character name assessment
simulation suite can now give the player character a proper name

* fix bug with new status notifications

* sim suite adjustments and fixes and tuning

* sim suite tweaks

* impl scene restore from file

* prompting tweaks for reinforcement messages and acting instructions

* more tweaks

* dialogue prompt tweaks for rerun + rewrite

* fix bug with character entry / exit with narration

* linting

* simsuite screenshots

* screenshots
2024-02-06 00:40:55 +02:00
veguAI
eb251d6e37 fix gpt-4 censorship triggered by system message (#74) 2024-02-01 12:15:30 +02:00
veguAI
4ba635497b Prep 0.18.1 (#72)
* prevent client ctx from being unset

* fix issue with LMStudio client ctx size not sticking

* 0.18.1
2024-01-31 09:46:51 +02:00
veguAI
bdbf14c1ed Update README.md 2024-01-31 01:47:52 +02:00
veguAI
c340fc085c Update README.md 2024-01-31 01:47:29 +02:00
veguAI
94f8d0f242 Update README.md 2024-01-31 01:00:59 +02:00
veguAI
1d8a9b113c Update README.md 2024-01-30 08:08:45 +02:00
vegu-ai-tools
1837796852 readme 2024-01-26 14:41:59 +02:00
vegu-ai-tools
c5c53c056e readme updates 2024-01-26 13:29:21 +02:00
veguAI
f1b1190f0b linting (#63) 2024-01-26 12:46:55 +02:00
veguAI
303ec2a139 Prep 0.18.0 (#58)
* vuetify update
recent saves

* use placeholder instead of prefilling text

* fix scene loading when no coverage image is set

* improve summarize and pin response quality

* summarization use previous entries as informative context

* fixes #49: auto save indicator missleading

* regenerate with instructions

* allow resetting of state reinforcement

* creative tools: introduce new character
creative tools: introduce passive character as active character

* character creation adjustments

* no longer needed

* activate, deactivate characters (work in progress)

* worldstate manager show inactive characters

* allow setting of llm prompt template from ux
reorganize llm prompt template directory for easier local overriding
support a more sane way to write llm prompt templates

* determine prompt template from huggingface

* ignore user overrides

* fix issue with removing narrator messages

* summarization agent config for prev entry inclusion
agent config attribute notes

* client code clean up to allow modularity of clients + generic openai compatible api client

* more client cleanup

* remove debug msg, step size for ctx upped to 1024

* wip on stepped history summarization

* summarization prompt fixes

* include time message for hisory context pushed in scene.context_history

* add / remove characters toggle narration of via ctrl

* fix pydantic namespace warning
fix client emit after reconfig

* set memory ids on character detail entries

* deal with chromadb race condition (maybe)

* activate / deactivate characters from creative editor
switch creative editor to edit characters through world state manager

* set 0.18.0

* relock dependencies

* openai client shortcut to set api key if not set

* set error_action to null

* if scene has just started provide intro for extra context in is_prsent and is_leaving queries

* nice error if determine template via huggingface doesn't work

* fix issue where regenerate would sometimes pick the wrong npc if there are multiple characters talking

* add new openai models

* default to gpt-4-turbo-preview
2024-01-26 12:42:21 +02:00
vegu-ai-tools
0303a42699 formatting 2024-01-19 11:52:00 +02:00
veguAI
d768713630 Prep 0.17.0 (#48)
* improve windows install script to check for compatible python versions, also work with multi version python installs

* bunch of llm prompt templates

* first gamestate directing impl

* lower similarity threshold when checking for repetition in llm responses

* tweaks to narrate after dialog prompt
tweaks to extract character sheet prompt

* set_context cmd

* Xwin MoE

* thematic generator for randomized content stimuli

* add a memory query to extract character sheet

* direct-scene prompt tweaks

* conversation prompt tweaks

* inline character creation from gameplay instruction template
expose thematic generator to prompt templates

* Mixtral
Synthia-MoE

* display prompt and response side by side

* improve ensure_dialogue_format

* prompt tweaks

* prevent double passive narration in one round
improvements to persist character logic

* SlimOrca
OpenBuddy

* prompt tweaks

* runpod status check wrapped in asyncio

* generate_json_list creator agent action

* limit conversation retries to 2
fix issue where REPETITION signal trigger would get sent with the prompt

* smaller agent tweaks

* thematic generator personality list
thematic generator generate from sets of lists

* adjust tests

* mistral prompt adjustment

* director: update content context

* prompt adjustments

* nous-hermes-2-yi
dolphin-2.2-yo
dolphin-2.6-mixtral

* status messages

* determine character goals
generate json lists

* fix error when chromadb add was called before db was ready (wait until the db is fully initiazed)

* only strip extra spaces off of prompt
textgenwebui: half temperature on -yi- models

* prompt tweaks

* more thematic generators

* direct scene without character should just run the scene instructions if they exist

* as_question_answer for query_scene

* context_history revamp

* Aurora-Nights
MixtgralOrochi
dolphin-2.7-mixtral
nous-hermas-2-solar

* remove old context_history calls

* mv world_state.py to subdir
FlatDolphinMaid
Goliath
Norobara
Nous-Capybara

* world state manager first progress

* context db manager

* fix issue with some clients not remembering context length settings after talemate restart

* Sensualize-Solar

* improve RAG prompt

* conversation agent use [ as a stopping string since the new reinforcement messages use that

* new method for RAG during conversation

* mixtral_11bx2_moe

* option to reset context db from manager ui

* fix context db cleanup if scene is closed without saving

* didnt mean to commit that

* hide internal meta tags

* keep track of manual context entries in scene save file so it can be rebuilt.

* auto save
auto progress
quick settings hotbar options

* manual mode
actor dialogue tools
refactor toolbar

* narrate directed progress
reorganiza narration tools into one cmd module

* 0.17.0

* Mixtral_34Bx2
Sensualize-Mixtral
openchat

* fix save-as action

* fix issue where too little context was joined in via RAG

* context pins implementation

* show active pins in world state component

* pin condition eval and world state agent action config

* Open_Gpt4

* summarization prompt improvements
system prompt for summarization

* guidance prompt for time passage narration

* fix rerun for generic / unhandled messages

* prompt fixes

* summarization methods

* prompt adjustments

* world tools to hot bar
ux tweaks

* bagel-dpo

* context state reinforcements support different insertion methods now (sequential, all context or conversation specific context)

* first progress on world state reinforcement templating

* Kunoichi

* tweaks to update reinforcements prompt

* world state templates progress

* world state templates integration into main ux

* fix issue where openai client wouldn't accept context length override

* dont reconfigure client if no arguments are provided

* pin condition prompt fixes
world state apply template comman label set

* world information / lore entries and reinforcement

* show world entry states reinforcers in ux

* gitignore

* dynamic scenario generation progress

* dynamic scenario experiment

* gitignore

* need to emit world state even if we dont run it during scene init

* summarize and pin action

* poetry relock

* template question / attribute cannot be empty

* fix issue with summarize and pin not respecting selected line

* keep reinforcement messages in history, but keep the same one from stacking up

* narrate query prompt more natural sounding response

* manage pins from world entry editor

* pin_only tag

* ts aware summarize and pin
pin text rendered to context with time label
context reuse session id (this fixes issue of editing context entry and not saving the scene causing removal of context entry next time scene is loaded)

* UX to add character state from template within the worldstate manager UX

* move divider

* handle agent emit error
fix issue with state reinforcer validation

* layout fixes in world state character panel
physical health template added to example config

* fix pin_only undefined error in world entry editor

* laser-dolphin
Noromaid-v0.4-Mixtral-Instruct

* show state templates for world and players in favorite list
fix applying world state template

* refresh world entry list on state creation

* changing a state from non-sequential to sequential should queue it as due

* quicksettings to bar

* fix error during memory db delete

* status messages during scene load

* removing a sequential state reinforcement should remove the reinforcement messages

* Nous-Hermes-2-Mixtral

* fix sync issue when editing character details through contextdb

* immutable save property

* enable director

* update example config

* enable director when loading a scene file that has instructions

* fix more openai client funkyness with context size and losing model

* iq dyn scenario prompt fixes

* delay client save so that dragging the ctx slider doesnt send off a million requests
default openai ctx to 8k

* input disabled while clients active

* declare event

* narrate query prompt tweaks

* fixes to dialogue cleanup that would cause messages after : to be cut off.

* init git repo if not exist

* pull current branch

* add 12 hours as option

* world-state persist deactivated

* install npm packages

* fix typo

* prompt tweaks

* new screenshots and features updated

* update screenshot
2024-01-19 11:47:38 +02:00
vegu-ai-tools
33b043b56d docs 2023-12-11 21:12:34 +02:00
veguAI
b6f4069e8c prep 0.16.1 (#42)
* improve windows install script to check for compatible python versions, also work with multi version python installs

* prep 0.16.1
2023-12-11 21:07:23 +02:00
veguAI
1cb5869f0b Update README.md 2023-12-11 16:03:46 +02:00
veguAI
8ad794aa6c Update README.md 2023-12-11 15:55:40 +02:00
veguAI
611f77a730 Prep 0.16.0 (#40)
* remove dbg message

* more work to make clients and agents modular
allow conversation and narrator to attempt to auto break AI repetition

* application settings refactor
setup third party api keys through application settings

* runpod docs

* fix wording

* docs

* improvements to auto-break-repetition functionality

* more auto-break-repetition improvements

* some cleanup to narrate on dialogue chance calculations

* changing api keys via ux should now reflect to ux instantly.

* memory agent / chromadb agent - wrap blocking functions calls in asyncio

* clean up narrate progression prompt and function

* turn off dedupe debug message for now

* encourage the AI to break repetition as well

* indicate if the current model is missing a LLM prompt template
add prompt template to client modal
fix a bunch of bad vue code

* only show llm prompt when editing client

* OpenHermes-2.5-neural-chat
RpBird-Yi-34B

* fix bug with auto rep break when no repetition was found

* allow giving extra instructions to narrator agent

* emit agents as needed, not constantly

* fix a bunch of vue alerts

* fix request-client-status event

* remove undefined reference

* log client / status emit

* worldstate component track scene time

* Tess
Noromaid

* fix narrate-character prompt context length overflow issues

* disable worldstate refresh button while waiting for response

* history timestamp moved to tooltip off of history button

* fixes #39: using openai embeddings for chromadb tends to error

* adjust conversation again default instructions

* poetry lock

* remove debug message

* chromadb - agent status error if openai embeddings are selected in api key isn't set

* prep 0.16.0
2023-12-08 22:57:44 +02:00
veguAI
0738899ac9 Prep 0.15.0 (#38)
* send one request for assign all clients

* tweak narrate-after-dialogue prompt

* elevenlabs default to turbo model and make model id configurable

* improve add client dialogue to be more robust

* prompt for default character creation on character card loads

* rename to model as to not conflict with pydantic

* narrate after dialogue strip dialogue generation unless enabled via new option

* starling and capybara-tess

* narrate dialogue context increased

* relabel tts agent to Voice, show agent label in status bar

* dont expect LLM to handle * and " - most of them are not stable / consistent enough with it

* starling template updated

* if allow dialogue in narration is disabled just assume the entire string is a narration

* reorganization the narrate after dialogue template

* fix more issues with time passage calculations

* move punkt download to agent init and silence

* improved RAG during conversation if AI selected is enabled in conversation agent

* prompt tweaks

* deepseek, chromomaid-storytelling

* relock

* narrate-after-dialogue prompt tweaks

* runpod status queries every 15 secs instead of 60

* default player character prompting when loading character card from talemate storage

* better chunking during split tts generation

* tweak narrate progress prompt

* improvements to ensure_dialogue_format and tests

* to pytest

* prep 0.15.0

* update packages

* dialogue cleanup fixes

* fix openai default model name
fix not being able to edit client due to name check

* free form analyst was using wrong system prompt causing gpt-4 to actually generate json responses
2023-12-02 00:40:14 +02:00
veguAI
76b7b5c0e0 templating overview (#37)
readme updates

readme updates
2023-11-26 16:35:09 +02:00
veguAI
cae5e8d217 Update README.md
Update textgenwebui setup picture to be in line with current api url requirements
2023-11-26 16:32:50 +02:00
veguAI
97bfd3a672 Add files via upload 2023-11-26 16:31:49 +02:00
veguAI
8fb1341b93 Update README.md
fix references to old repo
2023-11-26 16:25:46 +02:00
fiwo
cba4412f3d Update README.md 2023-11-25 01:49:44 +02:00
fiwo
2ad87f6e8a Prep 0.14.1 (#35)
* tts dont try to play sound if agent not ready

* tts: flag agent as uninitlized if no voice is selected
tts: fix some config issues with voice selection

* 0.14.1
2023-11-25 00:13:33 +02:00
fiwo
496eb469db Prep 0.14.0 (#34)
* tts agent first progress

* coqui support
voice lists

* orca-2

* tts tweaks

* switch to ux for audio gen

* some tweaks for the new audio queue

* fix error handling if llm fails to create a good world state on initial scene load

* loading creative mode for a new scene will now ask for confirmation if the current scene has unsaved progress

* local tts support

* fix voice list reloading when switching tts api
fix agent config ux to auto save on change, remove save / close buttons

* only do a delayed save on agent config on text input changes

* OrionStar

* dont allow scene loading when llm agents arent correctly configured

* wire summarization to game loop, summarizer agent configs

* fix issues with time passage

* editor fix narrator messages

* 0.14.0

* poetry lock

* requires_llm_client moved to cls property

* add additional config stubs

* tts still load voices even if the agent is disabled

* fix bugf that would keep losing voice selection for tts agent after backend restart

* update tts install requirements

* remove debug output
2023-11-24 22:08:13 +02:00
FInalWombat
b78fec3bac Update README.md 2023-11-20 00:13:08 +02:00
FInalWombat
d250df8950 Prep 0.13.2 (#33)
* fix issue with client removal

* client type not editable after creation (keeps things simple)

* fixes issue with openai client bugging out (api_url not set)

* fix issues with edit client not reflecting changes to UX

* 0.13.2
2023-11-19 20:43:15 +02:00
FInalWombat
816f950afe Prep 0.13.1 (#29)
* narrate after dialog constrained a bit more so it doesnt create something unrelated

* fix issue where textgenwebui client would come back as status ok even though no model was loaded

* 0.13.1
2023-11-19 18:58:40 +02:00
FInalWombat
8fb72fdbe9 Update README.md 2023-11-19 14:05:09 +02:00
FInalWombat
54297a4768 Update README.md 2023-11-18 12:20:02 +02:00
FInalWombat
d7e72d27c5 Prep 0.13.0 (#28)
* requirements.txt file

* windows installs from requirements.txt because of silly permission issues

* relock

* narrator - narrate on dialogue agent actions

* add support for new textgenwebui api

* world state auto regen trigger off of gameloop

* funciton !rename command

* ensure_dialog_format error handling

* Cat, Nous-Capybara, dolphin-2.2.1

* narrate after dialog rerun fixes, template fixes

* LMStudio client (experimental)

* dolhpin yi

* refactor client base

* cruft

* openai client to new base

* more client refactor fixes

* tweak context retrieval prompts

* adjust nous capybara template

* add Tess-Medium

* 0.13.0

* switch back to poetry for windows as well

* error on legacy textgenwebui api

* runpod text gen api url fixed

* fix windows install script

* add fllow instruction template

* Psyfighter2
2023-11-18 12:16:29 +02:00
FInalWombat
f9b23f8705 Update README.md 2023-11-14 11:06:52 +02:00
FInalWombat
37a5873330 Update README.md 2023-11-12 15:43:02 +02:00
FInalWombat
bc3f5d63c8 Add files via upload 2023-11-12 15:42:07 +02:00
FInalWombat
72202dee02 Prep 0.12.0 (#26)
* no " or * just treat as spoken words

* chromadb perist to db

* collect name should contain embedding so switching between chromadb configurations doesn't brick your scenes

* fix save-as long term memory transfer

* add chroma

* director agent refactor

* tweak director command, prompt reset, ux display

* tweak director message ux

* allow clearing of prompt log

* remove auto adding of quotes if neither quote or * are present

* command to reset long term memory for the scene

* improve summarization template as it would cause some llms to add extra details

* rebuilding history will now also rebuild long term memory

* direct scene template

* fix scene time reset

* dialogue template tweaks

* better dialog format fixing

* some dialogue template adjustments

* adjust default values of director agent

* keep track of scene saved/unsaved status and confirm loading a different scene if current scene is unsaved

* prompt fixes

* remove the collection on recommitting the seen to memory, as the embeddings may have changed

* change to the official python api for the openai client and make it async

* prompt tweaks

* world state prompt parsing fixes

* improve handling of json responses

* 0 seconds ago changed to moments ago

* move memory context closer to scene

* token counts for openai client

* narrator agent option: narrate passage of time

* gitignore

* remove memory id

* refactor world state with persistence to chromadb (wip)

* remove world state update instructions

* dont display blank emotion in world state

* openai gpt-4 turbo support

* conversation agent extra instructions

* track prompt response times

* Yi and UtopiaXL

* long term memory retrieval improvements during conversations

* narrate scene tweaks

* conversation ltm augment tweaks

* hide subconfig if parent config isnt enabled

* ai assisted memory recall during conversation default to off

* openai json_object coersion only on model that supports it

openai client emit prompt processing time

* 0.12.0

* remove prompt number from prompt debug list

* add prompt number back in but shift it to the upper row

* narrate time passage hard content limit restriction for now as gpt-4
would just write a whole chapter.

* relock
2023-11-10 22:45:50 +02:00
FInalWombat
91f228aa68 Update __init__.py 2023-10-29 15:45:56 +02:00
FInalWombat
27d6c5e7c2 Update pyproject.toml 2023-10-29 15:45:37 +02:00
FInalWombat
1f5cff4c6d remove debug output 2023-10-29 15:44:40 +02:00
FinalWombat
77425935be update version 2023-10-28 12:45:07 +03:00
FInalWombat
e6b21789d1 Prep 0.11.0 (#19)
* dolphin mistral template

* removate trailing \n before attaching the model response

* improve prompt and validator for generated human age

* fix issue where errors during character creation process would not be
communicated to the ux and the character creator would appear stuck

* add dolphin mistral to list

* add talemate_env

* poetry relock

* add json schema for talemate scene files

* fix issues with pydantic after version upgrade

* add json extrac util functions

* fix pydantic model

* use extract json function

* scene generator, better scene name prompt

* OpenHermes-2-Mistral

* alpaca base template
Amethyst 20B template

* character description is no longer part of the sheet and needs to be added separately

* fix pydantic validation

* fix issue where sometimes partial emote strings were kept at the end of dialogue

* no need to commit character name to memory

* dedupe prompts

* clean up extra linebreaks in prompts

* experimental editor agent
agent signals first progress

* take out hardcoded example

* amethyst llm prompt template

* editor agent disableable
agent edit modal tweaks

* world state agent
agent action config schema

* director agent disableable
remove automatic actions config from ux (deprecated)

* fix responsive update when toggling enable on or off in agent dialog

* prompt adjustments
fix divine intellect preset (mirostat values were way off)
fix world state regenerating every turn regardless of setting

* move templates for world state from summarizer to worldstate agent

* conversation agent generation lenght setting

* conversation agent jiggle attribute (randomize offset to certain inference parameters)

* relabel

* scene cover image set to cover as much space as it can

* add character sheet to dialogue example generate prompt

* character creator agent mixin use set_processing

* add <|im_end|> to stopping strings

* add random number gen to template functions

* SynthIA and Tiefighter

* create new persisted characters ouf of world state
natural flow option for conversation agent to help guide multi character conversations

* conversation agent natural flow improvements

* fix bug with 1h time passage option

* some templates

* poetry relock

* fix config validation

* fix issues when detemrining scene history context length to stay within budget

* fixes to world state json parsing
fixes to conversation context length

* remove unused import

* update windows install scripts

* zephyr

* </s> stopping string

* dialog cleanup utils improved

* add agents and clients key to the config example
2023-10-28 11:33:51 +03:00
FInalWombat
89d7b9d6e3 Update README.md 2023-10-25 09:41:42 +03:00
FInalWombat
c36fd3a9b0 fixes character descriptions missing from dialogue prompt (#21)
* character description is no longer part of the sheet and needs to be added separately

* prep 0.10.1
2023-10-19 03:05:17 +03:00
FInalWombat
5874d6f05c Update README.md 2023-10-18 03:28:30 +03:00
FInalWombat
4c15ca5290 Update linux-install.md 2023-10-15 16:09:41 +03:00
FInalWombat
595b04b8dd Update README.md 2023-10-15 12:44:30 +03:00
FInalWombat
c7e614c01a Update README.md 2023-10-13 16:14:42 +03:00
FInalWombat
626da5c551 Update README.md 2023-10-13 16:08:18 +03:00
FInalWombat
e5de5dad4d Update .gitignore
clean up cruft
2023-10-09 12:39:49 +03:00
FinalWombat
ce2517dd03 readme 2023-10-02 01:59:47 +03:00
FinalWombat
4b26d5e410 readme 2023-10-02 01:55:41 +03:00
932 changed files with 66207 additions and 21172 deletions

30
.github/workflows/ci.yml vendored Normal file
View File

@@ -0,0 +1,30 @@
name: ci
on:
push:
branches:
- master
- main
- prep-0.26.0
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- uses: actions/setup-python@v5
with:
python-version: 3.x
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v4
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- run: pip install mkdocs-material mkdocs-awesome-pages-plugin mkdocs-glightbox
- run: mkdocs gh-deploy --force

16
.gitignore vendored
View File

@@ -1,10 +1,20 @@
.lmer
*.pyc
problems
*.swp
*.swo
*.egg-info
tales/
*-internal*
*.internal*
*_internal*
talemate_env
chroma
config.yaml
templates/llm-prompt/user/*.jinja2
templates/world-state/*.yaml
scenes/
!scenes/infinity-quest-dynamic-scenario/
!scenes/infinity-quest-dynamic-scenario/assets/
!scenes/infinity-quest-dynamic-scenario/templates/
!scenes/infinity-quest-dynamic-scenario/infinity-quest.json
!scenes/infinity-quest/assets/
!scenes/infinity-quest/infinity-quest.json
tts_voice_samples/*.wav

86
Dockerfile Normal file
View File

@@ -0,0 +1,86 @@
# Stage 1: Frontend build
FROM node:21 AS frontend-build
ENV NODE_ENV=development
WORKDIR /app
# Copy the frontend directory contents into the container at /app
COPY ./talemate_frontend /app
# Install all dependencies and build
RUN npm install && npm run build
# Stage 2: Backend build
FROM python:3.11-slim AS backend-build
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
bash \
gcc \
&& rm -rf /var/lib/apt/lists/*
# Install poetry
RUN pip install poetry
# Copy poetry files
COPY pyproject.toml poetry.lock* /app/
# Create a virtual environment
RUN python -m venv /app/talemate_env
# Activate virtual environment and install dependencies
RUN . /app/talemate_env/bin/activate && \
poetry config virtualenvs.create false && \
poetry install --only main --no-root
# Copy the Python source code
COPY ./src /app/src
# Conditional PyTorch+CUDA install
ARG CUDA_AVAILABLE=false
RUN . /app/talemate_env/bin/activate && \
if [ "$CUDA_AVAILABLE" = "true" ]; then \
echo "Installing PyTorch with CUDA support..." && \
pip uninstall torch torchaudio -y && \
pip install torch~=2.4.1 torchaudio~=2.4.1 --index-url https://download.pytorch.org/whl/cu121; \
fi
# Stage 3: Final image
FROM python:3.11-slim
WORKDIR /app
RUN apt-get update && apt-get install -y \
bash \
&& rm -rf /var/lib/apt/lists/*
# Copy virtual environment from backend-build stage
COPY --from=backend-build /app/talemate_env /app/talemate_env
# Copy Python source code
COPY --from=backend-build /app/src /app/src
# Copy Node.js build artifacts from frontend-build stage
COPY --from=frontend-build /app/dist /app/talemate_frontend/dist
# Copy the frontend WSGI file if it exists
COPY frontend_wsgi.py /app/frontend_wsgi.py
# Copy base config
COPY config.example.yaml /app/config.yaml
# Copy essentials
COPY scenes templates chroma* /app/
# Set PYTHONPATH to include the src directory
ENV PYTHONPATH=/app/src:$PYTHONPATH
# Make ports available to the world outside this container
EXPOSE 5050
EXPOSE 8080
# Use bash as the shell, activate the virtual environment, and run backend server
CMD ["/bin/bash", "-c", "source /app/talemate_env/bin/activate && python src/talemate/server/run.py runserver --host 0.0.0.0 --port 5050 --frontend-host 0.0.0.0 --frontend-port 8080"]

189
README.md
View File

@@ -1,167 +1,44 @@
# Talemate
Allows you to play roleplay scenarios with large language models.
Roleplay with AI with a focus on strong narration and consistent world and game state tracking.
It does not run any large language models itself but relies on existing APIs. Currently supports **text-generation-webui** and **openai**.
|![Screenshot 3](docs/img/ss-1.png)|![Screenshot 3](docs/img/ss-2.png)|
|------------------------------------------|------------------------------------------|
|![Screenshot 4](docs/img/ss-4.png)|![Screenshot 1](docs/img/Screenshot_15.png)|
|![Screenshot 2](docs/img/Screenshot_16.png)|![Screenshot 3](docs/img/Screenshot_17.png)|
This means you need to either have an openai api key or know how to setup [oobabooga/text-generation-webui](https://github.com/oobabooga/text-generation-webui) (locally or remotely via gpu renting.)
## Core Features
![Screenshot 1](docs/img/Screenshot_8.png)
![Screenshot 2](docs/img/Screenshot_2.png)
- Multiple agents for dialogue, narration, summarization, direction, editing, world state management, character/scenario creation, text-to-speech, and visual generation
- Supports per agent API selection
- Long-term memory and passage of time tracking
- Narrative world state management to reinforce character and world truths
- Creative tools for managing NPCs, AI-assisted character, and scenario creation with template support
- Context management for character details, world information, past events, and pinned information
- Customizable templates for all prompts using Jinja2
- Modern, responsive UI
## Current features
## Documentation
- responive modern ui
- agents
- conversation
- narration
- summarization
- director
- creative
- multi-client (agents can be connected to separate LLMs)
- long term memory (very experimental at this point)
- narrative world state
- narrative tools
- creative tools
- AI backed character creation with template support (jinja2)
- AI backed scenario creation
- runpod integration
- overridable templates foe all LLM prompts. (jinja2)
- [Installation and Getting started](https://vegu-ai.github.io/talemate/)
- [User Guide](https://vegu-ai.github.io/talemate/user-guide/interacting/)
## Planned features
## Supported APIs
Kinda making it up as i go along, but i want to lean more into gameplay through AI, keeping track of gamestates, moving away from simply roleplaying towards a more game-ified experience.
- [OpenAI](https://platform.openai.com/overview)
- [Anthropic](https://www.anthropic.com/)
- [mistral.ai](https://mistral.ai/)
- [Cohere](https://www.cohere.com/)
- [Groq](https://www.groq.com/)
- [Google Gemini](https://console.cloud.google.com/)
In no particular order:
Supported self-hosted APIs:
- [KoboldCpp](https://koboldai.org/cpp) ([Local](https://koboldai.org/cpp), [Runpod](https://koboldai.org/runpodcpp), [VastAI](https://koboldai.org/vastcpp), also includes image gen support)
- [oobabooga/text-generation-webui](https://github.com/oobabooga/text-generation-webui) (local or with runpod support)
- [LMStudio](https://lmstudio.ai/)
- [TabbyAPI](https://github.com/theroyallab/tabbyAPI/)
- Gameplay loop governed by AI
- Improved world state
- Dynamic player choice generation
- Better creative tools
- node based scenario / character creation
- Improved long term memory (base is there, but its very rough at the moment)
- Improved director agent
- Right now this doesn't really work well on anything but GPT-4 (and even there it's debatable). It tends to steer the story in a way that introduces pacing issues. It needs a model that is creative but also reasons really well i think.
- Automatic1111 client
# Quickstart
## Installation
### Windows
1. Download and install Python 3.10 or higher from the [official Python website](https://www.python.org/downloads/windows/).
1. Download and install Node.js from the [official Node.js website](https://nodejs.org/en/download/). This will also install npm.
1. Download the Talemate project to your local machine. Download from [the Releases page](https://github.com/final-wombat/talemate/releases).
1. Unpack the download and run `install.bat` by double clicking it. This will set up the project on your local machine.
1. Once the installation is complete, you can start the backend and frontend servers by running `start.bat`.
1. Navigate your browser to http://localhost:8080
### Linux
`python 3.10` or higher is required.
1. `git clone git@github.com:final-wombat/talemate`
1. `cd talemate`
1. `source install.sh`
1. Start the backend: `python src/talemate/server/run.py runserver --host 0.0.0.0 --port 5001`.
1. Open a new terminal, navigate to the `talemate_frontend` directory, and start the frontend server by running `npm run serve`.
## Configuration
### OpenAI
To set your openai api key, open `config.yaml` in any text editor and uncomment / add
```yaml
openai:
api_key: sk-my-api-key-goes-here
```
You will need to restart the backend for this change to take effect.
### RunPod
To set your runpod api key, open `config.yaml` in any text editor and uncomment / add
```yaml
runpod:
api_key: my-api-key-goes-here
```
You will need to restart the backend for this change to take effect.
Once the api key is set Pods loaded from text-generation-webui templates (or the bloke's runpod llm template) will be autoamtically added to your client list in talemate.
**ATTENTION**: Talemate is not a suitable for way for you to determine whether your pod is currently running or not. **Always** check the runpod dashboard to see if your pod is running or not.
## Recommended Models
Note: this is my personal opinion while using talemate. If you find a model that works better for you, let me know about it.
Will be updated as i test more models and over time.
| Model Name | Type | Notes |
|-------------------------------|-----------------|-------------------------------------------------------------------------------------------------------------------|
| [Nous Hermes LLama2](https://huggingface.co/TheBloke/Nous-Hermes-Llama2-GPTQ) | 13B model | My go-to model for 13B parameters. It's good at roleplay and also smart enough to handle the world state and narrative tools. A 13B model loaded via exllama also allows you run chromadb with the xl instructor embeddings off of a single 4090. |
| [Xwin-LM-13B](https://huggingface.co/TheBloke/Xwin-LM-13B-V0.1-GPTQ) | 13B model | Really strong model, roleplaying capability still needs more testing |
| [MythoMax](https://huggingface.co/TheBloke/MythoMax-L2-13B-GPTQ) | 13B model | Similar quality to Hermes LLama2, but a bit more creative. Rarely fails on JSON responses. |
| [Synthia v1.2 34B](https://huggingface.co/TheBloke/Synthia-34B-v1.2-GPTQ) | 34B model | Cannot be run at full context together with chromadb instructor models on a single 4090. But a great choice if you're running chromadb with the default embeddings (or on cpu). |
| [Xwin-LM-70B](https://huggingface.co/TheBloke/Xwin-LM-70B-V0.1-GPTQ) | 70B model | Great choice if you have the hardware to run it (or can rent it). |
| [Synthia v1.2 70B](https://huggingface.co/TheBloke/Synthia-70B-v1.2-GPTQ) | 70B model | Great choice if you have the hardware to run it (or can rent it). |
| [GPT-4](https://platform.openai.com/) | Remote | Still the best for consistency and reasoning, but is heavily censored. While talemate will send a general "decensor" system prompt, depending on the type of content you want to roleplay, there is a chance your key will be banned. **If you do use this make sure to monitor your api usage, talemate tends to send a lot more requests than other roleplaying applications.** |
| [GPT-3.5-turbo](https://platform.openai.com/) | Remote | It's really inconsistent with JSON responses, plus its probably still just as heavily censored as GPT-4. If you want to run it i'd suggest running it for the conversation agent, and use GPT-4 for the other agents. **If you do use this make sure to monitor your api usage, talemate tends to send a lot more requests than other roleplaying applications.** |
I have not tested with Llama 1 models in a while, Lazarus was really good at roleplay, but started failing on JSON requirements.
I have not tested with anything below 13B parameters.
## Connecting to an LLM
On the right hand side click the "Add Client" button. If there is no button, you may need to toggle the client options by clicking this button:
![Client options](docs/img/client-options-toggle.png)
### Text-generation-webui
In the modal if you're planning to connect to text-generation-webui, you can likely leave everything as is and just click Save.
![Add client modal](docs/img/add-client-modal.png)
### OpenAI
If you want to add an OpenAI client, just change the client type and select the apropriate model.
![Add client modal](docs/img/add-client-modal-openai.png)
### Ready to go
You will know you are good to go when the client and all the agents have a green dot next to them.
![Ready to go](docs/img/client-setup-complete.png)
## Load the introductory scenario "Infinity Quest"
Generated using talemate creative tools, mostly used for testing / demoing.
You can load it (and any other talemate scenarios or save files) by expanding the "Load" menu in the top left corner and selecting the middle tab. Then simple search for a partial name of the scenario you want to load and click on the result.
![Load scenario location](docs/img/load-scene-location.png)
## Loading character cards
Supports both v1 and v2 chara specs.
Expand the "Load" menu in the top left corner and either click on "Upload a character card" or simply drag and drop a character card file into the same area.
![Load character card location](docs/img/load-card-location.png)
Once a character is uploaded, talemate may actually take a moment because it needs to convert it to a talemate format and will also run additional LLM prompts to generate character attributes and world state.
Make sure you save the scene after the character is loaded as it can then be loaded as normal talemate scenario in the future.
## Further documentation
- Creative mode (docs WIP)
- Prompt template overrides
- [ChromaDB (long term memory)](docs/chromadb.md)
- Runpod Integration
Generic OpenAI api implementations (tested and confirmed working):
- [DeepInfra](https://deepinfra.com/)
- [llamacpp](https://github.com/ggerganov/llama.cpp) with the `api_like_OAI.py` wrapper
- let me know if you have tested any other implementations and they failed / worked or landed somewhere in between

View File

@@ -1,24 +1,40 @@
agents: {}
clients: {}
creator:
content_context:
- a fun and engaging slice of life story aimed at an adult audience.
- a terrifying horror story aimed at an adult audience.
- a thrilling action story aimed at an adult audience.
- a mysterious adventure aimed at an adult audience.
- an epic sci-fi adventure aimed at an adult audience.
game:
default_player_character:
color: '#6495ed'
description: a young man with a penchant for adventure.
gender: male
name: Elmer
- a fun and engaging slice of life story
- a terrifying horror story
- a thrilling action story
- a mysterious adventure
- an epic sci-fi adventure
## Long-term memory
#chromadb:
# embeddings: instructor
# instructor_device: cuda
# instructor_model: hkunlp/instructor-xl
# openai_model: text-embedding-3-small
## Remote LLMs
#openai:
# api_key: <API_KEY>
#runpod:
# api_key: <API_KEY>
# api_key: <API_KEY>
## TTS (Text-to-Speech)
#elevenlabs:
# api_key: <API_KEY>
#coqui:
# api_key: <API_KEY>
#tts:
# device: cuda
# model: tts_models/multilingual/multi-dataset/xtts_v2
# voices:
# - label: <name>
# value: <path to .wav for voice sample>

21
docker-compose.yml Normal file
View File

@@ -0,0 +1,21 @@
version: '3.8'
services:
talemate:
build:
context: .
dockerfile: Dockerfile
args:
- CUDA_AVAILABLE=${CUDA_AVAILABLE:-false}
ports:
- "${FRONTEND_PORT:-8080}:8080"
- "${BACKEND_PORT:-5050}:5050"
volumes:
- ./config.yaml:/app/config.yaml
- ./scenes:/app/scenes
- ./templates:/app/templates
- ./chroma:/app/chroma
environment:
- PYTHONUNBUFFERED=1
- PYTHONPATH=/app/src:$PYTHONPATH
command: ["/bin/bash", "-c", "source /app/talemate_env/bin/activate && python src/talemate/server/run.py runserver --host 0.0.0.0 --port 5050 --frontend-host 0.0.0.0 --frontend-port 8080"]

5
docs/.pages Normal file
View File

@@ -0,0 +1,5 @@
nav:
- Home: index.md
- Getting started: getting-started
- User guide: user-guide
- Developer guide: dev

View File

@@ -1,61 +0,0 @@
# ChromaDB
Talemate uses ChromaDB to maintain long-term memory. The default embeddings used are really fast but also not incredibly accurate. If you want to use more accurate embeddings you can use the instructor embeddings or the openai embeddings. See below for instructions on how to enable these.
In my testing so far, instructor-xl has proved to be the most accurate (even more-so than openai)
## Local instructor embeddings
If you want chromaDB to use the more accurate (but much slower) instructor embeddings add the following to `config.yaml`:
**Note**: The `xl` model takes a while to load even with cuda. Expect a minute of loading time on the first scene you load.
```yaml
chromadb:
embeddings: instructor
instructor_device: cpu
instructor_model: hkunlp/instructor-xl
```
### Instructor embedding models
- `hkunlp/instructor-base` (smallest / fastest)
- `hkunlp/instructor-large`
- `hkunlp/instructor-xl` (largest / slowest) - requires about 5GB of memory
You will need to restart the backend for this change to take effect.
**NOTE** - The first time you do this it will need to download the instructor model you selected. This may take a while, and the talemate backend will be un-responsive during that time.
Once the download is finished, if talemate is still un-responsive, try reloading the front-end to reconnect. When all fails just restart the backend as well. I'll try to make this more robust in the future.
### GPU support
If you want to use the instructor embeddings with GPU support, you will need to install pytorch with CUDA support.
To do this on windows, run `install-pytorch-cuda.bat` from the project directory. Then change your device in the config to `cuda`:
```yaml
chromadb:
embeddings: instructor
instructor_device: cuda
instructor_model: hkunlp/instructor-xl
```
## OpenAI embeddings
First make sure your openai key is specified in the `config.yaml` file
```yaml
openai:
api_key: <your-key-here>
```
Then add the following to `config.yaml` for chromadb:
```yaml
chromadb:
embeddings: openai
```
**Note**: As with everything openai, using this isn't free. It's way cheaper than their text completion though. ALSO - if you send super explicit content they may flag / ban your key, so keep that in mind (i hear they usually send warnings first though), and always monitor your usage on their dashboard.

166
docs/cleanup.py Normal file
View File

@@ -0,0 +1,166 @@
import os
import re
import subprocess
from pathlib import Path
import argparse
def find_image_references(md_file):
"""Find all image references in a markdown file."""
with open(md_file, 'r', encoding='utf-8') as f:
content = f.read()
pattern = r'!\[.*?\]\((.*?)\)'
matches = re.findall(pattern, content)
cleaned_paths = []
for match in matches:
path = match.lstrip('/')
if 'img/' in path:
path = path[path.index('img/') + 4:]
# Only keep references to versioned images
parts = os.path.normpath(path).split(os.sep)
if len(parts) >= 2 and parts[0].replace('.', '').isdigit():
cleaned_paths.append(path)
return cleaned_paths
def scan_markdown_files(docs_dir):
"""Recursively scan all markdown files in the docs directory."""
md_files = []
for root, _, files in os.walk(docs_dir):
for file in files:
if file.endswith('.md'):
md_files.append(os.path.join(root, file))
return md_files
def find_all_images(img_dir):
"""Find all image files in version subdirectories."""
image_files = []
for root, _, files in os.walk(img_dir):
# Get the relative path from img_dir to current directory
rel_dir = os.path.relpath(root, img_dir)
# Skip if we're in the root img directory
if rel_dir == '.':
continue
# Check if the immediate parent directory is a version number
parent_dir = rel_dir.split(os.sep)[0]
if not parent_dir.replace('.', '').isdigit():
continue
for file in files:
if file.lower().endswith(('.png', '.jpg', '.jpeg', '.gif', '.svg')):
rel_path = os.path.relpath(os.path.join(root, file), img_dir)
image_files.append(rel_path)
return image_files
def grep_check_image(docs_dir, image_path):
"""
Check if versioned image is referenced anywhere using grep.
Returns True if any reference is found, False otherwise.
"""
try:
# Split the image path to get version and filename
parts = os.path.normpath(image_path).split(os.sep)
version = parts[0] # e.g., "0.29.0"
filename = parts[-1] # e.g., "world-state-suggestions-2.png"
# For versioned images, require both version and filename to match
version_pattern = f"{version}.*{filename}"
try:
result = subprocess.run(
['grep', '-r', '-l', version_pattern, docs_dir],
capture_output=True,
text=True
)
if result.stdout.strip():
print(f"Found reference to {image_path} with version pattern: {version_pattern}")
return True
except subprocess.CalledProcessError:
pass
except Exception as e:
print(f"Error during grep check for {image_path}: {e}")
return False
def main():
parser = argparse.ArgumentParser(description='Find and optionally delete unused versioned images in MkDocs project')
parser.add_argument('--docs-dir', type=str, required=True, help='Path to the docs directory')
parser.add_argument('--img-dir', type=str, required=True, help='Path to the images directory')
parser.add_argument('--delete', action='store_true', help='Delete unused images')
parser.add_argument('--verbose', action='store_true', help='Show all found references and files')
parser.add_argument('--skip-grep', action='store_true', help='Skip the additional grep validation')
args = parser.parse_args()
# Convert paths to absolute paths
docs_dir = os.path.abspath(args.docs_dir)
img_dir = os.path.abspath(args.img_dir)
print(f"Scanning markdown files in: {docs_dir}")
print(f"Looking for versioned images in: {img_dir}")
# Get all markdown files
md_files = scan_markdown_files(docs_dir)
print(f"Found {len(md_files)} markdown files")
# Collect all image references
used_images = set()
for md_file in md_files:
refs = find_image_references(md_file)
used_images.update(refs)
# Get all actual images (only from version directories)
all_images = set(find_all_images(img_dir))
if args.verbose:
print("\nAll versioned image references found in markdown:")
for img in sorted(used_images):
print(f"- {img}")
print("\nAll versioned images in directory:")
for img in sorted(all_images):
print(f"- {img}")
# Find potentially unused images
unused_images = all_images - used_images
# Additional grep validation if not skipped
if not args.skip_grep and unused_images:
print("\nPerforming additional grep validation...")
actually_unused = set()
for img in unused_images:
if not grep_check_image(docs_dir, img):
actually_unused.add(img)
if len(actually_unused) != len(unused_images):
print(f"\nGrep validation found {len(unused_images) - len(actually_unused)} additional image references!")
unused_images = actually_unused
# Report findings
print("\nResults:")
print(f"Total versioned images found: {len(all_images)}")
print(f"Versioned images referenced in markdown: {len(used_images)}")
print(f"Unused versioned images: {len(unused_images)}")
if unused_images:
print("\nUnused versioned images:")
for img in sorted(unused_images):
print(f"- {img}")
if args.delete:
print("\nDeleting unused versioned images...")
for img in unused_images:
full_path = os.path.join(img_dir, img)
try:
os.remove(full_path)
print(f"Deleted: {img}")
except Exception as e:
print(f"Error deleting {img}: {e}")
print("\nDeletion complete")
else:
print("\nNo unused versioned images found!")
if __name__ == "__main__":
main()

View File

@@ -0,0 +1,48 @@
from talemate.agents.base import Agent, AgentAction
from talemate.agents.registry import register
from talemate.events import GameLoopEvent
import talemate.emit.async_signals
from talemate.emit import emit
@register()
class TestAgent(Agent):
agent_type = "test"
verbose_name = "Test"
def __init__(self, client):
self.client = client
self.is_enabled = True
self.actions = {
"test": AgentAction(
enabled=True,
label="Test",
description="Test",
),
}
@property
def enabled(self):
return self.is_enabled
@property
def has_toggle(self):
return True
@property
def experimental(self):
return True
def connect(self, scene):
super().connect(scene)
talemate.emit.async_signals.get("game_loop").connect(self.on_game_loop)
async def on_game_loop(self, emission: GameLoopEvent):
"""
Called on the beginning of every game loop
"""
if not self.enabled:
return
emit("status", status="info", message="Annoying you with a test message every game loop.")

View File

@@ -0,0 +1,130 @@
"""
An attempt to write a client against the runpod serverless vllm worker.
This is close to functional, but since runpod serverless gpu availability is currently terrible, i have
been unable to properly test it.
Putting it here for now since i think it makes a decent example of how to write a client against a new service.
"""
import pydantic
import structlog
import runpod
import asyncio
import aiohttp
from talemate.client.base import ClientBase, ExtraField
from talemate.client.registry import register
from talemate.emit import emit
from talemate.config import Client as BaseClientConfig
log = structlog.get_logger("talemate.client.runpod_vllm")
class Defaults(pydantic.BaseModel):
max_token_length: int = 4096
model: str = ""
runpod_id: str = ""
class ClientConfig(BaseClientConfig):
runpod_id: str = ""
@register()
class RunPodVLLMClient(ClientBase):
client_type = "runpod_vllm"
conversation_retries = 5
config_cls = ClientConfig
class Meta(ClientBase.Meta):
title: str = "Runpod VLLM"
name_prefix: str = "Runpod VLLM"
enable_api_auth: bool = True
manual_model: bool = True
defaults: Defaults = Defaults()
extra_fields: dict[str, ExtraField] = {
"runpod_id": ExtraField(
name="runpod_id",
type="text",
label="Runpod ID",
required=True,
description="The Runpod ID to connect to.",
)
}
def __init__(self, model=None, runpod_id=None, **kwargs):
self.model_name = model
self.runpod_id = runpod_id
super().__init__(**kwargs)
@property
def experimental(self):
return False
def set_client(self, **kwargs):
log.debug("set_client", kwargs=kwargs, runpod_id=self.runpod_id)
self.runpod_id = kwargs.get("runpod_id", self.runpod_id)
def tune_prompt_parameters(self, parameters: dict, kind: str):
super().tune_prompt_parameters(parameters, kind)
keys = list(parameters.keys())
valid_keys = ["temperature", "top_p", "max_tokens"]
for key in keys:
if key not in valid_keys:
del parameters[key]
async def get_model_name(self):
return self.model_name
async def generate(self, prompt: str, parameters: dict, kind: str):
"""
Generates text from the given prompt and parameters.
"""
prompt = prompt.strip()
self.log.debug("generate", prompt=prompt[:128] + " ...", parameters=parameters)
try:
async with aiohttp.ClientSession() as session:
endpoint = runpod.AsyncioEndpoint(self.runpod_id, session)
run_request = await endpoint.run({
"input": {
"prompt": prompt,
}
#"parameters": parameters
})
while (await run_request.status()) not in ["COMPLETED", "FAILED", "CANCELLED"]:
status = await run_request.status()
log.debug("generate", status=status)
await asyncio.sleep(0.1)
status = await run_request.status()
log.debug("generate", status=status)
response = await run_request.output()
log.debug("generate", response=response)
return response["choices"][0]["tokens"][0]
except Exception as e:
self.log.error("generate error", e=e)
emit(
"status", message="Error during generation (check logs)", status="error"
)
return ""
def reconfigure(self, **kwargs):
if kwargs.get("model"):
self.model_name = kwargs["model"]
if "runpod_id" in kwargs:
self.api_auth = kwargs["runpod_id"]
log.warning("reconfigure", kwargs=kwargs)
self.set_client(**kwargs)

View File

@@ -0,0 +1,67 @@
import pydantic
from openai import AsyncOpenAI
from talemate.client.base import ClientBase
from talemate.client.registry import register
class Defaults(pydantic.BaseModel):
api_url: str = "http://localhost:1234"
max_token_length: int = 4096
@register()
class TestClient(ClientBase):
client_type = "test"
class Meta(ClientBase.Meta):
name_prefix: str = "test"
title: str = "Test"
defaults: Defaults = Defaults()
def set_client(self, **kwargs):
self.client = AsyncOpenAI(base_url=self.api_url + "/v1", api_key="sk-1111")
def tune_prompt_parameters(self, parameters: dict, kind: str):
"""
Talemate adds a bunch of parameters to the prompt, but not all of them are valid for all clients.
This method is called before the prompt is sent to the client, and it allows the client to remove
any parameters that it doesn't support.
"""
super().tune_prompt_parameters(parameters, kind)
keys = list(parameters.keys())
valid_keys = ["temperature", "top_p"]
for key in keys:
if key not in valid_keys:
del parameters[key]
async def get_model_name(self):
"""
This should return the name of the model that is being used.
"""
return "Mock test model"
async def generate(self, prompt: str, parameters: dict, kind: str):
"""
Generates text from the given prompt and parameters.
"""
human_message = {"role": "user", "content": prompt.strip()}
self.log.debug("generate", prompt=prompt[:128] + " ...", parameters=parameters)
try:
response = await self.client.chat.completions.create(
model=self.model_name, messages=[human_message], **parameters
)
return response.choices[0].message.content
except Exception as e:
self.log.error("generate error", e=e)
return ""

3
docs/dev/index.md Normal file
View File

@@ -0,0 +1,3 @@
# Coming soon
Developer documentation is coming soon. Stay tuned!

85
docs/dev/templates.md Normal file
View File

@@ -0,0 +1,85 @@
# Template Overrides
!!! warning "Old documentation"
This is old documentation and needs to be updated, however may still contain useful information.
## Introduction to Templates
In Talemate, templates are used to generate dynamic content for various agents involved in roleplaying scenarios. These templates leverage the Jinja2 templating engine, allowing for the inclusion of variables, conditional logic, and custom functions to create rich and interactive narratives.
## Template Structure
A typical template in Talemate consists of several sections, each enclosed within special section tags (`<|SECTION:NAME|>` and `<|CLOSE_SECTION|>`). These sections can include character details, dialogue examples, scenario overviews, tasks, and additional context. Templates utilize loops and blocks to iterate over data and render content conditionally based on the task requirements.
## Overriding Templates
Users can customize the behavior of Talemate by overriding the default templates. To override a template, create a new template file with the same name in the `./templates/prompts/{agent}/` directory. When a custom template is present, Jinja2 will prioritize it over the default template located in the `./src/talemate/prompts/templates/{agent}/` directory.
## Creator Agent Templates
The creator agent templates allow for the creation of new characters within the character creator. Following the naming convention `character-attributes-*.jinja2`, `character-details-*.jinja2`, and `character-example-dialogue-*.jinja2`, users can add new templates that will be available for selection in the character creator.
### Requirements for Creator Templates
- All three types (`attributes`, `details`, `example-dialogue`) need to be available for a choice to be valid in the character creator.
- Users can check the human templates for an understanding of how to structure these templates.
### Example Templates
- `src/talemate/prompts/templates/creator/character-attributes-human.jinja2`
- `src/talemate/prompts/templates/creator/character-details-human.jinja2`
- `src/talemate/prompts/templates/creator/character-example-dialogue-human.jinja2`
These example templates can serve as a guide for users to create their own custom templates for the character creator.
### Extending Existing Templates
Jinja2's template inheritance feature allows users to extend existing templates and add extra information. By using the `{% extends "template-name.jinja2" %}` tag, a new template can inherit everything from an existing template and then add or override specific blocks of content.
#### Example
To add a description of a character's hairstyle to the human character details template, you could create a new template like this:
```jinja2
{% extends "character-details-human.jinja2" %}
{% block questions %}
{% if character_details.q("what does "+character.name+"'s hair look like?") -%}
Briefly describe {{ character.name }}'s hair-style using a narrative writing style that reminds of mid 90s point and click adventure games. (2 - 3 sentences).
{% endif %}
{% endblock %}
```
This example shows how to extend the `character-details-human.jinja2` template and add a block for questions about the character's hair. The `{% block questions %}` tag is used to define a section where additional questions can be inserted or existing ones can be overridden.
## Advanced Template Topics
### Jinja2 Functions in Talemate
Talemate exposes several functions to the Jinja2 template environment, providing utilities for data manipulation, querying, and controlling content flow. Here's a list of available functions:
1. `set_prepared_response(response, prepend)`: Sets the prepared response with an optional prepend string. This function allows the template to specify the beginning of the LLM response when processing the rendered template. For example, `set_prepared_response("Certainly!")` will ensure that the LLM's response starts with "Certainly!".
2. `set_prepared_response_random(responses, prefix)`: Chooses a random response from a list and sets it as the prepared response with an optional prefix.
3. `set_eval_response(empty)`: Prepares the response for evaluation, optionally initializing a counter for an empty string.
4. `set_json_response(initial_object, instruction, cutoff)`: Prepares for a JSON response with an initial object and optional instruction and cutoff.
5. `set_question_eval(question, trigger, counter, weight)`: Sets up a question for evaluation with a trigger, counter, and weight.
6. `disable_dedupe()`: Disables deduplication of the response text.
7. `random(min, max)`: Generates a random integer between the specified minimum and maximum.
8. `query_scene(query, at_the_end, as_narrative)`: Queries the scene with a question and returns the formatted response.
9. `query_text(query, text, as_question_answer)`: Queries a text with a question and returns the formatted response.
10. `query_memory(query, as_question_answer, **kwargs)`: Queries the memory with a question and returns the formatted response.
11. `instruct_text(instruction, text)`: Instructs the text with a command and returns the result.
12. `retrieve_memories(lines, goal)`: Retrieves memories based on the provided lines and an optional goal.
13. `uuidgen()`: Generates a UUID string.
14. `to_int(x)`: Converts the given value to an integer.
15. `config`: Accesses the configuration settings.
16. `len(x)`: Returns the length of the given object.
17. `count_tokens(x)`: Counts the number of tokens in the given text.
18. `print(x)`: Prints the given object (mainly for debugging purposes).
These functions enhance the capabilities of templates, allowing for dynamic and interactive content generation.
### Error Handling
Errors encountered during template rendering are logged and propagated to the user interface. This ensures that users are informed of any issues that may arise, allowing them to troubleshoot and resolve problems effectively.
By following these guidelines, users can create custom templates that tailor the Talemate experience to their specific storytelling needs.# Template Overrides in Talemate

View File

@@ -0,0 +1,14 @@
## Third Party API docs
### Chat completions
- [Anthropic](https://docs.anthropic.com/en/api/messages)
- [Cohere](https://docs.cohere.com/reference/chat)
- [Google AI](https://ai.google.dev/api/generate-content#v1beta.GenerationConfig)
- [Groq](https://console.groq.com/docs/api-reference#chat-create)
- [KoboldCpp](https://lite.koboldai.net/koboldcpp_api#/api/v1)
- [LMStudio](https://lmstudio.ai/docs/api/rest-api)
- [Mistral AI](https://docs.mistral.ai/api/)
- [OpenAI](https://platform.openai.com/docs/api-reference/completions)
- [TabbyAPI](https://theroyallab.github.io/tabbyAPI/#operation/chat_completion_request_v1_chat_completions_post)
- [Text-Generation-WebUI](https://github.com/oobabooga/text-generation-webui/blob/main/extensions/openai/typing.py)

View File

@@ -0,0 +1,5 @@
nav:
- 1. Installation: installation
- 2. Connect a client: connect-a-client.md
- 3. Load a scene: load-a-scene.md
- ...

View File

@@ -0,0 +1,3 @@
nav:
- change-host-and-port.md
- ...

View File

@@ -0,0 +1,102 @@
# Changing host and port
## Backend
By default, the backend listens on `localhost:5050`.
To run the server on a different host and port, you need to change the values passed to the `--host` and `--port` parameters during startup and also make sure the frontend knows the new values.
### Changing the host and port for the backend
#### :material-linux: Linux
Copy `start.sh` to `start_custom.sh` and edit the `--host` and `--port` parameters in the `uvicorn` command.
```bash
#!/bin/sh
. talemate_env/bin/activate
python src/talemate/server/run.py runserver --host 0.0.0.0 --port 1234
```
#### :material-microsoft-windows: Windows
Copy `start.bat` to `start_custom.bat` and edit the `--host` and `--port` parameters in the `uvicorn` command.
```batch
start cmd /k "cd talemate_env\Scripts && activate && cd ../../ && python src\talemate\server\run.py runserver --host 0.0.0.0 --port 1234"
```
### Letting the frontend know about the new host and port
Copy `talemate_frontend/example.env.development.local` to `talemate_frontend/.env.production.local` and edit the `VUE_APP_TALEMATE_BACKEND_WEBSOCKET_URL`.
```env
VUE_APP_TALEMATE_BACKEND_WEBSOCKET_URL=ws://localhost:1234
```
Next rebuild the frontend.
```bash
cd talemate_frontend
npm run build
```
### Start the backend and frontend
Start the backend and frontend as usual.
#### :material-linux: Linux
```bash
./start_custom.sh
```
#### :material-microsoft-windows: Windows
```batch
start_custom.bat
```
## Frontend
By default, the frontend listens on `localhost:8080`.
To change the frontend host and port, you need to change the values passed to the `--frontend-host` and `--frontend-port` parameters during startup.
### Changing the host and port for the frontend
#### :material-linux: Linux
Copy `start.sh` to `start_custom.sh` and edit the `--frontend-host` and `--frontend-port` parameters.
```bash
#!/bin/sh
. talemate_env/bin/activate
python src/talemate/server/run.py runserver --host 0.0.0.0 --port 5055 \
--frontend-host localhost --frontend-port 8082
```
#### :material-microsoft-windows: Windows
Copy `start.bat` to `start_custom.bat` and edit the `--frontend-host` and `--frontend-port` parameters.
```batch
start cmd /k "cd talemate_env\Scripts && activate && cd ../../ && python src\talemate\server\run.py runserver --host 0.0.0.0 --port 5055 --frontend-host localhost --frontend-port 8082"
```
### Start the backend and frontend
Start the backend and frontend as usual.
#### :material-linux: Linux
```bash
./start_custom.sh
```
#### :material-microsoft-windows: Windows
```batch
start_custom.bat
```

View File

@@ -0,0 +1,68 @@
# Connect a client
Once Talemate is up and running and you are connected, you will see a notification in the corner instructing you to configured a client.
![no clients](/talemate/img/0.26.0/no-clients.png)
Talemate uses client(s) to connect to local or remote AI text generation APIs like koboldcpp, text-generation-webui or OpenAI.
## Add a new client
On the right hand side click the **:material-plus-box: ADD CLIENT** button.
![connect a client add client](/talemate/img/0.26.0/connect-a-client-add-client.png)
!!! note "No button?"
If there is no button, you may need to toggle the client options by clicking this button
![open clients](/talemate/img/0.26.0/open-clients.png)
The client configuration window will appear. Here you can choose the type of client you want to add.
![connect a client add client modal](/talemate/img/0.26.0/connect-a-client-add-client-modal.png)
## Choose an API / Client Type
We have support for multiple local and remote APIs. You can choose to use one or more of them.
!!! note "Local vs remote"
A local API runs on your machine, while a remote API runs on a server somewhere else.
Select the API you want to use and click through to follow the instructions to configure a client for it:
##### Remote APIs
- [OpenAI](/talemate/user-guide/clients/types/openai/)
- [Anthropic](/talemate/user-guide/clients/types/anthropic/)
- [mistral.ai](/talemate/user-guide/clients/types/mistral/)
- [Cohere](/talemate/user-guide/clients/types/cohere/)
- [Groq](/talemate/user-guide/clients/types/groq/)
- [Google Gemini](/talemate/user-guide/clients/types/google/)
##### Local APIs
- [KoboldCpp](/talemate/user-guide/clients/types/koboldcpp/)
- [Text-Generation-WebUI](/talemate/user-guide/clients/types/text-generation-webui/)
- [LMStudio](/talemate/user-guide/clients/types/lmstudio/)
- [TabbyAPI](/talemate/user-guide/clients/types/tabbyapi/)
##### Unofficial OpenAI API implementations
- [DeepInfra](/talemate/user-guide/clients/types/openai-compatible/#deepinfra)
- llamacpp with the `api_like_OAI.py` wrapper
## Assign the client to the agents
Whenever you add your first client, Talemate will automatically assign it to all agents. Once the client is configured and assigned, all agents should have a green dot next to them. (Or grey if the agent is currently disabled)
![Connect a client assigned](/talemate/img/0.26.0/connect-a-client-ready.png)
You can tell the client is assigned to the agent by checking the tag beneath the agent name, which will contain the client name if it is assigned.
![Agent has client assigned](/talemate/img/0.26.0/agent-has-client-assigned.png)
## Its not assigned!
If for some reason the client is not assigned to the agent, you can manually assign it to all agents by clicking the **:material-transit-connection-variant: Assign to all agents** button.
![Connect a client assign to all agents](/talemate/img/0.26.0/connect-a-client-assign-to-all-agents.png)

View File

@@ -0,0 +1,5 @@
nav:
- windows.md
- linux.md
- docker.md
- ...

View File

@@ -0,0 +1,22 @@
!!! example "Experimental"
Talemate through docker has not received a lot of testing from me, so please let me know if you encounter any issues.
You can do so by creating an issue on the [:material-github: GitHub repository](https://github.com/vegu-ai/talemate)
## Quick install instructions
1. `git clone https://github.com/vegu-ai/talemate.git`
1. `cd talemate`
1. copy config file
1. linux: `cp config.example.yaml config.yaml`
1. windows: `copy config.example.yaml config.yaml`
1. If your host has a CUDA compatible Nvidia GPU
1. Windows (via PowerShell): `$env:CUDA_AVAILABLE="true"; docker compose up`
1. Linux: `CUDA_AVAILABLE=true docker compose up`
1. If your host does **NOT** have a CUDA compatible Nvidia GPU
1. Windows: `docker compose up`
1. Linux: `docker compose up`
1. Navigate your browser to http://localhost:8080
!!! note
When connecting local APIs running on the hostmachine (e.g. text-generation-webui), you need to use `host.docker.internal` as the hostname.

View File

@@ -1,3 +1,27 @@
## Quick install instructions
!!! warning
python 3.12 is currently not supported.
### Dependencies
1. node.js and npm - see instructions [here](https://nodejs.org/en/download/package-manager/)
1. python 3.10 or 3.11 - see instructions [here](https://www.python.org/downloads/)
### Installation
1. `git clone https://github.com/vegu-ai/talemate.git`
1. `cd talemate`
1. `source install.sh`
- When asked if you want to install pytorch with CUDA support choose `y` if you have
a CUDA compatible Nvidia GPU and have installed the necessary drivers.
1. `source start.sh`
If everything went well, you can proceed to [connect a client](../../connect-a-client).
## Additional Information
### Setting Up a Virtual Environment
1. Open a terminal.
@@ -14,7 +38,7 @@
1. With the virtual environment activated and dependencies installed, you can start the backend server.
2. Navigate to the `src/talemate/server` directory.
3. Run the server with `python run.py runserver --host 0.0.0.0 --port 5001`.
3. Run the server with `python run.py runserver --host 0.0.0.0 --port 5050`.
### Running the Frontend
@@ -22,4 +46,4 @@
2. If you haven't already, install npm dependencies by running `npm install`.
3. Start the server with `npm run serve`.
Please note that you may need to set environment variables or modify the host and port as per your setup. You can refer to the `runserver.sh` and `frontend.sh` files for more details.
Please note that you may need to set environment variables or modify the host and port as per your setup. You can refer to the `runserver.sh` and `frontend.sh` files for more details.

View File

@@ -0,0 +1,28 @@
# Common issues
## Windows
### Installation fails with "Microsoft Visual C++" error
If your installation errors with a notification to upgrade "Microsoft Visual C++" go to https://visualstudio.microsoft.com/visual-cpp-build-tools/ and click "Download Build Tools" and run it.
- During installation make sure you select the C++ development package (upper left corner)
- Run `reinstall.bat` inside talemate directory
## Docker
### Docker has created `config.yaml` directory
If you do not copy the example config to `config.yaml` before running `docker compose up` docker will create a `config` directory in the root of the project. This will cause the backend to fail to start.
This happens because we mount the config file directly as a docker volume, and if it does not exist docker will create a directory with the same name.
This will eventually be fixed, for now please make sure to copy the example config file before running the docker compose command.
## General
### Running behind reverse proxy with ssl
Personally i have not been able to make this work yet, but its on my list, issue stems from some vue oddities when specifying the base urls while running in a dev environment. I expect once i start building the project for production this will be resolved.
If you do make it work, please reach out to me so i can update this documentation.

View File

@@ -0,0 +1,42 @@
## Quick install instructions
!!! warning
python 3.12 is currently not supported
1. Download and install Python 3.10 or Python 3.11 from the [official Python website](https://www.python.org/downloads/windows/).
- [Click here for direct link to python 3.11.9 download](https://www.python.org/downloads/release/python-3119/)
1. Download and install Node.js from the [official Node.js website](https://nodejs.org/en/download/prebuilt-installer). This will also install npm.
1. Download the Talemate project to your local machine. Download from [the Releases page](https://github.com/vegu-ai/talemate/releases).
1. Unpack the download and run `install.bat` by double clicking it. This will set up the project on your local machine.
1. Once the installation is complete, you can start the backend and frontend servers by running `start.bat`.
1. Navigate your browser to http://localhost:8080
If everything went well, you can proceed to [connect a client](../../connect-a-client).
## Additional Information
### How to Install Python 3.10 or 3.11
1. Visit the official Python website's download page for Windows at [https://www.python.org/downloads/windows/](https://www.python.org/downloads/windows/).
2. Find the latest version of Python 3.10 or 3.11 and click on one of the download links. (You will likely want the Windows installer (64-bit))
4. Run the installer file and follow the setup instructions. Make sure to check the box that says Add Python 3.10 to PATH before you click Install Now.
### How to Install npm
1. Download Node.js from the official site [https://nodejs.org/en/download/prebuilt-installer](https://nodejs.org/en/download/prebuilt-installer).
2. Run the installer (the .msi installer is recommended).
3. Follow the prompts in the installer (Accept the license agreement, click the NEXT button a bunch of times and accept the default installation settings).
### Usage of the Supplied bat Files
#### install.bat
This batch file is used to set up the project on your local machine. It creates a virtual environment, activates it, installs poetry, and uses poetry to install dependencies. It then navigates to the frontend directory and installs the necessary npm packages.
To run this file, simply double click on it or open a command prompt in the same directory and type `install.bat`.
#### start.bat
This batch file is used to start the backend and frontend servers. It opens two command prompts, one for the frontend and one for the backend.
To run this file, simply double click on it or open a command prompt in the same directory and type `start.bat`.

View File

@@ -0,0 +1,57 @@
# Load a scenario
Once you've set up a client and assigned it to all the agents, you will be presented with the `Home` screen. From here, you can load talemate scenarios and upload character cards.
To load the introductory `Infinity Quest` scenario, simply click on its entry in the `Quick Load` section.
![Load infinity quest](/talemate/img/0.26.0/getting-started-load-screen.png)
!!! info "First time may take a moment"
When you load the a scenario for the first time, Talemate will need to initialize the long term memory model. Which likely means a download. Just be patient and it will be ready soon.
## Interacting with the scenario
After a moment of loading, you will see the scenario's introductory message and be able to send a text interaction.
![Getting stgarted scene 1](/talemate/img/0.26.0/getting-started-scene-1.png)
Its time to send the first message.
Spoken words should go into `"` and actions should be written in `*`. Talemate will automatically supply the other if you supply one.
![Getting started first interaction](/talemate/img/0.26.0/getting-started-first-interaction.png)
Once sent, its now the AI's turn to respond - depending on the service and model selected this can take a a moment.
![Getting started first ai response](/talemate/img/0.26.0/getting-started-first-ai-response.png)
## Quick overview of UI elements
### Scenario tools
Above the chat input there is a set of tools to help you interact with the scenario.
![Getting started ui element tools](/talemate/img/0.26.0/getting-started-ui-element-tools.png)
These contain tools to, for example:
- regenrate the most recent AI response
- give directions to characters
- narrate the scene
- advance time
- save the current scene state
- and more ...
A full guide can be found in the [Scenario Tools](/talemate/user-guide/scenario-tools) section of the user guide.
### World state
Shows a sumamrization of the current scene state.
![getting started world state 1](/talemate/img/0.26.0/getting-started-world-state-1.png)
Each item can be expanded for more information.
![getting started world state 2](/talemate/img/0.26.0/getting-started-world-state-2.png)
Find out more about the world state in the [World State](/talemate/user-guide/world-state) section of the user guide.

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 933 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 634 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 441 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 289 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Some files were not shown because too many files have changed in this diff Show More