openai/openai-dotnet

Public

mirrored from https://github.com/openai/openai-dotnetAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
OpenAI_2.0.0

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

src/Custom/Assistants/AssistantClient.Protocol.cs

580lines · modecode

1using System;
2using System.ClientModel;
3using System.ClientModel.Primitives;
4using System.ComponentModel;
5using System.Threading.Tasks;
6
7namespace OpenAI.Assistants;
8
9public partial class AssistantClient
10{
11 /// <summary>
12 /// [Protocol Method] Create an assistant with a model and instructions.
13 /// </summary>
14 /// <param name="content"> The content to send as the body of the request. </param>
15 /// <param name="options"> The request options, which can override default behaviors of the client pipeline on a per-call basis. </param>
16 /// <exception cref="ArgumentNullException"> <paramref name="content"/> is null. </exception>
17 /// <exception cref="ClientResultException"> Service returned a non-success status code. </exception>
18 /// <returns> The response returned from the service. </returns>
19 [EditorBrowsable(EditorBrowsableState.Never)]
20 public virtual async Task<ClientResult> CreateAssistantAsync(BinaryContent content, RequestOptions options = null)
21 {
22 Argument.AssertNotNull(content, nameof(content));
23
24 using PipelineMessage message = CreateCreateAssistantRequest(content, options);
25 return ClientResult.FromResponse(await _pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false));
26 }
27
28 /// <summary>
29 /// [Protocol Method] Create an assistant with a model and instructions.
30 /// </summary>
31 /// <param name="content"> The content to send as the body of the request. </param>
32 /// <param name="options"> The request options, which can override default behaviors of the client pipeline on a per-call basis. </param>
33 /// <exception cref="ArgumentNullException"> <paramref name="content"/> is null. </exception>
34 /// <exception cref="ClientResultException"> Service returned a non-success status code. </exception>
35 /// <returns> The response returned from the service. </returns>
36 [EditorBrowsable(EditorBrowsableState.Never)]
37 public virtual ClientResult CreateAssistant(BinaryContent content, RequestOptions options = null)
38 {
39 Argument.AssertNotNull(content, nameof(content));
40
41 using PipelineMessage message = CreateCreateAssistantRequest(content, options);
42 return ClientResult.FromResponse(_pipeline.ProcessMessage(message, options));
43 }
44
45 /// <summary>
46 /// [Protocol Method] Returns a paginated collection of assistants.
47 /// </summary>
48 /// <param name="limit">
49 /// A limit on the number of objects to be returned. Limit can range between 1 and 100, and the
50 /// default is 20.
51 /// </param>
52 /// <param name="order">
53 /// Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`
54 /// for descending order. Allowed values: "asc" | "desc"
55 /// </param>
56 /// <param name="after">
57 /// A cursor for use in pagination. `after` is an object ID that defines your place in the list.
58 /// For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
59 /// subsequent call can include after=obj_foo in order to fetch the next page of the list.
60 /// </param>
61 /// <param name="before">
62 /// A cursor for use in pagination. `before` is an object ID that defines your place in the list.
63 /// For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
64 /// subsequent call can include before=obj_foo in order to fetch the previous page of the list.
65 /// </param>
66 /// <param name="options"> The request options, which can override default behaviors of the client pipeline on a per-call basis. </param>
67 /// <exception cref="ClientResultException"> Service returned a non-success status code. </exception>
68 /// <returns> A collection of service responses, each holding a page of values. </returns>
69 [EditorBrowsable(EditorBrowsableState.Never)]
70 public virtual AsyncCollectionResult GetAssistantsAsync(int? limit, string order, string after, string before, RequestOptions options)
71 {
72 return new AsyncAssistantCollectionResult(this, _pipeline, options, limit, order, after, before);
73 }
74
75 /// <summary>
76 /// [Protocol Method] Returns a paginated collection of assistants.
77 /// </summary>
78 /// <param name="limit">
79 /// A limit on the number of objects to be returned. Limit can range between 1 and 100, and the
80 /// default is 20.
81 /// </param>
82 /// <param name="order">
83 /// Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`
84 /// for descending order. Allowed values: "asc" | "desc"
85 /// </param>
86 /// <param name="after">
87 /// A cursor for use in pagination. `after` is an object ID that defines your place in the list.
88 /// For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
89 /// subsequent call can include after=obj_foo in order to fetch the next page of the list.
90 /// </param>
91 /// <param name="before">
92 /// A cursor for use in pagination. `before` is an object ID that defines your place in the list.
93 /// For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
94 /// subsequent call can include before=obj_foo in order to fetch the previous page of the list.
95 /// </param>
96 /// <param name="options"> The request options, which can override default behaviors of the client pipeline on a per-call basis. </param>
97 /// <exception cref="ClientResultException"> Service returned a non-success status code. </exception>
98 /// <returns> A collection of service responses, each holding a page of values. </returns>
99 [EditorBrowsable(EditorBrowsableState.Never)]
100 public virtual CollectionResult GetAssistants(int? limit, string order, string after, string before, RequestOptions options)
101 {
102 return new AssistantCollectionResult(this, _pipeline, options, limit, order, after, before);
103 }
104
105 /// <summary>
106 /// [Protocol Method] Retrieves an assistant.
107 /// </summary>
108 /// <param name="assistantId"> The ID of the assistant to retrieve. </param>
109 /// <param name="options"> The request options, which can override default behaviors of the client pipeline on a per-call basis. </param>
110 /// <exception cref="ArgumentNullException"> <paramref name="assistantId"/> is null. </exception>
111 /// <exception cref="ArgumentException"> <paramref name="assistantId"/> is an empty string, and was expected to be non-empty. </exception>
112 /// <exception cref="ClientResultException"> Service returned a non-success status code. </exception>
113 /// <returns> The response returned from the service. </returns>
114 [EditorBrowsable(EditorBrowsableState.Never)]
115 public virtual async Task<ClientResult> GetAssistantAsync(string assistantId, RequestOptions options)
116 {
117 Argument.AssertNotNullOrEmpty(assistantId, nameof(assistantId));
118
119 using PipelineMessage message = CreateGetAssistantRequest(assistantId, options);
120 return ClientResult.FromResponse(await _pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false));
121 }
122
123 /// <summary>
124 /// [Protocol Method] Retrieves an assistant.
125 /// </summary>
126 /// <param name="assistantId"> The ID of the assistant to retrieve. </param>
127 /// <param name="options"> The request options, which can override default behaviors of the client pipeline on a per-call basis. </param>
128 /// <exception cref="ArgumentNullException"> <paramref name="assistantId"/> is null. </exception>
129 /// <exception cref="ArgumentException"> <paramref name="assistantId"/> is an empty string, and was expected to be non-empty. </exception>
130 /// <exception cref="ClientResultException"> Service returned a non-success status code. </exception>
131 /// <returns> The response returned from the service. </returns>
132 [EditorBrowsable(EditorBrowsableState.Never)]
133 public virtual ClientResult GetAssistant(string assistantId, RequestOptions options)
134 {
135 Argument.AssertNotNullOrEmpty(assistantId, nameof(assistantId));
136
137 using PipelineMessage message = CreateGetAssistantRequest(assistantId, options);
138 return ClientResult.FromResponse(_pipeline.ProcessMessage(message, options));
139 }
140
141 /// <summary>
142 /// [Protocol Method] Modifies an assistant.
143 /// </summary>
144 /// <param name="assistantId"> The ID of the assistant to modify. </param>
145 /// <param name="content"> The content to send as the body of the request. </param>
146 /// <param name="options"> The request options, which can override default behaviors of the client pipeline on a per-call basis. </param>
147 /// <exception cref="ArgumentNullException"> <paramref name="assistantId"/> or <paramref name="content"/> is null. </exception>
148 /// <exception cref="ArgumentException"> <paramref name="assistantId"/> is an empty string, and was expected to be non-empty. </exception>
149 /// <exception cref="ClientResultException"> Service returned a non-success status code. </exception>
150 /// <returns> The response returned from the service. </returns>
151 [EditorBrowsable(EditorBrowsableState.Never)]
152 public virtual async Task<ClientResult> ModifyAssistantAsync(string assistantId, BinaryContent content, RequestOptions options = null)
153 {
154 Argument.AssertNotNullOrEmpty(assistantId, nameof(assistantId));
155 Argument.AssertNotNull(content, nameof(content));
156
157 using PipelineMessage message = CreateModifyAssistantRequest(assistantId, content, options);
158 return ClientResult.FromResponse(await _pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false));
159 }
160
161 /// <summary>
162 /// [Protocol Method] Modifies an assistant.
163 /// </summary>
164 /// <param name="assistantId"> The ID of the assistant to modify. </param>
165 /// <param name="content"> The content to send as the body of the request. </param>
166 /// <param name="options"> The request options, which can override default behaviors of the client pipeline on a per-call basis. </param>
167 /// <exception cref="ArgumentNullException"> <paramref name="assistantId"/> or <paramref name="content"/> is null. </exception>
168 /// <exception cref="ArgumentException"> <paramref name="assistantId"/> is an empty string, and was expected to be non-empty. </exception>
169 /// <exception cref="ClientResultException"> Service returned a non-success status code. </exception>
170 /// <returns> The response returned from the service. </returns>
171 [EditorBrowsable(EditorBrowsableState.Never)]
172 public virtual ClientResult ModifyAssistant(string assistantId, BinaryContent content, RequestOptions options = null)
173 {
174 Argument.AssertNotNullOrEmpty(assistantId, nameof(assistantId));
175 Argument.AssertNotNull(content, nameof(content));
176
177 using PipelineMessage message = CreateModifyAssistantRequest(assistantId, content, options);
178 return ClientResult.FromResponse(_pipeline.ProcessMessage(message, options));
179 }
180
181 /// <summary>
182 /// [Protocol Method] Delete an assistant.
183 /// </summary>
184 /// <param name="assistantId"> The ID of the assistant to delete. </param>
185 /// <param name="options"> The request options, which can override default behaviors of the client pipeline on a per-call basis. </param>
186 /// <exception cref="ArgumentNullException"> <paramref name="assistantId"/> is null. </exception>
187 /// <exception cref="ArgumentException"> <paramref name="assistantId"/> is an empty string, and was expected to be non-empty. </exception>
188 /// <exception cref="ClientResultException"> Service returned a non-success status code. </exception>
189 /// <returns> The response returned from the service. </returns>
190 [EditorBrowsable(EditorBrowsableState.Never)]
191 public virtual async Task<ClientResult> DeleteAssistantAsync(string assistantId, RequestOptions options)
192 {
193 Argument.AssertNotNullOrEmpty(assistantId, nameof(assistantId));
194
195 using PipelineMessage message = CreateDeleteAssistantRequest(assistantId, options);
196 return ClientResult.FromResponse(await _pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false));
197 }
198
199 /// <summary>
200 /// [Protocol Method] Delete an assistant.
201 /// </summary>
202 /// <param name="assistantId"> The ID of the assistant to delete. </param>
203 /// <param name="options"> The request options, which can override default behaviors of the client pipeline on a per-call basis. </param>
204 /// <exception cref="ArgumentNullException"> <paramref name="assistantId"/> is null. </exception>
205 /// <exception cref="ArgumentException"> <paramref name="assistantId"/> is an empty string, and was expected to be non-empty. </exception>
206 /// <exception cref="ClientResultException"> Service returned a non-success status code. </exception>
207 /// <returns> The response returned from the service. </returns>
208 [EditorBrowsable(EditorBrowsableState.Never)]
209 public virtual ClientResult DeleteAssistant(string assistantId, RequestOptions options)
210 {
211 Argument.AssertNotNullOrEmpty(assistantId, nameof(assistantId));
212
213 using PipelineMessage message = CreateDeleteAssistantRequest(assistantId, options);
214 return ClientResult.FromResponse(_pipeline.ProcessMessage(message, options));
215 }
216
217 /// <inheritdoc cref="InternalAssistantMessageClient.CreateMessageAsync"/>
218 [EditorBrowsable(EditorBrowsableState.Never)]
219 public virtual Task<ClientResult> CreateMessageAsync(string threadId, BinaryContent content, RequestOptions options = null)
220 => _messageSubClient.CreateMessageAsync(threadId, content, options);
221
222 /// <inheritdoc cref="InternalAssistantMessageClient.CreateMessage"/>
223 [EditorBrowsable(EditorBrowsableState.Never)]
224 public virtual ClientResult CreateMessage(string threadId, BinaryContent content, RequestOptions options = null)
225 => _messageSubClient.CreateMessage(threadId, content, options);
226
227 /// <summary>
228 /// [Protocol Method] Returns a paginated collection of messages for a given thread.
229 /// </summary>
230 /// <param name="threadId"> The ID of the [thread](/docs/api-reference/threads) the messages belong to. </param>
231 /// <param name="limit">
232 /// A limit on the number of objects to be returned. Limit can range between 1 and 100, and the
233 /// default is 20.
234 /// </param>
235 /// <param name="order">
236 /// Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`
237 /// for descending order. Allowed values: "asc" | "desc"
238 /// </param>
239 /// <param name="after">
240 /// A cursor for use in pagination. `after` is an object ID that defines your place in the list.
241 /// For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
242 /// subsequent call can include after=obj_foo in order to fetch the next page of the list.
243 /// </param>
244 /// <param name="before">
245 /// A cursor for use in pagination. `before` is an object ID that defines your place in the list.
246 /// For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
247 /// subsequent call can include before=obj_foo in order to fetch the previous page of the list.
248 /// </param>
249 /// <param name="options"> The request options, which can override default behaviors of the client pipeline on a per-call basis. </param>
250 /// <exception cref="ArgumentNullException"> <paramref name="threadId"/> is null. </exception>
251 /// <exception cref="ArgumentException"> <paramref name="threadId"/> is an empty string, and was expected to be non-empty. </exception>
252 /// <exception cref="ClientResultException"> Service returned a non-success status code. </exception>
253 /// <returns> A collection of service responses, each holding a page of values. </returns>
254 [EditorBrowsable(EditorBrowsableState.Never)]
255 public virtual AsyncCollectionResult GetMessagesAsync(string threadId, int? limit, string order, string after, string before, RequestOptions options)
256 {
257 Argument.AssertNotNullOrEmpty(threadId, nameof(threadId));
258
259 return new AsyncMessageCollectionResult(_messageSubClient, options, threadId, limit, order, after, before);
260 }
261
262 /// <summary>
263 /// [Protocol Method] Returns a paginated collection of messages for a given thread.
264 /// </summary>
265 /// <param name="threadId"> The ID of the [thread](/docs/api-reference/threads) the messages belong to. </param>
266 /// <param name="limit">
267 /// A limit on the number of objects to be returned. Limit can range between 1 and 100, and the
268 /// default is 20.
269 /// </param>
270 /// <param name="order">
271 /// Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`
272 /// for descending order. Allowed values: "asc" | "desc"
273 /// </param>
274 /// <param name="after">
275 /// A cursor for use in pagination. `after` is an object ID that defines your place in the list.
276 /// For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
277 /// subsequent call can include after=obj_foo in order to fetch the next page of the list.
278 /// </param>
279 /// <param name="before">
280 /// A cursor for use in pagination. `before` is an object ID that defines your place in the list.
281 /// For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
282 /// subsequent call can include before=obj_foo in order to fetch the previous page of the list.
283 /// </param>
284 /// <param name="options"> The request options, which can override default behaviors of the client pipeline on a per-call basis. </param>
285 /// <exception cref="ArgumentNullException"> <paramref name="threadId"/> is null. </exception>
286 /// <exception cref="ArgumentException"> <paramref name="threadId"/> is an empty string, and was expected to be non-empty. </exception>
287 /// <exception cref="ClientResultException"> Service returned a non-success status code. </exception>
288 /// <returns> A collection of service responses, each holding a page of values. </returns>
289 [EditorBrowsable(EditorBrowsableState.Never)]
290 public virtual CollectionResult GetMessages(string threadId, int? limit, string order, string after, string before, RequestOptions options)
291 {
292 Argument.AssertNotNullOrEmpty(threadId, nameof(threadId));
293
294 return new MessageCollectionResult(_messageSubClient, options, threadId, limit, order, after, before);
295 }
296
297 /// <inheritdoc cref="InternalAssistantMessageClient.GetMessageAsync"/>
298 [EditorBrowsable(EditorBrowsableState.Never)]
299 public virtual Task<ClientResult> GetMessageAsync(string threadId, string messageId, RequestOptions options)
300 => _messageSubClient.GetMessageAsync(threadId, messageId, options);
301
302 /// <inheritdoc cref="InternalAssistantMessageClient.GetMessage"/>
303 [EditorBrowsable(EditorBrowsableState.Never)]
304 public virtual ClientResult GetMessage(string threadId, string messageId, RequestOptions options)
305 => _messageSubClient.GetMessage(threadId, messageId, options);
306
307 /// <inheritdoc cref="InternalAssistantMessageClient.ModifyMessageAsync"/>
308 [EditorBrowsable(EditorBrowsableState.Never)]
309 public virtual Task<ClientResult> ModifyMessageAsync(string threadId, string messageId, BinaryContent content, RequestOptions options = null)
310 => _messageSubClient.ModifyMessageAsync(threadId, messageId, content, options);
311
312 /// <inheritdoc cref="InternalAssistantMessageClient.ModifyMessage"/>
313 [EditorBrowsable(EditorBrowsableState.Never)]
314 public virtual ClientResult ModifyMessage(string threadId, string messageId, BinaryContent content, RequestOptions options = null)
315 => _messageSubClient.ModifyMessage(threadId, messageId, content, options);
316
317 /// <inheritdoc cref="InternalAssistantMessageClient.DeleteMessageAsync"/>
318 [EditorBrowsable(EditorBrowsableState.Never)]
319 public virtual Task<ClientResult> DeleteMessageAsync(string threadId, string messageId, RequestOptions options)
320 => _messageSubClient.DeleteMessageAsync(threadId, messageId, options);
321
322 /// <inheritdoc cref="InternalAssistantMessageClient.DeleteMessage"/>
323 [EditorBrowsable(EditorBrowsableState.Never)]
324 public virtual ClientResult DeleteMessage(string threadId, string messageId, RequestOptions options)
325 => _messageSubClient.DeleteMessage(threadId, messageId, options);
326
327 /// <inheritdoc cref="InternalAssistantRunClient.CreateThreadAndRunAsync"/>
328 [EditorBrowsable(EditorBrowsableState.Never)]
329 public virtual Task<ClientResult> CreateThreadAndRunAsync(BinaryContent content, RequestOptions options = null)
330 => _runSubClient.CreateThreadAndRunAsync(content, options);
331
332 /// <inheritdoc cref="InternalAssistantRunClient.CreateThreadAndRun"/>
333 [EditorBrowsable(EditorBrowsableState.Never)]
334 public virtual ClientResult CreateThreadAndRun(BinaryContent content, RequestOptions options = null)
335 => _runSubClient.CreateThreadAndRun(content, options = null);
336
337 /// <inheritdoc cref="InternalAssistantRunClient.CreateRunAsync"/>
338 [EditorBrowsable(EditorBrowsableState.Never)]
339 public virtual Task<ClientResult> CreateRunAsync(string threadId, BinaryContent content, RequestOptions options = null)
340 => _runSubClient.CreateRunAsync(threadId, content, options);
341
342 /// <inheritdoc cref="InternalAssistantRunClient.CreateRun"/>
343 [EditorBrowsable(EditorBrowsableState.Never)]
344 public virtual ClientResult CreateRun(string threadId, BinaryContent content, RequestOptions options = null)
345 => _runSubClient.CreateRun(threadId, content, options);
346
347 /// <summary>
348 /// [Protocol Method] Returns a paginated collection of runs belonging to a thread.
349 /// </summary>
350 /// <param name="threadId"> The ID of the thread the run belongs to. </param>
351 /// <param name="limit">
352 /// A limit on the number of objects to be returned. Limit can range between 1 and 100, and the
353 /// default is 20.
354 /// </param>
355 /// <param name="order">
356 /// Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`
357 /// for descending order. Allowed values: "asc" | "desc"
358 /// </param>
359 /// <param name="after">
360 /// A cursor for use in pagination. `after` is an object ID that defines your place in the list.
361 /// For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
362 /// subsequent call can include after=obj_foo in order to fetch the next page of the list.
363 /// </param>
364 /// <param name="before">
365 /// A cursor for use in pagination. `before` is an object ID that defines your place in the list.
366 /// For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
367 /// subsequent call can include before=obj_foo in order to fetch the previous page of the list.
368 /// </param>
369 /// <param name="options"> The request options, which can override default behaviors of the client pipeline on a per-call basis. </param>
370 /// <exception cref="ArgumentNullException"> <paramref name="threadId"/> is null. </exception>
371 /// <exception cref="ArgumentException"> <paramref name="threadId"/> is an empty string, and was expected to be non-empty. </exception>
372 /// <exception cref="ClientResultException"> Service returned a non-success status code. </exception>
373 /// <returns> A collection of service responses, each holding a page of values. </returns>
374 [EditorBrowsable(EditorBrowsableState.Never)]
375 public virtual AsyncCollectionResult GetRunsAsync(string threadId, int? limit, string order, string after, string before, RequestOptions options)
376 {
377 Argument.AssertNotNullOrEmpty(threadId, nameof(threadId));
378
379 return new AsyncRunCollectionResult(_runSubClient, options, threadId, limit, order, after, before);
380 }
381
382 /// <summary>
383 /// [Protocol Method] Returns a paginated collection of runs belonging to a thread.
384 /// </summary>
385 /// <param name="threadId"> The ID of the thread the run belongs to. </param>
386 /// <param name="limit">
387 /// A limit on the number of objects to be returned. Limit can range between 1 and 100, and the
388 /// default is 20.
389 /// </param>
390 /// <param name="order">
391 /// Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`
392 /// for descending order. Allowed values: "asc" | "desc"
393 /// </param>
394 /// <param name="after">
395 /// A cursor for use in pagination. `after` is an object ID that defines your place in the list.
396 /// For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
397 /// subsequent call can include after=obj_foo in order to fetch the next page of the list.
398 /// </param>
399 /// <param name="before">
400 /// A cursor for use in pagination. `before` is an object ID that defines your place in the list.
401 /// For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
402 /// subsequent call can include before=obj_foo in order to fetch the previous page of the list.
403 /// </param>
404 /// <param name="options"> The request options, which can override default behaviors of the client pipeline on a per-call basis. </param>
405 /// <exception cref="ArgumentNullException"> <paramref name="threadId"/> is null. </exception>
406 /// <exception cref="ArgumentException"> <paramref name="threadId"/> is an empty string, and was expected to be non-empty. </exception>
407 /// <exception cref="ClientResultException"> Service returned a non-success status code. </exception>
408 /// <returns> A collection of service responses, each holding a page of values. </returns>
409 [EditorBrowsable(EditorBrowsableState.Never)]
410 public virtual CollectionResult GetRuns(string threadId, int? limit, string order, string after, string before, RequestOptions options)
411 {
412 Argument.AssertNotNullOrEmpty(threadId, nameof(threadId));
413
414 return new RunCollectionResult(_runSubClient, options, threadId, limit, order, after, before);
415 }
416
417 /// <inheritdoc cref="InternalAssistantRunClient.GetRunAsync"/>
418 [EditorBrowsable(EditorBrowsableState.Never)]
419 public virtual Task<ClientResult> GetRunAsync(string threadId, string runId, RequestOptions options)
420 => _runSubClient.GetRunAsync(threadId, runId, options);
421
422 /// <inheritdoc cref="InternalAssistantRunClient.GetRun"/>
423 [EditorBrowsable(EditorBrowsableState.Never)]
424 public virtual ClientResult GetRun(string threadId, string runId, RequestOptions options)
425 => _runSubClient.GetRun(threadId, runId, options);
426
427 /// <inheritdoc cref="InternalAssistantRunClient.ModifyRunAsync"/>
428 [EditorBrowsable(EditorBrowsableState.Never)]
429 public virtual Task<ClientResult> ModifyRunAsync(string threadId, string runId, BinaryContent content, RequestOptions options = null)
430 => _runSubClient.ModifyRunAsync(threadId, runId, content, options);
431
432 /// <inheritdoc cref="InternalAssistantRunClient.ModifyRun"/>
433 [EditorBrowsable(EditorBrowsableState.Never)]
434 public virtual ClientResult ModifyRun(string threadId, string runId, BinaryContent content, RequestOptions options = null)
435 => _runSubClient.ModifyRun(threadId, runId, content, options);
436
437 /// <inheritdoc cref="InternalAssistantRunClient.CancelRunAsync"/>
438 [EditorBrowsable(EditorBrowsableState.Never)]
439 public virtual Task<ClientResult> CancelRunAsync(string threadId, string runId, RequestOptions options)
440 => _runSubClient.CancelRunAsync(threadId, runId, options);
441
442 /// <inheritdoc cref="InternalAssistantRunClient.CancelRun"/>
443 [EditorBrowsable(EditorBrowsableState.Never)]
444 public virtual ClientResult CancelRun(string threadId, string runId, RequestOptions options)
445 => _runSubClient.CancelRun(threadId, runId, options);
446
447 /// <inheritdoc cref="InternalAssistantRunClient.SubmitToolOutputsToRunAsync"/>
448 [EditorBrowsable(EditorBrowsableState.Never)]
449 public virtual Task<ClientResult> SubmitToolOutputsToRunAsync(string threadId, string runId, BinaryContent content, RequestOptions options = null)
450 => _runSubClient.SubmitToolOutputsToRunAsync(threadId, runId, content, options);
451
452 /// <inheritdoc cref="InternalAssistantRunClient.SubmitToolOutputsToRun"/>
453 [EditorBrowsable(EditorBrowsableState.Never)]
454 public virtual ClientResult SubmitToolOutputsToRun(string threadId, string runId, BinaryContent content, RequestOptions options = null)
455 => _runSubClient.SubmitToolOutputsToRun(threadId, runId, content, options);
456
457 /// <summary>
458 /// [Protocol Method] Returns a paginated collection of run steps belonging to a run.
459 /// </summary>
460 /// <param name="threadId"> The ID of the thread the run and run steps belong to. </param>
461 /// <param name="runId"> The ID of the run the run steps belong to. </param>
462 /// <param name="limit">
463 /// A limit on the number of objects to be returned. Limit can range between 1 and 100, and the
464 /// default is 20.
465 /// </param>
466 /// <param name="order">
467 /// Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`
468 /// for descending order. Allowed values: "asc" | "desc"
469 /// </param>
470 /// <param name="after">
471 /// A cursor for use in pagination. `after` is an object ID that defines your place in the list.
472 /// For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
473 /// subsequent call can include after=obj_foo in order to fetch the next page of the list.
474 /// </param>
475 /// <param name="before">
476 /// A cursor for use in pagination. `before` is an object ID that defines your place in the list.
477 /// For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
478 /// subsequent call can include before=obj_foo in order to fetch the previous page of the list.
479 /// </param>
480 /// <param name="options"> The request options, which can override default behaviors of the client pipeline on a per-call basis. </param>
481 /// <exception cref="ArgumentNullException"> <paramref name="threadId"/> or <paramref name="runId"/> is null. </exception>
482 /// <exception cref="ArgumentException"> <paramref name="threadId"/> or <paramref name="runId"/> is an empty string, and was expected to be non-empty. </exception>
483 /// <exception cref="ClientResultException"> Service returned a non-success status code. </exception>
484 /// <returns> A collection of service responses, each holding a page of values. </returns>
485 [EditorBrowsable(EditorBrowsableState.Never)]
486 public virtual AsyncCollectionResult GetRunStepsAsync(string threadId, string runId, int? limit, string order, string after, string before, RequestOptions options)
487 {
488 Argument.AssertNotNullOrEmpty(threadId, nameof(threadId));
489 Argument.AssertNotNullOrEmpty(runId, nameof(runId));
490
491 return new AsyncRunStepCollectionResult(_runSubClient, options,threadId, runId, limit, order, after, before);
492 }
493
494 /// <summary>
495 /// [Protocol Method] Returns a paginated collection of run steps belonging to a run.
496 /// </summary>
497 /// <param name="threadId"> The ID of the thread the run and run steps belong to. </param>
498 /// <param name="runId"> The ID of the run the run steps belong to. </param>
499 /// <param name="limit">
500 /// A limit on the number of objects to be returned. Limit can range between 1 and 100, and the
501 /// default is 20.
502 /// </param>
503 /// <param name="order">
504 /// Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`
505 /// for descending order. Allowed values: "asc" | "desc"
506 /// </param>
507 /// <param name="after">
508 /// A cursor for use in pagination. `after` is an object ID that defines your place in the list.
509 /// For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
510 /// subsequent call can include after=obj_foo in order to fetch the next page of the list.
511 /// </param>
512 /// <param name="before">
513 /// A cursor for use in pagination. `before` is an object ID that defines your place in the list.
514 /// For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
515 /// subsequent call can include before=obj_foo in order to fetch the previous page of the list.
516 /// </param>
517 /// <param name="options"> The request options, which can override default behaviors of the client pipeline on a per-call basis. </param>
518 /// <exception cref="ArgumentNullException"> <paramref name="threadId"/> or <paramref name="runId"/> is null. </exception>
519 /// <exception cref="ArgumentException"> <paramref name="threadId"/> or <paramref name="runId"/> is an empty string, and was expected to be non-empty. </exception>
520 /// <exception cref="ClientResultException"> Service returned a non-success status code. </exception>
521 /// <returns> A collection of service responses, each holding a page of values. </returns>
522 [EditorBrowsable(EditorBrowsableState.Never)]
523 public virtual CollectionResult GetRunSteps(string threadId, string runId, int? limit, string order, string after, string before, RequestOptions options)
524 {
525 Argument.AssertNotNullOrEmpty(threadId, nameof(threadId));
526 Argument.AssertNotNullOrEmpty(runId, nameof(runId));
527
528 return new RunStepCollectionResult(_runSubClient, options, threadId, runId, limit, order, after, before);
529 }
530
531 /// <inheritdoc cref="InternalAssistantRunClient.GetRunStepAsync"/>
532 [EditorBrowsable(EditorBrowsableState.Never)]
533 public virtual Task<ClientResult> GetRunStepAsync(string threadId, string runId, string stepId, RequestOptions options)
534 => _runSubClient.GetRunStepAsync(threadId, runId, stepId, options);
535
536 /// <inheritdoc cref="InternalAssistantRunClient.GetRunStep"/>
537 [EditorBrowsable(EditorBrowsableState.Never)]
538 public virtual ClientResult GetRunStep(string threadId, string runId, string stepId, RequestOptions options)
539 => _runSubClient.GetRunStep(threadId, runId, stepId, options);
540
541 /// <inheritdoc cref="InternalAssistantThreadClient.CreateThreadAsync"/>
542 [EditorBrowsable(EditorBrowsableState.Never)]
543 public virtual Task<ClientResult> CreateThreadAsync(BinaryContent content, RequestOptions options = null)
544 => _threadSubClient.CreateThreadAsync(content, options);
545
546 /// <inheritdoc cref="InternalAssistantThreadClient.CreateThread"/>
547 [EditorBrowsable(EditorBrowsableState.Never)]
548 public virtual ClientResult CreateThread(BinaryContent content, RequestOptions options = null)
549 => _threadSubClient.CreateThread(content, options);
550
551 /// <inheritdoc cref="InternalAssistantThreadClient.GetThreadAsync"/>
552 [EditorBrowsable(EditorBrowsableState.Never)]
553 public virtual Task<ClientResult> GetThreadAsync(string threadId, RequestOptions options)
554 => _threadSubClient.GetThreadAsync(threadId, options);
555
556 /// <inheritdoc cref="InternalAssistantThreadClient.GetThread"/>
557 [EditorBrowsable(EditorBrowsableState.Never)]
558 public virtual ClientResult GetThread(string threadId, RequestOptions options)
559 => _threadSubClient.GetThread(threadId, options);
560
561 /// <inheritdoc cref="InternalAssistantThreadClient.ModifyThreadAsync"/>
562 [EditorBrowsable(EditorBrowsableState.Never)]
563 public virtual Task<ClientResult> ModifyThreadAsync(string threadId, BinaryContent content, RequestOptions options = null)
564 => _threadSubClient.ModifyThreadAsync(threadId, content, options);
565
566 /// <inheritdoc cref="InternalAssistantThreadClient.ModifyThread"/>
567 [EditorBrowsable(EditorBrowsableState.Never)]
568 public virtual ClientResult ModifyThread(string threadId, BinaryContent content, RequestOptions options = null)
569 => _threadSubClient.ModifyThread(threadId, content, options);
570
571 /// <inheritdoc cref="InternalAssistantThreadClient.DeleteThreadAsync"/>
572 [EditorBrowsable(EditorBrowsableState.Never)]
573 public virtual Task<ClientResult> DeleteThreadAsync(string threadId, RequestOptions options)
574 => _threadSubClient.DeleteThreadAsync(threadId, options);
575
576 /// <inheritdoc cref="InternalAssistantThreadClient.DeleteThread"/>
577 [EditorBrowsable(EditorBrowsableState.Never)]
578 public virtual ClientResult DeleteThread(string threadId, RequestOptions options)
579 => _threadSubClient.DeleteThread(threadId, options);
580}