Closed parasshah10 closed 1 year ago
Hey @parasshah10, wondering why you closed this? Custom code being able to edit the character's "personality" in a way that persists across threads would be really cool! Hadn't replied yet because I've been thinking about how it should be implemented.
Self-modifying characters seems like a pretty awesome feature - definitely want to make this possible.
There are 3 different things to think about in terms of characters modifying their own data:
storage
object in the custom code doc.1 is done, but I'm probably going to adjust the implementation a bit (in a backwards-compatible way) to make it easy to "chain" multiple "extensions" together in a way where they won't conflict too much with one another
2 I think could be implemented with a simple character
object, and you simply edit the properties like character.name="foo"
- similar to storage
3 I'm not 100% sure on yet because I'm now thinking that maybe there should be storage.thread
and storage.global
or something like that - but I guess people writing custom code could handle that distinction themselves? hmm
Thinking out loud here - if you have any thoughts, or examples of use cases that you think should be supported, that'd be useful!
Oh I just realise that you might have closed it because of the note "custom code can now create system messages" in latest release notes - this actually refers to system messages within the current thread (since this is allowed in the ChatML format - you can arbitrarily mix user/ai/system messages). Currently there's no way to edit the first, "personality-defining" system message, or any other data that would make changes that transfer to other threads.
Let's keep this issue open until it's possible for custom code to edit character details like the first, personality system message, and other cross-thread data.
This is now possible! Characters can now edit their own system message, custom code, temperature, etc.
Please see custom code docs: https://github.com/josephrocca/OpenCharacters/blob/main/docs/custom-code.md
Changing the system message of the character would allow changing the personality of the character over time or adding context without putting it in a new user message as that could cause the ai to get confused between actual user message and the contextual message. Examples would be updating summary, inventory, relationships, events or even relevant past conversations using sematic search etc for the character only for that thread in the system message giving the character a "long-term memory".
This could be done using the processMessages function allowing to add to/overwrite the existing system prompt on a per thread basis so that other threads of same character are not affected.
Edit: I just saw the api.chat and api.completion in the custom-code.md. Would this allow to replace the assistant message on it's turn using the one generated using api?