add options to enable/disable presence/frequency penalty

This commit is contained in:
2025-01-21 05:31:37 +08:00
parent 1146d514d3
commit 3151fb8477
4 changed files with 39 additions and 4 deletions

View File

@@ -406,6 +406,30 @@ const Number = (props: {
}}
/>
)}
{props.field === "presence_penalty" && (
<Checkbox
checked={chatStore.presence_penalty_enabled}
onCheckedChange={() => {
const newChatStore = { ...chatStore };
newChatStore.presence_penalty_enabled =
!newChatStore.presence_penalty_enabled;
setChatStore({ ...newChatStore });
}}
/>
)}
{props.field === "frequency_penalty" && (
<Checkbox
checked={chatStore.frequency_penalty_enabled}
onCheckedChange={() => {
const newChatStore = { ...chatStore };
newChatStore.frequency_penalty_enabled =
!newChatStore.frequency_penalty_enabled;
setChatStore({ ...newChatStore });
}}
/>
)}
</Label>
<Input

View File

@@ -87,12 +87,15 @@ const Navbar: React.FC = () => {
<MenubarItem>
<ReceiptIcon className="w-4 h-4 mr-2" />
Price:{" "}
{models[chatStore.model]?.price?.prompt * 1000 * 1000}$
/ 1M input tokens
{models[chatStore.model]?.price?.prompt *
1000 *
1000}$ / 1M input tokens
</MenubarItem>
<MenubarItem>
<WalletIcon className="w-4 h-4 mr-2" />
Total: {getTotalCost().toFixed(2)}$
Total: {getTotalCost().toFixed(
2
)}$
</MenubarItem>
<MenubarItem>
<ArrowUpDownIcon className="w-4 h-4 mr-2" />
@@ -112,7 +115,9 @@ const Navbar: React.FC = () => {
</MenubarItem>
<MenubarItem>
<ScissorsIcon className="w-4 h-4 mr-2" />
{chatStore.postBeginIndex} / {chatStore.history.length}
{
chatStore.postBeginIndex
} / {chatStore.history.length}
</MenubarItem>
<MenubarSeparator />
<MenubarItem disabled>