@@ -12,8 +12,8 @@ namespace OpenAI.Assistants;
1212
1313/// <summary> The service client for OpenAI assistants operations. </summary>
1414[ Experimental ( "OPENAI001" ) ]
15- [ CodeGenClient ( "Assistants" ) ]
16- [ CodeGenSuppress ( "AssistantClient" , typeof ( ClientPipeline ) , typeof ( ApiKeyCredential ) , typeof ( Uri ) ) ]
15+ [ CodeGenType ( "Assistants" ) ]
16+ [ CodeGenSuppress ( "AssistantClient" , typeof ( ClientPipeline ) , typeof ( Uri ) ) ]
1717[ CodeGenSuppress ( "CreateAssistantAsync" , typeof ( AssistantCreationOptions ) , typeof ( CancellationToken ) ) ]
1818[ CodeGenSuppress ( "CreateAssistant" , typeof ( AssistantCreationOptions ) , typeof ( CancellationToken ) ) ]
1919[ CodeGenSuppress ( "GetAssistantAsync" , typeof ( string ) ) ]
@@ -22,8 +22,8 @@ namespace OpenAI.Assistants;
2222[ CodeGenSuppress ( "ModifyAssistant" , typeof ( string ) , typeof ( AssistantModificationOptions ) ) ]
2323[ CodeGenSuppress ( "DeleteAssistantAsync" , typeof ( string ) ) ]
2424[ CodeGenSuppress ( "DeleteAssistant" , typeof ( string ) ) ]
25- [ CodeGenSuppress ( "ListAssistantsAsync" , typeof ( int ? ) , typeof ( AssistantCollectionOrder ? ) , typeof ( string ) , typeof ( string ) , typeof ( CancellationToken ) ) ]
26- [ CodeGenSuppress ( "ListAssistants" , typeof ( int ? ) , typeof ( AssistantCollectionOrder ? ) , typeof ( string ) , typeof ( string ) , typeof ( CancellationToken ) ) ]
25+ [ CodeGenSuppress ( "ListAssistantsAsync" , typeof ( int ? ) , typeof ( OpenAI . VectorStores . VectorStoreCollectionOrder ? ) , typeof ( string ) , typeof ( string ) , typeof ( CancellationToken ) ) ]
26+ [ CodeGenSuppress ( "ListAssistants" , typeof ( int ? ) , typeof ( OpenAI . VectorStores . VectorStoreCollectionOrder ? ) , typeof ( string ) , typeof ( string ) , typeof ( CancellationToken ) ) ]
2727public partial class AssistantClient
2828{
2929 private readonly InternalAssistantMessageClient _messageSubClient ;
@@ -725,11 +725,10 @@ public virtual AsyncCollectionResult<StreamingUpdate> CreateRunStreamingAsync(
725725 options . AssistantId = assistantId ;
726726 options . Stream = true ;
727727
728- async Task < ClientResult > sendRequestAsync ( ) =>
729- await CreateRunAsync ( threadId , options , cancellationToken . ToRequestOptions ( streaming : true ) )
730- . ConfigureAwait ( false ) ;
731-
732- return new AsyncStreamingUpdateCollection ( sendRequestAsync , cancellationToken ) ;
728+ return new AsyncSseUpdateCollection < StreamingUpdate > (
729+ async ( ) => await CreateRunAsync ( threadId , options , cancellationToken . ToRequestOptions ( streaming : true ) ) . ConfigureAwait ( false ) ,
730+ StreamingUpdate . FromSseItem ,
731+ cancellationToken ) ;
733732 }
734733
735734 /// <summary>
@@ -753,8 +752,10 @@ public virtual CollectionResult<StreamingUpdate> CreateRunStreaming(
753752 options . AssistantId = assistantId ;
754753 options . Stream = true ;
755754
756- ClientResult sendRequest ( ) => CreateRun ( threadId , options , cancellationToken . ToRequestOptions ( streaming : true ) ) ;
757- return new StreamingUpdateCollection ( sendRequest , cancellationToken ) ;
755+ return new SseUpdateCollection < StreamingUpdate > (
756+ ( ) => CreateRun ( threadId , options , cancellationToken . ToRequestOptions ( streaming : true ) ) ,
757+ StreamingUpdate . FromSseItem ,
758+ cancellationToken ) ;
758759 }
759760
760761 /// <summary>
@@ -818,11 +819,10 @@ public virtual AsyncCollectionResult<StreamingUpdate> CreateThreadAndRunStreamin
818819 runOptions . Stream = true ;
819820 BinaryContent protocolContent = CreateThreadAndRunProtocolContent ( assistantId , threadOptions , runOptions ) ;
820821
821- async Task < ClientResult > sendRequestAsync ( ) =>
822- await CreateThreadAndRunAsync ( protocolContent , cancellationToken . ToRequestOptions ( streaming : true ) )
823- . ConfigureAwait ( false ) ;
824-
825- return new AsyncStreamingUpdateCollection ( sendRequestAsync , cancellationToken ) ;
822+ return new AsyncSseUpdateCollection < StreamingUpdate > (
823+ async ( ) => await CreateThreadAndRunAsync ( protocolContent , cancellationToken . ToRequestOptions ( streaming : true ) ) . ConfigureAwait ( false ) ,
824+ StreamingUpdate . FromSseItem ,
825+ cancellationToken ) ;
826826 }
827827
828828 /// <summary>
@@ -844,8 +844,10 @@ public virtual CollectionResult<StreamingUpdate> CreateThreadAndRunStreaming(
844844 runOptions . Stream = true ;
845845 BinaryContent protocolContent = CreateThreadAndRunProtocolContent ( assistantId , threadOptions , runOptions ) ;
846846
847- ClientResult sendRequest ( ) => CreateThreadAndRun ( protocolContent , cancellationToken . ToRequestOptions ( streaming : true ) ) ;
848- return new StreamingUpdateCollection ( sendRequest , cancellationToken ) ;
847+ return new SseUpdateCollection < StreamingUpdate > (
848+ ( ) => CreateThreadAndRun ( protocolContent , cancellationToken . ToRequestOptions ( streaming : true ) ) ,
849+ StreamingUpdate . FromSseItem ,
850+ cancellationToken ) ;
849851 }
850852
851853 /// <summary>
@@ -1043,11 +1045,10 @@ public virtual AsyncCollectionResult<StreamingUpdate> SubmitToolOutputsToRunStre
10431045
10441046 BinaryContent content = new InternalSubmitToolOutputsRunRequest ( toolOutputs . ToList ( ) , stream : true , null ) ;
10451047
1046- async Task < ClientResult > sendRequestAsync ( ) =>
1047- await SubmitToolOutputsToRunAsync ( threadId , runId , content , cancellationToken . ToRequestOptions ( streaming : true ) )
1048- . ConfigureAwait ( false ) ;
1049-
1050- return new AsyncStreamingUpdateCollection ( sendRequestAsync , cancellationToken ) ;
1048+ return new AsyncSseUpdateCollection < StreamingUpdate > (
1049+ async ( ) => await SubmitToolOutputsToRunAsync ( threadId , runId , content , cancellationToken . ToRequestOptions ( streaming : true ) ) . ConfigureAwait ( false ) ,
1050+ StreamingUpdate . FromSseItem ,
1051+ cancellationToken ) ;
10511052 }
10521053
10531054 /// <summary>
@@ -1070,8 +1071,10 @@ public virtual CollectionResult<StreamingUpdate> SubmitToolOutputsToRunStreaming
10701071
10711072 BinaryContent content = new InternalSubmitToolOutputsRunRequest ( toolOutputs . ToList ( ) , stream : true , null ) ;
10721073
1073- ClientResult sendRequest ( ) => SubmitToolOutputsToRun ( threadId , runId , content , cancellationToken . ToRequestOptions ( streaming : true ) ) ;
1074- return new StreamingUpdateCollection ( sendRequest , cancellationToken ) ;
1074+ return new SseUpdateCollection < StreamingUpdate > (
1075+ ( ) => SubmitToolOutputsToRun ( threadId , runId , content , cancellationToken . ToRequestOptions ( streaming : true ) ) ,
1076+ StreamingUpdate . FromSseItem ,
1077+ cancellationToken ) ;
10751078 }
10761079
10771080 /// <summary>
0 commit comments