Skip to content

Commit 2b83621

Browse files
committed
Merge branch 'main' of https://github.com/openai/openai-dotnet into shreja/AddJsonPath
2 parents a1132b6 + ef7ffba commit 2b83621

21 files changed

+55
-120
lines changed

api/OpenAI.net8.0.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5478,18 +5478,14 @@ public class OpenAIResponseClient {
54785478
public virtual ClientResult<ResponseDeletionResult> DeleteResponse(string responseId, CancellationToken cancellationToken = default);
54795479
public virtual Task<ClientResult> DeleteResponseAsync(string responseId, RequestOptions options);
54805480
public virtual Task<ClientResult<ResponseDeletionResult>> DeleteResponseAsync(string responseId, CancellationToken cancellationToken = default);
5481-
public virtual CollectionResult<ResponseItem> GetInputItems(string responseId, ResponseItemCollectionOptions options = null, CancellationToken cancellationToken = default);
5482-
public virtual CollectionResult GetInputItems(string responseId, int? limit, string order, string after, string before, RequestOptions options);
5483-
public virtual AsyncCollectionResult<ResponseItem> GetInputItemsAsync(string responseId, ResponseItemCollectionOptions options = null, CancellationToken cancellationToken = default);
5484-
public virtual AsyncCollectionResult GetInputItemsAsync(string responseId, int? limit, string order, string after, string before, RequestOptions options);
54855481
public virtual ClientResult GetResponse(string responseId, bool? stream, int? startingAfter, RequestOptions options);
54865482
public virtual ClientResult<OpenAIResponse> GetResponse(string responseId, CancellationToken cancellationToken = default);
54875483
public virtual Task<ClientResult> GetResponseAsync(string responseId, bool? stream, int? startingAfter, RequestOptions options);
54885484
public virtual Task<ClientResult<OpenAIResponse>> GetResponseAsync(string responseId, CancellationToken cancellationToken = default);
54895485
public virtual CollectionResult<ResponseItem> GetResponseInputItems(string responseId, ResponseItemCollectionOptions options = null, CancellationToken cancellationToken = default);
5490-
public virtual CollectionResult GetResponseInputItems(string responseId, int? limit, string order, string after, string before, RequestOptions options = null);
5486+
public virtual CollectionResult GetResponseInputItems(string responseId, int? limit, string order, string after, string before, RequestOptions options);
54915487
public virtual AsyncCollectionResult<ResponseItem> GetResponseInputItemsAsync(string responseId, ResponseItemCollectionOptions options = null, CancellationToken cancellationToken = default);
5492-
public virtual AsyncCollectionResult GetResponseInputItemsAsync(string responseId, int? limit, string order, string after, string before, RequestOptions options = null);
5488+
public virtual AsyncCollectionResult GetResponseInputItemsAsync(string responseId, int? limit, string order, string after, string before, RequestOptions options);
54935489
public virtual CollectionResult<StreamingResponseUpdate> GetResponseStreaming(string responseId, int? startingAfter = null, CancellationToken cancellationToken = default);
54945490
public virtual AsyncCollectionResult<StreamingResponseUpdate> GetResponseStreamingAsync(string responseId, int? startingAfter = null, CancellationToken cancellationToken = default);
54955491
}

api/OpenAI.netstandard2.0.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4801,18 +4801,14 @@ public class OpenAIResponseClient {
48014801
public virtual ClientResult<ResponseDeletionResult> DeleteResponse(string responseId, CancellationToken cancellationToken = default);
48024802
public virtual Task<ClientResult> DeleteResponseAsync(string responseId, RequestOptions options);
48034803
public virtual Task<ClientResult<ResponseDeletionResult>> DeleteResponseAsync(string responseId, CancellationToken cancellationToken = default);
4804-
public virtual CollectionResult<ResponseItem> GetInputItems(string responseId, ResponseItemCollectionOptions options = null, CancellationToken cancellationToken = default);
4805-
public virtual CollectionResult GetInputItems(string responseId, int? limit, string order, string after, string before, RequestOptions options);
4806-
public virtual AsyncCollectionResult<ResponseItem> GetInputItemsAsync(string responseId, ResponseItemCollectionOptions options = null, CancellationToken cancellationToken = default);
4807-
public virtual AsyncCollectionResult GetInputItemsAsync(string responseId, int? limit, string order, string after, string before, RequestOptions options);
48084804
public virtual ClientResult GetResponse(string responseId, bool? stream, int? startingAfter, RequestOptions options);
48094805
public virtual ClientResult<OpenAIResponse> GetResponse(string responseId, CancellationToken cancellationToken = default);
48104806
public virtual Task<ClientResult> GetResponseAsync(string responseId, bool? stream, int? startingAfter, RequestOptions options);
48114807
public virtual Task<ClientResult<OpenAIResponse>> GetResponseAsync(string responseId, CancellationToken cancellationToken = default);
48124808
public virtual CollectionResult<ResponseItem> GetResponseInputItems(string responseId, ResponseItemCollectionOptions options = null, CancellationToken cancellationToken = default);
4813-
public virtual CollectionResult GetResponseInputItems(string responseId, int? limit, string order, string after, string before, RequestOptions options = null);
4809+
public virtual CollectionResult GetResponseInputItems(string responseId, int? limit, string order, string after, string before, RequestOptions options);
48144810
public virtual AsyncCollectionResult<ResponseItem> GetResponseInputItemsAsync(string responseId, ResponseItemCollectionOptions options = null, CancellationToken cancellationToken = default);
4815-
public virtual AsyncCollectionResult GetResponseInputItemsAsync(string responseId, int? limit, string order, string after, string before, RequestOptions options = null);
4811+
public virtual AsyncCollectionResult GetResponseInputItemsAsync(string responseId, int? limit, string order, string after, string before, RequestOptions options);
48164812
public virtual CollectionResult<StreamingResponseUpdate> GetResponseStreaming(string responseId, int? startingAfter = null, CancellationToken cancellationToken = default);
48174813
public virtual AsyncCollectionResult<StreamingResponseUpdate> GetResponseStreamingAsync(string responseId, int? startingAfter = null, CancellationToken cancellationToken = default);
48184814
}

codegen/generator/src/OpenAI.Library.Plugin.csproj

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="Microsoft.TypeSpec.Generator.ClientModel" Version="1.0.0-alpha.20251001.2" />
11+
<PackageReference Include="Microsoft.TypeSpec.Generator.ClientModel" Version="1.0.0-alpha.20251002.1" />
1212
</ItemGroup>
1313

1414
<!-- Copy output to package dist path for local execution and -->
@@ -22,8 +22,3 @@
2222
</Target>
2323

2424
</Project>
25-
26-
27-
28-
29-

codegen/generator/src/Visitors/PaginationVisitor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,11 @@ public class PaginationVisitor : ScmLibraryVisitor
8888
("ContainerFileResource", "ContainerFileCollectionOptions", _paginationParamsToReplace)
8989
},
9090
{
91-
"GetInputItems",
91+
"GetResponseInputItems",
9292
("ResponseItem", "ResponseItemCollectionOptions", _paginationParamsToReplace)
9393
},
9494
{
95-
"GetInputItemsAsync",
95+
"GetResponseInputItemsAsync",
9696
("ResponseItem", "ResponseItemCollectionOptions", _paginationParamsToReplace)
9797
},
9898
{

codegen/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"dependencies": {
3131
"@open-ai/plugin": "file:",
3232
"@azure-tools/typespec-client-generator-core": "0.60.0",
33-
"@typespec/http-client-csharp": "1.0.0-alpha.20251001.2",
33+
"@typespec/http-client-csharp": "1.0.0-alpha.20251002.1",
3434
"@typespec/http": "1.4.0",
3535
"@typespec/openapi": "1.4.0"
3636
},

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/Submit-GeneratorUpdatePr.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ try {
176176
if (Test-Path $openAiCsprojPath) {
177177
$openAiCsproj = Get-Content $openAiCsprojPath -Raw
178178
$openAiCsproj = $openAiCsproj -replace '(<PackageReference Include="Microsoft\.TypeSpec\.Generator\.ClientModel" Version=")[^"]*(")', "`${1}$PackageVersion`${2}"
179-
Set-Content -Path $openAiCsprojPath -Value $openAiCsproj
179+
Set-Content -Path $openAiCsprojPath -Value $openAiCsproj -NoNewline
180180
Write-Log "Updated OpenAI csproj: $openAiCsprojPath"
181181
} else {
182182
Write-Warning-Log "OpenAI csproj not found at: $openAiCsprojPath"

specification/client/responses.client.tsp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ using TypeSpec.HttpClient.CSharp;
7171

7272
@@clientName(MCPToolFilter.read_only, "IsReadOnly");
7373

74+
@@clientName(Responses.listInputItems, "GetResponseInputItems");
75+
7476
// ------------ Streaming ------------
7577

7678
@@alternateType(ResponseFunctionCallArgumentsDoneEvent.arguments, unknown);

src/Custom/Responses/OpenAIResponseClient.Protocol.cs

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -32,30 +32,4 @@ public virtual ClientResult GetResponse(string responseId, bool? stream, int? st
3232
PipelineResponse protocolResponse = Pipeline.ProcessMessage(message, options);
3333
return ClientResult.FromResponse(protocolResponse);
3434
}
35-
36-
public virtual AsyncCollectionResult GetResponseInputItemsAsync(
37-
string responseId,
38-
int? limit,
39-
string order,
40-
string after,
41-
string before,
42-
RequestOptions options = null)
43-
{
44-
Argument.AssertNotNull(responseId, nameof(responseId));
45-
46-
return new AsyncResponseItemCollectionResult(this, responseId, limit, order, after, before, options);
47-
}
48-
49-
public virtual CollectionResult GetResponseInputItems(
50-
string responseId,
51-
int? limit,
52-
string order,
53-
string after,
54-
string before,
55-
RequestOptions options = null)
56-
{
57-
Argument.AssertNotNull(responseId, nameof(responseId));
58-
59-
return new ResponseItemCollectionResult(this, responseId, limit, order, after, before, options);
60-
}
6135
}

src/Custom/Responses/OpenAIResponseClient.cs

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -266,34 +266,6 @@ public virtual CollectionResult<StreamingResponseUpdate> GetResponseStreaming(st
266266
cancellationToken);
267267
}
268268

269-
public virtual AsyncCollectionResult<ResponseItem> GetResponseInputItemsAsync(string responseId, ResponseItemCollectionOptions options = default, CancellationToken cancellationToken = default)
270-
{
271-
Argument.AssertNotNullOrEmpty(responseId, nameof(responseId));
272-
273-
AsyncCollectionResult result = GetResponseInputItemsAsync(responseId, options?.PageSizeLimit, options?.Order?.ToString(), options?.AfterId, options?.BeforeId, cancellationToken.ToRequestOptions());
274-
275-
if (result is not AsyncCollectionResult<ResponseItem> responsesItemCollection)
276-
{
277-
throw new InvalidOperationException("Failed to cast protocol return type to expected collection type 'AsyncCollectionResult<ResponsesItem>'.");
278-
}
279-
280-
return responsesItemCollection;
281-
}
282-
283-
public virtual CollectionResult<ResponseItem> GetResponseInputItems(string responseId, ResponseItemCollectionOptions options = default, CancellationToken cancellationToken = default)
284-
{
285-
Argument.AssertNotNullOrEmpty(responseId, nameof(responseId));
286-
287-
CollectionResult result = GetResponseInputItems(responseId, options?.PageSizeLimit, options?.Order?.ToString(), options?.AfterId, options?.BeforeId, cancellationToken.ToRequestOptions());
288-
289-
if (result is not CollectionResult<ResponseItem> responsesItemCollection)
290-
{
291-
throw new InvalidOperationException("Failed to cast protocol return type to expected collection type 'CollectionResult<ResponsesItem>'.");
292-
}
293-
294-
return responsesItemCollection;
295-
}
296-
297269
public virtual async Task<ClientResult<ResponseDeletionResult>> DeleteResponseAsync(string responseId, CancellationToken cancellationToken = default)
298270
{
299271
Argument.AssertNotNullOrEmpty(responseId, nameof(responseId));

0 commit comments

Comments
 (0)