openai/openai-dotnet

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
OpenAI_2.3.0

Branches

Tags

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

Clone

HTTPS

Download ZIP

src/Custom/Assistants/Internal/InternalAssistantRunClient.Protocol.cs

398lines · modeblame

9f9f2936Jose Arriaga Maldonado2 years ago1using System;
2using System.ClientModel;
3using System.ClientModel.Primitives;
bf3f0eddJose Arriaga Maldonado1 years ago4using System.Collections.Generic;
9f9f2936Jose Arriaga Maldonado2 years ago5using System.Threading.Tasks;
6
7namespace OpenAI.Assistants;
8
5dce104aJose Arriaga Maldonado1 years ago9[CodeGenSuppress("CreateRunAsync", typeof(string), typeof(BinaryContent), typeof(IEnumerable<InternalIncludedRunStepProperty>), typeof(RequestOptions))]
10[CodeGenSuppress("CreateRun", typeof(string), typeof(BinaryContent), typeof(IEnumerable<InternalIncludedRunStepProperty>), typeof(RequestOptions))]
11[CodeGenSuppress("CreateThreadAndRunAsync", typeof(string), typeof(BinaryContent), typeof(RequestOptions))]
12[CodeGenSuppress("CreateThreadAndRun", typeof(string), typeof(BinaryContent), typeof(RequestOptions))]
13[CodeGenSuppress("SubmitToolOutputsToRunAsync", typeof(string), typeof(string), typeof(string), typeof(BinaryContent),typeof(RequestOptions))]
14[CodeGenSuppress("SubmitToolOutputsToRun", typeof(string), typeof(string), typeof(string), typeof(BinaryContent), typeof(RequestOptions))]
15[CodeGenSuppress("GetRunStepsAsync", typeof(string), typeof(string), typeof(int?), typeof(string), typeof(string), typeof(string), typeof(IEnumerable<InternalIncludedRunStepProperty>), typeof(RequestOptions))]
16[CodeGenSuppress("GetRunSteps", typeof(string), typeof(string), typeof(int?), typeof(string), typeof(string), typeof(string), typeof(IEnumerable<InternalIncludedRunStepProperty>), typeof(RequestOptions))]
bf3f0eddJose Arriaga Maldonado1 years ago17[CodeGenSuppress("GetRunStepAsync", typeof(string), typeof(string), typeof(string), typeof(IEnumerable<InternalIncludedRunStepProperty>), typeof(RequestOptions))]
18[CodeGenSuppress("GetRunStep", typeof(string), typeof(string), typeof(string), typeof(IEnumerable<InternalIncludedRunStepProperty>), typeof(RequestOptions))]
9f9f2936Jose Arriaga Maldonado2 years ago19internal partial class InternalAssistantRunClient
20{
21/// <summary>
22/// [Protocol Method] Create a thread and run it in one request.
23/// </summary>
24/// <param name="content"> The content to send as the body of the request. </param>
25/// <param name="options"> The request options, which can override default behaviors of the client pipeline on a per-call basis. </param>
26/// <exception cref="ArgumentNullException"> <paramref name="content"/> is null. </exception>
27/// <exception cref="ClientResultException"> Service returned a non-success status code. </exception>
28/// <returns> The response returned from the service. </returns>
29public virtual async Task<ClientResult> CreateThreadAndRunAsync(BinaryContent content, RequestOptions options = null)
30{
31Argument.AssertNotNull(content, nameof(content));
32
33PipelineMessage message = null;
34try
35{
5dce104aJose Arriaga Maldonado1 years ago36message = CreateCreateThreadAndRunRequest(content, options);
e0fee603Jose Arriaga Maldonado1 years ago37return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false));
9f9f2936Jose Arriaga Maldonado2 years ago38}
39finally
40{
41if (options?.BufferResponse != false)
42{
43message.Dispose();
44}
45}
46}
47
48/// <summary>
49/// [Protocol Method] Create a thread and run it in one request.
50/// </summary>
51/// <param name="content"> The content to send as the body of the request. </param>
52/// <param name="options"> The request options, which can override default behaviors of the client pipeline on a per-call basis. </param>
53/// <exception cref="ArgumentNullException"> <paramref name="content"/> is null. </exception>
54/// <exception cref="ClientResultException"> Service returned a non-success status code. </exception>
55/// <returns> The response returned from the service. </returns>
56public virtual ClientResult CreateThreadAndRun(BinaryContent content, RequestOptions options = null)
57{
58Argument.AssertNotNull(content, nameof(content));
59
60PipelineMessage message = null;
61try
62{
5dce104aJose Arriaga Maldonado1 years ago63message = CreateCreateThreadAndRunRequest(content, options);
e0fee603Jose Arriaga Maldonado1 years ago64return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options));
9f9f2936Jose Arriaga Maldonado2 years ago65}
66finally
67{
68if (options?.BufferResponse != false)
69{
70message.Dispose();
71}
72}
73}
74
75/// <summary>
76/// [Protocol Method] Create a run.
77/// </summary>
78/// <param name="threadId"> The ID of the thread to run. </param>
79/// <param name="content"> The content to send as the body of the request. </param>
80/// <param name="options"> The request options, which can override default behaviors of the client pipeline on a per-call basis. </param>
81/// <exception cref="ArgumentNullException"> <paramref name="threadId"/> or <paramref name="content"/> is null. </exception>
82/// <exception cref="ArgumentException"> <paramref name="threadId"/> is an empty string, and was expected to be non-empty. </exception>
83/// <exception cref="ClientResultException"> Service returned a non-success status code. </exception>
84/// <returns> The response returned from the service. </returns>
85public virtual async Task<ClientResult> CreateRunAsync(string threadId, BinaryContent content, RequestOptions options = null)
86{
87Argument.AssertNotNullOrEmpty(threadId, nameof(threadId));
88Argument.AssertNotNull(content, nameof(content));
89
90PipelineMessage message = null;
91try
92{
bf3f0eddJose Arriaga Maldonado1 years ago93// Always request the included properties.
94IEnumerable<InternalIncludedRunStepProperty> includedRunStepProperties = [InternalIncludedRunStepProperty.FileSearchResultContent];
95
5dce104aJose Arriaga Maldonado1 years ago96message = CreateCreateRunRequest(threadId, content, includedRunStepProperties, options);
e0fee603Jose Arriaga Maldonado1 years ago97return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false));
9f9f2936Jose Arriaga Maldonado2 years ago98}
99finally
100{
101if (options?.BufferResponse != false)
102{
103message.Dispose();
104}
105}
106}
107
108/// <summary>
109/// [Protocol Method] Create a run.
110/// </summary>
111/// <param name="threadId"> The ID of the thread to run. </param>
112/// <param name="content"> The content to send as the body of the request. </param>
113/// <param name="options"> The request options, which can override default behaviors of the client pipeline on a per-call basis. </param>
114/// <exception cref="ArgumentNullException"> <paramref name="threadId"/> or <paramref name="content"/> is null. </exception>
115/// <exception cref="ArgumentException"> <paramref name="threadId"/> is an empty string, and was expected to be non-empty. </exception>
116/// <exception cref="ClientResultException"> Service returned a non-success status code. </exception>
117/// <returns> The response returned from the service. </returns>
118public virtual ClientResult CreateRun(string threadId, BinaryContent content, RequestOptions options = null)
119{
120Argument.AssertNotNullOrEmpty(threadId, nameof(threadId));
121Argument.AssertNotNull(content, nameof(content));
122
123PipelineMessage message = null;
124try
125{
bf3f0eddJose Arriaga Maldonado1 years ago126// Always request the included properties.
127IEnumerable<InternalIncludedRunStepProperty> includedRunStepProperties = [InternalIncludedRunStepProperty.FileSearchResultContent];
128
5dce104aJose Arriaga Maldonado1 years ago129message = CreateCreateRunRequest(threadId, content, includedRunStepProperties, options);
e0fee603Jose Arriaga Maldonado1 years ago130return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options));
9f9f2936Jose Arriaga Maldonado2 years ago131}
132finally
133{
134if (options?.BufferResponse != false)
135{
136message.Dispose();
137}
138}
139}
140
141/// <summary>
142/// [Protocol Method] Retrieves a run.
143/// </summary>
144/// <param name="threadId"> The ID of the [thread](/docs/api-reference/threads) that was run. </param>
145/// <param name="runId"> The ID of the run to retrieve. </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="threadId"/> or <paramref name="runId"/> is null. </exception>
148/// <exception cref="ArgumentException"> <paramref name="threadId"/> or <paramref name="runId"/> 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>
151public virtual async Task<ClientResult> GetRunAsync(string threadId, string runId, RequestOptions options)
152{
153Argument.AssertNotNullOrEmpty(threadId, nameof(threadId));
154Argument.AssertNotNullOrEmpty(runId, nameof(runId));
155
156using PipelineMessage message = CreateGetRunRequest(threadId, runId, options);
e0fee603Jose Arriaga Maldonado1 years ago157return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false));
9f9f2936Jose Arriaga Maldonado2 years ago158}
159
160/// <summary>
161/// [Protocol Method] Retrieves a run.
162/// </summary>
163/// <param name="threadId"> The ID of the [thread](/docs/api-reference/threads) that was run. </param>
164/// <param name="runId"> The ID of the run to retrieve. </param>
165/// <param name="options"> The request options, which can override default behaviors of the client pipeline on a per-call basis. </param>
166/// <exception cref="ArgumentNullException"> <paramref name="threadId"/> or <paramref name="runId"/> is null. </exception>
167/// <exception cref="ArgumentException"> <paramref name="threadId"/> or <paramref name="runId"/> is an empty string, and was expected to be non-empty. </exception>
168/// <exception cref="ClientResultException"> Service returned a non-success status code. </exception>
169/// <returns> The response returned from the service. </returns>
170public virtual ClientResult GetRun(string threadId, string runId, RequestOptions options)
171{
172Argument.AssertNotNullOrEmpty(threadId, nameof(threadId));
173Argument.AssertNotNullOrEmpty(runId, nameof(runId));
174
175using PipelineMessage message = CreateGetRunRequest(threadId, runId, options);
e0fee603Jose Arriaga Maldonado1 years ago176return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options));
9f9f2936Jose Arriaga Maldonado2 years ago177}
178
179/// <summary>
180/// [Protocol Method] Modifies a run.
181/// </summary>
182/// <param name="threadId"> The ID of the [thread](/docs/api-reference/threads) that was run. </param>
183/// <param name="runId"> The ID of the run to modify. </param>
184/// <param name="content"> The content to send as the body of the request. </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="threadId"/>, <paramref name="runId"/> or <paramref name="content"/> is null. </exception>
187/// <exception cref="ArgumentException"> <paramref name="threadId"/> or <paramref name="runId"/> 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>
190public virtual async Task<ClientResult> ModifyRunAsync(string threadId, string runId, BinaryContent content, RequestOptions options = null)
191{
192Argument.AssertNotNullOrEmpty(threadId, nameof(threadId));
193Argument.AssertNotNullOrEmpty(runId, nameof(runId));
194Argument.AssertNotNull(content, nameof(content));
195
196using PipelineMessage message = CreateModifyRunRequest(threadId, runId, content, options);
e0fee603Jose Arriaga Maldonado1 years ago197return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false));
9f9f2936Jose Arriaga Maldonado2 years ago198}
199
200/// <summary>
201/// [Protocol Method] Modifies a run.
202/// </summary>
203/// <param name="threadId"> The ID of the [thread](/docs/api-reference/threads) that was run. </param>
204/// <param name="runId"> The ID of the run to modify. </param>
205/// <param name="content"> The content to send as the body of the request. </param>
206/// <param name="options"> The request options, which can override default behaviors of the client pipeline on a per-call basis. </param>
207/// <exception cref="ArgumentNullException"> <paramref name="threadId"/>, <paramref name="runId"/> or <paramref name="content"/> is null. </exception>
208/// <exception cref="ArgumentException"> <paramref name="threadId"/> or <paramref name="runId"/> is an empty string, and was expected to be non-empty. </exception>
209/// <exception cref="ClientResultException"> Service returned a non-success status code. </exception>
210/// <returns> The response returned from the service. </returns>
211public virtual ClientResult ModifyRun(string threadId, string runId, BinaryContent content, RequestOptions options = null)
212{
213Argument.AssertNotNullOrEmpty(threadId, nameof(threadId));
214Argument.AssertNotNullOrEmpty(runId, nameof(runId));
215Argument.AssertNotNull(content, nameof(content));
216
217using PipelineMessage message = CreateModifyRunRequest(threadId, runId, content, options);
e0fee603Jose Arriaga Maldonado1 years ago218return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options));
9f9f2936Jose Arriaga Maldonado2 years ago219}
220
221/// <summary>
222/// [Protocol Method] Cancels a run that is `in_progress`.
223/// </summary>
224/// <param name="threadId"> The ID of the thread to which this run belongs. </param>
225/// <param name="runId"> The ID of the run to cancel. </param>
226/// <param name="options"> The request options, which can override default behaviors of the client pipeline on a per-call basis. </param>
227/// <exception cref="ArgumentNullException"> <paramref name="threadId"/> or <paramref name="runId"/> is null. </exception>
228/// <exception cref="ArgumentException"> <paramref name="threadId"/> or <paramref name="runId"/> is an empty string, and was expected to be non-empty. </exception>
229/// <exception cref="ClientResultException"> Service returned a non-success status code. </exception>
230/// <returns> The response returned from the service. </returns>
231public virtual async Task<ClientResult> CancelRunAsync(string threadId, string runId, RequestOptions options)
232{
233Argument.AssertNotNullOrEmpty(threadId, nameof(threadId));
234Argument.AssertNotNullOrEmpty(runId, nameof(runId));
235
236using PipelineMessage message = CreateCancelRunRequest(threadId, runId, options);
e0fee603Jose Arriaga Maldonado1 years ago237return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false));
9f9f2936Jose Arriaga Maldonado2 years ago238}
239
240/// <summary>
241/// [Protocol Method] Cancels a run that is `in_progress`.
242/// </summary>
243/// <param name="threadId"> The ID of the thread to which this run belongs. </param>
244/// <param name="runId"> The ID of the run to cancel. </param>
245/// <param name="options"> The request options, which can override default behaviors of the client pipeline on a per-call basis. </param>
246/// <exception cref="ArgumentNullException"> <paramref name="threadId"/> or <paramref name="runId"/> is null. </exception>
247/// <exception cref="ArgumentException"> <paramref name="threadId"/> or <paramref name="runId"/> is an empty string, and was expected to be non-empty. </exception>
248/// <exception cref="ClientResultException"> Service returned a non-success status code. </exception>
249/// <returns> The response returned from the service. </returns>
250public virtual ClientResult CancelRun(string threadId, string runId, RequestOptions options)
251{
252Argument.AssertNotNullOrEmpty(threadId, nameof(threadId));
253Argument.AssertNotNullOrEmpty(runId, nameof(runId));
254
255using PipelineMessage message = CreateCancelRunRequest(threadId, runId, options);
e0fee603Jose Arriaga Maldonado1 years ago256return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options));
9f9f2936Jose Arriaga Maldonado2 years ago257}
258
259/// <summary>
260/// [Protocol Method] When a run has the `status: "requires_action"` and `required_action.type` is
261/// `submit_tool_outputs`, this endpoint can be used to submit the outputs from the tool calls once
262/// they're all completed. All outputs must be submitted in a single request.
263/// </summary>
264/// <param name="threadId"> The ID of the [thread](/docs/api-reference/threads) to which this run belongs. </param>
265/// <param name="runId"> The ID of the run that requires the tool output submission. </param>
266/// <param name="content"> The content to send as the body of the request. </param>
267/// <param name="options"> The request options, which can override default behaviors of the client pipeline on a per-call basis. </param>
268/// <exception cref="ArgumentNullException"> <paramref name="threadId"/>, <paramref name="runId"/> or <paramref name="content"/> is null. </exception>
269/// <exception cref="ArgumentException"> <paramref name="threadId"/> or <paramref name="runId"/> is an empty string, and was expected to be non-empty. </exception>
270/// <exception cref="ClientResultException"> Service returned a non-success status code. </exception>
271/// <returns> The response returned from the service. </returns>
272public virtual async Task<ClientResult> SubmitToolOutputsToRunAsync(string threadId, string runId, BinaryContent content, RequestOptions options = null)
273{
274Argument.AssertNotNullOrEmpty(threadId, nameof(threadId));
275Argument.AssertNotNullOrEmpty(runId, nameof(runId));
276Argument.AssertNotNull(content, nameof(content));
277
278PipelineMessage message = null;
279try
280{
5dce104aJose Arriaga Maldonado1 years ago281message = CreateSubmitToolOutputsToRunRequest(threadId, runId, content, options);
e0fee603Jose Arriaga Maldonado1 years ago282return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false));
9f9f2936Jose Arriaga Maldonado2 years ago283}
284finally
285{
286if (options?.BufferResponse != false)
287{
288message.Dispose();
289}
290}
291}
292
293/// <summary>
294/// [Protocol Method] When a run has the `status: "requires_action"` and `required_action.type` is
295/// `submit_tool_outputs`, this endpoint can be used to submit the outputs from the tool calls once
296/// they're all completed. All outputs must be submitted in a single request.
297/// </summary>
298/// <param name="threadId"> The ID of the [thread](/docs/api-reference/threads) to which this run belongs. </param>
299/// <param name="runId"> The ID of the run that requires the tool output submission. </param>
300/// <param name="content"> The content to send as the body of the request. </param>
301/// <param name="options"> The request options, which can override default behaviors of the client pipeline on a per-call basis. </param>
302/// <exception cref="ArgumentNullException"> <paramref name="threadId"/>, <paramref name="runId"/> or <paramref name="content"/> is null. </exception>
303/// <exception cref="ArgumentException"> <paramref name="threadId"/> or <paramref name="runId"/> is an empty string, and was expected to be non-empty. </exception>
304/// <exception cref="ClientResultException"> Service returned a non-success status code. </exception>
305/// <returns> The response returned from the service. </returns>
306public virtual ClientResult SubmitToolOutputsToRun(string threadId, string runId, BinaryContent content, RequestOptions options = null)
307{
308Argument.AssertNotNullOrEmpty(threadId, nameof(threadId));
309Argument.AssertNotNullOrEmpty(runId, nameof(runId));
310Argument.AssertNotNull(content, nameof(content));
311
312PipelineMessage message = null;
313try
314{
5dce104aJose Arriaga Maldonado1 years ago315message = CreateSubmitToolOutputsToRunRequest(threadId, runId, content, options);
e0fee603Jose Arriaga Maldonado1 years ago316return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options));
9f9f2936Jose Arriaga Maldonado2 years ago317}
318finally
319{
320if (options?.BufferResponse != false)
321{
322message.Dispose();
323}
324}
325}
326
bf3f0eddJose Arriaga Maldonado1 years ago327public virtual async Task<ClientResult> GetRunStepsAsync(string threadId, string runId, int? limit, string order, string after, string before, RequestOptions options)
328{
329Argument.AssertNotNullOrEmpty(threadId, nameof(threadId));
330Argument.AssertNotNullOrEmpty(runId, nameof(runId));
331
332// Always request the included properties.
333IEnumerable<InternalIncludedRunStepProperty> includedRunStepProperties = [InternalIncludedRunStepProperty.FileSearchResultContent];
334
5dce104aJose Arriaga Maldonado1 years ago335using PipelineMessage message = CreateGetRunStepsRequest(threadId, runId, limit, order, after, before, includedRunStepProperties, options);
e0fee603Jose Arriaga Maldonado1 years ago336return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false));
bf3f0eddJose Arriaga Maldonado1 years ago337}
338
339public virtual ClientResult GetRunSteps(string threadId, string runId, int? limit, string order, string after, string before, RequestOptions options)
340{
341Argument.AssertNotNullOrEmpty(threadId, nameof(threadId));
342Argument.AssertNotNullOrEmpty(runId, nameof(runId));
343
344// Always request the included properties.
345IEnumerable<InternalIncludedRunStepProperty> includedRunStepProperties = [InternalIncludedRunStepProperty.FileSearchResultContent];
346
5dce104aJose Arriaga Maldonado1 years ago347using PipelineMessage message = CreateGetRunStepsRequest(threadId, runId, limit, order, after, before, includedRunStepProperties, options);
e0fee603Jose Arriaga Maldonado1 years ago348return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options));
bf3f0eddJose Arriaga Maldonado1 years ago349}
350
9f9f2936Jose Arriaga Maldonado2 years ago351/// <summary>
352/// [Protocol Method] Retrieves a run step.
353/// </summary>
354/// <param name="threadId"> The ID of the thread to which the run and run step belongs. </param>
355/// <param name="runId"> The ID of the run to which the run step belongs. </param>
356/// <param name="stepId"> The ID of the run step to retrieve. </param>
357/// <param name="options"> The request options, which can override default behaviors of the client pipeline on a per-call basis. </param>
358/// <exception cref="ArgumentNullException"> <paramref name="threadId"/>, <paramref name="runId"/> or <paramref name="stepId"/> is null. </exception>
359/// <exception cref="ArgumentException"> <paramref name="threadId"/>, <paramref name="runId"/> or <paramref name="stepId"/> is an empty string, and was expected to be non-empty. </exception>
360/// <exception cref="ClientResultException"> Service returned a non-success status code. </exception>
361/// <returns> The response returned from the service. </returns>
362public virtual async Task<ClientResult> GetRunStepAsync(string threadId, string runId, string stepId, RequestOptions options)
363{
364Argument.AssertNotNullOrEmpty(threadId, nameof(threadId));
365Argument.AssertNotNullOrEmpty(runId, nameof(runId));
366Argument.AssertNotNullOrEmpty(stepId, nameof(stepId));
367
bf3f0eddJose Arriaga Maldonado1 years ago368// Always request the included properties.
369IEnumerable<InternalIncludedRunStepProperty> includedRunStepProperties = [InternalIncludedRunStepProperty.FileSearchResultContent];
370
371using PipelineMessage message = CreateGetRunStepRequest(threadId, runId, stepId, includedRunStepProperties, options);
e0fee603Jose Arriaga Maldonado1 years ago372return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false));
9f9f2936Jose Arriaga Maldonado2 years ago373}
374
375/// <summary>
376/// [Protocol Method] Retrieves a run step.
377/// </summary>
378/// <param name="threadId"> The ID of the thread to which the run and run step belongs. </param>
379/// <param name="runId"> The ID of the run to which the run step belongs. </param>
380/// <param name="stepId"> The ID of the run step to retrieve. </param>
381/// <param name="options"> The request options, which can override default behaviors of the client pipeline on a per-call basis. </param>
382/// <exception cref="ArgumentNullException"> <paramref name="threadId"/>, <paramref name="runId"/> or <paramref name="stepId"/> is null. </exception>
383/// <exception cref="ArgumentException"> <paramref name="threadId"/>, <paramref name="runId"/> or <paramref name="stepId"/> is an empty string, and was expected to be non-empty. </exception>
384/// <exception cref="ClientResultException"> Service returned a non-success status code. </exception>
385/// <returns> The response returned from the service. </returns>
386public virtual ClientResult GetRunStep(string threadId, string runId, string stepId, RequestOptions options)
387{
388Argument.AssertNotNullOrEmpty(threadId, nameof(threadId));
389Argument.AssertNotNullOrEmpty(runId, nameof(runId));
390Argument.AssertNotNullOrEmpty(stepId, nameof(stepId));
391
bf3f0eddJose Arriaga Maldonado1 years ago392// Always request the included properties.
393IEnumerable<InternalIncludedRunStepProperty> includedRunStepProperties = [InternalIncludedRunStepProperty.FileSearchResultContent];
394
395using PipelineMessage message = CreateGetRunStepRequest(threadId, runId, stepId, includedRunStepProperties, options);
e0fee603Jose Arriaga Maldonado1 years ago396return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options));
9f9f2936Jose Arriaga Maldonado2 years ago397}
398}