createSearchWithHttpInfo method

Future<Response> createSearchWithHttpInfo(
  1. String engineId,
  2. CreateSearchRequest createSearchRequest
)

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. To 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. The 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.

Note: This method returns the HTTP Response.

Parameters:

  • String engineId (required): The ID of the engine to use for this request. You can select one of ada, babbage, curie, or davinci.

  • CreateSearchRequest createSearchRequest (required):

Implementation

Future<Response> createSearchWithHttpInfo(String engineId, CreateSearchRequest createSearchRequest,) async {
  // ignore: prefer_const_declarations
  final path = r'/engines/{engine_id}/search'
    .replaceAll('{engine_id}', engineId);

  // ignore: prefer_final_locals
  Object? postBody = createSearchRequest;

  final queryParams = <QueryParam>[];
  final headerParams = <String, String>{};
  final formParams = <String, String>{};

  const contentTypes = <String>['application/json'];


  return apiClient.invokeAPI(
    path,
    'POST',
    queryParams,
    postBody,
    headerParams,
    formParams,
    contentTypes.isEmpty ? null : contentTypes.first,
  );
}