Skip to content

Commit

Permalink
fix: RunStepDetailsToolCalls deserialization in Assistants API v2 (#404)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmigloz committed May 9, 2024
1 parent 8e8df6c commit d76c6ab
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 110 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ sealed class RunStepDeltaStepDetailsToolCalls
@JsonKey(includeIfNull: false) String? id,

/// The type of tool call. This is always going to be `file_search` for this type of tool call.
required RunStepDeltaStepDetailsToolCallsFileSearchObjectType type,
required String type,

/// For now, this is always going to be an empty object.
@JsonKey(name: 'file_search') required Map<String, dynamic> fileSearch,
Expand Down Expand Up @@ -79,16 +79,6 @@ sealed class RunStepDeltaStepDetailsToolCalls
_$RunStepDeltaStepDetailsToolCallsFromJson(json);
}

// ==========================================
// ENUM: RunStepDeltaStepDetailsToolCallsFileSearchObjectType
// ==========================================

/// The type of tool call. This is always going to be `file_search` for this type of tool call.
enum RunStepDeltaStepDetailsToolCallsFileSearchObjectType {
@JsonValue('file_search')
fileSearch,
}

// ==========================================
// CLASS: RunStepDeltaStepDetailsToolCallsFunction
// ==========================================
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ sealed class RunStepDetailsToolCalls with _$RunStepDetailsToolCalls {
required String id,

/// The type of tool call. This is always going to be `file_search` for this type of tool call.
required RunStepDetailsToolCallsFileSearchObjectType type,
required String type,

/// For now, this is always going to be an empty object.
@JsonKey(name: 'file_search') required Map<String, dynamic> fileSearch,
Expand All @@ -67,16 +67,6 @@ sealed class RunStepDetailsToolCalls with _$RunStepDetailsToolCalls {
_$RunStepDetailsToolCallsFromJson(json);
}

// ==========================================
// ENUM: RunStepDetailsToolCallsFileSearchObjectType
// ==========================================

/// The type of tool call. This is always going to be `file_search` for this type of tool call.
enum RunStepDetailsToolCallsFileSearchObjectType {
@JsonValue('file_search')
fileSearch,
}

// ==========================================
// CLASS: RunStepDetailsToolCallsFunction
// ==========================================
Expand Down

0 comments on commit d76c6ab

Please sign in to comment.