Assistant class

An assistant that can interact with users and use tools.

Assistants can use code interpreter, file search, and custom functions.

Example

final assistant = await client.assistants.create(
  CreateAssistantRequest(
    model: 'gpt-4o',
    name: 'Math Tutor',
    instructions: 'You are a helpful math tutor.',
  ),
);
Annotations
  • @immutable

Constructors

Assistant({required String id, required String object, required int createdAt, required String model, String? name, String? description, String? instructions, required List<AssistantTool> tools, ToolResources? toolResources, required Map<String, String> metadata, double? temperature, double? topP, ResponseFormat? responseFormat})
Creates an Assistant.
const
Assistant.fromJson(Map<String, dynamic> json)
Creates an Assistant from JSON.
factory

Properties

createdAt int
The Unix timestamp when the assistant was created.
final
createdAtDateTime DateTime
The creation time as a DateTime.
no setter
description String?
The description of the assistant.
final
hasCodeInterpreter bool
Whether the assistant has code interpreter enabled.
no setter
hasFileSearch bool
Whether the assistant has file search enabled.
no setter
hasFunctions bool
Whether the assistant has any function tools.
no setter
hashCode int
The hash code for this object.
no setteroverride
id String
The assistant identifier.
final
instructions String?
The system instructions for the assistant.
final
metadata Map<String, String>
Custom metadata for the assistant.
final
model String
The model the assistant uses.
final
name String?
The name of the assistant.
final
object String
The object type (always "assistant").
final
responseFormat ResponseFormat?
The response format.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
temperature double?
The sampling temperature.
final
toolResources ToolResources?
Resources available to the assistant's tools.
final
tools List<AssistantTool>
The tools enabled for the assistant.
final
topP double?
The nucleus sampling parameter.
final

Methods

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

Operators

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