Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rebase from origin #344

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/lib/Chat.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
faPaperPlane,
faGear,
faPenToSquare,
faMicrophone,

Check failure on line 30 in src/lib/Chat.svelte

View workflow job for this annotation

GitHub Actions / lint

'faMicrophone' is defined but never used
faLightbulb,
faCommentSlash,
faCircleCheck
Expand Down Expand Up @@ -344,7 +344,7 @@
})
}

const recordToggle = () => {

Check failure on line 347 in src/lib/Chat.svelte

View workflow job for this annotation

GitHub Actions / lint

'recordToggle' is assigned a value but never used
ttsStop()
if (chatRequest.updating) return
// Check if already recording - if so, stop - else start
Expand Down Expand Up @@ -395,6 +395,7 @@
{#if $currentChatId !== 0 && ($currentChatMessages.length === 0 || ($currentChatMessages.length === 1 && $currentChatMessages[0].role === 'system'))}
<Prompts bind:input />
{/if}

</div>
<Footer class="prompt-input-container" strongMask={true}>
<form class="field has-addons has-addons-right is-align-items-flex-end" on:submit|preventDefault={() => submitForm()}>
Expand All @@ -412,14 +413,13 @@
}
}}
on:input={e => autoGrowInputOnEvent(e)}
bind:this={input}
/>
bind:this={input}></textarea>
</p>
<p class="control mic" class:is-hidden={!recognition}>
<!-- <p class="control mic" class:is-hidden={!recognition}>
<button class="button" class:is-disabled={chatRequest.updating} class:is-pulse={recording} on:click|preventDefault={recordToggle}
><span class="icon"><Fa icon={faMicrophone} /></span></button
>
</p>
</p> -->
<p class="control settings">
<button title="Chat/Profile Settings" class="button" on:click|preventDefault={showSettingsModal}><span class="icon"><Fa icon={faGear} /></span></button>
</p>
Expand Down
22 changes: 11 additions & 11 deletions src/lib/Footer.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import Fa from 'svelte-fa/src/fa.svelte'

Check failure on line 2 in src/lib/Footer.svelte

View workflow job for this annotation

GitHub Actions / lint

'Fa' is defined but never used
import {
faGithub

Check failure on line 4 in src/lib/Footer.svelte

View workflow job for this annotation

GitHub Actions / lint

'faGithub' is defined but never used
} from '@fortawesome/free-brands-svg-icons/index'

let classes = ''
Expand All @@ -13,15 +13,15 @@
<div class="lower-mask section-footer-mask" class:pin-footer={pin}/>
<div class="lower-mask2" class:strong-mask={strongMask} />
<div class="section-footer {classes}" class:pin-footer={pin}>
<slot />
<div class="content has-text-centered credit-footer">
<p>
<strong>ChatGPT-web</strong>
<span class="author">by
<a target="_blank" href="https://niekvandermaas.nl/">Niek van der Maas</a>
</span>
<a target="_blank" class="ml-4" href="https://github.com/Niek/chatgpt-web"><span style="position:absolute" class="icon default-text"><Fa size="2x" icon="{faGithub}"/></span></a>
<span style="display:inline-block;width:30px;height:20px;"></span>
</p>
</div>
<!--<slot />
<div class="content has-text-centered credit-footer">
<p>
<strong>ChatGPT-web</strong>
<span class="author">by
<a target="_blank" href="https://niekvandermaas.nl/">Niek van der Maas</a>
</span>
<a target="_blank" class="ml-4" href="https://github.com/Niek/chatgpt-web"><span style="position:absolute" class="icon default-text"><Fa size="2x" icon="{faGithub}"/></span></a>
<span style="display:inline-block;width:30px;height:20px;"></span>
</p>
</div> -->
</div>
4 changes: 2 additions & 2 deletions src/lib/Home.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import Footer from './Footer.svelte'
import { replace } from 'svelte-spa-router'
import { afterUpdate, onMount } from 'svelte'
import { getPetalsBase, getPetalsWebsocket } from './ApiUtil.svelte'

Check failure on line 6 in src/lib/Home.svelte

View workflow job for this annotation

GitHub Actions / lint

'getPetalsBase' is defined but never used

Check failure on line 6 in src/lib/Home.svelte

View workflow job for this annotation

GitHub Actions / lint

'getPetalsWebsocket' is defined but never used
import { set as setOpenAI } from './providers/openai/util.svelte'

Check failure on line 7 in src/lib/Home.svelte

View workflow job for this annotation

GitHub Actions / lint

'setOpenAI' is defined but never used
import { hasActiveModels } from './Models.svelte'

$: apiKey = $apiKeyStorage
Expand Down Expand Up @@ -32,7 +32,7 @@
$checkStateChange++
})

const setPetalsEnabled = (event: Event) => {

Check failure on line 35 in src/lib/Home.svelte

View workflow job for this annotation

GitHub Actions / lint

'setPetalsEnabled' is assigned a value but never used
const el = (event.target as HTMLInputElement)
setGlobalSettingValueByKey('enablePetals', !!el.checked)
showPetalsSettings = $globalStorage.enablePetals
Expand All @@ -42,7 +42,7 @@
</script>

<section class="section">
<article class="message">
<!--<article class="message">
<div class="message-body">
<p class="mb-4">
<strong><a href="https://github.com/Niek/chatgpt-web" target="_blank">ChatGPT-web</a></strong>
Expand Down Expand Up @@ -163,7 +163,7 @@
</p>
{/if}
</div>
</article>
</article> -->
{#if apiKey}
<article class="message is-info">
<div class="message-body">
Expand Down
12 changes: 1 addition & 11 deletions src/lib/providers/openai/models.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
} as ModelDetail

// Reference: https://openai.com/pricing#language-models
const gpt35 = {

Check failure on line 60 in src/lib/providers/openai/models.svelte

View workflow job for this annotation

GitHub Actions / lint

'gpt35' is assigned a value but never used
...chatModelBase,
prompt: 0.0000015, // $0.0015 per 1000 tokens prompt
completion: 0.000002, // $0.002 per 1000 tokens completion
Expand All @@ -75,7 +75,7 @@
completion: 0.00006, // $0.06 per 1000 tokens completion
max: 8192 // 8k max token buffer
}
const gpt432k = {

Check failure on line 78 in src/lib/providers/openai/models.svelte

View workflow job for this annotation

GitHub Actions / lint

'gpt432k' is assigned a value but never used
...chatModelBase,
prompt: 0.00006, // $0.06 per 1000 tokens prompt
completion: 0.00012, // $0.12 per 1000 tokens completion
Expand All @@ -90,18 +90,8 @@

export const chatModels : Record<string, ModelDetail> = {
'gpt-3.5-turbo': { ...gpt3516k },
'gpt-3.5-turbo-0301': { ...gpt35 },
'gpt-3.5-turbo-0613': { ...gpt35 },
'gpt-3.5-turbo-1106': { ...gpt3516k },
'gpt-3.5-turbo-16k': { ...gpt3516k },
'gpt-3.5-turbo-16k-0613': { ...gpt3516k },
'gpt-4': { ...gpt4 },
'gpt-4-0314': { ...gpt4 },
'gpt-4-0613': { ...gpt4 },
'gpt-4-1106-preview': { ...gpt4128kpreview },
'gpt-4-32k': { ...gpt432k },
'gpt-4-32k-0314': { ...gpt432k },
'gpt-4-32k-0613': { ...gpt432k }
'gpt-4-1106-preview': { ...gpt4128kpreview }
}

const imageModelBase = {
Expand Down