Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit bb305b0

Browse filesBrowse files
ThorbJThorb JiangiBotPeaches
authored
fix: Add compatibility for Aliyun compatibility layer for Files (#530)
* Add compatibility for aliyun LLM APIs * test: add test to confirm status_details missing --------- Co-authored-by: Thorb Jiang <thorb@mathunion.xyz> Co-authored-by: Connor Tumbleson <connor@sourcetoad.com>
1 parent a1fe444 commit bb305b0
Copy full SHA for bb305b0

File tree

Expand file treeCollapse file tree

4 files changed

+14
-3
lines changed
Filter options
Expand file treeCollapse file tree

4 files changed

+14
-3
lines changed

‎src/Responses/Files/CreateResponse.php

Copy file name to clipboardExpand all lines: src/Responses/Files/CreateResponse.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public static function from(array $attributes, MetaInformation $meta): self
5454
$attributes['filename'],
5555
$attributes['purpose'],
5656
$attributes['status'],
57-
$attributes['status_details'],
57+
$attributes['status_details'] ?? null,
5858
$meta,
5959
);
6060
}

‎src/Responses/Files/RetrieveResponse.php

Copy file name to clipboardExpand all lines: src/Responses/Files/RetrieveResponse.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public static function from(array $attributes, MetaInformation $meta): self
5454
$attributes['filename'],
5555
$attributes['purpose'],
5656
$attributes['status'],
57-
$attributes['status_details'],
57+
$attributes['status_details'] ?? null,
5858
$meta,
5959
);
6060
}

‎src/Responses/FineTunes/RetrieveResponseFile.php

Copy file name to clipboardExpand all lines: src/Responses/FineTunes/RetrieveResponseFile.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public static function from(array $attributes): self
4646
$attributes['filename'],
4747
$attributes['purpose'],
4848
$attributes['status'],
49-
$attributes['status_details'],
49+
$attributes['status_details'] ?? null,
5050
);
5151
}
5252

‎tests/Responses/Files/RetrieveResponse.php

Copy file name to clipboardExpand all lines: tests/Responses/Files/RetrieveResponse.php
+11Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,17 @@
5050
->meta()->toBeInstanceOf(MetaInformation::class);
5151
});
5252

53+
test('from with status_details missing', function () {
54+
$data = fileResource();
55+
unset($data['status_details']);
56+
57+
$result = RetrieveResponse::from($data, meta());
58+
59+
expect($result)
60+
->toBeInstanceOf(RetrieveResponse::class)
61+
->statusDetails->toBeNull();
62+
});
63+
5364
test('as array accessible', function () {
5465
$result = RetrieveResponse::from(fileResource(), meta());
5566

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.