mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-19 14:41:24 +08:00
fix the query for agents with the same name is not fully displayed (#8826)
* fix[AgentsPage]: fix using name deduplication leads to the loss of agents with the same name * fix[agents-zh]: fix id 499 the problem of markdown display * fix[agent]: agent search adds descriptive text search
This commit is contained in:
parent
efda20c143
commit
d8d0ab5fc4
@ -5788,7 +5788,7 @@
|
||||
"文案",
|
||||
"创意"
|
||||
],
|
||||
"prompt": "你是小红书爆款写作专家,请你用以下步骤来进行创作,首先产出5个标题(含适当的emoji表情),其次产出1个正文(每一个段落含有适当的emoji表情,文末有合适的tag标签) \r\n 一、在小红书标题方面,你会以下技能: \r\n 1. 采用二极管标题法进行创作 \r\n 2. 你善于使用标题吸引人的特点 \r\n 3. 你使用爆款关键词,写标题时,从这个列表中随机选1-2个 \r\n 4. 你了解小红书平台的标题特性 \r\n 5. 你懂得创作的规则 \r\n 二、在小红书正文方面,你会以下技能: \r\n 1. 写作风格 \r\n 2. 写作开篇方法 \r\n 3. 文本结构 \r\n 4. 互动引导方法 \r\n 5. 一些小技巧 \r\n 6. 爆炸词 \r\n 7. 从你生成的稿子中,抽取3-6个seo关键词,生成#标签并放在文章最后 \r\n 8. 文章的每句话都尽量口语化、简短 \r\n 9. 在每段话的开头使用表情符号,在每段话的结尾使用表情符号,在每段话的中间插入表情符号 \r\n 三、结合我给你输入的信息,以及你掌握的标题和正文的技巧,产出内容。请按照如下格式输出内容,只需要格式描述的部分,如果产生其他内容则不输出: \r\n 一. 标题 \r\n [标题1到标题5] \r\n [换行] \r\n 二. 正文 \r\n [正文] \r\n 标签:[标签]",
|
||||
"prompt": "你是小红书爆款写作专家,请你用以下步骤来进行创作,首先产出5个标题(含适当的emoji表情),其次产出1个正文(每一个段落含有适当的emoji表情,文末有合适的tag标签) \r\n 一、在小红书标题方面,你会以下技能: \r\n 1. 采用二极管标题法进行创作 \r\n 2. 你善于使用标题吸引人的特点 \r\n 3. 你使用爆款关键词,写标题时,从这个列表中随机选1-2个 \r\n 4. 你了解小红书平台的标题特性 \r\n 5. 你懂得创作的规则 \r\n\n 二、在小红书正文方面,你会以下技能: \r\n 1. 写作风格 \r\n 2. 写作开篇方法 \r\n 3. 文本结构 \r\n 4. 互动引导方法 \r\n 5. 一些小技巧 \r\n 6. 爆炸词 \r\n 7. 从你生成的稿子中,抽取3-6个seo关键词,生成#标签并放在文章最后 \r\n 8. 文章的每句话都尽量口语化、简短 \r\n 9. 在每段话的开头使用表情符号,在每段话的结尾使用表情符号,在每段话的中间插入表情符号 \r\n\n 三、结合我给你输入的信息,以及你掌握的标题和正文的技巧,产出内容。请按照如下格式输出内容,只需要格式描述的部分,如果产生其他内容则不输出: \r\n 一. 标题 \r\n [标题1到标题5] \r\n [换行] \r\n 二. 正文 \r\n [正文] \r\n 标签:[标签]",
|
||||
"description": "你是小红书爆款写作专家,请你用以下步骤来进行创作,首先产出5个标题(含适当的emoji表情),其次产出1个正文(每一个段落含有适当的emoji表情,文末有合适的tag标签)"
|
||||
},
|
||||
{
|
||||
|
||||
@ -38,7 +38,11 @@ const PopupContainer: React.FC<Props> = ({ resolve }) => {
|
||||
const allAgents = [...userAgents, ...systemAgents] as Agent[]
|
||||
const list = [defaultAssistant, ...allAgents.filter((agent) => !assistants.map((a) => a.id).includes(agent.id))]
|
||||
const filtered = searchText
|
||||
? list.filter((agent) => agent.name.toLowerCase().includes(searchText.trim().toLocaleLowerCase()))
|
||||
? list.filter(
|
||||
(agent) =>
|
||||
agent.name.toLowerCase().includes(searchText.trim().toLocaleLowerCase()) ||
|
||||
agent.description?.toLowerCase().includes(searchText.trim().toLocaleLowerCase())
|
||||
)
|
||||
: list
|
||||
|
||||
if (searchText.trim()) {
|
||||
|
||||
@ -44,27 +44,22 @@ const AgentsPage: FC = () => {
|
||||
}, [systemAgents, userAgents])
|
||||
|
||||
const filteredAgents = useMemo(() => {
|
||||
let agents: Agent[] = []
|
||||
|
||||
if (search.trim()) {
|
||||
// 搜索框为空直接返回「我的」分组下的 agent
|
||||
if (!search.trim()) {
|
||||
return agentGroups[activeGroup] || []
|
||||
}
|
||||
const uniqueAgents = new Map<string, Agent>()
|
||||
|
||||
Object.entries(agentGroups).forEach(([, agents]) => {
|
||||
agents.forEach((agent) => {
|
||||
if (
|
||||
(agent.name.toLowerCase().includes(search.toLowerCase()) ||
|
||||
agent.description?.toLowerCase().includes(search.toLowerCase())) &&
|
||||
!uniqueAgents.has(agent.name)
|
||||
agent.name.toLowerCase().includes(search.toLowerCase()) ||
|
||||
agent.description?.toLowerCase().includes(search.toLowerCase())
|
||||
) {
|
||||
uniqueAgents.set(agent.name, agent)
|
||||
uniqueAgents.set(agent.id, agent)
|
||||
}
|
||||
})
|
||||
})
|
||||
agents = Array.from(uniqueAgents.values())
|
||||
} else {
|
||||
agents = agentGroups[activeGroup] || []
|
||||
}
|
||||
return agents.filter((agent) => agent.name.toLowerCase().includes(search.toLowerCase()))
|
||||
return Array.from(uniqueAgents.values())
|
||||
}, [agentGroups, activeGroup, search])
|
||||
|
||||
const { t, i18n } = useTranslation()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user