Skip to content

Commit 82379a2

Browse files
committed
models and moderations
1 parent db74b03 commit 82379a2

26 files changed

+2187
-46
lines changed

tests/Models/ModelsTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
namespace OpenAI.Tests.Models;
1212

13-
//[Parallelizable(ParallelScope.All)]
1413
[Category("Models")]
1514
public class ModelsTests : OpenAIRecordedTestBase
1615
{

tests/Moderations/ModerationsTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
namespace OpenAI.Tests.Moderations;
1010

11-
[Parallelizable(ParallelScope.All)]
1211
[Category("Moderations")]
1312
public class ModerationsTests : OpenAIRecordedTestBase
1413
{

tests/Realtime/RealtimeTestFixtureBase.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ namespace OpenAI.Tests.Realtime;
1313

1414
#pragma warning disable OPENAI002
1515

16-
[Parallelizable(ParallelScope.All)]
1716
[Category("Conversation")]
1817
public class RealtimeTestFixtureBase : OpenAIRecordedTestBase
1918
{

tests/Responses/ResponsesTests.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -495,11 +495,15 @@ public async Task FileInputFromIdWorks()
495495
OpenAIFileClient fileClient = GetProxiedOpenAIClient<OpenAIFileClient>(TestScenario.Files);
496496
string filePath = Path.Join("Assets", "files_travis_favorite_food.pdf");
497497

498-
OpenAIFile newFileToUse = await fileClient.UploadFileAsync(
498+
OpenAIFile newFileToUse;
499+
using (Recording.DisableRequestBodyRecording()) // Temp pending https://github.com/Azure/azure-sdk-tools/issues/11901
500+
{
501+
newFileToUse = await fileClient.UploadFileAsync(
499502
BinaryData.FromBytes(File.ReadAllBytes(filePath)),
500503
"test_favorite_foods.pdf",
501504
FileUploadPurpose.UserData);
502-
Validate(newFileToUse);
505+
Validate(newFileToUse);
506+
}
503507

504508
ResponseItem messageItem = ResponseItem.CreateUserMessageItem(
505509
[
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"Entries": [
3+
{
4+
"RequestUri": "https://api.openai.com/v1/models/fake_id",
5+
"RequestMethod": "DELETE",
6+
"RequestHeaders": {
7+
"Accept": "application/json",
8+
"Authorization": "Sanitized",
9+
"User-Agent": "OpenAI/2.4.0 (.NET 9.0.9; Microsoft Windows 10.0.26100)"
10+
},
11+
"RequestBody": null,
12+
"StatusCode": 404,
13+
"ResponseHeaders": {
14+
"Access-Control-Allow-Origin": "*",
15+
"Alt-Svc": "h3=\":443\"",
16+
"cf-cache-status": "DYNAMIC",
17+
"CF-RAY": "980438e6cf82ec7c-SEA",
18+
"Connection": "keep-alive",
19+
"Content-Length": "163",
20+
"Content-Type": "application/json",
21+
"Date": "Tue, 16 Sep 2025 23:42:47 GMT",
22+
"openai-organization": "Sanitized",
23+
"openai-processing-ms": "177",
24+
"openai-project": "Sanitized",
25+
"openai-version": "2020-10-01",
26+
"Server": "cloudflare",
27+
"Set-Cookie": [
28+
"Sanitized",
29+
"Sanitized"
30+
],
31+
"Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload",
32+
"X-Content-Type-Options": "nosniff",
33+
"x-envoy-upstream-service-time": "185",
34+
"x-openai-proxy-wasm": "v0.1",
35+
"X-Request-ID": "Sanitized"
36+
},
37+
"ResponseBody": {
38+
"error": {
39+
"message": "The model 'fake_id' does not exist",
40+
"type": "invalid_request_error",
41+
"param": "model",
42+
"code": "model_not_found"
43+
}
44+
}
45+
}
46+
],
47+
"Variables": {}
48+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"Entries": [
3+
{
4+
"RequestUri": "https://api.openai.com/v1/models/fake_id",
5+
"RequestMethod": "DELETE",
6+
"RequestHeaders": {
7+
"Accept": "application/json",
8+
"Authorization": "Sanitized",
9+
"User-Agent": "OpenAI/2.4.0 (.NET 9.0.9; Microsoft Windows 10.0.26100)"
10+
},
11+
"RequestBody": null,
12+
"StatusCode": 404,
13+
"ResponseHeaders": {
14+
"Access-Control-Allow-Origin": "*",
15+
"Alt-Svc": "h3=\":443\"",
16+
"cf-cache-status": "DYNAMIC",
17+
"CF-RAY": "980438f7481aec7c-SEA",
18+
"Connection": "keep-alive",
19+
"Content-Length": "163",
20+
"Content-Type": "application/json",
21+
"Date": "Tue, 16 Sep 2025 23:42:49 GMT",
22+
"openai-organization": "Sanitized",
23+
"openai-processing-ms": "93",
24+
"openai-project": "Sanitized",
25+
"openai-version": "2020-10-01",
26+
"Server": "cloudflare",
27+
"Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload",
28+
"X-Content-Type-Options": "nosniff",
29+
"x-envoy-upstream-service-time": "101",
30+
"x-openai-proxy-wasm": "v0.1",
31+
"X-Request-ID": "Sanitized"
32+
},
33+
"ResponseBody": {
34+
"error": {
35+
"message": "The model 'fake_id' does not exist",
36+
"type": "invalid_request_error",
37+
"param": "model",
38+
"code": "model_not_found"
39+
}
40+
}
41+
}
42+
],
43+
"Variables": {}
44+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"Entries": [
3+
{
4+
"RequestUri": "https://api.openai.com/v1/models/fake_id",
5+
"RequestMethod": "GET",
6+
"RequestHeaders": {
7+
"Accept": "application/json",
8+
"Authorization": "Sanitized",
9+
"User-Agent": "OpenAI/2.4.0 (.NET 9.0.9; Microsoft Windows 10.0.26100)"
10+
},
11+
"RequestBody": null,
12+
"StatusCode": 404,
13+
"ResponseHeaders": {
14+
"Alt-Svc": "h3=\":443\"",
15+
"cf-cache-status": "DYNAMIC",
16+
"CF-RAY": "980438e959ecec7c-SEA",
17+
"Connection": "keep-alive",
18+
"Content-Length": "162",
19+
"Content-Type": "application/json",
20+
"Date": "Tue, 16 Sep 2025 23:42:47 GMT",
21+
"openai-processing-ms": "615",
22+
"openai-version": "2020-10-01",
23+
"Server": "cloudflare",
24+
"Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload",
25+
"X-Content-Type-Options": "nosniff",
26+
"x-envoy-upstream-service-time": "619",
27+
"x-openai-proxy-wasm": "v0.1",
28+
"X-Request-ID": "Sanitized"
29+
},
30+
"ResponseBody": {
31+
"error": {
32+
"message": "The model 'fake_id' does not exist",
33+
"type": "invalid_request_error",
34+
"param": "model",
35+
"code": "model_not_found"
36+
}
37+
}
38+
}
39+
],
40+
"Variables": {}
41+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"Entries": [
3+
{
4+
"RequestUri": "https://api.openai.com/v1/models/fake_id",
5+
"RequestMethod": "GET",
6+
"RequestHeaders": {
7+
"Accept": "application/json",
8+
"Authorization": "Sanitized",
9+
"User-Agent": "OpenAI/2.4.0 (.NET 9.0.9; Microsoft Windows 10.0.26100)"
10+
},
11+
"RequestBody": null,
12+
"StatusCode": 404,
13+
"ResponseHeaders": {
14+
"Alt-Svc": "h3=\":443\"",
15+
"cf-cache-status": "DYNAMIC",
16+
"CF-RAY": "980438f8f9b7ec7c-SEA",
17+
"Connection": "keep-alive",
18+
"Content-Length": "162",
19+
"Content-Type": "application/json",
20+
"Date": "Tue, 16 Sep 2025 23:42:50 GMT",
21+
"openai-processing-ms": "516",
22+
"openai-version": "2020-10-01",
23+
"Server": "cloudflare",
24+
"Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload",
25+
"X-Content-Type-Options": "nosniff",
26+
"x-envoy-upstream-service-time": "520",
27+
"x-openai-proxy-wasm": "v0.1",
28+
"X-Request-ID": "Sanitized"
29+
},
30+
"ResponseBody": {
31+
"error": {
32+
"message": "The model 'fake_id' does not exist",
33+
"type": "invalid_request_error",
34+
"param": "model",
35+
"code": "model_not_found"
36+
}
37+
}
38+
}
39+
],
40+
"Variables": {}
41+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"Entries": [
3+
{
4+
"RequestUri": "https://api.openai.com/v1/models/gpt-4o-mini",
5+
"RequestMethod": "GET",
6+
"RequestHeaders": {
7+
"Accept": "application/json",
8+
"Authorization": "Sanitized",
9+
"User-Agent": "OpenAI/2.4.0 (.NET 9.0.9; Microsoft Windows 10.0.26100)"
10+
},
11+
"RequestBody": null,
12+
"StatusCode": 200,
13+
"ResponseHeaders": {
14+
"Alt-Svc": "h3=\":443\"",
15+
"cf-cache-status": "DYNAMIC",
16+
"CF-RAY": "980438ee4ea8ec7c-SEA",
17+
"Connection": "keep-alive",
18+
"Content-Length": "95",
19+
"Content-Type": "application/json",
20+
"Date": "Tue, 16 Sep 2025 23:42:48 GMT",
21+
"openai-processing-ms": "391",
22+
"openai-version": "2020-10-01",
23+
"Server": "cloudflare",
24+
"Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload",
25+
"X-Content-Type-Options": "nosniff",
26+
"x-envoy-upstream-service-time": "396",
27+
"x-openai-proxy-wasm": "v0.1",
28+
"X-Request-ID": "Sanitized"
29+
},
30+
"ResponseBody": {
31+
"id": "gpt-4o-mini",
32+
"object": "model",
33+
"created": 1721172741,
34+
"owned_by": "system"
35+
}
36+
}
37+
],
38+
"Variables": {}
39+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"Entries": [
3+
{
4+
"RequestUri": "https://api.openai.com/v1/models/gpt-4o-mini",
5+
"RequestMethod": "GET",
6+
"RequestHeaders": {
7+
"Accept": "application/json",
8+
"Authorization": "Sanitized",
9+
"User-Agent": "OpenAI/2.4.0 (.NET 9.0.9; Microsoft Windows 10.0.26100)"
10+
},
11+
"RequestBody": null,
12+
"StatusCode": 200,
13+
"ResponseHeaders": {
14+
"Alt-Svc": "h3=\":443\"",
15+
"cf-cache-status": "DYNAMIC",
16+
"CF-RAY": "980438fd1d95ec7c-SEA",
17+
"Connection": "keep-alive",
18+
"Content-Length": "95",
19+
"Content-Type": "application/json",
20+
"Date": "Tue, 16 Sep 2025 23:42:50 GMT",
21+
"openai-processing-ms": "199",
22+
"openai-version": "2020-10-01",
23+
"Server": "cloudflare",
24+
"Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload",
25+
"X-Content-Type-Options": "nosniff",
26+
"x-envoy-upstream-service-time": "201",
27+
"x-openai-proxy-wasm": "v0.1",
28+
"X-Request-ID": "Sanitized"
29+
},
30+
"ResponseBody": {
31+
"id": "gpt-4o-mini",
32+
"object": "model",
33+
"created": 1721172741,
34+
"owned_by": "system"
35+
}
36+
}
37+
],
38+
"Variables": {}
39+
}

0 commit comments

Comments
 (0)