Hi It is VMS
I am able to do file search with response api with below code after declaring the vector store id copied from vector store tab in Azure AI foundry
Sample code that worked with OpenAI version = 1.77
from openai import OpenAI
client = OpenAI(
api_key="<apikey>",
base_url="https://<youropeniresourcename>.openai.azure.com/openai/v1/",
default_query={"api-version": "preview"},
)
input=[{"role": "user", "content": "Summarize the uploaded file"}]
second_response = client.responses.create(
model="gpt-4o-mini",
input=input,
tools=[{
"type": "file_search",
"vector_store_ids": ["vs_8HEzmBLsCImwxe33m2rk7AYf"], #replace it with your vector store id
}]
)
for i in second_response.output:
if i.type == "message":
print(i.content[0].text)
Results
The uploaded document is a sample IEEE format paper titled "Distance Direction Extraction in Geospatial Text." Here are the main points:
- **Authors**: John Doe, Jane Smith
- **Abstract**: The paper introduces a method for extracting directional and distance information from geospatial expressions.
- **Introduction**: It highlights the importance of extracting expressions like '.14 Miles E' for spatial analysis in mapping datasets.
- **Methodology**: The focus is on identifying patterns where distance is followed by a directional abbreviation.
- **Results**: The model successfully extracted various geospatial expressions, such as .14 Miles E and .25 Miles W.
- **Conclusion**: The paper serves as a mock example to demonstrate how data can be formatted for training extraction models.
Please let us know if you it is a working solution for you.
Thank you.