-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add basic novel assistant * Refactor assistant * Add logic for for items, scenes, maps, objective, indicators * fix import type * Fix amount of calls and the create_start specification * improve assistant prompt * fix description prompt * add disclaimer, fix char description * fix background and song search
- Loading branch information
Showing
17 changed files
with
4,136 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
apps/novel-builder/src/components/novel-assistant/DisclaimerModal.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
@import '../../styles/variables'; | ||
|
||
.disclaimer-modal { | ||
&__content { | ||
padding: 20px; | ||
display: flex; | ||
flex-direction: column; | ||
gap: 20px; | ||
} | ||
|
||
&__section { | ||
display: flex; | ||
gap: 12px; | ||
align-items: flex-start; | ||
padding: 12px; | ||
border-radius: 8px; | ||
|
||
&--premium { | ||
background-color: rgba($color-gold, 0.1); | ||
color: $color-gold; | ||
} | ||
|
||
&--warning { | ||
background-color: rgba($color-red, 0.1); | ||
color: $text-1; | ||
} | ||
|
||
&--info { | ||
background-color: rgba($node-color, 0.1); | ||
color: $text-1; | ||
} | ||
} | ||
|
||
&__icon { | ||
font-size: 20px; | ||
margin-top: 4px; | ||
} | ||
|
||
&__text-container { | ||
flex: 1; | ||
} | ||
|
||
&__title { | ||
font-size: 1rem; | ||
font-weight: 600; | ||
margin-bottom: 4px; | ||
margin-top: 2px; | ||
} | ||
|
||
&__text { | ||
line-height: 1.5; | ||
font-size: 0.95rem; | ||
opacity: 0.9; | ||
} | ||
|
||
&__button-container { | ||
display: flex; | ||
justify-content: center; | ||
} | ||
} |
68 changes: 68 additions & 0 deletions
68
apps/novel-builder/src/components/novel-assistant/DisclaimerModal.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import { Button, Modal } from '@mikugg/ui-kit'; | ||
import { HiSparkles } from 'react-icons/hi'; | ||
import { BiSolidError } from 'react-icons/bi'; | ||
import { MdOutlineTimer, MdPhotoCamera } from 'react-icons/md'; | ||
import './DisclaimerModal.scss'; | ||
|
||
interface DisclaimerModalProps { | ||
opened: boolean; | ||
onClose: () => void; | ||
} | ||
|
||
export default function DisclaimerModal({ opened, onClose }: DisclaimerModalProps) { | ||
return ( | ||
<Modal opened={opened} title="Assistant Disclaimer" shouldCloseOnOverlayClick={false} onCloseModal={onClose}> | ||
<div className="disclaimer-modal__content"> | ||
<div className="disclaimer-modal__section disclaimer-modal__section--premium"> | ||
<HiSparkles className="disclaimer-modal__icon" /> | ||
<div className="disclaimer-modal__text-container"> | ||
<h3 className="disclaimer-modal__title">Premium Feature</h3> | ||
<p className="disclaimer-modal__text"> | ||
This feature is exclusively available for premium members at the moment. Please keep in mind that the | ||
assistant might NOT be available even for premium members in the future due to high costs. | ||
</p> | ||
</div> | ||
</div> | ||
|
||
<div className="disclaimer-modal__section disclaimer-modal__section--warning"> | ||
<BiSolidError className="disclaimer-modal__icon" /> | ||
<div className="disclaimer-modal__text-container"> | ||
<h3 className="disclaimer-modal__title">Experimental Feature - Save Your Work</h3> | ||
<p className="disclaimer-modal__text"> | ||
The assistant is highly experimental and may produce unexpected results. Always save your work before | ||
using it, as it might occasionally misunderstand context or provide suboptimal suggestions. While we | ||
strive for reliability, it's important to backup your content to prevent any potential data loss. | ||
</p> | ||
</div> | ||
</div> | ||
|
||
<div className="disclaimer-modal__section disclaimer-modal__section--info"> | ||
<MdOutlineTimer className="disclaimer-modal__icon" /> | ||
<div className="disclaimer-modal__text-container"> | ||
<h3 className="disclaimer-modal__title">Usage Limits</h3> | ||
<p className="disclaimer-modal__text"> | ||
Due to the significant computational costs involved, there are usage limits in place. Please use the | ||
assistant thoughtfully and efficiently. | ||
</p> | ||
</div> | ||
</div> | ||
|
||
<div className="disclaimer-modal__section disclaimer-modal__section--info"> | ||
<MdPhotoCamera className="disclaimer-modal__icon" /> | ||
<div className="disclaimer-modal__text-container"> | ||
<h3 className="disclaimer-modal__title">Text Only</h3> | ||
<p className="disclaimer-modal__text"> | ||
The assistant can help with text content only. It cannot generate, modify, or manipulate images. | ||
</p> | ||
</div> | ||
</div> | ||
|
||
<div className="disclaimer-modal__button-container"> | ||
<Button onClick={onClose} theme="primary"> | ||
I understand | ||
</Button> | ||
</div> | ||
</div> | ||
</Modal> | ||
); | ||
} |
32 changes: 32 additions & 0 deletions
32
apps/novel-builder/src/components/novel-assistant/NovelAssistant.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
@import '../../styles/variables'; | ||
|
||
.AssistantActivityLog { | ||
font-style: italic; | ||
padding: 0.4rem 1rem; | ||
font-size: 0.8rem; | ||
background-color: rgba($background-1, 1); | ||
width: 100%; | ||
animation: fadeIn 0.5s ease-in-out; | ||
|
||
&:first-child { | ||
border-top-left-radius: 0.5rem; | ||
border-top-right-radius: 0.5rem; | ||
} | ||
|
||
&__verb { | ||
color: $secondary-color; | ||
} | ||
|
||
&__button { | ||
color: $text-1; | ||
} | ||
} | ||
|
||
@keyframes fadeIn { | ||
from { | ||
opacity: 0; | ||
} | ||
to { | ||
opacity: 1; | ||
} | ||
} |
Oops, something went wrong.