v1.1.9: 高级模型参数(temperature/topP/maxTokens)、火山引擎接口、Claude默认maxTokens提升
This commit is contained in:
1 parent
49fadde800
commit
d8e50cd387
15 files changed
+186
-20
No files matched your search
@@ -5,7 +5,7 @@ export const runtime = 'edge';
|
||||
|
||||
export async function POST(request) {
|
||||
try {
|
||||
const { systemPrompt, userPrompt, apiConfig, maxTokens } = await request.json();
|
||||
const { systemPrompt, userPrompt, apiConfig, maxTokens, temperature, topP } = await request.json();
|
||||
|
||||
const apiKey = apiConfig?.apiKey;
|
||||
const baseUrl = (apiConfig?.baseUrl || 'https://api.anthropic.com').replace(/\/$/, '');
|
||||
@@ -23,12 +23,14 @@ export async function POST(request) {
|
||||
// 构造 Messages API 请求体
|
||||
const requestBody = {
|
||||
model,
|
||||
max_tokens: maxTokens || 2000,
|
||||
max_tokens: maxTokens || 4096,
|
||||
system: systemPrompt,
|
||||
messages: [
|
||||
{ role: 'user', content: userPrompt }
|
||||
],
|
||||
stream: true,
|
||||
...(temperature != null ? { temperature } : {}),
|
||||
...(topP != null ? { top_p: topP } : {}),
|
||||
};
|
||||
|
||||
// 如果模型支持 extended thinking (claude-3-7-sonnet),可以启用
|
||||
|
||||
@@ -5,7 +5,7 @@ export const runtime = 'edge';
|
||||
|
||||
export async function POST(request) {
|
||||
try {
|
||||
const { systemPrompt, userPrompt, apiConfig, maxTokens } = await request.json();
|
||||
const { systemPrompt, userPrompt, apiConfig, maxTokens, temperature, topP } = await request.json();
|
||||
|
||||
const apiKey = apiConfig?.apiKey || process.env.GEMINI_API_KEY;
|
||||
let rawBaseUrl = apiConfig?.baseUrl;
|
||||
@@ -36,8 +36,8 @@ export async function POST(request) {
|
||||
}
|
||||
],
|
||||
generationConfig: {
|
||||
temperature: 0.8,
|
||||
topP: 0.9,
|
||||
temperature: temperature ?? 0.8,
|
||||
topP: topP ?? 0.9,
|
||||
...(maxTokens ? { maxOutputTokens: maxTokens } : {}),
|
||||
},
|
||||
};
|
||||
|
||||
@@ -5,7 +5,7 @@ export const runtime = 'edge';
|
||||
|
||||
export async function POST(request) {
|
||||
try {
|
||||
const { systemPrompt, userPrompt, apiConfig, maxTokens } = await request.json();
|
||||
const { systemPrompt, userPrompt, apiConfig, maxTokens, temperature, topP } = await request.json();
|
||||
|
||||
const apiKey = apiConfig?.apiKey;
|
||||
const baseUrl = (apiConfig?.baseUrl || 'https://api.openai.com/v1').replace(/\/$/, '');
|
||||
@@ -28,6 +28,8 @@ export async function POST(request) {
|
||||
{ role: 'user', content: userPrompt },
|
||||
],
|
||||
stream: true,
|
||||
...(temperature != null ? { temperature } : {}),
|
||||
...(topP != null ? { top_p: topP } : {}),
|
||||
};
|
||||
|
||||
// 添加思考等级(默认 medium)
|
||||
|
||||
+3
-2
@@ -5,7 +5,7 @@ export const runtime = 'edge';
|
||||
|
||||
export async function POST(request) {
|
||||
try {
|
||||
const { systemPrompt, userPrompt, apiConfig, maxTokens } = await request.json();
|
||||
const { systemPrompt, userPrompt, apiConfig, maxTokens, temperature, topP } = await request.json();
|
||||
|
||||
const apiKey = apiConfig?.apiKey || process.env.ZHIPU_API_KEY;
|
||||
const baseUrl = apiConfig?.baseUrl || 'https://open.bigmodel.cn/api/paas/v4';
|
||||
@@ -33,7 +33,8 @@ export async function POST(request) {
|
||||
{ role: 'system', content: systemPrompt },
|
||||
{ role: 'user', content: userPrompt }
|
||||
],
|
||||
temperature: 0.8,
|
||||
temperature: temperature ?? 0.8,
|
||||
...(topP != null ? { top_p: topP } : {}),
|
||||
...(maxTokens ? { max_tokens: maxTokens } : {}),
|
||||
stream: true,
|
||||
}),
|
||||
|
||||
@@ -208,7 +208,14 @@ export default function AiSidebar({ onInsertText }) {
|
||||
const res = await fetch(apiEndpoint, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ systemPrompt, userPrompt, apiConfig, maxTokens: 2000 }),
|
||||
body: JSON.stringify({
|
||||
systemPrompt, userPrompt, apiConfig,
|
||||
...(apiConfig?.useAdvancedParams ? {
|
||||
maxTokens: apiConfig.maxOutputTokens || 65536,
|
||||
temperature: apiConfig.temperature ?? 1,
|
||||
topP: apiConfig.topP ?? 0.95,
|
||||
} : { maxTokens: 4096 }),
|
||||
}),
|
||||
});
|
||||
|
||||
const contentType = res.headers.get('content-type') || '';
|
||||
|
||||
@@ -133,7 +133,14 @@ ${importedFields}
|
||||
const res = await fetch(apiEndpoint, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ systemPrompt, userPrompt, apiConfig, maxTokens: 2000 }),
|
||||
body: JSON.stringify({
|
||||
systemPrompt, userPrompt, apiConfig,
|
||||
...(apiConfig?.useAdvancedParams ? {
|
||||
maxTokens: apiConfig.maxOutputTokens || 65536,
|
||||
temperature: apiConfig.temperature ?? 1,
|
||||
topP: apiConfig.topP ?? 0.95,
|
||||
} : { maxTokens: 4096 }),
|
||||
}),
|
||||
});
|
||||
|
||||
if (!res.ok) {
|
||||
|
||||
@@ -799,6 +799,7 @@ const PROVIDERS = [
|
||||
{ key: 'gemini-native', label: 'Gemini(原生格式)', baseUrl: 'https://generativelanguage.googleapis.com/v1beta', models: ['gemini-2.0-flash', 'gemini-2.0-flash-lite', 'gemini-1.5-flash', 'gemini-1.5-pro'] },
|
||||
{ key: 'openai-responses', label: 'OpenAI Responses', baseUrl: 'https://api.openai.com/v1', models: [] },
|
||||
{ key: 'siliconflow', label: 'SiliconFlow (硅基流动)', baseUrl: 'https://api.siliconflow.cn/v1', models: ['deepseek-ai/DeepSeek-V3', 'Qwen/Qwen2.5-72B-Instruct', 'THUDM/glm-4-9b-chat'] },
|
||||
{ key: 'volcengine', label: '火山引擎 (豆包)', baseUrl: 'https://ark.cn-beijing.volces.com/api/v3', models: [] },
|
||||
{ key: 'moonshot', label: 'Moonshot (Kimi)', baseUrl: 'https://api.moonshot.cn/v1', models: ['moonshot-v1-8k', 'moonshot-v1-32k', 'moonshot-v1-128k'] },
|
||||
{ key: 'custom', label: '自定义 (OpenAI兼容)', baseUrl: '', models: [] },
|
||||
];
|
||||
@@ -1055,6 +1056,102 @@ function ApiConfigForm({ data, onChange }) {
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* 高级模型参数 */}
|
||||
<div style={{ marginTop: 24, marginBottom: 14, paddingTop: 16, borderTop: '1px solid var(--border-light)' }}>
|
||||
<label style={{ display: 'flex', alignItems: 'center', gap: 8, cursor: 'pointer', fontSize: 13, fontWeight: 500, color: 'var(--text-primary)' }}>
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={data.useAdvancedParams || false}
|
||||
onChange={e => update('useAdvancedParams', e.target.checked)}
|
||||
style={{ margin: 0 }}
|
||||
/>
|
||||
{t('apiConfig.advancedParamsTitle')}
|
||||
</label>
|
||||
<div style={{ fontSize: 11, color: 'var(--text-muted)', marginTop: 4, paddingLeft: 22 }}>
|
||||
{t('apiConfig.advancedParamsDesc')}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{data.useAdvancedParams && (
|
||||
<div style={{ padding: '16px', background: 'var(--bg-secondary)', borderRadius: 'var(--radius-md)', marginBottom: 20 }}>
|
||||
{/* Temperature */}
|
||||
<div style={{ marginBottom: 14 }}>
|
||||
<label style={{ display: 'block', fontSize: 13, fontWeight: 500, color: 'var(--text-secondary)', marginBottom: 5 }}>
|
||||
{t('apiConfig.temperature')}
|
||||
</label>
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: 10 }}>
|
||||
<input
|
||||
type="range" min="0" max="2" step="0.05"
|
||||
value={data.temperature ?? 1}
|
||||
onChange={e => update('temperature', parseFloat(e.target.value))}
|
||||
style={{ flex: 1, accentColor: 'var(--accent)' }}
|
||||
/>
|
||||
<input
|
||||
type="number" min="0" max="2" step="0.05"
|
||||
className="modal-input"
|
||||
style={{ width: 72, margin: 0, padding: '5px 8px', fontSize: 13, textAlign: 'center' }}
|
||||
value={data.temperature ?? 1}
|
||||
onChange={e => update('temperature', parseFloat(e.target.value) || 0)}
|
||||
/>
|
||||
</div>
|
||||
<div style={{ fontSize: 11, color: 'var(--text-muted)', marginTop: 2 }}>{t('apiConfig.temperatureDesc')}</div>
|
||||
</div>
|
||||
|
||||
{/* Top P */}
|
||||
<div style={{ marginBottom: 14 }}>
|
||||
<label style={{ display: 'block', fontSize: 13, fontWeight: 500, color: 'var(--text-secondary)', marginBottom: 5 }}>
|
||||
{t('apiConfig.topP')}
|
||||
</label>
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: 10 }}>
|
||||
<input
|
||||
type="range" min="0" max="1" step="0.05"
|
||||
value={data.topP ?? 0.95}
|
||||
onChange={e => update('topP', parseFloat(e.target.value))}
|
||||
style={{ flex: 1, accentColor: 'var(--accent)' }}
|
||||
/>
|
||||
<input
|
||||
type="number" min="0" max="1" step="0.05"
|
||||
className="modal-input"
|
||||
style={{ width: 72, margin: 0, padding: '5px 8px', fontSize: 13, textAlign: 'center' }}
|
||||
value={data.topP ?? 0.95}
|
||||
onChange={e => update('topP', parseFloat(e.target.value) || 0)}
|
||||
/>
|
||||
</div>
|
||||
<div style={{ fontSize: 11, color: 'var(--text-muted)', marginTop: 2 }}>{t('apiConfig.topPDesc')}</div>
|
||||
</div>
|
||||
|
||||
{/* 最大上下文长度 */}
|
||||
<div style={{ marginBottom: 14 }}>
|
||||
<label style={{ display: 'block', fontSize: 13, fontWeight: 500, color: 'var(--text-secondary)', marginBottom: 5 }}>
|
||||
{t('apiConfig.maxContextLength')}
|
||||
</label>
|
||||
<input
|
||||
type="number" min="1024" step="1024"
|
||||
className="modal-input"
|
||||
style={{ margin: 0, width: 160, padding: '5px 8px', fontSize: 13 }}
|
||||
value={data.maxContextLength ?? 200000}
|
||||
onChange={e => update('maxContextLength', parseInt(e.target.value) || 4096)}
|
||||
/>
|
||||
<div style={{ fontSize: 11, color: 'var(--text-muted)', marginTop: 2 }}>{t('apiConfig.maxContextLengthDesc')}</div>
|
||||
</div>
|
||||
|
||||
{/* 最大输出 Token */}
|
||||
<div style={{ marginBottom: 0 }}>
|
||||
<label style={{ display: 'block', fontSize: 13, fontWeight: 500, color: 'var(--text-secondary)', marginBottom: 5 }}>
|
||||
{t('apiConfig.maxOutputTokens')}
|
||||
</label>
|
||||
<input
|
||||
type="number" min="256" step="256"
|
||||
className="modal-input"
|
||||
style={{ margin: 0, width: 160, padding: '5px 8px', fontSize: 13 }}
|
||||
value={data.maxOutputTokens ?? 65536}
|
||||
onChange={e => update('maxOutputTokens', parseInt(e.target.value) || 4096)}
|
||||
/>
|
||||
<div style={{ fontSize: 11, color: 'var(--text-muted)', marginTop: 2 }}>{t('apiConfig.maxOutputTokensDesc')}</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* 独立 Embedding 配置 */}
|
||||
<div style={{ marginTop: 24, marginBottom: 14, paddingTop: 16, borderTop: '1px solid var(--border-light)' }}>
|
||||
<label style={{ display: 'flex', alignItems: 'center', gap: 8, cursor: 'pointer', fontSize: 13, fontWeight: 500, color: 'var(--text-primary)' }}>
|
||||
|
||||
@@ -294,7 +294,7 @@ export default function Sidebar({ onOpenHelp, onToggle, editorRef }) {
|
||||
{/* ===== 文档分页 ===== */}
|
||||
<div className="gdocs-section-header">
|
||||
<span className="gdocs-section-title">文档分页</span>
|
||||
<button className="gdocs-section-add" onClick={handleCreateChapter} title={t('sidebar.newChapter')}>+</button>
|
||||
<button id="tour-new-chapter" className="gdocs-section-add" onClick={handleCreateChapter} title={t('sidebar.newChapter')}>+</button>
|
||||
</div>
|
||||
<div className="gdocs-tab-list">
|
||||
{chapters.map(ch => {
|
||||
@@ -420,8 +420,8 @@ export default function Sidebar({ onOpenHelp, onToggle, editorRef }) {
|
||||
<button className="btn btn-secondary btn-sm btn-icon" onClick={() => { exportProject(); }} title={t('sidebar.btnSaveTitle') || '存档(导出项目 JSON)'}>💾</button>
|
||||
<button className="btn btn-secondary btn-sm btn-icon" onClick={() => { document.getElementById('project-import-input')?.click(); }} title={t('sidebar.btnLoadTitle') || '读档(导入项目 JSON)'}>📂</button>
|
||||
<button className="btn btn-secondary btn-sm btn-icon" onClick={() => { document.getElementById('work-import-input')?.click(); }} title={t('sidebar.btnImportWorkTitle')}>📥</button>
|
||||
<button className="btn btn-secondary btn-sm btn-icon" onClick={() => onOpenHelp?.()} title={t('page.helpAndGuide') || '帮助与教程'}>📖</button>
|
||||
<button className="btn btn-secondary btn-sm btn-icon" onClick={() => setShowGitPopup(prev => !prev)} title="GitHub / Gitee / QQ群">
|
||||
<button id="tour-help" className="btn btn-secondary btn-sm btn-icon" onClick={() => onOpenHelp?.()} title={t('page.helpAndGuide') || '帮助与教程'}>📖</button>
|
||||
<button id="tour-github" className="btn btn-secondary btn-sm btn-icon" onClick={() => setShowGitPopup(prev => !prev)} title="GitHub / Gitee / QQ群">
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0024 12c0-6.63-5.37-12-12-12z" /></svg>
|
||||
</button>
|
||||
<input id="project-import-input" type="file" accept=".json" style={{ display: 'none' }} onChange={async (e) => { const file = e.target.files?.[0]; if (!file) return; const result = await importProject(file); if (result.success) { alert(result.message + '\n' + t('sidebar.importSuccess')); window.location.reload(); } else { alert(result.message); } e.target.value = ''; }} />
|
||||
|
||||
@@ -44,13 +44,13 @@ export default function TourOverlay({ onOpenHelp }) {
|
||||
targetId: 'tour-help',
|
||||
title: t('tour.step5Title'),
|
||||
content: t('tour.step5Content'),
|
||||
placement: 'left'
|
||||
placement: 'top'
|
||||
},
|
||||
{
|
||||
targetId: 'tour-github',
|
||||
title: t('tour.step6Title'),
|
||||
content: t('tour.step6Content'),
|
||||
placement: 'left'
|
||||
placement: 'top'
|
||||
}
|
||||
], [t]);
|
||||
|
||||
@@ -90,6 +90,11 @@ export default function TourOverlay({ onOpenHelp }) {
|
||||
if (retryEl) {
|
||||
const r = retryEl.getBoundingClientRect();
|
||||
setTargetRect({ x: r.x, y: r.y, width: r.width, height: r.height });
|
||||
} else {
|
||||
// Fallback: show tooltip centered when target element not found
|
||||
const cx = window.innerWidth / 2;
|
||||
const cy = window.innerHeight / 2;
|
||||
setTargetRect({ x: cx - 1, y: cy - 1, width: 2, height: 2 });
|
||||
}
|
||||
}, 300);
|
||||
}
|
||||
@@ -193,6 +198,8 @@ export default function TourOverlay({ onOpenHelp }) {
|
||||
tooltipStyle = { top: rY + rH / 2, right: windowSize.w - rX + 20, transform: 'translateY(-50%)' };
|
||||
} else if (step.placement === 'bottom') {
|
||||
tooltipStyle = { top: rY + rH + 20, left: rX + rW / 2, transform: 'translateX(-50%)' };
|
||||
} else if (step.placement === 'top') {
|
||||
tooltipStyle = { bottom: windowSize.h - rY + 20, left: rX + rW / 2, transform: 'translateX(-50%)' };
|
||||
} else if (step.placement === 'center') {
|
||||
tooltipStyle = { top: rY + rH / 2, left: rX + rW / 2, transform: 'translate(-50%, -50%)' };
|
||||
}
|
||||
|
||||
@@ -117,6 +117,12 @@ const DEFAULT_SETTINGS = {
|
||||
embedApiKey: '',
|
||||
embedBaseUrl: 'https://open.bigmodel.cn/api/paas/v4',
|
||||
embedModel: 'embedding-3',
|
||||
// 高级模型参数
|
||||
useAdvancedParams: false, // 总开关:关闭时使用默认值
|
||||
temperature: 1, // 0 ~ 2
|
||||
topP: 0.95, // 0 ~ 1
|
||||
maxContextLength: 200000, // 最大上下文 token
|
||||
maxOutputTokens: 65536, // 最大输出 token
|
||||
},
|
||||
|
||||
// 作品基本信息
|
||||
|
||||
+11
-1
@@ -455,7 +455,17 @@
|
||||
"networkError": "Network connection failed",
|
||||
"fetchModelsFailed": "Failed to fetch model list",
|
||||
"fetchEmbedModelsFailed": "Failed to fetch embedding model list",
|
||||
"embedApiPrefix": "Embedding API: "
|
||||
"embedApiPrefix": "Embedding API: ",
|
||||
"advancedParamsTitle": "Advanced Model Parameters",
|
||||
"advancedParamsDesc": "When enabled, customize temperature, sampling, and output limits. When disabled, defaults are used. Editor and chat share the same parameters.",
|
||||
"temperature": "Temperature",
|
||||
"temperatureDesc": "Higher = more random, lower = more deterministic. Recommended 0.7–1.2",
|
||||
"topP": "Top P (Nucleus Sampling)",
|
||||
"topPDesc": "Controls sampling range, 1.0 = no filtering. Recommended 0.9–1.0",
|
||||
"maxContextLength": "Max Context Length",
|
||||
"maxContextLengthDesc": "Maximum context tokens sent to the model",
|
||||
"maxOutputTokens": "Max Output Tokens",
|
||||
"maxOutputTokensDesc": "Maximum tokens per model response"
|
||||
},
|
||||
"preferences": {
|
||||
"intro": "You can change your language and visual theme preferences here at any time. All changes take effect immediately and are saved locally.",
|
||||
|
||||
+11
-1
@@ -455,7 +455,17 @@
|
||||
"networkError": "Ошибка сетевого соединения",
|
||||
"fetchModelsFailed": "Не удалось получить список моделей",
|
||||
"fetchEmbedModelsFailed": "Не удалось получить список моделей Embedding",
|
||||
"embedApiPrefix": "Embedding API: "
|
||||
"embedApiPrefix": "Embedding API: ",
|
||||
"advancedParamsTitle": "Расширенные параметры модели",
|
||||
"advancedParamsDesc": "При включении можно настроить температуру, параметры выборки и лимиты вывода. При отключении используются значения по умолчанию. Редактор и чат используют одинаковые параметры.",
|
||||
"temperature": "Температура (Temperature)",
|
||||
"temperatureDesc": "Выше = более случайный вывод, ниже = более предсказуемый. Рекомендуется 0.7–1.2",
|
||||
"topP": "Top P (Ядерная выборка)",
|
||||
"topPDesc": "Контролирует диапазон выборки, 1.0 = без фильтрации. Рекомендуется 0.9–1.0",
|
||||
"maxContextLength": "Макс. длина контекста",
|
||||
"maxContextLengthDesc": "Максимальное количество токенов контекста, отправляемых модели",
|
||||
"maxOutputTokens": "Макс. токенов вывода",
|
||||
"maxOutputTokensDesc": "Максимальное количество токенов в одном ответе модели"
|
||||
},
|
||||
"preferences": {
|
||||
"intro": "Здесь вы можете в любое время изменить язык и визуальную тему. Все изменения вступают в силу немедленно и сохраняются локально.",
|
||||
|
||||
+11
-1
@@ -455,7 +455,17 @@
|
||||
"networkError": "网络连接失败",
|
||||
"fetchModelsFailed": "拉取模型列表失败",
|
||||
"fetchEmbedModelsFailed": "拉取向量模型列表失败",
|
||||
"embedApiPrefix": "向量 API: "
|
||||
"embedApiPrefix": "向量 API: ",
|
||||
"advancedParamsTitle": "高级模型参数",
|
||||
"advancedParamsDesc": "开启后可自定义温度、采样参数和输出长度等参数,关闭则使用默认值。编辑区和对话区共用同一组参数。",
|
||||
"temperature": "温度 (Temperature)",
|
||||
"temperatureDesc": "值越高输出越随机,越低越确定。推荐 0.7~1.2",
|
||||
"topP": "Top P (核采样)",
|
||||
"topPDesc": "控制采样范围,1.0 = 不过滤。推荐 0.9~1.0",
|
||||
"maxContextLength": "最大上下文长度",
|
||||
"maxContextLengthDesc": "发送给模型的最大上下文 token 数",
|
||||
"maxOutputTokens": "最大输出 Token",
|
||||
"maxOutputTokensDesc": "模型单次回复的最大 token 数"
|
||||
},
|
||||
"preferences": {
|
||||
"intro": "在这里可以随时更改应用程序的语言和视觉主题偏好。所有的更改都会实时生效并保存在本地。",
|
||||
|
||||
+8
-1
@@ -231,7 +231,14 @@ export default function Home() {
|
||||
const res = await fetch(apiEndpoint, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ systemPrompt, userPrompt, apiConfig }),
|
||||
body: JSON.stringify({
|
||||
systemPrompt, userPrompt, apiConfig,
|
||||
...(apiConfig?.useAdvancedParams ? {
|
||||
maxTokens: apiConfig.maxOutputTokens || 65536,
|
||||
temperature: apiConfig.temperature ?? 1,
|
||||
topP: apiConfig.topP ?? 0.95,
|
||||
} : { maxTokens: 4096 }),
|
||||
}),
|
||||
signal,
|
||||
});
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "author-app",
|
||||
"version": "1.1.8",
|
||||
"version": "1.1.9",
|
||||
"private": true,
|
||||
"main": "electron/main.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in new issue
Block a user