action openai_create_search { label: "The search endpoint computes similarity scores between provided query and documents. Documents can be passed directly to the API if there are no more than 200 of them.\n\nTo go beyond the 200 document limit, documents can be processed offline and then used for efficient retrieval at query time. When `file` is set, the search endpoint searches over all the documents in the given file and returns up to the `max_rerank` number of documents. These documents will be returned along with their search scores.\n\nThe similarity score is a positive score that usually ranges from 0 to 300 (but can sometimes go higher), where a score above 200 usually means the document is semantically similar to the query.\n" provider: openai method: POST path: "/engines/{engine_id}/search" encoding: json input: { type: "object" properties: { documents: { type: "array" description: "Up to 200 documents to search over, provided as a list of strings.\n\nThe maximum document length (in tokens) is 2034 minus the number of tokens in the query.\n\nYou should specify either `documents` or a `file`, but not both.\n" items: { type: "string" } } engine_id: { type: "string" } file: { type: "string" description: "The ID of an uploaded file that contains documents to search over.\n\nYou should specify either `documents` or a `file`, but not both.\n" } max_rerank: { type: "integer" description: "The maximum number of documents to be re-ranked and returned by search.\n\nThis flag only takes effect when `file` is set.\n" } query: { type: "string" description: "Query to search against the documents." } return_metadata: { type: "boolean" description: "A special boolean flag for showing metadata. If set to `true`, each document entry in the returned JSON will contain a \"metadata\" field.\n\nThis flag only takes effect when `file` is set.\n" } user: { type: "string" description: "A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices/end-user-ids).\n" } } required: ["engine_id", "query"] additionalProperties: false } output: { type: "object" properties: { data: { type: "array" items: { type: "object" properties: { document: { type: "integer" } object: { type: "string" } score: { type: "number" } } } } model: { type: "string" } object: { type: "string" } } } }