You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何使用自定义端点配置crewAI的PDFSearchTool?

解决PDFSearchTool Azure OpenAI配置的SchemaError问题

错误原因是PDFSearchTool的LLM配置schema不识别azure_endpoint这个键,Azure OpenAI的端点配置需要使用工具schema认可的字段名,通常为endpoint。

修正后的代码如下:

pdf_tool = PDFSearchTool(
    config=dict(
        llm=dict(
            provider="azure_openai",
            config=dict(
                model=os.getenv("AZURE_OPENAI_DEPLOYMENT_NAME"),
                api_key=os.getenv("AZURE_OPENAI_API_KEY"),
                endpoint=os.getenv("AZURE_OPENAI_ENDPOINT"),
                temperature=0.0,
            ),
        ),
    ),
    pdf=document
)

若替换后仍有报错,可确认PDFSearchTool的配置schema中Azure OpenAI对应的端点字段名,部分工具可能使用base_url作为替代字段。

内容的提问来源于stack exchange,提问作者Bernd Prager

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.20 03:02:04