-
-
Notifications
You must be signed in to change notification settings - Fork 1
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 #70 from solaoi/main
update to v0.9.1
- Loading branch information
Showing
11 changed files
with
315 additions
and
25 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import { ChangeEvent } from "react"; | ||
import { useRecoilState } from 'recoil'; | ||
import { settingKeyState } from "../../store/atoms/settingKeyState"; | ||
|
||
const SettingAILanguage = (): JSX.Element => { | ||
const settingAILanguages = ["None", "Kyoko", "Samantha", "Tingting", "Yuna", "Thomas", "Anna", "Milena", "Mónica", "Luciana", "Yelda", "Linh", "Alice", "Xander", "Montse", "Lesya", "Alva", "Lekha", "Zuzana", "Zosia"] | ||
const [settingKey, setSettingKey] = useRecoilState(settingKeyState("settingAILanguage")) | ||
|
||
const change = (e: ChangeEvent<HTMLSelectElement>) => { | ||
const settingKey = e.target.value | ||
setSettingKey(settingKey) | ||
} | ||
|
||
const mapper = (aiLanguage: string) => { | ||
switch (aiLanguage) { | ||
case "None": | ||
return "しない"; | ||
case "Kyoko": | ||
return "日本語"; | ||
case "Samantha": | ||
return "英語"; | ||
case "Tingting": | ||
return "中国語"; | ||
case "Yuna": | ||
return "韓国語"; | ||
case "Thomas": | ||
return "フランス語"; | ||
case "Anna": | ||
return "ドイツ語"; | ||
case "Milena": | ||
return "ロシア語"; | ||
case "Mónica": | ||
return "スペイン語"; | ||
case "Luciana": | ||
return "ポルトガル語"; | ||
case "Yelda": | ||
return "トルコ語"; | ||
case "Linh": | ||
return "ベトナム語"; | ||
case "Alice": | ||
return "イタリア語"; | ||
case "Xander": | ||
return "オランダ語"; | ||
case "Montse": | ||
return "カタルーニャ語"; | ||
case "Lesya": | ||
return "ウクライナ語"; | ||
case "Alva": | ||
return "スウェーデン語"; | ||
case "Lekha": | ||
return "ヒンディー語"; | ||
case "Zuzana": | ||
return "チェコ語"; | ||
case "Zosia": | ||
return "ポーランド語"; | ||
default: | ||
throw new Error("unknown languageType"); | ||
} | ||
} | ||
|
||
return ( | ||
<div className="flex items-center mb-2"> | ||
<p className="w-[8rem]">発話</p> | ||
<select className="select select-bordered focus:outline-none text-xs" name="setting-aiLanguage" onChange={change} > | ||
{settingAILanguages?.map((aiLanguage, i) => ( | ||
<option key={"setting-aiLanguage" + i} value={aiLanguage} selected={aiLanguage === settingKey}>{mapper(aiLanguage)}</option> | ||
))} | ||
</select> | ||
</div> | ||
) | ||
} | ||
|
||
export { SettingAILanguage } |
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,25 @@ | ||
import { ChangeEvent } from "react"; | ||
import { useRecoilState } from 'recoil'; | ||
import { settingKeyState } from "../../store/atoms/settingKeyState"; | ||
|
||
type SettingHookProps = { | ||
hookName: string; | ||
} | ||
|
||
const SettingHook = (props: SettingHookProps): JSX.Element => { | ||
const { hookName } = props; | ||
const [settingKey, setSettingKey] = useRecoilState(settingKeyState(hookName)) | ||
const change = (e: ChangeEvent<HTMLTextAreaElement>) => { | ||
const settingKey = e.target.value | ||
setSettingKey(settingKey) | ||
} | ||
|
||
return ( | ||
<div className="flex items-center"> | ||
<p className="w-[8rem]">CLI Hook</p> | ||
<textarea rows={3} placeholder='echo "{{question}} > {{answer}}" > ~/Desktop/sample.txt' className="p-2.5 h-full rounded-2xl input input-bordered focus:outline-none flex-1" value={settingKey} onChange={change} onKeyDown={e => { if (e.key === 'Enter') { e.preventDefault(); } }} /> | ||
</div> | ||
) | ||
} | ||
|
||
export { SettingHook } |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { ChangeEvent } from "react"; | ||
import { useRecoilState } from 'recoil'; | ||
import { settingKeyState } from "../../store/atoms/settingKeyState"; | ||
|
||
const SettingModel = (): JSX.Element => { | ||
const settingModels = ["gpt-3.5-turbo", "gpt-4"] | ||
const [settingKey, setSettingKey] = useRecoilState(settingKeyState("settingModel")) | ||
|
||
const change = (e: ChangeEvent<HTMLSelectElement>) => { | ||
const settingKey = e.target.value | ||
setSettingKey(settingKey) | ||
} | ||
|
||
return ( | ||
<div className="flex items-center mb-2"> | ||
<p className="w-[8rem]">利用モデル</p> | ||
<select className="select select-bordered focus:outline-none text-xs" name="setting-model" onChange={change} > | ||
{settingModels?.map((model, i) => ( | ||
<option key={"setting-model" + i} value={model} selected={model === settingKey}>{model}</option> | ||
))} | ||
</select> | ||
</div> | ||
) | ||
} | ||
|
||
export { SettingModel } |
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,25 @@ | ||
import { ChangeEvent } from "react"; | ||
import { useRecoilState } from 'recoil'; | ||
import { settingKeyState } from "../../store/atoms/settingKeyState"; | ||
|
||
type SettingResourceProps = { | ||
resourceName: string; | ||
} | ||
|
||
const SettingResource = (props: SettingResourceProps): JSX.Element => { | ||
const { resourceName } = props; | ||
const [settingKey, setSettingKey] = useRecoilState(settingKeyState(resourceName)) | ||
const change = (e: ChangeEvent<HTMLTextAreaElement>) => { | ||
const settingKey = e.target.value | ||
setSettingKey(settingKey) | ||
} | ||
|
||
return ( | ||
<div className="flex items-center mb-2"> | ||
<p className="w-[8rem]">CLI Resource</p> | ||
<textarea rows={3} placeholder='curl -s "https://example.com/latest?query={{question}}"' className="p-2.5 h-full rounded-2xl input input-bordered focus:outline-none flex-1" value={settingKey} onChange={change} onKeyDown={e => { if (e.key === 'Enter') { e.preventDefault(); } }} /> | ||
</div> | ||
) | ||
} | ||
|
||
export { SettingResource } |
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.