Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions api/OpenAI.net8.0.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5330,18 +5330,14 @@ public class OpenAIResponseClient {
public virtual ClientResult<ResponseDeletionResult> DeleteResponse(string responseId, CancellationToken cancellationToken = default);
public virtual Task<ClientResult> DeleteResponseAsync(string responseId, RequestOptions options);
public virtual Task<ClientResult<ResponseDeletionResult>> DeleteResponseAsync(string responseId, CancellationToken cancellationToken = default);
public virtual CollectionResult<ResponseItem> GetInputItems(string responseId, ResponseItemCollectionOptions options = null, CancellationToken cancellationToken = default);
public virtual CollectionResult GetInputItems(string responseId, int? limit, string order, string after, string before, RequestOptions options);
public virtual AsyncCollectionResult<ResponseItem> GetInputItemsAsync(string responseId, ResponseItemCollectionOptions options = null, CancellationToken cancellationToken = default);
public virtual AsyncCollectionResult GetInputItemsAsync(string responseId, int? limit, string order, string after, string before, RequestOptions options);
public virtual ClientResult GetResponse(string responseId, bool? stream, int? startingAfter, RequestOptions options);
public virtual ClientResult<OpenAIResponse> GetResponse(string responseId, CancellationToken cancellationToken = default);
public virtual Task<ClientResult> GetResponseAsync(string responseId, bool? stream, int? startingAfter, RequestOptions options);
public virtual Task<ClientResult<OpenAIResponse>> GetResponseAsync(string responseId, CancellationToken cancellationToken = default);
public virtual CollectionResult<ResponseItem> GetResponseInputItems(string responseId, ResponseItemCollectionOptions options = null, CancellationToken cancellationToken = default);
public virtual CollectionResult GetResponseInputItems(string responseId, int? limit, string order, string after, string before, RequestOptions options = null);
public virtual CollectionResult GetResponseInputItems(string responseId, int? limit, string order, string after, string before, RequestOptions options);
public virtual AsyncCollectionResult<ResponseItem> GetResponseInputItemsAsync(string responseId, ResponseItemCollectionOptions options = null, CancellationToken cancellationToken = default);
public virtual AsyncCollectionResult GetResponseInputItemsAsync(string responseId, int? limit, string order, string after, string before, RequestOptions options = null);
public virtual AsyncCollectionResult GetResponseInputItemsAsync(string responseId, int? limit, string order, string after, string before, RequestOptions options);
public virtual CollectionResult<StreamingResponseUpdate> GetResponseStreaming(string responseId, int? startingAfter = null, CancellationToken cancellationToken = default);
public virtual AsyncCollectionResult<StreamingResponseUpdate> GetResponseStreamingAsync(string responseId, int? startingAfter = null, CancellationToken cancellationToken = default);
}
Expand Down
8 changes: 2 additions & 6 deletions api/OpenAI.netstandard2.0.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4702,18 +4702,14 @@ public class OpenAIResponseClient {
public virtual ClientResult<ResponseDeletionResult> DeleteResponse(string responseId, CancellationToken cancellationToken = default);
public virtual Task<ClientResult> DeleteResponseAsync(string responseId, RequestOptions options);
public virtual Task<ClientResult<ResponseDeletionResult>> DeleteResponseAsync(string responseId, CancellationToken cancellationToken = default);
public virtual CollectionResult<ResponseItem> GetInputItems(string responseId, ResponseItemCollectionOptions options = null, CancellationToken cancellationToken = default);
public virtual CollectionResult GetInputItems(string responseId, int? limit, string order, string after, string before, RequestOptions options);
public virtual AsyncCollectionResult<ResponseItem> GetInputItemsAsync(string responseId, ResponseItemCollectionOptions options = null, CancellationToken cancellationToken = default);
public virtual AsyncCollectionResult GetInputItemsAsync(string responseId, int? limit, string order, string after, string before, RequestOptions options);
public virtual ClientResult GetResponse(string responseId, bool? stream, int? startingAfter, RequestOptions options);
public virtual ClientResult<OpenAIResponse> GetResponse(string responseId, CancellationToken cancellationToken = default);
public virtual Task<ClientResult> GetResponseAsync(string responseId, bool? stream, int? startingAfter, RequestOptions options);
public virtual Task<ClientResult<OpenAIResponse>> GetResponseAsync(string responseId, CancellationToken cancellationToken = default);
public virtual CollectionResult<ResponseItem> GetResponseInputItems(string responseId, ResponseItemCollectionOptions options = null, CancellationToken cancellationToken = default);
public virtual CollectionResult GetResponseInputItems(string responseId, int? limit, string order, string after, string before, RequestOptions options = null);
public virtual CollectionResult GetResponseInputItems(string responseId, int? limit, string order, string after, string before, RequestOptions options);
public virtual AsyncCollectionResult<ResponseItem> GetResponseInputItemsAsync(string responseId, ResponseItemCollectionOptions options = null, CancellationToken cancellationToken = default);
public virtual AsyncCollectionResult GetResponseInputItemsAsync(string responseId, int? limit, string order, string after, string before, RequestOptions options = null);
public virtual AsyncCollectionResult GetResponseInputItemsAsync(string responseId, int? limit, string order, string after, string before, RequestOptions options);
public virtual CollectionResult<StreamingResponseUpdate> GetResponseStreaming(string responseId, int? startingAfter = null, CancellationToken cancellationToken = default);
public virtual AsyncCollectionResult<StreamingResponseUpdate> GetResponseStreamingAsync(string responseId, int? startingAfter = null, CancellationToken cancellationToken = default);
}
Expand Down
4 changes: 2 additions & 2 deletions codegen/generator/src/Visitors/PaginationVisitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ public class PaginationVisitor : ScmLibraryVisitor
("ContainerFileResource", "ContainerFileCollectionOptions", _paginationParamsToReplace)
},
{
"GetInputItems",
"GetResponseInputItems",
("ResponseItem", "ResponseItemCollectionOptions", _paginationParamsToReplace)
},
{
"GetInputItemsAsync",
"GetResponseInputItemsAsync",
("ResponseItem", "ResponseItemCollectionOptions", _paginationParamsToReplace)
},
{
Expand Down
2 changes: 2 additions & 0 deletions specification/client/responses.client.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ using Azure.ClientGenerator.Core;

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

@@clientName(Responses.listInputItems, "GetResponseInputItems");

// ------------ Streaming ------------

@@alternateType(ResponseFunctionCallArgumentsDoneEvent.arguments, unknown);
Expand Down
26 changes: 0 additions & 26 deletions src/Custom/Responses/OpenAIResponseClient.Protocol.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,30 +32,4 @@ public virtual ClientResult GetResponse(string responseId, bool? stream, int? st
PipelineResponse protocolResponse = Pipeline.ProcessMessage(message, options);
return ClientResult.FromResponse(protocolResponse);
}

public virtual AsyncCollectionResult GetResponseInputItemsAsync(
string responseId,
int? limit,
string order,
string after,
string before,
RequestOptions options = null)
{
Argument.AssertNotNull(responseId, nameof(responseId));

return new AsyncResponseItemCollectionResult(this, responseId, limit, order, after, before, options);
}

public virtual CollectionResult GetResponseInputItems(
string responseId,
int? limit,
string order,
string after,
string before,
RequestOptions options = null)
{
Argument.AssertNotNull(responseId, nameof(responseId));

return new ResponseItemCollectionResult(this, responseId, limit, order, after, before, options);
}
}
28 changes: 0 additions & 28 deletions src/Custom/Responses/OpenAIResponseClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -266,34 +266,6 @@ public virtual CollectionResult<StreamingResponseUpdate> GetResponseStreaming(st
cancellationToken);
}

public virtual AsyncCollectionResult<ResponseItem> GetResponseInputItemsAsync(string responseId, ResponseItemCollectionOptions options = default, CancellationToken cancellationToken = default)
{
Argument.AssertNotNullOrEmpty(responseId, nameof(responseId));

AsyncCollectionResult result = GetResponseInputItemsAsync(responseId, options?.PageSizeLimit, options?.Order?.ToString(), options?.AfterId, options?.BeforeId, cancellationToken.ToRequestOptions());

if (result is not AsyncCollectionResult<ResponseItem> responsesItemCollection)
{
throw new InvalidOperationException("Failed to cast protocol return type to expected collection type 'AsyncCollectionResult<ResponsesItem>'.");
}

return responsesItemCollection;
}

public virtual CollectionResult<ResponseItem> GetResponseInputItems(string responseId, ResponseItemCollectionOptions options = default, CancellationToken cancellationToken = default)
{
Argument.AssertNotNullOrEmpty(responseId, nameof(responseId));

CollectionResult result = GetResponseInputItems(responseId, options?.PageSizeLimit, options?.Order?.ToString(), options?.AfterId, options?.BeforeId, cancellationToken.ToRequestOptions());

if (result is not CollectionResult<ResponseItem> responsesItemCollection)
{
throw new InvalidOperationException("Failed to cast protocol return type to expected collection type 'CollectionResult<ResponsesItem>'.");
}

return responsesItemCollection;
}

public virtual async Task<ClientResult<ResponseDeletionResult>> DeleteResponseAsync(string responseId, CancellationToken cancellationToken = default)
{
Argument.AssertNotNullOrEmpty(responseId, nameof(responseId));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public async Task<ClientResult> GetNextPageAsync(ClientResult result)

internal virtual async Task<ClientResult> GetResponsesAsync(string responseId, int? limit, string? order, string? after, string? before, RequestOptions? options)
{
using PipelineMessage message = _parentClient.CreateGetInputItemsRequest(responseId, limit, order, after, before, options);
using PipelineMessage message = _parentClient.CreateGetResponseInputItemsRequest(responseId, limit, order, after, before, options);
return ClientResult.FromResponse(await _parentClient.Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public static bool HasNextPage(ClientResult result)

internal virtual ClientResult GetResponseInputItems(string responseId, int? limit, string? order, string? after, string? before, RequestOptions? options)
{
using PipelineMessage message = _parentClient.CreateGetInputItemsRequest(responseId, limit, order, after, before, options);
using PipelineMessage message = _parentClient.CreateGetResponseInputItemsRequest(responseId, limit, order, after, before, options);
return ClientResult.FromResponse(_parentClient.Pipeline.ProcessMessage(message, options));
}
}
2 changes: 1 addition & 1 deletion src/Generated/OpenAIResponseClient.RestClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ internal virtual PipelineMessage CreateCancelResponseRequest(string responseId,
return message;
}

internal virtual PipelineMessage CreateGetInputItemsRequest(string responseId, int? limit, string order, string after, string before, RequestOptions options)
internal virtual PipelineMessage CreateGetResponseInputItemsRequest(string responseId, int? limit, string order, string after, string before, RequestOptions options)
{
ClientUriBuilder uri = new ClientUriBuilder();
uri.Reset(_endpoint);
Expand Down
16 changes: 8 additions & 8 deletions src/Generated/OpenAIResponseClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ public virtual async Task<ClientResult> CancelResponseAsync(string responseId, R
return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false));
}

public virtual CollectionResult GetInputItems(string responseId, int? limit, string order, string after, string before, RequestOptions options)
public virtual CollectionResult GetResponseInputItems(string responseId, int? limit, string order, string after, string before, RequestOptions options)
{
Argument.AssertNotNullOrEmpty(responseId, nameof(responseId));

return new OpenAIResponseClientGetInputItemsCollectionResult(
return new OpenAIResponseClientGetResponseInputItemsCollectionResult(
this,
responseId,
limit,
Expand All @@ -91,11 +91,11 @@ public virtual CollectionResult GetInputItems(string responseId, int? limit, str
options);
}

public virtual AsyncCollectionResult GetInputItemsAsync(string responseId, int? limit, string order, string after, string before, RequestOptions options)
public virtual AsyncCollectionResult GetResponseInputItemsAsync(string responseId, int? limit, string order, string after, string before, RequestOptions options)
{
Argument.AssertNotNullOrEmpty(responseId, nameof(responseId));

return new OpenAIResponseClientGetInputItemsAsyncCollectionResult(
return new OpenAIResponseClientGetResponseInputItemsAsyncCollectionResult(
this,
responseId,
limit,
Expand All @@ -105,11 +105,11 @@ public virtual AsyncCollectionResult GetInputItemsAsync(string responseId, int?
options);
}

public virtual CollectionResult<ResponseItem> GetInputItems(string responseId, ResponseItemCollectionOptions options = default, CancellationToken cancellationToken = default)
public virtual CollectionResult<ResponseItem> GetResponseInputItems(string responseId, ResponseItemCollectionOptions options = default, CancellationToken cancellationToken = default)
{
Argument.AssertNotNullOrEmpty(responseId, nameof(responseId));

return new OpenAIResponseClientGetInputItemsCollectionResultOfT(
return new OpenAIResponseClientGetResponseInputItemsCollectionResultOfT(
this,
responseId,
options?.PageSizeLimit,
Expand All @@ -119,11 +119,11 @@ public virtual CollectionResult<ResponseItem> GetInputItems(string responseId, R
cancellationToken.CanBeCanceled ? new RequestOptions { CancellationToken = cancellationToken } : null);
}

public virtual AsyncCollectionResult<ResponseItem> GetInputItemsAsync(string responseId, ResponseItemCollectionOptions options = default, CancellationToken cancellationToken = default)
public virtual AsyncCollectionResult<ResponseItem> GetResponseInputItemsAsync(string responseId, ResponseItemCollectionOptions options = default, CancellationToken cancellationToken = default)
{
Argument.AssertNotNullOrEmpty(responseId, nameof(responseId));

return new OpenAIResponseClientGetInputItemsAsyncCollectionResultOfT(
return new OpenAIResponseClientGetResponseInputItemsAsyncCollectionResultOfT(
this,
responseId,
options?.PageSizeLimit,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace OpenAI.Responses
{
internal partial class OpenAIResponseClientGetInputItemsAsyncCollectionResult : AsyncCollectionResult
internal partial class OpenAIResponseClientGetResponseInputItemsAsyncCollectionResult : AsyncCollectionResult
{
private readonly OpenAIResponseClient _client;
private readonly string _responseId;
Expand All @@ -20,7 +20,7 @@ internal partial class OpenAIResponseClientGetInputItemsAsyncCollectionResult :
private readonly string _before;
private readonly RequestOptions _options;

public OpenAIResponseClientGetInputItemsAsyncCollectionResult(OpenAIResponseClient client, string responseId, int? limit, string order, string after, string before, RequestOptions options)
public OpenAIResponseClientGetResponseInputItemsAsyncCollectionResult(OpenAIResponseClient client, string responseId, int? limit, string order, string after, string before, RequestOptions options)
{
Argument.AssertNotNullOrEmpty(responseId, nameof(responseId));

Expand All @@ -35,7 +35,7 @@ public OpenAIResponseClientGetInputItemsAsyncCollectionResult(OpenAIResponseClie

public override async IAsyncEnumerable<ClientResult> GetRawPagesAsync()
{
PipelineMessage message = _client.CreateGetInputItemsRequest(_responseId, _limit, _order, _after, _before, _options);
PipelineMessage message = _client.CreateGetResponseInputItemsRequest(_responseId, _limit, _order, _after, _before, _options);
string nextToken = null;
while (true)
{
Expand All @@ -50,7 +50,7 @@ public override async IAsyncEnumerable<ClientResult> GetRawPagesAsync()
{
yield break;
}
message = _client.CreateGetInputItemsRequest(_responseId, _limit, _order, nextToken, _before, _options);
message = _client.CreateGetResponseInputItemsRequest(_responseId, _limit, _order, nextToken, _before, _options);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

namespace OpenAI.Responses
{
internal partial class OpenAIResponseClientGetInputItemsAsyncCollectionResultOfT : AsyncCollectionResult<ResponseItem>
internal partial class OpenAIResponseClientGetResponseInputItemsAsyncCollectionResultOfT : AsyncCollectionResult<ResponseItem>
{
private readonly OpenAIResponseClient _client;
private readonly string _responseId;
Expand All @@ -21,7 +21,7 @@ internal partial class OpenAIResponseClientGetInputItemsAsyncCollectionResultOfT
private readonly string _before;
private readonly RequestOptions _options;

public OpenAIResponseClientGetInputItemsAsyncCollectionResultOfT(OpenAIResponseClient client, string responseId, int? limit, string order, string after, string before, RequestOptions options)
public OpenAIResponseClientGetResponseInputItemsAsyncCollectionResultOfT(OpenAIResponseClient client, string responseId, int? limit, string order, string after, string before, RequestOptions options)
{
Argument.AssertNotNullOrEmpty(responseId, nameof(responseId));

Expand All @@ -36,7 +36,7 @@ public OpenAIResponseClientGetInputItemsAsyncCollectionResultOfT(OpenAIResponseC

public override async IAsyncEnumerable<ClientResult> GetRawPagesAsync()
{
PipelineMessage message = _client.CreateGetInputItemsRequest(_responseId, _limit, _order, _after, _before, _options);
PipelineMessage message = _client.CreateGetResponseInputItemsRequest(_responseId, _limit, _order, _after, _before, _options);
string nextToken = null;
while (true)
{
Expand All @@ -51,7 +51,7 @@ public override async IAsyncEnumerable<ClientResult> GetRawPagesAsync()
{
yield break;
}
message = _client.CreateGetInputItemsRequest(_responseId, _limit, _order, nextToken, _before, _options);
message = _client.CreateGetResponseInputItemsRequest(_responseId, _limit, _order, nextToken, _before, _options);
}
}

Expand Down
Loading