Fix anthropic request cannot handle webSearch and knowbase references (#7559)

修复 Anthropic 模型请求忽略了知识库和网络搜索引用内容的问题
This commit is contained in:
亢奋猫 2025-06-26 13:19:36 +08:00 committed by GitHub
parent 3048d0850c
commit 1db93e8b56
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 5 additions and 5 deletions

View File

@ -66,7 +66,7 @@ import {
mcpToolCallResponseToAnthropicMessage,
mcpToolsToAnthropicTools
} from '@renderer/utils/mcp-tools'
import { findFileBlocks, findImageBlocks, getMainTextContent } from '@renderer/utils/messageUtils/find'
import { findFileBlocks, findImageBlocks } from '@renderer/utils/messageUtils/find'
import { buildSystemPrompt } from '@renderer/utils/prompt'
import { BaseApiClient } from '../BaseApiClient'
@ -192,7 +192,7 @@ export class AnthropicAPIClient extends BaseApiClient<
const parts: MessageParam['content'] = [
{
type: 'text',
text: getMainTextContent(message)
text: await this.getMessageContent(message)
}
]

View File

@ -150,7 +150,7 @@ const ThinkingTimeSeconds = memo(
)
const CollapseContainer = styled(Collapse)`
margin-bottom: 15px;
margin: 15px 0;
`
const MessageTitleLabel = styled.div`

View File

@ -2,7 +2,7 @@
exports[`ThinkingBlock > basic rendering > should match snapshot 1`] = `
.c0 {
margin-bottom: 15px;
margin: 15px 0;
}
.c1 {

View File

@ -326,7 +326,7 @@ const PopoverContent = styled.div`
`
const KnowledgePopoverContent = styled(PopoverContent)`
max-width: 800px;
max-width: 600px;
`
const PopoverContentItem = styled.div`