Merge branch 'QuantumNous:main' into main
This commit is contained in:
@@ -118,7 +118,6 @@ export const buildApiPayload = (
|
||||
model: inputs.model,
|
||||
group: inputs.group,
|
||||
messages: processedMessages,
|
||||
group: inputs.group,
|
||||
stream: inputs.stream,
|
||||
};
|
||||
|
||||
@@ -132,13 +131,15 @@ export const buildApiPayload = (
|
||||
seed: 'seed',
|
||||
};
|
||||
|
||||
|
||||
Object.entries(parameterMappings).forEach(([key, param]) => {
|
||||
if (
|
||||
parameterEnabled[key] &&
|
||||
inputs[param] !== undefined &&
|
||||
inputs[param] !== null
|
||||
) {
|
||||
payload[param] = inputs[param];
|
||||
const enabled = parameterEnabled[key];
|
||||
const value = inputs[param];
|
||||
const hasValue = value !== undefined && value !== null;
|
||||
|
||||
|
||||
if (enabled && hasValue) {
|
||||
payload[param] = value;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -1030,6 +1030,8 @@ export function renderModelPrice(
|
||||
audioInputSeperatePrice = false,
|
||||
audioInputTokens = 0,
|
||||
audioInputPrice = 0,
|
||||
imageGenerationCall = false,
|
||||
imageGenerationCallPrice = 0,
|
||||
) {
|
||||
const { ratio: effectiveGroupRatio, label: ratioLabel } = getEffectiveRatio(
|
||||
groupRatio,
|
||||
@@ -1072,7 +1074,8 @@ export function renderModelPrice(
|
||||
(audioInputTokens / 1000000) * audioInputPrice * groupRatio +
|
||||
(completionTokens / 1000000) * completionRatioPrice * groupRatio +
|
||||
(webSearchCallCount / 1000) * webSearchPrice * groupRatio +
|
||||
(fileSearchCallCount / 1000) * fileSearchPrice * groupRatio;
|
||||
(fileSearchCallCount / 1000) * fileSearchPrice * groupRatio +
|
||||
(imageGenerationCallPrice * groupRatio);
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -1134,7 +1137,13 @@ export function renderModelPrice(
|
||||
})}
|
||||
</p>
|
||||
)}
|
||||
<p></p>
|
||||
{imageGenerationCall && imageGenerationCallPrice > 0 && (
|
||||
<p>
|
||||
{i18next.t('图片生成调用:${{price}} / 1次', {
|
||||
price: imageGenerationCallPrice,
|
||||
})}
|
||||
</p>
|
||||
)}
|
||||
<p>
|
||||
{(() => {
|
||||
// 构建输入部分描述
|
||||
@@ -1214,6 +1223,16 @@ export function renderModelPrice(
|
||||
},
|
||||
)
|
||||
: '',
|
||||
imageGenerationCall && imageGenerationCallPrice > 0
|
||||
? i18next.t(
|
||||
' + 图片生成调用 ${{price}} / 1次 * {{ratioType}} {{ratio}}',
|
||||
{
|
||||
price: imageGenerationCallPrice,
|
||||
ratio: groupRatio,
|
||||
ratioType: ratioLabel,
|
||||
},
|
||||
)
|
||||
: '',
|
||||
].join('');
|
||||
|
||||
return i18next.t(
|
||||
|
||||
@@ -75,13 +75,17 @@ export async function copy(text) {
|
||||
await navigator.clipboard.writeText(text);
|
||||
} catch (e) {
|
||||
try {
|
||||
// 构建input 执行 复制命令
|
||||
var _input = window.document.createElement('input');
|
||||
_input.value = text;
|
||||
window.document.body.appendChild(_input);
|
||||
_input.select();
|
||||
window.document.execCommand('Copy');
|
||||
window.document.body.removeChild(_input);
|
||||
// 构建 textarea 执行复制命令,保留多行文本格式
|
||||
const textarea = window.document.createElement('textarea');
|
||||
textarea.value = text;
|
||||
textarea.setAttribute('readonly', '');
|
||||
textarea.style.position = 'fixed';
|
||||
textarea.style.left = '-9999px';
|
||||
textarea.style.top = '-9999px';
|
||||
window.document.body.appendChild(textarea);
|
||||
textarea.select();
|
||||
window.document.execCommand('copy');
|
||||
window.document.body.removeChild(textarea);
|
||||
} catch (e) {
|
||||
okay = false;
|
||||
console.error(e);
|
||||
|
||||
Reference in New Issue
Block a user