mirror of
https://github.com/vegu-ai/talemate.git
synced 2025-12-25 16:09:32 +01:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d250df8950 | ||
|
|
816f950afe | ||
|
|
8fb72fdbe9 | ||
|
|
54297a4768 | ||
|
|
d7e72d27c5 | ||
|
|
f9b23f8705 | ||
|
|
37a5873330 | ||
|
|
bc3f5d63c8 |
24
README.md
24
README.md
@@ -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)
|
||||
|
||||

|
||||
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.
|
||||
|
||||

|
||||

|
||||
|
||||
## 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.
|
||||
|
||||

|
||||
|
||||
### Text-generation-webui
|
||||
|
||||
BIN
docs/img/Screenshot_9.png
Normal file
BIN
docs/img/Screenshot_9.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 551 KiB |
@@ -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"
|
||||
|
||||
@@ -2,4 +2,4 @@ from .agents import Agent
|
||||
from .client import TextGeneratorWebuiClient
|
||||
from .tale_mate import *
|
||||
|
||||
VERSION = "0.13.0"
|
||||
VERSION = "0.13.2"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -47,7 +47,7 @@ class ClientBase:
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
api_url: str,
|
||||
api_url: str = None,
|
||||
name = None,
|
||||
**kwargs,
|
||||
):
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -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('*') }}
|
||||
@@ -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"],
|
||||
|
||||
@@ -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);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user