deleteAssistant method

Future<void> deleteAssistant(
  1. String assistantId
)

Deletes an assistant by its ID.

assistantId is the unique identifier of the assistant to delete.

Returns void on successful deletion. Throws LangGraphApiException if the assistant is not found or the request fails.

Implementation

Future<void> deleteAssistant(String assistantId) async {
  try {
    final response = await client.delete(
      Uri.parse('$baseUrl/assistants/$assistantId'),
      headers: headers,
    );

    if (response.statusCode != 200) {
      throw LangGraphApiException(
        'Failed to delete assistant',
        response.statusCode,
      );
    }
  } catch (e) {
    if (e is LangGraphApiException) rethrow;
    throw LangGraphApiException('Failed to delete assistant: $e');
  }
}