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.

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.