Search vector store
vector_stores.search(vector_store_id, **kwargs) -> Page<VectorStoreSearchResponse { attributes, content, file_id, 2 more } >
POST/vector_stores/{vector_store_id}/search
Search a vector store for relevant chunks based on a query and file attributes filter.
Parameters
vector_store_id: String
max_num_results: Integer
The maximum number of results to return. This number should be between 1 and 50 inclusive.
minimum1
maximum50
rewrite_query: bool
Whether to rewrite the natural language query for vector search.
Returns
Search vector store
require "openai"
openai = OpenAI::Client.new(api_key: "My API Key")
page = openai.vector_stores.search("vs_abc123", query: "string")
puts(page){
"data": [
{
"attributes": {
"foo": "string"
},
"content": [
{
"text": "text",
"type": "text"
}
],
"file_id": "file_id",
"filename": "filename",
"score": 0
}
],
"has_more": true,
"next_page": "next_page",
"object": "vector_store.search_results.page",
"search_query": [
"string"
]
}Returns Examples
{
"data": [
{
"attributes": {
"foo": "string"
},
"content": [
{
"text": "text",
"type": "text"
}
],
"file_id": "file_id",
"filename": "filename",
"score": 0
}
],
"has_more": true,
"next_page": "next_page",
"object": "vector_store.search_results.page",
"search_query": [
"string"
]
}