mirror of
https://github.com/linux-do/new-api.git
synced 2025-11-17 19:13:42 +08:00
Compare commits
4 Commits
v0.3.1.0-a
...
v0.3.1.0-a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b40c2e1071 | ||
|
|
afc1e92ed0 | ||
|
|
ee04dbd9dd | ||
|
|
e5588fc1ee |
@@ -48,6 +48,7 @@
|
||||
4. Telegram Bot 名称是bot username 去掉@后的字符串
|
||||
13. 添加 [Suno API](https://github.com/Suno-API/Suno-API)接口的支持,[对接文档](Suno.md)
|
||||
14. 支持Rerank模型,目前仅兼容Cohere和Jina,可接入Dify,[对接文档](Rerank.md)
|
||||
15. **[OpenAI Realtime API](https://platform.openai.com/docs/guides/realtime/integration)** - 支持OpenAI的Realtime API,支持Azure渠道。
|
||||
|
||||
## 模型支持
|
||||
此版本额外支持以下模型:
|
||||
|
||||
@@ -336,33 +336,33 @@ const LogsTable = () => {
|
||||
);
|
||||
},
|
||||
},
|
||||
// {
|
||||
// title: '重试',
|
||||
// dataIndex: 'retry',
|
||||
// className: isAdmin() ? 'tableShow' : 'tableHiddle',
|
||||
// render: (text, record, index) => {
|
||||
// let content = '渠道:' + record.channel;
|
||||
// if (record.other !== '') {
|
||||
// let other = JSON.parse(record.other);
|
||||
// if (other === null) {
|
||||
// return <></>;
|
||||
// }
|
||||
// if (other.admin_info !== undefined) {
|
||||
// if (
|
||||
// other.admin_info.use_channel !== null &&
|
||||
// other.admin_info.use_channel !== undefined &&
|
||||
// other.admin_info.use_channel !== ''
|
||||
// ) {
|
||||
// // channel id array
|
||||
// let useChannel = other.admin_info.use_channel;
|
||||
// let useChannelStr = useChannel.join('->');
|
||||
// content = `渠道:${useChannelStr}`;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// return isAdminUser ? <div>{content}</div> : <></>;
|
||||
// },
|
||||
// },
|
||||
{
|
||||
title: '重试',
|
||||
dataIndex: 'retry',
|
||||
className: isAdmin() ? 'tableShow' : 'tableHiddle',
|
||||
render: (text, record, index) => {
|
||||
let content = '渠道:' + record.channel;
|
||||
if (record.other !== '') {
|
||||
let other = JSON.parse(record.other);
|
||||
if (other === null) {
|
||||
return <></>;
|
||||
}
|
||||
if (other.admin_info !== undefined) {
|
||||
if (
|
||||
other.admin_info.use_channel !== null &&
|
||||
other.admin_info.use_channel !== undefined &&
|
||||
other.admin_info.use_channel !== ''
|
||||
) {
|
||||
// channel id array
|
||||
let useChannel = other.admin_info.use_channel;
|
||||
let useChannelStr = useChannel.join('->');
|
||||
content = `渠道:${useChannelStr}`;
|
||||
}
|
||||
}
|
||||
}
|
||||
return isAdminUser ? <div>{content}</div> : <></>;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '详情',
|
||||
dataIndex: 'content',
|
||||
@@ -384,25 +384,24 @@ const LogsTable = () => {
|
||||
</Paragraph>
|
||||
);
|
||||
}
|
||||
let content = renderModelPrice(
|
||||
record.prompt_tokens,
|
||||
record.completion_tokens,
|
||||
other.model_ratio,
|
||||
other.model_price,
|
||||
other.completion_ratio,
|
||||
other.group_ratio,
|
||||
);
|
||||
|
||||
// let content = renderModelPrice(
|
||||
// record.prompt_tokens,
|
||||
// record.completion_tokens,
|
||||
// other.model_ratio,
|
||||
// other.model_price,
|
||||
// other.completion_ratio,
|
||||
// other.group_ratio,
|
||||
// );
|
||||
return (
|
||||
<Tooltip content={content}>
|
||||
<Paragraph
|
||||
ellipsis={{
|
||||
rows: 2,
|
||||
}}
|
||||
style={{ maxWidth: 240 }}
|
||||
ellipsis={{
|
||||
rows: 2,
|
||||
}}
|
||||
style={{ maxWidth: 240 }}
|
||||
>
|
||||
{text}
|
||||
调用消费
|
||||
</Paragraph>
|
||||
</Tooltip>
|
||||
);
|
||||
},
|
||||
},
|
||||
@@ -520,25 +519,25 @@ const LogsTable = () => {
|
||||
let other = getLogOther(logs[i].other);
|
||||
let expandDataLocal = [];
|
||||
if (isAdmin()) {
|
||||
let content = '渠道:' + logs[i].channel;
|
||||
if (other.admin_info !== undefined) {
|
||||
if (
|
||||
other.admin_info.use_channel !== null &&
|
||||
other.admin_info.use_channel !== undefined &&
|
||||
other.admin_info.use_channel !== ''
|
||||
) {
|
||||
// channel id array
|
||||
let useChannel = other.admin_info.use_channel;
|
||||
let useChannelStr = useChannel.join('->');
|
||||
content = `渠道:${useChannelStr}`;
|
||||
}
|
||||
}
|
||||
expandDataLocal.push({
|
||||
key: '重试',
|
||||
value: content,
|
||||
})
|
||||
// let content = '渠道:' + logs[i].channel;
|
||||
// if (other.admin_info !== undefined) {
|
||||
// if (
|
||||
// other.admin_info.use_channel !== null &&
|
||||
// other.admin_info.use_channel !== undefined &&
|
||||
// other.admin_info.use_channel !== ''
|
||||
// ) {
|
||||
// // channel id array
|
||||
// let useChannel = other.admin_info.use_channel;
|
||||
// let useChannelStr = useChannel.join('->');
|
||||
// content = `渠道:${useChannelStr}`;
|
||||
// }
|
||||
// }
|
||||
// expandDataLocal.push({
|
||||
// key: '渠道重试',
|
||||
// value: content,
|
||||
// })
|
||||
}
|
||||
if (other.ws) {
|
||||
if (other?.ws) {
|
||||
expandDataLocal.push({
|
||||
key: '语音输入',
|
||||
value: other.audio_input,
|
||||
@@ -556,9 +555,28 @@ const LogsTable = () => {
|
||||
value: other.text_output,
|
||||
});
|
||||
}
|
||||
expandDataLocal.push({
|
||||
key: '日志详情',
|
||||
value: logs[i].content,
|
||||
})
|
||||
if (logs[i].type === 2) {
|
||||
let content = renderModelPrice(
|
||||
logs[i].prompt_tokens,
|
||||
logs[i].completion_tokens,
|
||||
other.model_ratio,
|
||||
other.model_price,
|
||||
other.completion_ratio,
|
||||
other.group_ratio,
|
||||
);
|
||||
expandDataLocal.push({
|
||||
key: '计费过程',
|
||||
value: content,
|
||||
});
|
||||
}
|
||||
|
||||
expandDatesLocal[logs[i].key] = expandDataLocal;
|
||||
}
|
||||
console.log(expandDatesLocal);
|
||||
|
||||
setExpandData(expandDatesLocal);
|
||||
|
||||
setLogs(logs);
|
||||
@@ -634,7 +652,7 @@ const LogsTable = () => {
|
||||
}, []);
|
||||
|
||||
const expandRowRender = (record, index) => {
|
||||
return <Descriptions align="justify" data={expandData[record.key]} />;
|
||||
return <Descriptions data={expandData[record.key]} />;
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user