fix: update regex for function calling models and improve time tracking logic

This commit is contained in:
suyao 2025-05-11 05:36:52 +08:00
parent c2f23d6916
commit 9b9a395451
No known key found for this signature in database
3 changed files with 5 additions and 5 deletions

View File

@ -206,7 +206,7 @@ export const FUNCTION_CALLING_MODELS = [
'gpt-4o-mini',
'gpt-4',
'gpt-4.5',
'o1(?:-[\\w-]+)?',
'o(1|3|4)(?:-[\\w-]+)?',
'claude',
'qwen',
'qwen3',

View File

@ -52,6 +52,7 @@ const ThinkingBlock: React.FC<Props> = ({ block }) => {
}
}, [block.content, t])
// FIXME: 这里统计的和请求处统计的有一定误差
useEffect(() => {
if (isThinking) {
intervalId.current = setInterval(() => {

View File

@ -428,7 +428,6 @@ export abstract class BaseOpenAiProvider extends BaseProvider {
type: 'input_text'
}
if (isSupportedReasoningEffortOpenAIModel(model)) {
systemMessageInput.text = `Formatting re-enabled${systemMessageInput.text ? '\n' + systemMessageInput.text : ''}`
systemMessage.role = 'developer'
}
@ -640,10 +639,10 @@ export abstract class BaseOpenAiProvider extends BaseProvider {
break
}
switch (chunk.type) {
case 'response.created':
time_first_token_millsec = new Date().getTime()
break
case 'response.output_item.added':
if (time_first_token_millsec === 0) {
time_first_token_millsec = new Date().getTime()
}
if (chunk.item.type === 'function_call') {
outputItems.push(chunk.item)
}