-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Settings and Update system Prompt option (#746)
* Added settings and system prompt option Signed-off-by: jaswanth8888 <[email protected]>
- Loading branch information
1 parent
67394b8
commit 1d1e1f9
Showing
7 changed files
with
190 additions
and
49 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
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
48 changes: 48 additions & 0 deletions
48
ProductivitySuite/docker/ui/react/src/components/Conversation/settings.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,48 @@ | ||
import { NumberInput, Slider, Text, Title } from "@mantine/core" | ||
import { useAppDispatch, useAppSelector } from "../../redux/store" | ||
import { conversationSelector, setTemperature, setToken } from "../../redux/Conversation/ConversationSlice" | ||
|
||
|
||
|
||
function Settings() { | ||
const { token,maxTemperature, minTemperature, maxToken, minToken, temperature} = useAppSelector(conversationSelector) | ||
const dispatch = useAppDispatch(); | ||
|
||
const onTemperatureChange = (value: number) => { | ||
dispatch(setTemperature(value)) | ||
} | ||
const onTokenChange = (value: number | string) => { | ||
dispatch(setToken(Number(value))) | ||
} | ||
|
||
return ( | ||
<> | ||
<div> | ||
<Title order={4}>Settings</Title> | ||
</div> | ||
<div> | ||
<Text>Temperature</Text> | ||
<Slider | ||
value={temperature} | ||
min={minTemperature} | ||
max={maxTemperature} | ||
step={0.1} | ||
onChange={onTemperatureChange} | ||
/> | ||
</div> | ||
<div> | ||
<Text>Token ({`${minToken} - ${maxToken}`})</Text> | ||
<NumberInput | ||
value={token} | ||
min={minToken} | ||
max={maxToken} | ||
step={100} | ||
onChange={onTokenChange} | ||
/> | ||
</div> | ||
</> | ||
|
||
) | ||
} | ||
|
||
export default Settings |
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.