Files
talemate/talemate_frontend/src/components/CreativeMenu.vue
veguAI add4893939 Prep 0.19.0 (#67)
* linting

* improve prompt devtools: test changes, show more information

* some more polish for the new promp devtools

* up default conversation gen length to 128

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

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

* ux polish for character sheet and character state ux

* actor instructions

* experiment using # for context / instructions

* fix bug where regenerating history would mess up time stamps

* remove trailing ]

* prevent client ctx from being unset

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

* upgrade dependencies

* set 0.19.0

* fix performance degradation caused by circular loading animation

* remove coqui studio support

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

* third party client / agent support

* edit dialogue examples through character / actor editor

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

* different icon for delete

* prompt adjustment for acting instructions

* adhoc context generation for character attributes and details

* add adhoc generation for character description

* contextual generation tweaks

* contextual generation for dialogue examples
fix some formatting issues

* contextual generation for world entries

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

* scene info
scene experimental

* assortment of fixes for holodeck improvements

* more holodeck fixes

* refactor holodeck instructions

* rename holodeck to simulation suite

* better scene status messages

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

* allow exclusion of characters when persisting based on world state

* better error handling of world state response

* better error handling of world state response

* more simulation suite fixes

* progress color

* world state character name mapping support

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

* fix rerun of new paraphrase op

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

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

* fix bug with new status notifications

* sim suite adjustments and fixes and tuning

* sim suite tweaks

* impl scene restore from file

* prompting tweaks for reinforcement messages and acting instructions

* more tweaks

* dialogue prompt tweaks for rerun + rewrite

* fix bug with character entry / exit with narration

* linting

* simsuite screenshots

* screenshots
2024-02-06 00:40:55 +02:00

176 lines
7.4 KiB
Vue

<template>
<div v-if="scene.environment === 'creative'">
<v-list-subheader class="text-uppercase">
<v-icon class="mr-1">mdi-account</v-icon>Characters
</v-list-subheader>
<div ref="charactersContainer">
<v-list density="compact">
<!-- active characters -->
<v-list-item density="compact" v-for="(character,index) in scene.characters" :key="index">
<v-list-item-title>
{{ character.name }}
</v-list-item-title>
<div class="text-center mt-1 mb-1">
<v-tooltip text="Permanently Delete">
<template v-slot:activator="{ props }">
<v-btn size="x-small" class="mr-1" v-bind="props" variant="tonal" density="comfortable" rounded="sm" color="red-darken-1" icon="mdi-account-cancel" @click.stop="removeCharacterFromScene(character.name)"></v-btn>
</template>
</v-tooltip>
<v-tooltip text="Deactivate">
<template v-slot:activator="{ props }">
<v-btn size="x-small" class="mr-1" v-bind="props" variant="tonal" density="comfortable" rounded="sm" color="secondary" icon="mdi-exit-run" @click.stop="getWebsocket().send(JSON.stringify({type: 'interact', text: '!char_d:'+character.name+':no'}))"></v-btn>
</template>
</v-tooltip>
<v-tooltip text="Edit character">
<template v-slot:activator="{ props }">
<v-btn size="x-small" class="mr-1" v-bind="props" variant="tonal" density="comfortable" rounded="sm" icon="mdi-account-edit" @click.stop="openWorldStateManager('characters',character.name, 'description')"></v-btn>
</template>
</v-tooltip>
<v-tooltip text="Open character template in character creator" v-if="character.base_attributes._template">
<template v-slot:activator="{ props }">
<v-btn size="x-small" class="mr-1" v-bind="props" variant="tonal" density="comfortable" rounded="sm" icon="mdi-badge-account-outline" @click.stop="openCharacterCreatorForCharacter(character.name)"></v-btn>
</template>
</v-tooltip>
</div>
<v-divider></v-divider>
</v-list-item>
<!-- inactive characters -->
<v-list-item v-for="(character_name, index) in scene.inactive_characters" density="compact" :key="index">
<v-list-item-title class="text-grey-darken-1">
{{ character_name }}
</v-list-item-title>
<div class="text-center mt-1 mb-1">
<v-tooltip text="Permanently Delete">
<template v-slot:activator="{ props }">
<v-btn size="x-small" class="mr-1" v-bind="props" variant="tonal" density="comfortable" rounded="sm" color="red-darken-1" icon="mdi-account-cancel" @click.stop="removeCharacterFromScene(character_name)"></v-btn>
</template>
</v-tooltip>
<v-tooltip text="Activate (call to scene)">
<template v-slot:activator="{ props }">
<v-btn size="x-small" class="mr-1" v-bind="props" variant="tonal" density="comfortable" rounded="sm" color="secondary" icon="mdi-human-greeting" @click.stop="getWebsocket().send(JSON.stringify({type: 'interact', text: '!char_a:'+character_name+':no'}))"></v-btn>
</template>
</v-tooltip>
<v-tooltip text="Edit character">
<template v-slot:activator="{ props }">
<v-btn size="x-small" class="mr-1" v-bind="props" variant="tonal" density="comfortable" rounded="sm" icon="mdi-account-edit" @click.stop="openWorldStateManager('characters',character_name, 'description')"></v-btn>
</template>
</v-tooltip>
</div>
<v-divider></v-divider>
</v-list-item>
<!-- add / import character -->
<v-list-item>
<v-tooltip text="Add character">
<template v-slot:activator="{ props }">
<v-btn @click="openCharacterCreator" v-bind="props" density="comfortable" class="mt-1 mr-1" size="small" color="primary" icon="mdi-account-plus" rounded="sm"></v-btn>
</template>
</v-tooltip>
<v-tooltip text="Import character from other scene">
<template v-slot:activator="{ props }">
<v-btn @click="openCharacterImporter" v-bind="props" density="comfortable" class="mt-1" size="small" color="primary" icon="mdi-account-arrow-right" rounded="sm"></v-btn>
</template>
</v-tooltip>
</v-list-item>
</v-list>
</div>
<v-list-subheader class="text-uppercase">
<v-icon class="mr-1">mdi-image</v-icon>Scenario
</v-list-subheader>
<v-list ref="sceneContainer">
<v-list-item>
<v-list-item-title>
{{ scene.name }}
</v-list-item-title>
<v-btn block color="primary" @click="openSceneCreator" prepend-icon="mdi-pencil">Edit Scenario</v-btn>
</v-list-item>
</v-list>
</div>
</template>
<script>
export default {
name: 'CreativeMenu',
data() {
return {
expanded: false,
scene: {
characters: {},
environment: null,
description: null,
name: null,
intro: null,
}
}
},
inject: [
'getWebsocket',
'registerMessageHandler',
'isConnected',
'openCharacterCreator',
'openCharacterCreatorForCharacter',
'openCharacterImporter',
'openSceneCreator',
],
emits: [
'open-world-state-manager',
],
methods: {
toggle() {
this.expanded = !this.expanded;
},
removeCharacterFromScene(character) {
let confirm = window.confirm(`Are you sure you want to remove ${character} from the game?`);
if(!confirm) {
return;
}
this.getWebsocket().send(JSON.stringify({
type: 'interact',
text: `!remove_character:${character}`,
}));
},
openWorldStateManager(tab, sub1, sub2, sub3) {
this.$emit('open-world-state-manager', tab, sub1, sub2, sub3);
},
handleMessage(data) {
if(data.type === 'scene_status' && data.status === 'started') {
this.scene = data.data;
}
},
},
created() {
this.registerMessageHandler(this.handleMessage);
},
}
</script>
<style scoped></style>