(一)(一)(一)(一)(一)
Agents 101 开发coze.com来源https://docs.feishu.cn/docx/Z2FrdQH6RoDUQBxaFdRcSSjenccAgent101 — 手把手打造专属AI搜索助理来源https://docs.feishu.cn/docx/J9rkdarNyoB62XxWq3mcQFNjnpb我们已经看到很多AI 搜索的产品比如 Perplexity 、秘塔AI搜索、KIMI搜索增强的原理简单来说是通过 LLM 把搜索得到的结果进行二次处理得到语义化的搜索结果。 这篇文章主要介绍通过 Coze 来实现你的搜索增强 bot本文假设你已经对 Coze 以及大模型有了基本了解。【你能学到什么】如何写 Prompt如何使用 workflow如何使用 google 搜索插件如何使用 Code 节点我们这个AI 搜索就叫做 AISearch体验地址https://www.coze.com/s/Zs8rrVCAd/https://github.com/OpenDocCN/dsai-notes-pt4-zh/raw/master/docs/agent-101/img/e776d2fd2342253b8a89ef6dab9a46c3.png这个 AISearch 的核心包括如何写Persona Prompt如何使用 workflow 以及 plugin通过 Code 节点对搜索的结果进行格式化在 workflow 中使用 LLM 生成内容如何写 Persona Prompthttps://github.com/OpenDocCN/dsai-notes-pt4-zh/raw/master/docs/agent-101/img/d9ac5ce2f2e5ed705bcd0ee26e00168e.pngPersona Prompt 是指 bot 的 入口prompt 如果你的bot 比较简单只需要一个 prompt 就可以完成的话你可以在把 prompt 写得足够详细。如果你的 bot 要使用多个 workflow 或者 plugin你的 prompt 需要包含人物设定功能和能力描述以及能力约束三个 部分人物设定描述 Bot 所扮演的角色或职责、回复风格。例如你是一个新闻播报员可以用非常生动的风格讲解科技新闻。功能和能力描述描述 Bot 的功能和工作流程约定 Bot 在不同的场景下如何回答用户问题。例如当用户查询最新 AI 新闻时调用“getNews”工具来搜索科技新闻。能力约束如果您想限制回复范围请直接告诉 Bot 什么应该回答、什么不应该回答。AISearch 的 Prompt 如下# Your Role You are a search enhancement assistant created by Agent101, you are the guide to the vast world of information. Ask away, and let the journey of exploration begin. Remember, there is nothing you don#x27;t know. # Skills ## Search and Anaswer Your most important ability is Search and Answer. When users pose questions or inquire about certain topics or concepts, you should **always** first conduct an online search before providing an answer. However, when users ask you **to do something**, such as translating, summarizing, etc., you must decide whether it#x27;s reasonable to use your search capability to enhance your ability to perform the task.如何使用 workflow 和 pluginAISearch 的核心能力就是搜索增强我们创建了一个叫做 search 的 workflow 来完成这个能力。https://github.com/OpenDocCN/dsai-notes-pt4-zh/raw/master/docs/agent-101/img/251530d00c7736282ec0bc6398dd1ccb.pngworkflow支持通过可视化的方式对插件、大语言模型、代码块等功能进行组合从而实现复杂、稳定的业务流程编排。 当目标任务场景包含较多的步骤且对输出结果的准确性、格式有严格要求时适合配置工作流来实现。工作流由多个节点构成节点是组成工作流的基本单元。例如大语言模型 LLM、自定义代码、判断逻辑等节点。 工作流默认包含了 Start 节点和 End 节点。在这个 Search workflow 中总共包含了Start 、googleWebSearch、Code、LLM 、End 五个节点。使用Code节点对搜索的结果进行格式化可以看到 google 搜索插件范围的数据是非常多的其中有很多数据我们并用不到另外一个是我们想要特定格式的搜索数据进行后续的处理这里我们可以使用 Code 节点来进行数据的二次处理和格式化。https://github.com/OpenDocCN/dsai-notes-pt4-zh/raw/master/docs/agent-101/img/ff1a519ed7b80721612ca4b417e6a0ad.pnghttps://github.com/OpenDocCN/dsai-notes-pt4-zh/raw/master/docs/agent-101/img/1b43f99109db6eff39af8458e3b0305b.png这里的 code 节点代码比较简单基本逻辑是1、清理掉有可能为空的数据2、结构化用于搜索增强的内容3、结构化用于展示引用的内容Workflow 中使用 LLM 生成内容到这里我们已经获取了搜索增强的内容和引用的内容接下来我们就用依托这些内容给用户生成回复这里我们采用了一个 LLM 节点模型采用了 gpt-4o gpt-4o 确实速度确实比较快而且具有 128k 的输入上下文。所使用的 Prompt 借鉴了贾扬清大佬的开源项目感谢大佬分享这里的 prompt 是整个workflow 的精髓你可以尝试改造成自己的You are a large language AI assistant built by Agent101. You are given a user question, and please write clean, concise and accurate answer to the question. You will be given a set of related contexts to the question, each starting with a reference number like [[x]], where x is a number. Please use the context and cite the context at the end of each sentence if applicable. Your answer must be correct, accurate and written by an expert using an unbiased and professional tone. Please limit to 2024 tokens. Do not give any information that is not related to the question, and do not repeat. Say quot;information is missing onquot; followed by the related topic, if the given context do not provide sufficient information. Please cite the retrieved contexts with the reference numbers, in the format [x]. If a sentence comes from multiple contexts, please list all applicable citations, like [3][5]. Other than code and specific names and citations. Here is the user query: {{query}} And here are the set of retrieved contexts: {{retrieved}} Remember your response MUST be written in the language the user prefers. Here is the user query: {{query}}从LLM 返回的结果直接输入就可以了。最后相应的 bot 和 workflow 代码我已经公开 你可以在这里查看完整的 Prompt 和 Workflow。 希望能对你有所帮助。加入 Agent101 Coze Teamhttps://www.coze.com/invite/VbogXxJTvUYU8wpxFoWh (需要加入 team 才能看到完整的 prompt 和 workflow)本 bot 地址https://www.coze.com/s/Zs8rrVCAd/参考文章1、https://juejin.cn/post/73368411917721436422、https://github.com/leptonai/search_with_leptonAgent101 — 复现吴恩达老师 AI 翻译工作流来源https://docs.feishu.cn/docx/Pr47dDQjcoDcP3xFBf3cKaM7nib吴恩达老师在 X/Twitter 上公开了他的 translation agent基本思路是 (i) 提示一个LLM从一种语言翻译到另一种语言(ii) 反思翻译以提出建设性的建议(iii) 使用这些建议来完善翻译。根据测试这个翻译工作流翻译效果已经可以媲美商业的翻译服务。今天我们尝试来复现他。吴恩达老师推文https://x.com/AndrewYNg/status/1800582171259982289https://github.com/OpenDocCN/dsai-notes-pt4-zh/raw/master/docs/agent-101/img/5661431690bff1eb67545304519dd5c2.png【你能学到什么】如何写一个code plugin如何试用反思来提升大模型的表现如何在工作流中使用批处理注意吴恩达老师这个工作流会耗费比较多的 token测试的时候请注意 token 消耗。我们这个agent 就叫做 Trans Ninja体验地址https://www.coze.com/store/bot/7388361569362542608https://github.com/OpenDocCN/dsai-notes-pt4-zh/raw/master/docs/agent-101/img/edced1771b5e518f7906815698412ca9.png原理分析吴恩达老师开源了这部分代码 https://github.com/andrewyng/translation-agent我们看这部分代码的原理初始翻译one_chunk_initial_translation函数用于将整个文本作为一个块进行初始翻译。multichunk_initial_translation函数用于将文本分成多个块并分别进行初始翻译。反思改进one_chunk_reflect_on_translation和multichunk_reflect_on_translation函数用于对初始翻译进行反思提供具体的建议来改进翻译的准确性、流畅性、风格和术语使用。改进翻译one_chunk_improve_translation和multichunk_improve_translation函数根据反思中的建议对初始翻译进行改进。完整翻译流程one_chunk_translate_text和multichunk_translation函数提供了完整的翻译流程包括初始翻译、反思改进以及最终翻译。单块翻译相关函数:one_chunk_initial_translation: 进行初步翻译。one_chunk_reflect_on_translation: 对初步翻译进行反思和评价。one_chunk_improve_translation: 基于反思改进翻译。one_chunk_translate_text: 整合上述三个步骤,完成单块文本的翻译。多块翻译相关函数:multichunk_initial_translation: 对多个文本块进行初步翻译。multichunk_reflect_on_translation: 对多个翻译块进行反思。multichunk_improve_translation: 改进多个翻译块。multichunk_translation: 整合多块翻译的整个过程。因为采用了分块处理可以翻译比较长的长文章比如我们默认 1000 个 token 分成一段 一个1M token 的文章就可以被分为 1000 块来分别翻译1M token 能翻译绝大多文章类的文字。工作流介绍我们创建了一个叫做 translate 的工作流核心包括1、text_split 2、条件判断 3、翻译/反思/二次翻译https://github.com/OpenDocCN/dsai-notes-pt4-zh/raw/master/docs/agent-101/img/3a13513e85736e6faf2447800cb0e793.png工作流的输入参数https://github.com/OpenDocCN/dsai-notes-pt4-zh/raw/master/docs/agent-101/img/249ecf1a338decf5771e71b0767c4cd1.pngsource_text: 要翻译的内容source_lang: 翻译内容的原语言target_lang: 翻译内容的目标语言chunk_size: 长内容分块翻译每块的大小默认 1000 token构建 TextSplitter Plugin上面提到如果用户输入的是长内容我们要对内容进行分块翻译至于为什么要分块应该有两个原因1、大模型输出上下文是 4k是无法输出超过 4k token内容的文字。2、输入分块可以减少太长的输入导致的幻觉。对于内容分块大家对 langchang 的 RecursiveCharacterTextSplitter但如何在 coze 中完成呢这里我们采用了 coze 提供的 code plugin。我们创建了一个基于 python 代码的 TextSplitter plugin来完成这个相关的代码和截图from runtime import Args from typings.split_text.split_text import Input, Output import tiktoken from langchain_text_splitters import RecursiveCharacterTextSplitter def num_tokens_in_string( input_str: str, encoding_name: str quot;cl100k_basequot; ) -gt; int: encoding tiktoken.get_encoding(encoding_name) num_tokens len(encoding.encode(input_str)) return num_tokens quot;quot;quot; Each file needs to export a function named handler. This function is the entrance to the Tool. Parameters: args: parameters of the entry function. args.input - input parameters, you can get test input value by args.input.xxx. args.logger - logger instance used to print logs, injected by runtime. Remember to fill in input/output in Metadata, it helps LLM to recognize and use tool. Return: The return data of the function, which should match the declared output parameters. quot;quot;quot; def handler(args: Args[Input])-gt;Output: chunk_size args.input.chunk_size or 1000 model_name args.input.model or quot;gpt-4quot; source_text args.input.source_text chunk_overlap args.input.chunk_overlap or 0 tokens num_tokens_in_string(source_text) text_splitter RecursiveCharacterTextSplitter.from_tiktoken_encoder( model_namequot;gpt-4quot;, chunk_sizechunk_size, chunk_overlap0, ) source_text_chunks text_splitter.split_text(source_text) return { quot;chunksquot;: source_text_chunks, quot;tokensquot;: tokens }在这个TextSplitter plugin 中我们需要安装依赖tiktoken 和 langchain_text_splitters。 Tiktoken 的作用是计算输入的文字的 token 大小langchain_text_splitters 的作用是来帮助我们根据 token 来进行分块。https://github.com/OpenDocCN/dsai-notes-pt4-zh/raw/master/docs/agent-101/img/563b33ba4141b4e859b1a535c235448a.png使用批处理来加快大模型处理如果用户要翻译长内容我们会拆分成很多个块来处理如果一个块一个块的处理大模型的处理时间会非常长如果解决这个问题呢我们使用Batch processing 来解决并发调用的问题。Batch Processing 要求输入必须是数组本例子中就是拆分完成的翻译块在 Input 中记得要把 Batch 环节中的变量设置为输入参数。https://github.com/OpenDocCN/dsai-notes-pt4-zh/raw/master/docs/agent-101/img/3b19fbdbfb60de1734e79ef212a6a50e.png使用反思改进流程来优化翻译效果翻译改进是本工作流最核心的部分我们以更复杂的 mutli chunks 过程来讲解。multichunk_initial_translation: 对多个文本块进行初步翻译。multichunk_reflect_on_translation: 对多个翻译块进行反思。multichunk_improve_translation: 改进多个翻译块。multichunk_translation: 整合多块翻译的整个过程。第一次翻译multichunk_initial_translation可以理解为第一次翻译我们采用的 prompt 如下You are an expert linguist, specializing in translation from {{source_lang}} to {{target_lang}}。 Your task is provide a professional translation from {{source_lang}} to {{target_lang}} of PART of a text. The source text is below, delimited by XML tags lt;SOURCE_TEXTgt; and lt;/SOURCE_TEXTgt;. Translate only the part within the lt;TRANSLATE_THISgt; and lt;/TRANSLATE_THISgt;. You can use the source text as context, but do not translate any of the other text. Do not output anything other than the translation of the indicated part of the text. lt;SOURCE_TEXTgt; {{source_text}} lt;/SOURCE_TEXTgt; To reiterate, you should translate only this part of the text, shown here between lt;TRANSLATE_THISgt; and lt;/TRANSLATE_THISgt;: lt;TRANSLATE_THISgt; {{chunk}} lt;/TRANSLATE_THISgt; Output only the translation of the portion you are asked to translate, and nothing else.这个 prompt 本身比较简单基本作用就是先进行一次翻译。反思multichunk_reflect_on_translation主要作用是对初步翻译进行反思和评价Prompt 如下You are an expert linguist, specializing in translation from {{source_lang}} to {{target_lang}}。 Your task is to carefully read a source text and part of a translation of that text from {{source_lang}} to {{target_lang}}, and then give constructive criticism and helpful suggestions for improving the translation. The source text is below, delimited by XML tags lt;SOURCE_TEXTgt; and lt;/SOURCE_TEXTgt;. You can use the source text as context for critiquing the translated part. lt;SOURCE_TEXTgt; {{source_text}} lt;/SOURCE_TEXTgt; To reiterate, only part of the text is being translated, shown here between lt;TRANSLATE_THISgt; and lt;/TRANSLATE_THISgt;: lt;TRANSLATE_THISgt; {{chunk}} lt;/TRANSLATE_THISgt; The translation of the indicated part, delimited below by lt;TRANSLATIONgt; and lt;/TRANSLATIONgt;, is as follows: lt;TRANSLATIONgt; {{translation1_chunk.chunk}} lt;/TRANSLATIONgt; When writing suggestions, pay attention to whether there are ways to improve the translation#x27;s: (i) accuracy (by correcting errors of addition, mistranslation, omission, or untranslated text), (ii) fluency (by applying {{target_lang}} grammar, spelling and punctuation rules, and ensuring there are no unnecessary repetitions), (iii) style (by ensuring the translations reflect the style of the source text and takes into account any cultural context), (iv) terminology (by ensuring terminology use is consistent and reflects the source text domain; and by only ensuring you use equivalent idioms {{target_lang}}). Write a list of specific, helpful and constructive suggestions for improving the translation. Each suggestion should address one specific part of the translation. Output only the suggestions and nothing else.这个 prompt 的意思就是对初步翻译提出优化建议并输出优化建议。改进multichunk_improve_translation我们有了第一次的翻译和第二次的改进建议第三步就是改进翻译prompt 如下Your task is to carefully read, then improve, a translation from {{source_lang}} to {{target_lang}}, taking into account a set of expert suggestions and constructive criticisms. Below, the source text, initial translation, and expert suggestions are provided. The source text is below, delimited by XML tags lt;SOURCE_TEXTgt; and lt;/SOURCE_TEXTgt; You can use the source text as context, but need to provide a translation only of the part indicated by lt;TRANSLATE_THISgt; and lt;/TRANSLATE_THISgt;. lt;SOURCE_TEXTgt; {{source_text}} lt;/SOURCE_TEXTgt; To reiterate, only part of the text is being translated, shown here again between lt;TRANSLATE_THISgt; and lt;/TRANSLATE_THISgt;: lt;TRANSLATE_THISgt; {{chunk}} lt;/TRANSLATE_THISgt; The translation of the indicated part, delimited below by lt;TRANSLATIONgt; and lt;/TRANSLATIONgt;, is as follows: lt;TRANSLATIONgt; {{translation1_chunk.chunk}} lt;/TRANSLATIONgt; The expert translations of the indicated part, delimited below by lt;EXPERT_SUGGESTIONSgt; and lt;/EXPERT_SUGGESTIONSgt;, is as follows: lt;EXPERT_SUGGESTIONSgt; {{reflection_chunk.chunk}} lt;/EXPERT_SUGGESTIONSgt; Taking into account the expert suggestions rewrite the translation to improve it, paying attention to whether there are ways to improve the translation#x27;s (i) accuracy (by correcting errors of addition, mistranslation, omission, or untranslated text), (ii) fluency (by applying {{target_lang}} grammar, spelling and punctuation rules and ensuring there are no unnecessary repetitions), \ (iii) style (by ensuring the translations reflect the style of the source text) (iv) terminology (inappropriate for context, inconsistent use), or (v) other errors. Output only the new translation of the indicated part and nothing else.这个 prompt 的意思是结合第一次翻译 以及 第二次的改进意见进行第二次翻译。最后合并多个翻译结果并返回这里我们采用一个 code 节点对多个翻译结果进行合并并输出。https://github.com/OpenDocCN/dsai-notes-pt4-zh/raw/master/docs/agent-101/img/b19a9d7b45f567d7728a852b10350080.png最后相应的 bot 和 workflow 代码我已经公开 你可以在这里查看完整的 Prompt 和 Workflow。 希望能对你有所帮助。加入 Agent101 Coze Teamhttps://www.coze.com/invite/VbogXxJTvUYU8wpxFoWh (需要加入 team 才能看到完整的 prompt 和 workflow)本 bot 地址https://www.coze.com/store/bot/7388361569362542608Agent101 — 5分钟抓取X/Twitter热点内容来源https://docs.feishu.cn/docx/PHowdHn6CosDYzxZbPfcSY2nnZdX/Twitter 是一个非常强大的信息平台提供了非常强大的搜索能力如何挖掘好这些信息的价值呢这个 Agent 来源于我之前发布的一条 tweet如何使用X/Twitter 的高级搜索。今天我们的 Tweet Hunter 就是来复现这个流程。相关 tweet: https://x.com/leeoxiang/status/1801875890726703529https://github.com/OpenDocCN/dsai-notes-pt4-zh/raw/master/docs/agent-101/img/493b932371b9d1fc1f4aa898b72118a5.png【你能学到什么】如何使用 twitter 高级搜索如何使用 twitter 搜索插件Tweet Hunter Agent 介绍Tweet Hunter 完成的工作是根据用户输入的内容解析出来关键词并根据这个关键词去做高级搜索返回该关键词下面最新的点赞数超过 50 的内容并通过大模型二次整理并返回出来。用到的 Prompt# Character You are a proficient Twitter Content Expert capable of leveraging bespoke tools based on user inputs. ## Skills ### Skill 1: Search content on Twitter - You#x27;re proficient at analyzing user#x27;s input, deciphering the key terms they#x27;re interested in searching. - You skillfully extract these keywords and employ them with the twitter_query functionality. ## Constraints - each tweet should Include the author of it, a brief description of the tweet, number of likes, time posted, and the link to the tweet. - should show the image if this tweet item inclue one. - Please translate the content into the same language as the user input.我们在Constraints 部分限制了返回中需要遵循的限制这个限制非常重要直接影响了输出的内容一条tweet需要包含用户名简单介绍喜欢数发布时间以及 tweet 的链接如果原始 tweet 中包含图片清尽可能显示出来并同时翻译为和用户输入一样的语言。Twitter Search workflow 介绍整个 workflow 包含两个关键节点query拼接节点 和 twitter 搜索节点。https://github.com/OpenDocCN/dsai-notes-pt4-zh/raw/master/docs/agent-101/img/9e8b857255fe3901c5eb9eec8c83b3e7.pngQuery 拼接节点Query 整理节点节点比较简单接受用户输入 query 并整理为 twitter 高级搜索需要的 query。async function main({ params }: Args): Promiselt;Outputgt; { const querys params.query const count params.count || 10 const query querys.join(#x27; OR #x27;) const str (${query}) min_faves:50 -filter:replies const ret { quot;queryquot;: str, quot;countquot;: count }; return ret; }这里需要说明多个关键词需要使用OR进行拼接比如查询 luma 和 lumaai 的 query 就是luma OR lumaai只选选取点赞超过 50 的内容 min_faves:50需要过滤掉评论类的内容 -filter:replies你可以在这里查看更多Twitter 高级搜索玩法并尝试。https://sites.google.com/view/twittercn/twitter-advanced-searchTwitter 搜索节点Coze 上提供了很多原本收费的 API其中 twitter plugin 就是一个twitter api 是非常贵的$100/月的订阅费挡住了很多开发者感谢 Coze 提供的 twitter plugin。https://github.com/OpenDocCN/dsai-notes-pt4-zh/raw/master/docs/agent-101/img/fb6cd7fe5ead7af84e29dff9387d31a7.png这里的用法很简单我们把Query 拼接节点输出的 query 给到Twitter搜索就可以了。运行起来的效果https://github.com/OpenDocCN/dsai-notes-pt4-zh/raw/master/docs/agent-101/img/f80172336469284e5dc4580d10a0be9f.png其他拓展玩法1、你可以订阅某些热点自动同步到飞书或者 notion 中2、订阅某个人的内容定期发送到邮件中。最后Tweet hunter 相应 workflow 代码我已经公开 你可以在这里查看完整的 Prompt 和 Workflow。 希望能对你有所帮助。加入 Agent101 Coze Teamhttps://www.coze.com/invite/VbogXxJTvUYU8wpxFoWh (需要加入 team 才能看到完整的 prompt 和 workflow)Tweet hunterhttps://www.coze.com/store/bot/7380746596973330448参考文章1、https://x.com/leeoxiang/status/18018758907267035292、https://sites.google.com/view/twittercn/twitter-advanced-searchAgent101 — 将YouTube视频转化为SEO友好的文章来源https://docs.feishu.cn/docx/A1zsda7vco5HZsxgh3fczgUZnKfYoutube 上已经存在大量的优质视频内容我们可以借助大模型的能力将这些视频变成优质的文章。本文以及相对应的 Workflow 只提供了一种实现的思路可以改造此工作流以适应自己的需求。我们把此工作流命名为 AI Article Writer – 将YouTube视频改写为SEO 友好的文章。体验地址如下https://www.coze.com/s/Zs8rQYarL/今天我们就以OpenAI 发布 GPT-4o 的视频为例看如何将该视频转化为一篇优质的文章视频地址如下 https://www.youtube.com/watch?vDQacCB9tDawhttps://github.com/OpenDocCN/dsai-notes-pt4-zh/raw/master/docs/agent-101/img/501a579925d35bd026f56183a7fc5a48.pngAI Article Writer 介绍AI Article Writer 这个工作流的核心工作流程是用户输入一个 youtube 上的视频我们通过 coze 的 youtube 插件获取 视频的标题、字幕、介绍、截图信息 根据标题和介绍生成SEO 优化过的标题和相关关键词并通过 google 搜索相关的关键词得到相关信息根据视频的字幕和搜索到的背景知识并进行文章的改写并发相关的截图插入到最终的文章中。核心流程如下用户输入用户输入要进行转写的视频。抓取视频的标题和介绍通过 youtube 插件分别得到视频的标题和介绍以及其他相关信息。生成标题和关键字根据视频的标题和介绍生成SEO优化的标题和相关关键字。Google搜索使用生成的标题和关键字进行Google搜索获取相关信息。生成文章根据视频的字幕和搜索来的文字生成文章大纲、内容并插入封面截图。具体的工作流如下https://github.com/OpenDocCN/dsai-notes-pt4-zh/raw/master/docs/agent-101/img/1b8e73e7bd2a7ea1dccfb4b5b64f407b.pngYoutube 视频信息抓取Coze 平台提供了获取 youtube 视频信息的 Plugin这里我们会使用 get_video_meta 和 get_caption 两个能力。https://github.com/OpenDocCN/dsai-notes-pt4-zh/raw/master/docs/agent-101/img/430863c5d37f41c0f686e2452832c67d.pnghttps://github.com/OpenDocCN/dsai-notes-pt4-zh/raw/master/docs/agent-101/img/3f587233879d8d09732fbfa0d83558ad.png生成标题和关键词我们使用了两个 LLM Plugin 来实现生成标题和关键词。https://github.com/OpenDocCN/dsai-notes-pt4-zh/raw/master/docs/agent-101/img/4876a4ee83ffdf982a9c658e305fbb6b.pngPrompt 1English: I am conducting research for an article about {{title}} and {{description}}, Could you please tell me which related and high-traffic phrase I should enter into Google to find this article? Just provide the phrase, without any special symbols such as quotation marks or colons. 中文 我正在为一篇关于{{title}}和{{description}}的文章进行研究请问应该在谷歌中输入哪个相关且流量高的短语来查找这篇文章请仅提供短语不包含引号或冒号等特殊符号。这个prompt 完成的工作就是根据 标题和描述来生成流量高的短语。Prompt2English: I need a Google search phrase to gather authoritative information for my article lt;lt; {{title}} {{text}}gt;gt; , Please provide a search phrase of five words or fewer to give me a good overview of the topic. Include any unfamiliar terms in the search query. 中文 我需要一个谷歌搜索短语以便为我的文章lt;lt; {{title}} {{text}}gt;gt;收集权威信息。请提供一个不超过五个词的搜索短语助我全面了解该主题并包含任何不熟悉的术语在查询中。这个 prompt 完成的工作就是继续根据上一个 prompt 给出的内容进行进一步分析给出多个适合 google 搜索的搜索短语。Google 搜索获取更多上下文根据上一步得到的搜索短语就可以用 google进行搜索了google 搜索插件的标准用法后面要跟一个 Code plugin 对搜索出来的内容进行格式化以便进行后续的使用。https://github.com/OpenDocCN/dsai-notes-pt4-zh/raw/master/docs/agent-101/img/3037b68a8023704f97e56a3b7aaa8976.png文章写作这里我们拿到了 google 搜索的内容和 从视频中获取的字幕就可以开始写长文章了。这里的 prompt 是用 claude 来帮助我写的最终出现的效果不错prompt 如下作为一位文章写作专家, 你的任务是根据提供的视频转录文本和从互联网收集的参考信息,撰写一篇SEO友好的文章。 其中转录文本通过lt;TRANSCRIPTgt; lt;/TRANSCRIPTgt;标签分隔参考信息通过lt;REFERENCEgt;lt;/REFERENCEgt;标签分隔。 转录文本如下 lt;TRANSCRIPTgt; {{caption}} lt;/TRANSCRIPTgt; 参考信息如下 lt;REFERENCEgt; {{retrieved}} lt;/REFERENCEgt; 请遵循以下指南: 仔细阅读提供的视频转录文本,提取关键信息和主题文章内容不要偏离转录文本。 分析从互联网收集的补充资料,找出与主题相关的重要观点和数据。 确定文章的主要关键词,并在文章中自然地使用这些关键词。 创建一个引人注目且包含主要关键词的标题。 文章内容请带上封面图,封面图地址{{thumb}}。 撰写一个简洁的元描述,概括文章内容并包含主要关键词。 使用清晰的标题结构(H1、H2、H3等),组织文章内容。 在正文中自然地融入长尾关键词。 确保文章内容丰富、信息量大,并为读者提供价值。 适当使用过渡词和短语,提高文章的可读性。 在文章中加入相关的内部和外部链接。 在文章末尾加入号召性用语(CTA)。 检查并优化文章的可读性得分。 你的回复必须使用用户偏好的语言。以下是用户的查询{{BOT_USER_INPUT}}。 注意只返回文章内容不要返回其他内容。 请根据这些指南,创作一篇既对搜索引擎友好又能吸引读者的高质量文章。最后这个 workflow 还比较简单可以拓展的玩法包括转写一篇已经存在的文章转写 B 站的长视频转写 抖音或者视频号上的视频内容可以尝试自己探索写期待你的成果。AI Article Writer 相应 workflow 代码我已经公开 你可以在这里查看完整的 Prompt 和 Workflow。 希望能对你有所帮助。加入 Agent101 Coze Teamhttps://www.coze.com/invite/VbogXxJTvUYU8wpxFoWh (需要加入 team 才能看到完整的 prompt 和 workflow)AI Article Writerhttps://www.coze.com/s/Zs8rQYarL/Agent101 开发coze.cn 扣子来源https://docs.feishu.cn/docx/DIDmd7sXFod0IoxDzV2c1aLfnwb通过coze构建一键生成抖音、小红书视频RPA自动化工具来源https://docs.feishu.cn/docx/PRwZdUfC1oMDV2xtrdRcbatmnKe该教程详细介绍了如何通过coze工作流构建一键生成图文类视频。效果演示https://github.com/OpenDocCN/dsai-notes-pt4-zh/raw/master/docs/agent-101/img/706628607c20337c9139f8e9c166486c.png小红书-工作流.mp4https://telegraph-image-djt.pages.dev/file/afe453234bf035d1bb77f.mp4工作流该工作流主要使用了以下节点大模型节点该节点主要是通过大模型节点输出文本内容并以JSON形式输出函数节点函数节点主要是对大模型的输出处理插件该节点的核心是调用构建的视频生成API对大模型输出的文本内容转换成视频服务https://github.com/OpenDocCN/dsai-notes-pt4-zh/raw/master/docs/agent-101/img/28e17bbd7d718ddeddad1611f119e5c3.png详细步骤前置条件视频生成服务是基于remotion构建的以下是remotion的相关资料和信息Remotion是一个开源框架允许开发者使用 React 组件来创建高质量的视频。它将 React 的声明式编程模型应用于视频制作使得程序员可以用编写网页的方式来制作复杂的动画和视频内容。此外运行remotion必须有Node 16及以上的环境才可以。https://github.com/OpenDocCN/dsai-notes-pt4-zh/raw/master/docs/agent-101/img/59153a83511f1dd1f25300bf8a64c19a.png文档步骤一构建remotion项目根据上文中分享的remotion相关文档使用命令行npx create-videolatest安装完成以后你本地文件会有以下类似的目录结构每个文件以及作用如下https://github.com/OpenDocCN/dsai-notes-pt4-zh/raw/master/docs/agent-101/img/1ee3025d2f2fa607fc6a8e273ddb5331.png然后在该目录下使用命令行 npm install 以及 npm start 完成安装和项目启动当然如果你本地还没有搭建具体环境只是想快速了解下remotion的魅力支持你可以通过官方提供的沙盒环境快速运行https://remotion-helloworld.vercel.app/?/HelloWorldhttps://github.com/OpenDocCN/dsai-notes-pt4-zh/raw/master/docs/agent-101/img/b21942d61a4ae0f92ae85417e88e2b74.png步骤二构建图文视频模板完成步骤一以后我们就可以进行构建我们想要的视频模板了构建视频模板之前首先需要构建模板组件此处我将展示并分享我构建的视频模板的代码我们所构建的组件代码必须都在src目录下你可以根据你要做的模板起名并创建目录文件下图为我创建的文件目录https://github.com/OpenDocCN/dsai-notes-pt4-zh/raw/master/docs/agent-101/img/efeee44965d973d584c7a8bc6d4907b0.png其中AudioFade.jsx 定义了背景音乐组件Subtitles.jsx 定义了字幕组件MyVideo.jsx 引用了 Audio 以及 Subtitles组件构成了主视频组件效果如下图所示https://github.com/OpenDocCN/dsai-notes-pt4-zh/raw/master/docs/agent-101/img/cc61c9d3c16ddac3e61af810f2dee99e.png以上实现代码我将上传至github地址在这里https://github.com/DangJin/remotion2Agent以上代码均为gpt生成我仅作了复制粘贴不信你看https://github.com/OpenDocCN/dsai-notes-pt4-zh/raw/master/docs/agent-101/img/04b497a315e652ce9225fea4afc34299.pngCleanShot 2024-07-30 at 00.04.32.mp4步骤三构建API服务完成视频模板创建并运行成功以后我们将通过express构建API具体代码逻辑如下https://github.com/OpenDocCN/dsai-notes-pt4-zh/raw/master/docs/agent-101/img/accc18a44afcd7b32a5a057e94f64be9.png步骤四部署此次部署采用了阿里云轻量应用服务器完成部署你只需要安装好Node相关环境代码上传至服务器并启动项目即可此处不做赘述如若代码部署问题可以留言给我步骤五构建text2video插件在编排工作流之前我们需要通过coze的插件能力如何创建插件此处不再赘述可以查看我之前的教程第1步定义元数据https://github.com/OpenDocCN/dsai-notes-pt4-zh/raw/master/docs/agent-101/img/0fbda09d2ce9bb404691b3ce6ce27184.png第2步删除插件默认生成的代码保留如下图所示https://github.com/OpenDocCN/dsai-notes-pt4-zh/raw/master/docs/agent-101/img/6d0bf3d0780203a6d4980b22dbbe839f.png第3步使用快捷键CommandI 唤起 AI 输入以下prompt让AI帮你生成代码prompt写一个post请求请求地址xxx.combody参数为{“text”:} ,待AI生成代码以后点击接受即可具体代码如下https://github.com/OpenDocCN/dsai-notes-pt4-zh/raw/master/docs/agent-101/img/584f352e8fc64ccaa27ef5230904a283.png步骤六编排工作流https://github.com/OpenDocCN/dsai-notes-pt4-zh/raw/master/docs/agent-101/img/1ed5bed5cd50b3cc33d05ef0340c0bdf.png步骤七最终效果展示https://github.com/OpenDocCN/dsai-notes-pt4-zh/raw/master/docs/agent-101/img/2b4c1de3549d4db929d4b2a334d2d5e9.png小红书-工作流.mp4其他项目代码https://github.com/DangJin/remotion2AgentRemotion 模板https://remotion-helloworld.vercel.app/?/HelloWorldRemotion Docshttps://www.remotion.dev/docs/扣子如何创建插件https://www.coze.cn/docs/guides/create_plugin加入Agent101 获取更多 Agent 开发知识https://github.com/OpenDocCN/dsai-notes-pt4-zh/raw/master/docs/agent-101/img/b551cc82ece13ad0a534381de0947ef7.pngAI自动生成小红书/Twitter 封面来源https://docs.feishu.cn/docx/GPzMdIcUHoNOMvxVRxdcTvh4n1cCooking效果如下 https://x.com/leeoxiang/status/1817232547358896331Agent101 开发dify来源https://docs.feishu.cn/docx/N3qvdNCPso4WOyxU9BVcoUBRnZb我们是谁?来源https://docs.feishu.cn/docx/Vo5mdoGlIoJ8uUxpIyocYhL7ngiLeo:Base北京10年音视频方向研发 产品经验关注 AI 增长关注 AI 出海我的经历腾讯2020-现在实时音视频研发 leader好未来2018-2020实时音视频技术负责人一起玩耍科技2014-2018手游直播平台创始人联系我Twitterhttps://x.com/leeoxiang邮箱leeoxianggmail.comWeChat 交流来源https://docs.feishu.cn/docx/RUuEdjEeAoA926xJSl6c4bjonQhWechat交流群https://github.com/OpenDocCN/dsai-notes-pt4-zh/raw/master/docs/agent-101/img/73ad239788105f3d2a41d83b4086a0d4.pngAgent101Agent101 项目说明来源https://docs.feishu.cn/docx/WFF9dCwg3oIOfkxlgGKcOnTnnAg项目说明欢迎来到Agent101.dev - 您的AI助手构建之旅的起点在这个快速发展的AI时代掌握创建和使用AI助手的技能已成为不可或缺的竞争优势。Agent101.dev诞生于一个简单的想法构建101个AI助手并与您分享每一步的过程。https://github.com/OpenDocCN/dsai-notes-pt4-zh/raw/master/docs/agent-101/img/cab59cff09675b7e69815ed13a824e0e.png您将获得什么101个精心设计的AI助手案例涵盖日常生活、工作效率、创意开发等多个领域。详细的步骤指南从构思到实现我将手把手带您完成每个AI助手的创建。丰富的技巧和最佳实践帮助您快速提升AI开发技能。