-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from Didymos-IO/release/v0.8.0
Release/v0.8.0
- Loading branch information
Showing
17 changed files
with
389 additions
and
148 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Changelog | ||
|
||
## 0.8.0 | ||
|
||
### Added | ||
|
||
- Added new "Enforcement" section to settings. The primary purpose of this is to help filter against messages where the LLM returns a response indicating it is a language model. After doing this, it often fails to remember its personality. It can also be used to filter unwanted content from message responses in general, by prompting a request for a new response. | ||
|
||
### Changed | ||
|
||
- Moved position of button bar and status text to give more room for both. | ||
|
||
### Fixed | ||
|
||
- No longer show "X more text before speaking" in status if voice transcription isn't active. | ||
- Toggling off Speech Synthesis button now prevents Sock from talking out loud when responding. | ||
- "Thinking" visual will continue while speech synthesis is running and end before playback, so | ||
so the entire "process user text -> go to LLM for response -> convert response to speech" process | ||
smoothly has one whole thinking phase instead of a visual gap between LLM response and talking. | ||
|
||
## [Example] | ||
|
||
### Added | ||
|
||
- This section is for listing new features. | ||
|
||
### Changed | ||
|
||
- This section is for listing changes to existing functionality. | ||
|
||
### Deprecated | ||
|
||
- This section is for listing features that will soon be removed in future versions. | ||
- It's quite possible this will not be used in the context of a text. | ||
|
||
### Removed | ||
|
||
- This section is for listing features that have been removed. | ||
|
||
### Fixed | ||
|
||
- This section is for listing fixes to errors, bugs in features etc. | ||
- Changed is for non-fix changes, Fixed is for correcting bugs/issues. |
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
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
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
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
99 changes: 99 additions & 0 deletions
99
src/components/settings/children/enforcementSection/enforcementSection.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,99 @@ | ||
import { ChangeEvent, useContext } from "react"; | ||
|
||
import { blankProfile, SettingsContext } from "@/state"; | ||
|
||
export const EnforcementSection = () => { | ||
const context = useContext(SettingsContext)!; | ||
const { index, settings, setField } = context; | ||
const { profiles } = settings; | ||
const enforcement = | ||
profiles[index].enforcement ?? | ||
JSON.parse(JSON.stringify(blankProfile.enforcement)); | ||
|
||
const getArrayField = (fieldName: string) => { | ||
const field = (enforcement as any)[fieldName]; | ||
return field ? field.join(",") : ""; | ||
}; | ||
|
||
const handleChangeField = ( | ||
e: ChangeEvent<HTMLInputElement | HTMLTextAreaElement> | ||
) => { | ||
setField("enforcement", e.target.name, e.target.value); | ||
}; | ||
|
||
const handleChangeFieldAsNumber = (e: ChangeEvent<HTMLInputElement>) => { | ||
setField("enforcement", e.target.name, Number(e.target.value)); | ||
}; | ||
|
||
const handleChangeArrayField = (e: ChangeEvent<HTMLInputElement>) => { | ||
const value = e.target.value.split(","); | ||
setField("enforcement", e.target.name, value); | ||
}; | ||
|
||
return ( | ||
<fieldset> | ||
<legend>Enforcement</legend> | ||
<div className="row"> | ||
<div className="col-8 mb-3"> | ||
<label className="form-label">Response Filter List</label> | ||
<p className="tip"> | ||
Comma separated list of words or phrases that, if returned from the | ||
LLM, will trigger an attempt to re-prompt the LLM for a different | ||
response. | ||
</p> | ||
<input | ||
name="responseFilterList" | ||
type="text" | ||
className="form-control" | ||
placeholder="e.g. OpenAI, LLM, language model" | ||
value={getArrayField("responseFilterList")} | ||
onChange={handleChangeArrayField} | ||
/> | ||
</div> | ||
<div className="col-4 mb-3"> | ||
<label className="form-label">Reattempts</label> | ||
<p className="tip"> | ||
Number of reattempts to get unfiltered response before giving up. | ||
</p> | ||
<input | ||
name="reattempts" | ||
type="number" | ||
className="form-control" | ||
placeholder="e.g. 1" | ||
value={enforcement.reattempts} | ||
onChange={handleChangeFieldAsNumber} | ||
/> | ||
</div> | ||
<div className="col-12 mb-3"> | ||
<label className="form-label">Corrective Message for LLM</label> | ||
<p className="tip"> | ||
An optional corrective statement to give the LLM to get it to think | ||
clearly before a reattempt | ||
</p> | ||
<input | ||
name="correctiveMessage" | ||
type="text" | ||
className="form-control" | ||
placeholder="e.g. You are not to behave like an AI model or LLM, and instead look at your system message that identifies you and behave from that." | ||
value={enforcement.correctiveMessage} | ||
onChange={handleChangeField} | ||
/> | ||
</div> | ||
<div className="col-12 mb-3"> | ||
<label className="form-label">Give-Up Default Response</label> | ||
<p className="tip"> | ||
A response to come from the puppet if the reattempts are exhausted. | ||
</p> | ||
<input | ||
name="giveupDefaultResponse" | ||
type="text" | ||
className="form-control" | ||
placeholder="e.g. Sorry, I got distracted and forgot what we were talking about. Could you rephrase that?" | ||
value={enforcement.giveupDefaultResponse} | ||
onChange={handleChangeField} | ||
/> | ||
</div> | ||
</div> | ||
</fieldset> | ||
); | ||
}; |
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 @@ | ||
export * from "./enforcementSection"; |
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
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
Oops, something went wrong.