Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update long-running operation APIs to use LRO subclient pattern #191

Open
wants to merge 50 commits into
base: main
Choose a base branch
from

Conversation

annelo-msft
Copy link
Collaborator

Move polling operation endpoints to the SCM-based client LRO pattern. Specifically:

  • Protocol and convenience methods for long-running operations return public subtypes of SCM OperationResult (operation subclients)
  • Where convenience layer is available, operation subclients add strongly-typed Value and/or Status properties, as applicable to the service operation
  • Operation subclients have protocol and convenience methods for any "linked operations" -- i.e. those used to update, resume, or cancel the operation, or retrieve values related to the specific operation
  • Operation subclients add overloads to WaitForCompletion and WaitForCompletionAsync that take a polling interval
  • Operation subclients have static Rehydrate and RehydrateAsync methods that can be called to recreate an operation subclient from a provided rehydration token

@annelo-msft annelo-msft marked this pull request as ready for review August 6, 2024 23:02
.dotnet/src/OpenAI.csproj Outdated Show resolved Hide resolved
.dotnet/src/Custom/Batch/BatchOperation.Protocol.cs Outdated Show resolved Hide resolved
.dotnet/src/Custom/Batch/BatchOperation.Protocol.cs Outdated Show resolved Hide resolved
.dotnet/src/Custom/Batch/BatchOperation.Protocol.cs Outdated Show resolved Hide resolved
.dotnet/tests/FineTuning/FineTuningTests.cs Outdated Show resolved Hide resolved
.dotnet/tests/Batch/BatchTests.cs Outdated Show resolved Hide resolved
.dotnet/api/OpenAI.netstandard2.0.cs Outdated Show resolved Hide resolved
.dotnet/api/OpenAI.netstandard2.0.cs Show resolved Hide resolved
.dotnet/api/OpenAI.netstandard2.0.cs Show resolved Hide resolved
.dotnet/api/OpenAI.netstandard2.0.cs Outdated Show resolved Hide resolved
.dotnet/api/OpenAI.netstandard2.0.cs Outdated Show resolved Hide resolved
.dotnet/src/Custom/Batch/BatchOperation.Protocol.cs Outdated Show resolved Hide resolved
.dotnet/src/Custom/Batch/BatchOperation.Protocol.cs Outdated Show resolved Hide resolved
.dotnet/src/Custom/Batch/BatchOperationToken.cs Outdated Show resolved Hide resolved
.dotnet/src/Custom/Batch/BatchOperationToken.cs Outdated Show resolved Hide resolved
.dotnet/src/Custom/Batch/BatchOperationToken.cs Outdated Show resolved Hide resolved
…roperties containing IDs to protocol-only LRO subclients
@annelo-msft
Copy link
Collaborator Author

@trrwilson, seek your guidance on getting the AOAI CI to pass ...

Chris Schraer and others added 22 commits September 6, 2024 13:47
…polling-lro

# Conflicts:
#	.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Batch/AzureBatchClient.Protocol.cs
#	.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Batch/AzureCreateBatchOperation.Protocol.cs
#	.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/FineTuning/AzureCreateJobOperation.Protocol.cs
#	.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/FineTuning/AzureFineTuningClient.Protocol.cs
#	.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/VectorStores/AzureAddFileToVectorStoreOperation.Protocol.cs
#	.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/VectorStores/AzureAddFileToVectorStoreOperation.cs
#	.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/VectorStores/AzureCreateBatchFileJobOperation.Protocol.cs
#	.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/VectorStores/AzureCreateBatchFileJobOperation.cs
#	.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/VectorStores/AzureCreateVectorStoreOperation.cs
#	.dotnet/src/Custom/Batch/BatchClient.cs
#	.dotnet/src/Custom/FineTuning/FineTuningClient.cs
#	.dotnet/src/Custom/VectorStores/VectorStoreClient.cs
#	.dotnet/src/Generated/FineTuningClient.cs
Co-authored-by: Anne Thompson <21269347+annelo-msft@users.noreply.github.com>
…s.cs

Co-authored-by: Anne Thompson <21269347+annelo-msft@users.noreply.github.com>
…e-openai-in-typespec into oai-polling-lro

# Conflicts:
#	.dotnet.azure/sdk/openai/Azure.AI.OpenAI/tests/FineTuningTests.cs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants