CreateAssistantRequest class abstract
Request object for the Create assistant endpoint.
- Available extensions
- Annotations
-
- @freezed
Constructors
-
CreateAssistantRequest({@_AssistantModelConverter.new() required AssistantModel model, @JsonKey.new(includeIfNull: false) String? name, @JsonKey.new(includeIfNull: false) String? description, @JsonKey.new(includeIfNull: false) String? instructions, @Default.new([]) List<
AssistantTools> tools, @JsonKey.new(name: 'tool_resources', includeIfNull: false) ToolResources? toolResources, @JsonKey.new(includeIfNull: false) Map<String, dynamic> ? metadata, @JsonKey.new(includeIfNull: false) @Default.new(1.0) double? temperature, @JsonKey.new(name: 'top_p', includeIfNull: false) @Default.new(1.0) double? topP, @_CreateAssistantRequestResponseFormatConverter.new() @JsonKey.new(name: 'response_format', includeIfNull: false) CreateAssistantRequestResponseFormat? responseFormat}) -
Factory constructor for CreateAssistantRequest
constfactory
-
CreateAssistantRequest.fromJson(Map<
String, dynamic> json) -
Object construction from a JSON representation
factory
Properties
-
copyWith
→ $CreateAssistantRequestCopyWith<
CreateAssistantRequest> -
Create a copy of CreateAssistantRequest
with the given fields replaced by the non-null parameter values.
no setterinherited
- description → String?
-
The description of the assistant. The maximum length is 512 characters.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- instructions → String?
-
The system instructions that the assistant uses. The maximum length is 256,000 characters.
no setterinherited
-
metadata
→ Map<
String, dynamic> ? -
Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional
information about the object in a structured format. Keys can be a maximum of 64 characters long and values
can be a maximum of 512 characters long.
no setterinherited
- model → AssistantModel
-
ID of the model to use. You can use the List models
API to see all of your available models, or see our Model overview for
descriptions of them.
no setterinherited
- name → String?
-
The name of the assistant. The maximum length is 256 characters.
no setterinherited
- responseFormat → CreateAssistantRequestResponseFormat?
-
Specifies the format that the model must output. Compatible with
GPT-4o,
GPT-4 Turbo, and all GPT-3.5 Turbo models
since
gpt-3.5-turbo-1106
.no setterinherited - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- temperature → double?
-
What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random,
while lower values like 0.2 will make it more focused and deterministic.
no setterinherited
- toolResources → ToolResources?
-
A set of resources that are made available to the assistant's tools in this thread. The resources are specific
to the type of tool. For example, the
code_interpreter
tool requires a list of file IDs, while thefile_search
tool requires a list of vector store IDs.no setterinherited -
tools
→ List<
AssistantTools> -
A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of
types
code_interpreter
,file_search
, orfunction
.no setterinherited - topP → double?
-
An alternative to sampling with temperature, called nucleus sampling, where the model considers the results
of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability
mass are considered.
no setterinherited
Methods
-
map<
TResult extends Object?> (TResult $default(_CreateAssistantRequest value)) → TResult -
Available on CreateAssistantRequest, provided by the CreateAssistantRequestPatterns extension
Aswitch
-like method, using callbacks. -
mapOrNull<
TResult extends Object?> (TResult? $default(_CreateAssistantRequest value)?) → TResult? -
Available on CreateAssistantRequest, provided by the CreateAssistantRequestPatterns extension
A variant ofmap
that fallback to returningnull
. -
maybeMap<
TResult extends Object?> (TResult $default(_CreateAssistantRequest value)?, {required TResult orElse()}) → TResult -
Available on CreateAssistantRequest, provided by the CreateAssistantRequestPatterns extension
A variant ofmap
that fallback to returningorElse
. -
maybeWhen<
TResult extends Object?> (TResult $default(AssistantModel model, String? name, String? description, String? instructions, List< AssistantTools> tools, ToolResources? toolResources, Map<String, dynamic> ? metadata, double? temperature, double? topP, CreateAssistantRequestResponseFormat? responseFormat)?, {required TResult orElse()}) → TResult -
Available on CreateAssistantRequest, provided by the CreateAssistantRequestPatterns extension
A variant ofwhen
that fallback to anorElse
callback. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
Serializes this CreateAssistantRequest to a JSON map.
inherited
-
toMap(
) → Map< String, dynamic> - Map representation of object (not serialized)
-
toString(
) → String -
A string representation of this object.
inherited
-
validateSchema(
) → String? - Perform validations on the schema property values
-
when<
TResult extends Object?> (TResult $default(AssistantModel model, String? name, String? description, String? instructions, List< AssistantTools> tools, ToolResources? toolResources, Map<String, dynamic> ? metadata, double? temperature, double? topP, CreateAssistantRequestResponseFormat? responseFormat)) → TResult -
Available on CreateAssistantRequest, provided by the CreateAssistantRequestPatterns extension
Aswitch
-like method, using callbacks. -
whenOrNull<
TResult extends Object?> (TResult? $default(AssistantModel model, String? name, String? description, String? instructions, List< AssistantTools> tools, ToolResources? toolResources, Map<String, dynamic> ? metadata, double? temperature, double? topP, CreateAssistantRequestResponseFormat? responseFormat)?) → TResult? -
Available on CreateAssistantRequest, provided by the CreateAssistantRequestPatterns extension
A variant ofwhen
that fallback to returningnull
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- descriptionMaxLengthValue → const int
- instructionsMaxLengthValue → const int
- nameMaxLengthValue → const int
- Validation constants
-
propertyNames
→ const List<
String> - List of all property names of schema
- temperatureDefaultValue → const double
- temperatureMaxValue → const double
- temperatureMinValue → const double
- topPDefaultValue → const double
- topPMaxValue → const double
- topPMinValue → const double