File Search and Retrieval in OCI Generative AI
The built-in File Search Tool in OCI Generative AI enables models to retrieve relevant information from Vector Stores, supporting both semantic and keyword-based search across your uploaded files. This grounds responses in your custom data, extending the model's world knowledge for more precise, context-aware answers.
- Vector Stores: Create stores and add files through OCI File API (compatible with OpenAI Files API format):
API Set Description Files API Standard file management. Files within a Vector Store Files tied directly to stores. File Batches within a Vector Store Files for batch processing to add to stores. Files API with Containers API Containerized file handling. - Platform-hosted: No client-side execution needed and the API handles retrieval.
Example:
Example
Declare the tool in the tools array with type: "file_search" and specify vector_store_ids:
response = client.responses.create(
model="openai.gpt-oss-120b",
input="What are shapes of OCI GPU",
tools=[{
"type": "file_search",
"vector_store_ids": ["<vector_store_id>"]
}]
)
print(response)
Note
Hybrid search parameters aren't supported with the file search tool.