YoutubeChannelSearchTool

我们仍在努力改进工具,因此未来可能会出现意外行为或变化。

描述

该工具旨在在特定YouTube频道的内容中执行语义搜索。利用RAG(检索增强生成)方法,它提供了相关的搜索结果,使其在提取信息或查找特定内容时非常宝贵,而无需手动筛选视频。它简化了YouTube频道内的搜索过程,适合研究人员、内容创作者和寻求特定信息或主题的观众。

安装

要使用YoutubeChannelSearchTool,必须安装crewai_tools包。在您的shell中执行以下命令进行安装:

pip install 'crewai[tools]'

示例

要开始使用YoutubeChannelSearchTool,请按照以下示例操作。 此示例演示了如何使用特定的YouTube频道句柄初始化工具,并在该频道的内容中进行搜索。

Code
from crewai_tools import YoutubeChannelSearchTool

# Initialize the tool to search within any Youtube channel's content the agent learns about during its execution
tool = YoutubeChannelSearchTool()

# OR

# Initialize the tool with a specific Youtube channel handle to target your search
tool = YoutubeChannelSearchTool(youtube_channel_handle='@exampleChannel')

参数

  • youtube_channel_handle : 一个必需的字符串,表示Youtube频道的句柄。此参数对于初始化工具以指定您要搜索的频道至关重要。该工具设计为仅在提供的频道句柄的内容中进行搜索。

自定义模型和嵌入

默认情况下,该工具使用OpenAI进行嵌入和摘要生成。要自定义模型,您可以使用如下配置字典:

Code
tool = YoutubeChannelSearchTool(
    config=dict(
        llm=dict(
            provider="ollama", # or google, openai, anthropic, llama2, ...
            config=dict(
                model="llama2",
                # temperature=0.5,
                # top_p=1,
                # stream=true,
            ),
        ),
        embedder=dict(
            provider="google", # or openai, ollama, ...
            config=dict(
                model="models/embedding-001",
                task_type="retrieval_document",
                # title="Embeddings",
            ),
        ),
    )
)

这个页面有帮助吗?