mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-24 09:16:09 +01:00
🎨 AI supports configuration randomness and context number https://github.com/siyuan-note/siyuan/issues/10660
This commit is contained in:
parent
97e3ff656d
commit
a7e1e3abac
12 changed files with 66 additions and 16 deletions
|
|
@ -29,6 +29,12 @@ export const ai = {
|
|||
<input class="b3-text-field fn__flex-center fn__block" type="number" step="1" min="0" id="apiMaxTokens" value="${window.siyuan.config.ai.openAI.apiMaxTokens}"/>
|
||||
<div class="b3-label__text">${window.siyuan.languages.apiMaxTokensTip}</div>
|
||||
</div>
|
||||
<div class="b3-label">
|
||||
${window.siyuan.languages.apiTemperature}
|
||||
<div class="fn__hr"></div>
|
||||
<input class="b3-text-field fn__flex-center fn__block" type="number" step="0.1" min="0" max="2" id="apiTemperature" value="${window.siyuan.config.ai.openAI.apiTemperature}"/>
|
||||
<div class="b3-label__text">${window.siyuan.languages.apiTemperatureTip}</div>
|
||||
</div>
|
||||
<div class="b3-label">
|
||||
${window.siyuan.languages.apiModel}
|
||||
<div class="fn__hr"></div>
|
||||
|
|
@ -96,6 +102,14 @@ export const ai = {
|
|||
<span class="fn__space"></span>
|
||||
<input class="b3-text-field fn__flex-center fn__size200" type="number" step="1" min="0" id="apiMaxTokens" value="${window.siyuan.config.ai.openAI.apiMaxTokens}"/>
|
||||
</div>
|
||||
<div class="fn__flex b3-label">
|
||||
<div class="fn__flex-1">
|
||||
${window.siyuan.languages.apiTemperature}
|
||||
<div class="b3-label__text">${window.siyuan.languages.apiTemperatureTip}</div>
|
||||
</div>
|
||||
<span class="fn__space"></span>
|
||||
<input class="b3-text-field fn__flex-center fn__size200" type="number" step="0.1" min="0" max="2" id="apiTemperature" value="${window.siyuan.config.ai.openAI.apiTemperature}"/>
|
||||
</div>
|
||||
<div class="fn__flex b3-label">
|
||||
<div class="fn__block">
|
||||
${window.siyuan.languages.apiModel}
|
||||
|
|
@ -176,6 +190,7 @@ export const ai = {
|
|||
apiKey: (ai.element.querySelector("#apiKey") as HTMLInputElement).value,
|
||||
apiModel: (ai.element.querySelector("#apiModel") as HTMLSelectElement).value,
|
||||
apiMaxTokens: parseInt((ai.element.querySelector("#apiMaxTokens") as HTMLInputElement).value),
|
||||
apiTemperature: parseInt((ai.element.querySelector("#apiTemperature") as HTMLInputElement).value),
|
||||
apiProxy: (ai.element.querySelector("#apiProxy") as HTMLInputElement).value,
|
||||
apiTimeout: parseInt((ai.element.querySelector("#apiTimeout") as HTMLInputElement).value),
|
||||
apiProvider: (ai.element.querySelector("#apiProvider") as HTMLSelectElement).value,
|
||||
|
|
|
|||
1
app/src/types/index.d.ts
vendored
1
app/src/types/index.d.ts
vendored
|
|
@ -738,6 +738,7 @@ interface IConfig {
|
|||
apiKey: string
|
||||
apiModel: string
|
||||
apiMaxTokens: number
|
||||
apiTemperature: number
|
||||
apiProxy: string
|
||||
apiTimeout: number
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue