Aedial / novelai-api

Python API for the NovelAI REST API
https://aedial.github.io/novelai-api/
MIT License
129 stars 17 forks source link

How to configure loreBook? #18

Closed cwyuu closed 1 year ago

cwyuu commented 1 year ago

I don't find any data about "loreBook" in the parameters of the web request or in the parameters of the api. Is there any usage of loreBook in the api? How can I achieve the effect of loreBook in the web page? Is it possible to search for keywords in the context? If the keyword is found, then the text about the keyword is added to the context. Is there a simpler way to do this? For example, a function that has been wrapped and passed the json data of loreBook directly. That's my question. Thank you very much.

Translated with www.DeepL.com/Translator (free version)

Aedial commented 1 year ago

Lorebook is part of context building, like AN, memory, story, etc, as such the base API doesn't support it, it's a frontend feature. Partial support of it from me is planned (novelai_api/StoryHandler.py), but it's... complicated. In the meantime, you will have to build the context yourself and send it as "prompt" (aka, context). It should be pretty straight forward if you're not trying to do something complicated.

cwyuu commented 1 year ago

Lorebook is part of context building, like AN, memory, story, etc, as such the base API doesn't support it, it's a frontend feature. Partial support of it from me is planned (novelai_api/StoryHandler.py), but it's... complicated. In the meantime, you will have to build the context yourself and send it as "prompt" (aka, context). It should be pretty straight forward if you're not trying to do something complicated.

Understood, thanks for the answer😊