CreateSearchRequest class

Constructors

CreateSearchRequest({required String query, List<String>? documents = const [], String? file, int? maxRerank = 200, bool? returnMetadata = false, String? user})
Returns a new CreateSearchRequest instance.

Properties

documents List<String>?
Up to 200 documents to search over, provided as a list of strings. The maximum document length (in tokens) is 2034 minus the number of tokens in the query. You should specify either documents or a file, but not both.
getter/setter pair
file String?
The ID of an uploaded file that contains documents to search over. You should specify either documents or a file, but not both.
getter/setter pair
hashCode int
The hash code for this object.
no setteroverride
maxRerank int?
The maximum number of documents to be re-ranked and returned by search. This flag only takes effect when file is set.
getter/setter pair
query String
Query to search against the documents.
getter/setter pair
returnMetadata bool?
A special boolean flag for showing metadata. If set to true, each document entry in the returned JSON will contain a "metadata" field. This flag only takes effect when file is set.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
user String?
A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. Learn more.
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override

Static Methods

fromJson(dynamic value) CreateSearchRequest?
Returns a new CreateSearchRequest instance and imports its values from value if it's a Map, null otherwise.
listFromJson(dynamic json, {bool growable = false}) List<CreateSearchRequest>?
mapFromJson(dynamic json) Map<String, CreateSearchRequest>
mapListFromJson(dynamic json, {bool growable = false}) Map<String, List<CreateSearchRequest>>

Constants

requiredKeys → const Set<String>
The list of required keys that must be present in a JSON.