support whisper stt

This commit is contained in:
2023-08-25 18:19:10 +08:00
parent 687ebf790c
commit cdb0c9a1b5
3 changed files with 115 additions and 3 deletions

View File

@@ -69,7 +69,7 @@ const LongInput = (props: {
const Input = (props: {
chatStore: ChatStore;
setChatStore: (cs: ChatStore) => void;
field: "apiKey" | "apiEndpoint";
field: "apiKey" | "apiEndpoint" | "whisper_api" | "whisper_key";
help: string;
}) => {
const [hideInput, setHideInput] = useState(true);
@@ -315,6 +315,16 @@ export default (props: {
readOnly={false}
{...props}
/>
<Input
field="whisper_api"
help="Whisper 语言转文字服务填入此api才会开启默认为 https://api.openai.com/v1/audio/transcptions"
{...props}
/>
<Input
field="whisper_key"
help="用于 Whisper 服务的 key默认为 上方使用的OPENAI key可在此单独配置专用key"
{...props}
/>
<div className="flex justify-between">
<p className="m-2 p-2">
Accumulated cost in all sessions ${totalCost.toFixed(4)}