mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-26 03:31:24 +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>,
|
||||
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) {
|
||||
// === 文本相关事件 ===
|
||||
case 'text-start':
|
||||
|
||||
@ -132,7 +132,6 @@ export function buildAiSdkMiddlewares(config: AiSdkMiddlewareConfig): LanguageMo
|
||||
})
|
||||
}
|
||||
|
||||
logger.info('builder.build()', builder.buildNamed())
|
||||
return builder.build()
|
||||
}
|
||||
|
||||
|
||||
@ -72,7 +72,7 @@ export function buildPlugins(
|
||||
// if (!middlewareConfig.enableTool && middlewareConfig.mcpTools && middlewareConfig.mcpTools.length > 0) {
|
||||
// plugins.push(createNativeToolUsePlugin())
|
||||
// }
|
||||
logger.info(
|
||||
logger.debug(
|
||||
'Final plugin list:',
|
||||
plugins.map((p) => p.name)
|
||||
)
|
||||
|
||||
@ -99,8 +99,7 @@ export async function fetchChatCompletion({
|
||||
const provider = AI.getActualProvider()
|
||||
|
||||
const mcpTools: MCPTool[] = []
|
||||
|
||||
if (isSupportedToolUse(assistant)) {
|
||||
if (isPromptToolUse(assistant) || isSupportedToolUse(assistant)) {
|
||||
mcpTools.push(...(await fetchMcpTools(assistant)))
|
||||
}
|
||||
if (prompt) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user