Compare commits

..

8 Commits

Author SHA1 Message Date
FInalWombat
d250df8950 Prep 0.13.2 (#33)
* fix issue with client removal

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

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

* fix issues with edit client not reflecting changes to UX

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

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

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

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

* relock

* narrator - narrate on dialogue agent actions

* add support for new textgenwebui api

* world state auto regen trigger off of gameloop

* funciton !rename command

* ensure_dialog_format error handling

* Cat, Nous-Capybara, dolphin-2.2.1

* narrate after dialog rerun fixes, template fixes

* LMStudio client (experimental)

* dolhpin yi

* refactor client base

* cruft

* openai client to new base

* more client refactor fixes

* tweak context retrieval prompts

* adjust nous capybara template

* add Tess-Medium

* 0.13.0

* switch back to poetry for windows as well

* error on legacy textgenwebui api

* runpod text gen api url fixed

* fix windows install script

* add fllow instruction template

* Psyfighter2
2023-11-18 12:16:29 +02:00
FInalWombat
f9b23f8705 Update README.md 2023-11-14 11:06:52 +02:00
FInalWombat
37a5873330 Update README.md 2023-11-12 15:43:02 +02:00
FInalWombat
bc3f5d63c8 Add files via upload 2023-11-12 15:42:07 +02:00
10 changed files with 37 additions and 15 deletions

View File

@@ -4,22 +4,26 @@ Allows you to play roleplay scenarios with large language models.
It does not run any large language models itself but relies on existing APIs. Currently supports **text-generation-webui** and **openai**.
This means you need to either have an openai api key or know how to setup [oobabooga/text-generation-webui](https://github.com/oobabooga/text-generation-webui) (locally or remotely via gpu renting. `--api` flag needs to be set)
This means you need to either have an openai api key or know how to setup [oobabooga/text-generation-webui](https://github.com/oobabooga/text-generation-webui) (locally or remotely via gpu renting. `--extension openai` flag needs to be set)
![Screenshot 1](docs/img/Screenshot_8.png)
As of version 0.13.0 the legacy text-generator-webui API `--extension api` is no longer supported, please use their new `--extension openai` api implementation instead.
![Screenshot 1](docs/img/Screenshot_9.png)
![Screenshot 2](docs/img/Screenshot_2.png)
## Current features
- responive modern ui
- agents
- conversation
- narration
- summarization
- director
- creative
- conversation: handles character dialogue
- narration: handles narrative exposition
- summarization: handles summarization to compress context while maintain history
- director: can be used to direct the story / characters
- editor: improves AI responses (very hit and miss at the moment)
- world state: generates world snapshot and handles passage of time (objects and characters)
- creator: character / scenario creator
- multi-client (agents can be connected to separate APIs)
- long term memory (experimental)
- long term memory
- chromadb integration
- passage of time
- narrative world state
@@ -49,7 +53,7 @@ In no particular order:
- objectives
- quests
- win / lose conditions
- Automatic1111 client
- Automatic1111 client for in place visual generation
# Quickstart
@@ -113,6 +117,8 @@ https://www.reddit.com/r/LocalLLaMA/comments/17fhp9k/huge_llm_comparisontest_39_
On the right hand side click the "Add Client" button. If there is no button, you may need to toggle the client options by clicking this button:
As of version 0.13.0 the legacy text-generator-webui API `--extension api` is no longer supported, please use their new `--extension openai` api implementation instead.
![Client options](docs/img/client-options-toggle.png)
### Text-generation-webui

BIN
docs/img/Screenshot_9.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 551 KiB

View File

@@ -4,7 +4,7 @@ build-backend = "poetry.masonry.api"
[tool.poetry]
name = "talemate"
version = "0.13.0"
version = "0.13.2"
description = "AI-backed roleplay and narrative tools"
authors = ["FinalWombat"]
license = "GNU Affero General Public License v3.0"

View File

@@ -2,4 +2,4 @@ from .agents import Agent
from .client import TextGeneratorWebuiClient
from .tale_mate import *
VERSION = "0.13.0"
VERSION = "0.13.2"

View File

@@ -89,7 +89,7 @@ class Agent(ABC):
if not getattr(self.client, "enabled", True):
return False
if self.client.current_status in ["error", "warning"]:
if self.client and self.client.current_status in ["error", "warning"]:
return False
return self.client is not None

View File

@@ -47,7 +47,7 @@ class ClientBase:
def __init__(
self,
api_url: str,
api_url: str = None,
name = None,
**kwargs,
):

View File

@@ -27,6 +27,10 @@ class TextGeneratorWebuiClient(ClientBase):
raise Exception("Could not find model info (wrong api version?)")
response_data = response.json()
model_name = response_data.get("model_name")
if model_name == "None":
model_name = None
return model_name

View File

@@ -14,6 +14,6 @@ Scenario Premise: {{ scene.description }}
<|SECTION:TASK|>
Based on the previous line '{{ last_line }}', create the next line of narration. This line should focus solely on describing sensory details (like sounds, sights, smells, tactile sensations) or external actions that move the story forward. Avoid including any character's internal thoughts, feelings, or dialogue. Your narration should directly respond to '{{ last_line }}', either by elaborating on the immediate scene or by subtly advancing the plot. Generate exactly one sentence of new narration. If the character is trying to determine some state, truth or situation, try to answer as part of the narration.
Be creative and generate something new and interesting.
Be creative and generate something new and interesting, but stay true to the setting and context of the story so far.
<|CLOSE_SECTION|>
{{ set_prepared_response('*') }}

View File

@@ -167,11 +167,16 @@ class WebsocketHandler(Receiver):
log.info("Configuring clients", clients=clients)
for client in clients:
client.pop("status", None)
if client["type"] in ["textgenwebui", "lmstudio"]:
try:
max_token_length = int(client.get("max_token_length", 2048))
except ValueError:
continue
client.pop("model", None)
self.llm_clients[client["name"]] = {
"type": client["type"],
@@ -180,6 +185,10 @@ class WebsocketHandler(Receiver):
"max_token_length": max_token_length,
}
elif client["type"] == "openai":
client.pop("model_name", None)
client.pop("apiUrl", None)
self.llm_clients[client["name"]] = {
"type": "openai",
"name": client["name"],

View File

@@ -8,7 +8,7 @@
<v-container>
<v-row>
<v-col cols="6">
<v-select v-model="client.type" :items="['openai', 'textgenwebui', 'lmstudio']" label="Client Type"></v-select>
<v-select v-model="client.type" :disabled="!typeEditable()" :items="['openai', 'textgenwebui', 'lmstudio']" label="Client Type"></v-select>
</v-col>
<v-col cols="6">
<v-text-field v-model="client.name" label="Client Name"></v-text-field>
@@ -68,6 +68,9 @@ export default {
}
},
methods: {
typeEditable() {
return this.state.formTitle === 'Add Client';
},
close() {
this.$emit('update:dialog', false);
},