settings: move save chat api button
This commit is contained in:
@@ -17,7 +17,7 @@ export function SetAPIsTemplate({
|
|||||||
}: Props) {
|
}: Props) {
|
||||||
return (
|
return (
|
||||||
<button
|
<button
|
||||||
className="p-2 m-2 rounded bg-blue-300"
|
className="p-1 m-1 rounded bg-blue-300"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
const name = prompt(`Give this **${label}** template a name:`);
|
const name = prompt(`Give this **${label}** template a name:`);
|
||||||
if (!name) {
|
if (!name) {
|
||||||
|
|||||||
@@ -401,6 +401,18 @@ export default (props: {
|
|||||||
help="function call tools, should be valied json format in list"
|
help="function call tools, should be valied json format in list"
|
||||||
{...props}
|
{...props}
|
||||||
/>
|
/>
|
||||||
|
<div className="relative border-slate-300 border rounded">
|
||||||
|
<div className="flex justify-between">
|
||||||
|
<strong className="p-1 m-1">Chat API</strong>
|
||||||
|
<SetAPIsTemplate
|
||||||
|
label="Chat API"
|
||||||
|
endpoint={props.chatStore.apiEndpoint}
|
||||||
|
APIkey={props.chatStore.apiKey}
|
||||||
|
tmps={props.templateAPIs}
|
||||||
|
setTmps={props.setTemplateAPIs}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<hr />
|
||||||
<Input
|
<Input
|
||||||
field="apiKey"
|
field="apiKey"
|
||||||
help="OPEN AI API 密钥,请勿泄漏此密钥"
|
help="OPEN AI API 密钥,请勿泄漏此密钥"
|
||||||
@@ -411,6 +423,7 @@ export default (props: {
|
|||||||
help="API 端点,方便在不支持的地区使用反向代理服务,默认为 https://api.openai.com/v1/chat/completions"
|
help="API 端点,方便在不支持的地区使用反向代理服务,默认为 https://api.openai.com/v1/chat/completions"
|
||||||
{...props}
|
{...props}
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
<Choice
|
<Choice
|
||||||
field="streamMode"
|
field="streamMode"
|
||||||
help="流模式,使用 stream mode 将可以动态看到生成内容,但无法准确计算 token 数量,在 token 数量过多时可能会裁切过多或过少历史消息"
|
help="流模式,使用 stream mode 将可以动态看到生成内容,但无法准确计算 token 数量,在 token 数量过多时可能会裁切过多或过少历史消息"
|
||||||
@@ -565,16 +578,6 @@ export default (props: {
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex justify-evenly flex-wrap">
|
<div className="flex justify-evenly flex-wrap">
|
||||||
{props.chatStore.apiEndpoint && (
|
|
||||||
<SetAPIsTemplate
|
|
||||||
label="Chat API"
|
|
||||||
endpoint={props.chatStore.apiEndpoint}
|
|
||||||
APIkey={props.chatStore.apiKey}
|
|
||||||
tmps={props.templateAPIs}
|
|
||||||
setTmps={props.setTemplateAPIs}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{props.chatStore.whisper_api && props.chatStore.whisper_key && (
|
{props.chatStore.whisper_api && props.chatStore.whisper_key && (
|
||||||
<SetAPIsTemplate
|
<SetAPIsTemplate
|
||||||
label="Whisper API"
|
label="Whisper API"
|
||||||
|
|||||||
Reference in New Issue
Block a user