mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-07 13:59:28 +08:00
refactor(logging): change logger level and remove unused log statements (#10030)
* refactor(logging): change logger level and remove unused log statements - Updated logger level from info to silly in AiSdkToChunkAdapter for more granular logging. - Removed unused logger statements in AiSdkMiddlewareBuilder and PluginBuilder to clean up the code. - Enhanced condition check in ApiService to include prompt tool usage. * chore
This commit is contained in:
parent
79592e2c27
commit
1cd89561ab
@ -89,7 +89,7 @@ export class AiSdkToChunkAdapter {
|
|||||||
chunk: TextStreamPart<any>,
|
chunk: TextStreamPart<any>,
|
||||||
final: { text: string; reasoningContent: string; webSearchResults: any[]; reasoningId: string }
|
final: { text: string; reasoningContent: string; webSearchResults: any[]; reasoningId: string }
|
||||||
) {
|
) {
|
||||||
logger.info(`AI SDK chunk type: ${chunk.type}`, chunk)
|
logger.silly(`AI SDK chunk type: ${chunk.type}`, chunk)
|
||||||
switch (chunk.type) {
|
switch (chunk.type) {
|
||||||
// === 文本相关事件 ===
|
// === 文本相关事件 ===
|
||||||
case 'text-start':
|
case 'text-start':
|
||||||
|
|||||||
@ -132,7 +132,6 @@ export function buildAiSdkMiddlewares(config: AiSdkMiddlewareConfig): LanguageMo
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.info('builder.build()', builder.buildNamed())
|
|
||||||
return builder.build()
|
return builder.build()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -72,7 +72,7 @@ export function buildPlugins(
|
|||||||
// if (!middlewareConfig.enableTool && middlewareConfig.mcpTools && middlewareConfig.mcpTools.length > 0) {
|
// if (!middlewareConfig.enableTool && middlewareConfig.mcpTools && middlewareConfig.mcpTools.length > 0) {
|
||||||
// plugins.push(createNativeToolUsePlugin())
|
// plugins.push(createNativeToolUsePlugin())
|
||||||
// }
|
// }
|
||||||
logger.info(
|
logger.debug(
|
||||||
'Final plugin list:',
|
'Final plugin list:',
|
||||||
plugins.map((p) => p.name)
|
plugins.map((p) => p.name)
|
||||||
)
|
)
|
||||||
|
|||||||
@ -99,8 +99,7 @@ export async function fetchChatCompletion({
|
|||||||
const provider = AI.getActualProvider()
|
const provider = AI.getActualProvider()
|
||||||
|
|
||||||
const mcpTools: MCPTool[] = []
|
const mcpTools: MCPTool[] = []
|
||||||
|
if (isPromptToolUse(assistant) || isSupportedToolUse(assistant)) {
|
||||||
if (isSupportedToolUse(assistant)) {
|
|
||||||
mcpTools.push(...(await fetchMcpTools(assistant)))
|
mcpTools.push(...(await fetchMcpTools(assistant)))
|
||||||
}
|
}
|
||||||
if (prompt) {
|
if (prompt) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user