谷歌推出 File Search Tool 文件搜索系统 ,集成至 Gemini API
谷歌宣布在Gemini API中推出File Search Tool(文件搜索系统)。这是一个完全托管的检索增强生成(RAG)解决方案,旨在为开发者提供一个简单、集成且可扩展的方式,使用自己的数据来“锚定”Gemini模型。 通过该工具,开发者可以上传文件,系统会自动进行分块、索引和检索,从而让Gemini模型能够基于用户提供的私有文件内容生成更准确、更具上下文的回复。 使用示例 from google import genai from google.genai import types client = genai.Client() store = client.file_search_stores.create() upload_op = client.file_search_stores.upload_to_file_search_store( file_search_store_name=store.name, file='path/to/your/document.pdf' ) while not upload_op.done: time....
