Skip to content

Conversation

@tammy3211
Copy link
Contributor

PR Checklist

  • Have you checked if it works normally in all models? Ignore this if it doesn't use models.
  • Have you checked if it works normally in all web, local, and node hosted versions? If it doesn't, have you blocked it in those versions?
  • Have you added type definitions?

Description

Add features

  • Add 'insert' operation to lorebook inject types in lorebook.svelte.ts
  • Implement loreinjectParser using inject-based approach in index.svelte.ts
  • Support both {{loreinject::name}} and {{lore_inject::name}} syntax
  • Update CBS documentation for loreinject function

Instructions

How to use the new loreinject functionality:

  1. Create a lorebook entry with @@inject_at decorator:
    @@inject_at myTarget This content will be injected when {{loreinject::myTarget}} is used. You can include multiple lines and complex content here.

  2. Use loreinject in your prompts:
    {{loreinject::myTarget}} or {{lore_inject::myTarget}}

  3. How it works:

  • It works almost same as {{position}}
  • The lorebook entry must start with @@inject_at <targetName>
  • The lorebook must be active (keywords matched) to be available for injection
  • Multiple lorebooks with the same target name will be combined

Example use case:

  • Create dynamic character descriptions that can be injected contextually
  • Build modular world-building content that can be referenced anywhere
  • Implement conditional lore injection based on active lorebooks

- Add 'insert' operation to lorebook inject types in lorebook.svelte.ts
- Implement loreinjectParser using inject-based approach in index.svelte.ts
- Support both {{loreinject::name}} and {{lore_inject::name}} syntax
- Update CBS documentation for loreinject function
- Replace complex content search with efficient inject.operation filtering
const chat:OpenAIChat = {
role: depthPrompt.role,
content: risuChatParser(depthPrompt.prompt, {chara: currentChar})
content: risuChatParser(loreinjectParser(depthPrompt.prompt), {chara: currentChar})
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't find what 'depthPrompt' work. AI said it is character's system prompt and need to use 'loreinjectParser', but well.. I'm not sure.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whatever depthPrompt is, there will be no errors in depthPrompt caused by 'loreinjectParser'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant