Files
talemate/tests/test_isodate.py

155 lines
5.4 KiB
Python
Raw Normal View History

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
import pytest
0.30.0 (#184) * pytorch update * github workflow for tests * tests set up config * tests download nltk punkt * punkt_tab * fix world state not updating on new initial scene load * fix new character creation from scene tools * py 312 py 313 support remove unreliant cuda detection and just lock poetry with cuda * fix tests * dont auto install cuda * remove unused StrEnum import * separate cuda install * fix auto progress OFF no longer working * fix debug logging options not sticking * disable revision during image prompt generation * prompt tweaks * prompt tweaks * fix some issues with directed character creation * tweak the continue generation button so its less prone to pop into a new line on itsown * fix context db filter field layout * handle error when trying to regnerate passthrough narrator message * prompt tweaks * increase auto direct evaluation length * fix node library on windows * auto direct eval tweaks * prompt tweaks * prompt tweaks * allow updationg of scene phase through director console * add generate action to director console phase intent text fields * prompt tweaks * track iteration count in scene loop always yield to user at initial start / load of a scene * fix issue with Split and Join nodes when passed \n as delimiter * sim suite only generate auto direct requirements if auto direct is enabled sim suite fix issues with title generation * autocomplete button disable until there is text to autcomplete * update installation docs * update scenario tools docs * docs * writing style phrase detection * typo * docs * fix issue where deleting an applied preset group would prevent selection of a different preset group in the affected client * fix @-Instruction is broken when using apostrophes * editor never attempt to fix exposition on user input if input starts with command characters @, ! or / * prompt tweaks * editor revision: automatic revision setting, prompt tweaks, docs * missing files * fix issue where narration responses starting with # would result in empty messages * prompt tweaks * fix issue with autocomplete not working at the beginning of a scene * fix issues where cached guidance would result in no guidance * editor revision analysis now has access to scene analysis and director guidance if it exists * fix issue where all nodes in the node editor would be locked on winsows OS * add `scene/SetIntroducation` node * fix issue where generating narration in a scene with zero characters would always come back blank * SceneIntroduction node state output fixed * node editor docs progress * fix issue with loading scene from file upload no longer working * better handling of what to do when there are no characters in a scene and no default character is defined * typo * silence trigger game loop debug message * docs * GenerateThematicList node * docs * docs * stubs * allow creation of module from existing nodes * move function into plugin * separate graph export functions into own .js file * group from selected nodes * remove debug output * tweak create module dialog * docs * docs * graph tests need to assume auto_progres True * add ModuleProperty node * fix some issues in the module creation modal when extending or copying a module * include module name in module deletion confirm dialog * fix node module copy not setting updated registry * module property name output * docs * docs * initializing a scene from a character card will no longer break the node editor * docs * when greeting text and intro do not match, do the greeting text first. * intro is set during card import, there is no need to ever emit character greetings in addition to the intro, its not really something that matches talemate's design philsophy at this point * docs * dynamic premise modules * tweaks * propagate module level property defaults to node * docs * fix issue where the default character would get added to scenes during load even though there already was a player character * prompt tweaks * tweaks to generate-premise module * docs * infinity quest dynamic story v2 * tweaks limits * fix line endings * prompt tweaks * fix some issues with node property editing * formatting * prompt tweaks * group and comment * add talemate tint node style fix gap in nodes when there are no sockets * node style fixes * docs * docs * icon for swtich nodes * conditional emit status node * don't reset dynamic premise * dynamic premise tweaks * dynamic premis status messages * fix issue with Input value error node * validate that topic is specified * fix issue where cancelling a generation triggered during scene loop init would cause the loop to reinitialize * docs * node error handling improvements * docs * better error handling in generate premise module * a connected socket should always override a property of the same value even if the socket connection is not resolved * dynamic premise expose intro length property * fix some issues with node module creation and add registry path validation * correctly title creative loop module so it can be copied * remove debug message * rename to dynamic storyline for clarity and so it doesn't collide with tutorial * import dynanimc storyline node * docs * gracefully handle a node missing during graph load * docs * make agent list a bit more compact * disable node property editing in inherited nodes * rename editor revision events so they are inline with the other agent events * support instruction injection for director.generate_choices action * normalize dynamic instructions * fix director guidance dynamic instructions * docs * generate choices event add choices property * prompt tweaks * add dynamic instruction node * prompt tweak * fix issue where some events could not be hooked into through event node modules * docs * clean response node * docs * docs * docs * module library tweaks * fix some issues with act-as selection * dont allow creation of new modules until scene has been saved at least once * public node modules dir * sim suite module styles * remove debug messages * fix default node titles * fix number input vlaidation in math nodes * context awareness in contextual generate now includes character info * fix dupe id warnings * alt drag to clone multiple nodes * alt drag to clone multiple nodes * docs * docs * fix issue where some scene modules could leak across scenes * dynamic instructions already included through extra context * prompt tweaks * update defaults * docs * make list init from json * socs * fix issue where not all field definitions would get sent * docs * fix issue causing deep analysis to loop * case insentive regex matching * prompt tweaks * fix node title * fix size issue in scene view when node editor was open on smaller resolutions * fix issue with autocomplete sometime loosing markup * add claude 4 * make director guidance and actor instructions available to autocomplete prompt * fix trim node handling of \n * extract node * extract node trim property * remover cruft * charactermessage node only set character if not already part of message prefix * editor revision unslop mode * fix search scenes showing node module files * prompt tweaks * unslop support unwanted phrase detection * define bad_prose * </FIX> seems to get ommitted a lot so lets handle it * cleanup * return on no issues * fix some issues with character creation * fix some character creation issues * prompt tweaks * contewxtual generate and autocomplete signals added * prefix revision_ * use uuidv4 which is already installed and doesnt come with compatibility issues * editor revision support for contextual generations normalize some event objects * add template picker to worldstate character creation interface * prompt tweaks * dont unslop scene intent or story intent generation * prompt tweaks * prompt tweaks * prompt tweaks * prompt tweaks * prompt tweaks * prompt tweaks * prompt tweaks * prompt tweaks * prompt tweaks * prompt tweaks * fix issue of conversation losing edits through signals * support revisions for world state entry generation * task_instructions * dont show rewrite specific options if unslop method is selected * docs * fix issue with setting locked save file when auto saving was turned on * don't trigger player_turn_start in creative mode * better check for when to fire player_turn_start and when not * node editor crash course fixes * docs * fix issue where sometimes wrong system prompt was selected * add world context to contextual generate node * fix node dragging issue when cloning multiple nodes * support editor revision for summarization generation * summarization support dynamic instructions * dedicated template for summary unslop * pass summarization_history to template vars * prompt tweaks * prompt tweaks * not sure how this got blanked * wording * wording * only display debug log if TALEMATE_DEBUG=1 * fix syntax * fix syntax * remove unused cruft * start-debug * log message cleanup * docs * tweak defaults * sim suite polish * remove unused images * add writing style instructions to revision prompts * missing endif tag * prompt tweaks * prompt tweaks * prompt tweaks * use app-busy * prompt tweaks * update readme and screenshots wording wording * add discord link
2025-06-03 12:26:12 +03:00
import isodate
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
from talemate.util import (
iso8601_add,
iso8601_correct_duration,
iso8601_diff,
iso8601_diff_to_human,
iso8601_duration_to_human,
parse_duration_to_isodate_duration,
timedelta_to_duration,
duration_to_timedelta,
0.31.0 (#193) * some prompt cleanup * prompt tweaks * prompt tweaks * prompt tweaks * set 0.31.0 * relock * rag queries add brief analysis * brief analysis before building rag questions * rag improvements * prompt tweaks * address circular import issues * set 0.30.1 * docs * numpy to 2 * docs * prompt tweaks * prompt tweak * some template cleanup * prompt viewer increase height * fix codemirror highlighting not working * adjust details height * update default * change to log debug * allow response to scale to max height * template cleanup * prompt tweaks * first progress for installing modules to scene * package install logic * package install polish * package install polish * package install polish and fixes * refactor initial world state update and expose setting for it * add `num` property to ModuleProperty to control order of widgets * dynamic storyline package info * fix issue where deactivating player character would cause inconsistencies in the creative tools menui * cruft * add openrouter support * ollama support * refactor how model choices are loaded, so that can be done per client instance as opposed to just per client type * set num_ctx * remove debug messages * ollama tweaks * toggle for whether or not default character gets added to blank talemate scenes * narrator prompt tweaks and template cleanup * cleanup * prompt tweaks and template cleanup * prompt tweaks * fix instructor embeddings * add additional error handling to prevent broken world state templates from breaking the world editor side menu * fix openrouter breaking startup if not configured * remove debug message * promp tweaks * fix example dialogue generation no longer working * prompt tweaks and better showing of dialogue examples in conversation instructions * prompt tweak * add initial startup message * prompt tweaks * fix asset error * move complex acting instructions into the task block * fix content input socket on DynamicInstructions node * log.error with traceback over log.exception since that has a tendency to explode and hang everything * fix usse with number nodes where they would try to execute even if the incoming wire wasnt active * fix issue with editor revision events missing template_vars * DynamicInstruction node should only run if both header and content can resolve * removed remaining references to 90s adventure game writing style * prompt tweaks * support embeddings via client apis (koboldcpp) * fix label on client-api embeddings * fix issue where adding / removing an embedding preset would not be reflected immediately in the memory agent config * remove debug output * prompt tweaks * prompt tweaks * autocomplete passes message object * validate group names to be filename valid * embedded winsows env installs and up to poetry2 * version config * get-pip * relock * pin runpod * no longer needed * remove rapidfuzz dependency * nodejs directly into embedded_node without a versioned middleman dir - also remove defunct local-tts install script * fix update script * update script error handling * update.bat error handling * adjust wording * support loading jinja2 templates node modules in templates/modules * update google model list * client t/s and business indicator - also switch all clients to async streaming * formatting * support coercion for anthropic / google switch to the new google genai sdk upgrade websockets * more coercion fixes * gracefully handle keyboard interrupt * EmitSystemMessage node * allow visual prompt generation without image generation * relock * chromadb to v1 * fix error handling * fix issue where adding client model list would be empty * supress pip install warnings * allow overriding of base urls * remove key from log * add fade effect * tweak request info ux * further clarification of endpoint override api key * world state manager: fix issue that caused max changes setting to disappear from character progress config * fix issue with google safety settings off causing generation failures * update to base url should always reset the client * getattr * support v3 chara card version and attempt to future proof * client based embeddings improvements * more fixes for client based embeddings * use client icon * history management tools progress * history memory ids fixed and added validation * regenerate summary fixes * more history regeneration fixes * fix layered history gen and prompt twweaks * allow regeneration of individual layered history entries * return list of LayeredArchiveEntry * reorg for less code dupelication * new scene message renderer based on marked * add inspect functionality to history viewer * message if no history entries yet * allow adding of history entries manually * allow deletion of history * summarization unslop improvements * fix make charcter real action from worldstate listing * allow overriding length in all context generation isntructioon dialogs * fix issue where extract_list could fail with an unhandled error if the llm response didnt contain a list * update whats'new * fix issues with the new history management tools * fix check * Switch dependency handling to UV (#202) * Migrate from Poetry to uv package manager (#200) * migrate from poetry to uv package manager * Update all installation and startup scripts for uv migration * Fix pyproject.toml for uv - allow direct references for hatchling * Fix PR feedback: Restore removed functionality - Restored embedded Python/Node.js functionality in install.bat and update.bat - Restored environment variable exposure in docker-compose.yml (CUDA_AVAILABLE, port configs) - Fixed GitHub Actions branches (main, prep-* instead of main, dev) - Restored fail-fast: false and cache configuration in test.yml These changes preserve all the functionality that should not be removed during the migration from Poetry to uv. --------- Co-authored-by: Ztripez von Matérn <ztripez@bobby.se> * remove uv.lock from .gitignore * add lock file * fix install issues * warn if unable to remove legacy poetry virt env dir * uv needs to be explicitly installed into the .venv so its available * third time's the charm? * fix windows install scripts * add .venv guard to update.bat * call :die * fix docker venv install * node 21 * fix cuda install * start.bat calls install if needed * sync start-local to other startup scripts * no need to activate venv --------- Co-authored-by: Ztripez <reg@otherland.nu> Co-authored-by: Ztripez von Matérn <ztripez@bobby.se> * ignore hfhub symlink warnings * add openrouter and ollama mentions * update windows install documentation * docs * docs * fix issue with memory agent fingerprint * removing a client that supports embeddings will also remove any embedding functions it created * on invalid embeddings reset to default * docs * typo * formatting * docs * docs * install package * adjust topic * add more obvious way to exit creative mode * when importing character cards immediately persist a usable save after the restoration save --------- Co-authored-by: Ztripez <reg@otherland.nu> Co-authored-by: Ztripez von Matérn <ztripez@bobby.se>
2025-06-29 18:06:11 +03:00
amount_unit_to_iso8601_duration,
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
)
def test_isodate_utils():
date1 = "P11MT15M"
date2 = "PT1S"
duration1= parse_duration_to_isodate_duration(date1)
assert duration1.months == 11
assert duration1.tdelta.seconds == 900
duration2 = parse_duration_to_isodate_duration(date2)
assert duration2.seconds == 1
timedelta1 = duration_to_timedelta(duration1)
assert timedelta1.seconds == 900
assert timedelta1.days == 11*30, timedelta1.days
timedelta2 = duration_to_timedelta(duration2)
assert timedelta2.seconds == 1
parsed = parse_duration_to_isodate_duration("P11MT14M59S")
assert iso8601_diff(date1, date2) == parsed, parsed
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
assert iso8601_duration_to_human(date1, flatten=False) == "11 Months and 15 Minutes ago", iso8601_duration_to_human(date1, flatten=False)
assert iso8601_duration_to_human(date2, flatten=False) == "1 Second ago", iso8601_duration_to_human(date2, flatten=False)
assert iso8601_duration_to_human(iso8601_diff(date1, date2), flatten=False) == "11 Months, 14 Minutes and 59 Seconds ago", iso8601_duration_to_human(iso8601_diff(date1, date2), flatten=False)
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
@pytest.mark.parametrize("dates, expected", [
(["PT1S", "P3M", "P6M", "P8M"], "P17MT1S"),
])
def test_adding_isodates(dates: list[str], expected: str):
date = dates[0]
for i in range(1, len(dates)):
date = iso8601_add(date, dates[i])
assert date == expected, date
@pytest.mark.parametrize("a, b, expected", [
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
# Basic year/month cases
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
("P1Y", "P11M", "1 Month and 5 Days ago"),
("P12M", "P11M", "1 Month ago"),
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
("P2Y", "P1Y", "1 Year ago"),
("P25M", "P1Y", "1 Year, 2 Weeks and 6 Days ago"),
# Mixed time components
("P34DT2H30M", "PT0S", "1 Month, 4 Days, 2 Hours and 30 Minutes ago"),
("P1YT24H", "P1Y", "1 Day ago"),
("P1MT60S", "P1M", "1 Minute ago"),
("P400D", "P1Y", "1 Month and 5 Days ago"),
# Edge cases
("PT1S", "PT0S", "1 Second ago"),
("PT1M", "PT0S", "1 Minute ago"),
("PT1H", "PT0S", "1 Hour ago"),
("P1D", "PT0S", "1 Day ago"),
("P1W", "PT0S", "1 Week ago"),
("P1M", "PT0S", "1 Month ago"),
("P1Y", "PT0S", "1 Year ago"),
# Complex mixed durations
("P1Y2M3DT4H5M6S", "PT0S", "1 Year, 2 Months, 3 Days, 4 Hours, 5 Minutes and 6 Seconds ago"),
("P1Y1M1DT1H1M1S", "P1Y", "1 Month, 1 Day, 1 Hour, 1 Minute and 1 Second ago"),
("P2Y15M", "P1Y", "2 Years, 2 Months, 3 Weeks and 4 Days ago"),
# Time-only durations
("PT24H", "PT0S", "1 Day ago"),
("PT25H", "PT1H", "1 Day ago"),
("PT90M", "PT30M", "1 Hour ago"),
("PT3600S", "PT0S", "1 Hour ago"),
# Inverse order (should give same absolute difference)
("P1M", "P2M", "1 Month ago"),
("PT0S", "P1Y", "1 Year ago"),
# Zero difference
("P1Y", "P1Y", "Recently"),
("P1M", "P1M", "Recently"),
("PT0S", "PT0S", "Recently"),
0.31.0 (#193) * some prompt cleanup * prompt tweaks * prompt tweaks * prompt tweaks * set 0.31.0 * relock * rag queries add brief analysis * brief analysis before building rag questions * rag improvements * prompt tweaks * address circular import issues * set 0.30.1 * docs * numpy to 2 * docs * prompt tweaks * prompt tweak * some template cleanup * prompt viewer increase height * fix codemirror highlighting not working * adjust details height * update default * change to log debug * allow response to scale to max height * template cleanup * prompt tweaks * first progress for installing modules to scene * package install logic * package install polish * package install polish * package install polish and fixes * refactor initial world state update and expose setting for it * add `num` property to ModuleProperty to control order of widgets * dynamic storyline package info * fix issue where deactivating player character would cause inconsistencies in the creative tools menui * cruft * add openrouter support * ollama support * refactor how model choices are loaded, so that can be done per client instance as opposed to just per client type * set num_ctx * remove debug messages * ollama tweaks * toggle for whether or not default character gets added to blank talemate scenes * narrator prompt tweaks and template cleanup * cleanup * prompt tweaks and template cleanup * prompt tweaks * fix instructor embeddings * add additional error handling to prevent broken world state templates from breaking the world editor side menu * fix openrouter breaking startup if not configured * remove debug message * promp tweaks * fix example dialogue generation no longer working * prompt tweaks and better showing of dialogue examples in conversation instructions * prompt tweak * add initial startup message * prompt tweaks * fix asset error * move complex acting instructions into the task block * fix content input socket on DynamicInstructions node * log.error with traceback over log.exception since that has a tendency to explode and hang everything * fix usse with number nodes where they would try to execute even if the incoming wire wasnt active * fix issue with editor revision events missing template_vars * DynamicInstruction node should only run if both header and content can resolve * removed remaining references to 90s adventure game writing style * prompt tweaks * support embeddings via client apis (koboldcpp) * fix label on client-api embeddings * fix issue where adding / removing an embedding preset would not be reflected immediately in the memory agent config * remove debug output * prompt tweaks * prompt tweaks * autocomplete passes message object * validate group names to be filename valid * embedded winsows env installs and up to poetry2 * version config * get-pip * relock * pin runpod * no longer needed * remove rapidfuzz dependency * nodejs directly into embedded_node without a versioned middleman dir - also remove defunct local-tts install script * fix update script * update script error handling * update.bat error handling * adjust wording * support loading jinja2 templates node modules in templates/modules * update google model list * client t/s and business indicator - also switch all clients to async streaming * formatting * support coercion for anthropic / google switch to the new google genai sdk upgrade websockets * more coercion fixes * gracefully handle keyboard interrupt * EmitSystemMessage node * allow visual prompt generation without image generation * relock * chromadb to v1 * fix error handling * fix issue where adding client model list would be empty * supress pip install warnings * allow overriding of base urls * remove key from log * add fade effect * tweak request info ux * further clarification of endpoint override api key * world state manager: fix issue that caused max changes setting to disappear from character progress config * fix issue with google safety settings off causing generation failures * update to base url should always reset the client * getattr * support v3 chara card version and attempt to future proof * client based embeddings improvements * more fixes for client based embeddings * use client icon * history management tools progress * history memory ids fixed and added validation * regenerate summary fixes * more history regeneration fixes * fix layered history gen and prompt twweaks * allow regeneration of individual layered history entries * return list of LayeredArchiveEntry * reorg for less code dupelication * new scene message renderer based on marked * add inspect functionality to history viewer * message if no history entries yet * allow adding of history entries manually * allow deletion of history * summarization unslop improvements * fix make charcter real action from worldstate listing * allow overriding length in all context generation isntructioon dialogs * fix issue where extract_list could fail with an unhandled error if the llm response didnt contain a list * update whats'new * fix issues with the new history management tools * fix check * Switch dependency handling to UV (#202) * Migrate from Poetry to uv package manager (#200) * migrate from poetry to uv package manager * Update all installation and startup scripts for uv migration * Fix pyproject.toml for uv - allow direct references for hatchling * Fix PR feedback: Restore removed functionality - Restored embedded Python/Node.js functionality in install.bat and update.bat - Restored environment variable exposure in docker-compose.yml (CUDA_AVAILABLE, port configs) - Fixed GitHub Actions branches (main, prep-* instead of main, dev) - Restored fail-fast: false and cache configuration in test.yml These changes preserve all the functionality that should not be removed during the migration from Poetry to uv. --------- Co-authored-by: Ztripez von Matérn <ztripez@bobby.se> * remove uv.lock from .gitignore * add lock file * fix install issues * warn if unable to remove legacy poetry virt env dir * uv needs to be explicitly installed into the .venv so its available * third time's the charm? * fix windows install scripts * add .venv guard to update.bat * call :die * fix docker venv install * node 21 * fix cuda install * start.bat calls install if needed * sync start-local to other startup scripts * no need to activate venv --------- Co-authored-by: Ztripez <reg@otherland.nu> Co-authored-by: Ztripez von Matérn <ztripez@bobby.se> * ignore hfhub symlink warnings * add openrouter and ollama mentions * update windows install documentation * docs * docs * fix issue with memory agent fingerprint * removing a client that supports embeddings will also remove any embedding functions it created * on invalid embeddings reset to default * docs * typo * formatting * docs * docs * install package * adjust topic * add more obvious way to exit creative mode * when importing character cards immediately persist a usable save after the restoration save --------- Co-authored-by: Ztripez <reg@otherland.nu> Co-authored-by: Ztripez von Matérn <ztripez@bobby.se>
2025-06-29 18:06:11 +03:00
# long durations
("P0D", "P998Y23M30D", "999 Years, 11 Months, 3 Weeks and 4 Days ago"),
("P0D", "P12M364640D", "1000 Years ago"),
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
])
def test_iso8601_diff_to_human_unflattened(a, b, expected):
assert iso8601_diff_to_human(a, b, flatten=False) == expected, iso8601_diff_to_human(a, b, flatten=False)
@pytest.mark.parametrize("a, b, expected", [
# Basic duration flattening tests
("P1Y2M3DT4H5M6S", "PT0S", "1 Year and 2 Months ago"),
("P2Y7M", "PT0S", "2 Years and 7 Months ago"),
("P18M", "PT0S", "1 Year and 6 Months ago"),
("P6M15D", "PT0S", "6 Months ago"),
("P45D", "PT0S", "1 Month and 15 Days ago"),
("P25D", "PT0S", "25 Days ago"),
("P2DT12H", "PT0S", "2 Days and 12 Hours ago"),
("PT20H", "PT0S", "20 Hours ago"),
("P1DT30M", "PT0S", "1 Day and 1 Hour ago"),
("P2DT45M", "PT0S", "2 Days and 1 Hour ago"),
("P15DT8H", "PT0S", "15 Days ago"),
("P35DT12H30M", "PT0S", "1 Month and 5 Days ago"),
0.31.0 (#193) * some prompt cleanup * prompt tweaks * prompt tweaks * prompt tweaks * set 0.31.0 * relock * rag queries add brief analysis * brief analysis before building rag questions * rag improvements * prompt tweaks * address circular import issues * set 0.30.1 * docs * numpy to 2 * docs * prompt tweaks * prompt tweak * some template cleanup * prompt viewer increase height * fix codemirror highlighting not working * adjust details height * update default * change to log debug * allow response to scale to max height * template cleanup * prompt tweaks * first progress for installing modules to scene * package install logic * package install polish * package install polish * package install polish and fixes * refactor initial world state update and expose setting for it * add `num` property to ModuleProperty to control order of widgets * dynamic storyline package info * fix issue where deactivating player character would cause inconsistencies in the creative tools menui * cruft * add openrouter support * ollama support * refactor how model choices are loaded, so that can be done per client instance as opposed to just per client type * set num_ctx * remove debug messages * ollama tweaks * toggle for whether or not default character gets added to blank talemate scenes * narrator prompt tweaks and template cleanup * cleanup * prompt tweaks and template cleanup * prompt tweaks * fix instructor embeddings * add additional error handling to prevent broken world state templates from breaking the world editor side menu * fix openrouter breaking startup if not configured * remove debug message * promp tweaks * fix example dialogue generation no longer working * prompt tweaks and better showing of dialogue examples in conversation instructions * prompt tweak * add initial startup message * prompt tweaks * fix asset error * move complex acting instructions into the task block * fix content input socket on DynamicInstructions node * log.error with traceback over log.exception since that has a tendency to explode and hang everything * fix usse with number nodes where they would try to execute even if the incoming wire wasnt active * fix issue with editor revision events missing template_vars * DynamicInstruction node should only run if both header and content can resolve * removed remaining references to 90s adventure game writing style * prompt tweaks * support embeddings via client apis (koboldcpp) * fix label on client-api embeddings * fix issue where adding / removing an embedding preset would not be reflected immediately in the memory agent config * remove debug output * prompt tweaks * prompt tweaks * autocomplete passes message object * validate group names to be filename valid * embedded winsows env installs and up to poetry2 * version config * get-pip * relock * pin runpod * no longer needed * remove rapidfuzz dependency * nodejs directly into embedded_node without a versioned middleman dir - also remove defunct local-tts install script * fix update script * update script error handling * update.bat error handling * adjust wording * support loading jinja2 templates node modules in templates/modules * update google model list * client t/s and business indicator - also switch all clients to async streaming * formatting * support coercion for anthropic / google switch to the new google genai sdk upgrade websockets * more coercion fixes * gracefully handle keyboard interrupt * EmitSystemMessage node * allow visual prompt generation without image generation * relock * chromadb to v1 * fix error handling * fix issue where adding client model list would be empty * supress pip install warnings * allow overriding of base urls * remove key from log * add fade effect * tweak request info ux * further clarification of endpoint override api key * world state manager: fix issue that caused max changes setting to disappear from character progress config * fix issue with google safety settings off causing generation failures * update to base url should always reset the client * getattr * support v3 chara card version and attempt to future proof * client based embeddings improvements * more fixes for client based embeddings * use client icon * history management tools progress * history memory ids fixed and added validation * regenerate summary fixes * more history regeneration fixes * fix layered history gen and prompt twweaks * allow regeneration of individual layered history entries * return list of LayeredArchiveEntry * reorg for less code dupelication * new scene message renderer based on marked * add inspect functionality to history viewer * message if no history entries yet * allow adding of history entries manually * allow deletion of history * summarization unslop improvements * fix make charcter real action from worldstate listing * allow overriding length in all context generation isntructioon dialogs * fix issue where extract_list could fail with an unhandled error if the llm response didnt contain a list * update whats'new * fix issues with the new history management tools * fix check * Switch dependency handling to UV (#202) * Migrate from Poetry to uv package manager (#200) * migrate from poetry to uv package manager * Update all installation and startup scripts for uv migration * Fix pyproject.toml for uv - allow direct references for hatchling * Fix PR feedback: Restore removed functionality - Restored embedded Python/Node.js functionality in install.bat and update.bat - Restored environment variable exposure in docker-compose.yml (CUDA_AVAILABLE, port configs) - Fixed GitHub Actions branches (main, prep-* instead of main, dev) - Restored fail-fast: false and cache configuration in test.yml These changes preserve all the functionality that should not be removed during the migration from Poetry to uv. --------- Co-authored-by: Ztripez von Matérn <ztripez@bobby.se> * remove uv.lock from .gitignore * add lock file * fix install issues * warn if unable to remove legacy poetry virt env dir * uv needs to be explicitly installed into the .venv so its available * third time's the charm? * fix windows install scripts * add .venv guard to update.bat * call :die * fix docker venv install * node 21 * fix cuda install * start.bat calls install if needed * sync start-local to other startup scripts * no need to activate venv --------- Co-authored-by: Ztripez <reg@otherland.nu> Co-authored-by: Ztripez von Matérn <ztripez@bobby.se> * ignore hfhub symlink warnings * add openrouter and ollama mentions * update windows install documentation * docs * docs * fix issue with memory agent fingerprint * removing a client that supports embeddings will also remove any embedding functions it created * on invalid embeddings reset to default * docs * typo * formatting * docs * docs * install package * adjust topic * add more obvious way to exit creative mode * when importing character cards immediately persist a usable save after the restoration save --------- Co-authored-by: Ztripez <reg@otherland.nu> Co-authored-by: Ztripez von Matérn <ztripez@bobby.se>
2025-06-29 18:06:11 +03:00
("P12M364640D", "P0D", "1000 Years ago"),
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
])
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
def test_iso8601_diff_to_human_flattened(a, b, expected):
assert iso8601_duration_to_human(iso8601_diff(a, b), flatten=True) == expected, \
0.31.0 (#193) * some prompt cleanup * prompt tweaks * prompt tweaks * prompt tweaks * set 0.31.0 * relock * rag queries add brief analysis * brief analysis before building rag questions * rag improvements * prompt tweaks * address circular import issues * set 0.30.1 * docs * numpy to 2 * docs * prompt tweaks * prompt tweak * some template cleanup * prompt viewer increase height * fix codemirror highlighting not working * adjust details height * update default * change to log debug * allow response to scale to max height * template cleanup * prompt tweaks * first progress for installing modules to scene * package install logic * package install polish * package install polish * package install polish and fixes * refactor initial world state update and expose setting for it * add `num` property to ModuleProperty to control order of widgets * dynamic storyline package info * fix issue where deactivating player character would cause inconsistencies in the creative tools menui * cruft * add openrouter support * ollama support * refactor how model choices are loaded, so that can be done per client instance as opposed to just per client type * set num_ctx * remove debug messages * ollama tweaks * toggle for whether or not default character gets added to blank talemate scenes * narrator prompt tweaks and template cleanup * cleanup * prompt tweaks and template cleanup * prompt tweaks * fix instructor embeddings * add additional error handling to prevent broken world state templates from breaking the world editor side menu * fix openrouter breaking startup if not configured * remove debug message * promp tweaks * fix example dialogue generation no longer working * prompt tweaks and better showing of dialogue examples in conversation instructions * prompt tweak * add initial startup message * prompt tweaks * fix asset error * move complex acting instructions into the task block * fix content input socket on DynamicInstructions node * log.error with traceback over log.exception since that has a tendency to explode and hang everything * fix usse with number nodes where they would try to execute even if the incoming wire wasnt active * fix issue with editor revision events missing template_vars * DynamicInstruction node should only run if both header and content can resolve * removed remaining references to 90s adventure game writing style * prompt tweaks * support embeddings via client apis (koboldcpp) * fix label on client-api embeddings * fix issue where adding / removing an embedding preset would not be reflected immediately in the memory agent config * remove debug output * prompt tweaks * prompt tweaks * autocomplete passes message object * validate group names to be filename valid * embedded winsows env installs and up to poetry2 * version config * get-pip * relock * pin runpod * no longer needed * remove rapidfuzz dependency * nodejs directly into embedded_node without a versioned middleman dir - also remove defunct local-tts install script * fix update script * update script error handling * update.bat error handling * adjust wording * support loading jinja2 templates node modules in templates/modules * update google model list * client t/s and business indicator - also switch all clients to async streaming * formatting * support coercion for anthropic / google switch to the new google genai sdk upgrade websockets * more coercion fixes * gracefully handle keyboard interrupt * EmitSystemMessage node * allow visual prompt generation without image generation * relock * chromadb to v1 * fix error handling * fix issue where adding client model list would be empty * supress pip install warnings * allow overriding of base urls * remove key from log * add fade effect * tweak request info ux * further clarification of endpoint override api key * world state manager: fix issue that caused max changes setting to disappear from character progress config * fix issue with google safety settings off causing generation failures * update to base url should always reset the client * getattr * support v3 chara card version and attempt to future proof * client based embeddings improvements * more fixes for client based embeddings * use client icon * history management tools progress * history memory ids fixed and added validation * regenerate summary fixes * more history regeneration fixes * fix layered history gen and prompt twweaks * allow regeneration of individual layered history entries * return list of LayeredArchiveEntry * reorg for less code dupelication * new scene message renderer based on marked * add inspect functionality to history viewer * message if no history entries yet * allow adding of history entries manually * allow deletion of history * summarization unslop improvements * fix make charcter real action from worldstate listing * allow overriding length in all context generation isntructioon dialogs * fix issue where extract_list could fail with an unhandled error if the llm response didnt contain a list * update whats'new * fix issues with the new history management tools * fix check * Switch dependency handling to UV (#202) * Migrate from Poetry to uv package manager (#200) * migrate from poetry to uv package manager * Update all installation and startup scripts for uv migration * Fix pyproject.toml for uv - allow direct references for hatchling * Fix PR feedback: Restore removed functionality - Restored embedded Python/Node.js functionality in install.bat and update.bat - Restored environment variable exposure in docker-compose.yml (CUDA_AVAILABLE, port configs) - Fixed GitHub Actions branches (main, prep-* instead of main, dev) - Restored fail-fast: false and cache configuration in test.yml These changes preserve all the functionality that should not be removed during the migration from Poetry to uv. --------- Co-authored-by: Ztripez von Matérn <ztripez@bobby.se> * remove uv.lock from .gitignore * add lock file * fix install issues * warn if unable to remove legacy poetry virt env dir * uv needs to be explicitly installed into the .venv so its available * third time's the charm? * fix windows install scripts * add .venv guard to update.bat * call :die * fix docker venv install * node 21 * fix cuda install * start.bat calls install if needed * sync start-local to other startup scripts * no need to activate venv --------- Co-authored-by: Ztripez <reg@otherland.nu> Co-authored-by: Ztripez von Matérn <ztripez@bobby.se> * ignore hfhub symlink warnings * add openrouter and ollama mentions * update windows install documentation * docs * docs * fix issue with memory agent fingerprint * removing a client that supports embeddings will also remove any embedding functions it created * on invalid embeddings reset to default * docs * typo * formatting * docs * docs * install package * adjust topic * add more obvious way to exit creative mode * when importing character cards immediately persist a usable save after the restoration save --------- Co-authored-by: Ztripez <reg@otherland.nu> Co-authored-by: Ztripez von Matérn <ztripez@bobby.se>
2025-06-29 18:06:11 +03:00
f"Failed for {a} vs {b}: Got {iso8601_duration_to_human(iso8601_diff(a, b), flatten=True)}"
@pytest.mark.parametrize("amount, unit, expected", [
# Minutes
(5, "minutes", "PT5M"),
(1, "minute", "PT1M"),
# Hours
(3, "hours", "PT3H"),
# Days
(2, "days", "P2D"),
# Weeks
(2, "weeks", "P2W"),
# Months (handled specially in the date section)
(7, "months", "P7M"),
# Years
(4, "years", "P4Y"),
# Negative amount should be converted to positive duration
(-5, "hours", "PT5H"),
# 1000 years
(1000, "years", "P1000Y"),
])
def test_amount_unit_to_iso8601_duration_valid(amount: int, unit: str, expected: str):
"""Ensure valid (amount, unit) pairs are converted to the correct ISO-8601 duration."""
assert amount_unit_to_iso8601_duration(amount, unit) == expected
@pytest.mark.parametrize("amount, unit", [
(1, "invalid"),
(0, "centuries"),
])
def test_amount_unit_to_iso8601_duration_invalid(amount: int, unit: str):
"""Ensure invalid units raise ValueError."""
with pytest.raises(ValueError):
amount_unit_to_iso8601_duration(amount, unit)