Skip to content

Commit

Permalink
feat: Updated OpenAPI spec
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored and HavenDV committed Jul 9, 2024
1 parent 713b362 commit 90d3094
Show file tree
Hide file tree
Showing 78 changed files with 3,350 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/libs/OpenAI/Generated/JsonSerializerContext.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#nullable enable

#pragma warning disable CS0618 // Type or member is obsolete
#pragma warning disable CS3016 // Arrays as attribute arguments is not CLS-compliant

namespace OpenAI
{
Expand Down
50 changes: 50 additions & 0 deletions src/libs/OpenAI/Generated/OpenAI.AssistantsClient.CancelRun.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,24 @@ namespace OpenAI
{
public partial class AssistantsClient
{
partial void PrepareCancelRunArguments(
global::System.Net.Http.HttpClient httpClient,
ref string threadId,
ref string runId);
partial void PrepareCancelRunRequest(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpRequestMessage httpRequestMessage,
string threadId,
string runId);
partial void ProcessCancelRunResponse(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpResponseMessage httpResponseMessage);

partial void ProcessCancelRunResponseContent(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpResponseMessage httpResponseMessage,
ref string content);

/// <summary>
/// Cancels a run that is `in_progress`.
/// </summary>
Expand All @@ -17,17 +35,49 @@ public partial class AssistantsClient
string runId,
global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: _httpClient);
PrepareCancelRunArguments(
httpClient: _httpClient,
threadId: ref threadId,
runId: ref runId);

using var httpRequest = new global::System.Net.Http.HttpRequestMessage(
method: global::System.Net.Http.HttpMethod.Post,
requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + $"/threads/{threadId}/runs/{runId}/cancel", global::System.UriKind.RelativeOrAbsolute));

PrepareRequest(
client: _httpClient,
request: httpRequest);
PrepareCancelRunRequest(
httpClient: _httpClient,
httpRequestMessage: httpRequest,
threadId: threadId,
runId: runId);

using var response = await _httpClient.SendAsync(
request: httpRequest,
completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
cancellationToken: cancellationToken).ConfigureAwait(false);

ProcessResponse(
client: _httpClient,
response: response);
ProcessCancelRunResponse(
httpClient: _httpClient,
httpResponseMessage: response);

var __content = await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);

ProcessResponseContent(
client: _httpClient,
response: response,
content: ref __content);
ProcessCancelRunResponseContent(
httpClient: _httpClient,
httpResponseMessage: response,
content: ref __content);

try
{
response.EnsureSuccessStatusCode();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@ namespace OpenAI
{
public partial class AssistantsClient
{
partial void PrepareCreateAssistantArguments(
global::System.Net.Http.HttpClient httpClient,
global::OpenAI.CreateAssistantRequest request);
partial void PrepareCreateAssistantRequest(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpRequestMessage httpRequestMessage,
global::OpenAI.CreateAssistantRequest request);
partial void ProcessCreateAssistantResponse(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpResponseMessage httpResponseMessage);

partial void ProcessCreateAssistantResponseContent(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpResponseMessage httpResponseMessage,
ref string content);

/// <summary>
/// Create an assistant with a model and instructions.
/// </summary>
Expand All @@ -17,6 +33,12 @@ public partial class AssistantsClient
{
request = request ?? throw new global::System.ArgumentNullException(nameof(request));

PrepareArguments(
client: _httpClient);
PrepareCreateAssistantArguments(
httpClient: _httpClient,
request: request);

using var httpRequest = new global::System.Net.Http.HttpRequestMessage(
method: global::System.Net.Http.HttpMethod.Post,
requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + "/assistants", global::System.UriKind.RelativeOrAbsolute));
Expand All @@ -26,13 +48,37 @@ public partial class AssistantsClient
encoding: global::System.Text.Encoding.UTF8,
mediaType: "application/json");

PrepareRequest(
client: _httpClient,
request: httpRequest);
PrepareCreateAssistantRequest(
httpClient: _httpClient,
httpRequestMessage: httpRequest,
request: request);

using var response = await _httpClient.SendAsync(
request: httpRequest,
completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
cancellationToken: cancellationToken).ConfigureAwait(false);

ProcessResponse(
client: _httpClient,
response: response);
ProcessCreateAssistantResponse(
httpClient: _httpClient,
httpResponseMessage: response);

var __content = await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);

ProcessResponseContent(
client: _httpClient,
response: response,
content: ref __content);
ProcessCreateAssistantResponseContent(
httpClient: _httpClient,
httpResponseMessage: response,
content: ref __content);

try
{
response.EnsureSuccessStatusCode();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,24 @@ namespace OpenAI
{
public partial class AssistantsClient
{
partial void PrepareCreateMessageArguments(
global::System.Net.Http.HttpClient httpClient,
ref string threadId,
global::OpenAI.CreateMessageRequest request);
partial void PrepareCreateMessageRequest(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpRequestMessage httpRequestMessage,
string threadId,
global::OpenAI.CreateMessageRequest request);
partial void ProcessCreateMessageResponse(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpResponseMessage httpResponseMessage);

partial void ProcessCreateMessageResponseContent(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpResponseMessage httpResponseMessage,
ref string content);

/// <summary>
/// Create a message.
/// </summary>
Expand All @@ -19,6 +37,13 @@ public partial class AssistantsClient
{
request = request ?? throw new global::System.ArgumentNullException(nameof(request));

PrepareArguments(
client: _httpClient);
PrepareCreateMessageArguments(
httpClient: _httpClient,
threadId: ref threadId,
request: request);

using var httpRequest = new global::System.Net.Http.HttpRequestMessage(
method: global::System.Net.Http.HttpMethod.Post,
requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + $"/threads/{threadId}/messages", global::System.UriKind.RelativeOrAbsolute));
Expand All @@ -28,13 +53,38 @@ public partial class AssistantsClient
encoding: global::System.Text.Encoding.UTF8,
mediaType: "application/json");

PrepareRequest(
client: _httpClient,
request: httpRequest);
PrepareCreateMessageRequest(
httpClient: _httpClient,
httpRequestMessage: httpRequest,
threadId: threadId,
request: request);

using var response = await _httpClient.SendAsync(
request: httpRequest,
completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
cancellationToken: cancellationToken).ConfigureAwait(false);

ProcessResponse(
client: _httpClient,
response: response);
ProcessCreateMessageResponse(
httpClient: _httpClient,
httpResponseMessage: response);

var __content = await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);

ProcessResponseContent(
client: _httpClient,
response: response,
content: ref __content);
ProcessCreateMessageResponseContent(
httpClient: _httpClient,
httpResponseMessage: response,
content: ref __content);

try
{
response.EnsureSuccessStatusCode();
Expand Down
50 changes: 50 additions & 0 deletions src/libs/OpenAI/Generated/OpenAI.AssistantsClient.CreateRun.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,24 @@ namespace OpenAI
{
public partial class AssistantsClient
{
partial void PrepareCreateRunArguments(
global::System.Net.Http.HttpClient httpClient,
ref string threadId,
global::OpenAI.CreateRunRequest request);
partial void PrepareCreateRunRequest(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpRequestMessage httpRequestMessage,
string threadId,
global::OpenAI.CreateRunRequest request);
partial void ProcessCreateRunResponse(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpResponseMessage httpResponseMessage);

partial void ProcessCreateRunResponseContent(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpResponseMessage httpResponseMessage,
ref string content);

/// <summary>
/// Create a run.
/// </summary>
Expand All @@ -19,6 +37,13 @@ public partial class AssistantsClient
{
request = request ?? throw new global::System.ArgumentNullException(nameof(request));

PrepareArguments(
client: _httpClient);
PrepareCreateRunArguments(
httpClient: _httpClient,
threadId: ref threadId,
request: request);

using var httpRequest = new global::System.Net.Http.HttpRequestMessage(
method: global::System.Net.Http.HttpMethod.Post,
requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + $"/threads/{threadId}/runs", global::System.UriKind.RelativeOrAbsolute));
Expand All @@ -28,13 +53,38 @@ public partial class AssistantsClient
encoding: global::System.Text.Encoding.UTF8,
mediaType: "application/json");

PrepareRequest(
client: _httpClient,
request: httpRequest);
PrepareCreateRunRequest(
httpClient: _httpClient,
httpRequestMessage: httpRequest,
threadId: threadId,
request: request);

using var response = await _httpClient.SendAsync(
request: httpRequest,
completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
cancellationToken: cancellationToken).ConfigureAwait(false);

ProcessResponse(
client: _httpClient,
response: response);
ProcessCreateRunResponse(
httpClient: _httpClient,
httpResponseMessage: response);

var __content = await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);

ProcessResponseContent(
client: _httpClient,
response: response,
content: ref __content);
ProcessCreateRunResponseContent(
httpClient: _httpClient,
httpResponseMessage: response,
content: ref __content);

try
{
response.EnsureSuccessStatusCode();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@ namespace OpenAI
{
public partial class AssistantsClient
{
partial void PrepareCreateThreadArguments(
global::System.Net.Http.HttpClient httpClient,
global::OpenAI.CreateThreadRequest request);
partial void PrepareCreateThreadRequest(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpRequestMessage httpRequestMessage,
global::OpenAI.CreateThreadRequest request);
partial void ProcessCreateThreadResponse(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpResponseMessage httpResponseMessage);

partial void ProcessCreateThreadResponseContent(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpResponseMessage httpResponseMessage,
ref string content);

/// <summary>
/// Create a thread.
/// </summary>
Expand All @@ -17,6 +33,12 @@ public partial class AssistantsClient
{
request = request ?? throw new global::System.ArgumentNullException(nameof(request));

PrepareArguments(
client: _httpClient);
PrepareCreateThreadArguments(
httpClient: _httpClient,
request: request);

using var httpRequest = new global::System.Net.Http.HttpRequestMessage(
method: global::System.Net.Http.HttpMethod.Post,
requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + "/threads", global::System.UriKind.RelativeOrAbsolute));
Expand All @@ -26,13 +48,37 @@ public partial class AssistantsClient
encoding: global::System.Text.Encoding.UTF8,
mediaType: "application/json");

PrepareRequest(
client: _httpClient,
request: httpRequest);
PrepareCreateThreadRequest(
httpClient: _httpClient,
httpRequestMessage: httpRequest,
request: request);

using var response = await _httpClient.SendAsync(
request: httpRequest,
completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
cancellationToken: cancellationToken).ConfigureAwait(false);

ProcessResponse(
client: _httpClient,
response: response);
ProcessCreateThreadResponse(
httpClient: _httpClient,
httpResponseMessage: response);

var __content = await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);

ProcessResponseContent(
client: _httpClient,
response: response,
content: ref __content);
ProcessCreateThreadResponseContent(
httpClient: _httpClient,
httpResponseMessage: response,
content: ref __content);

try
{
response.EnsureSuccessStatusCode();
Expand Down
Loading

0 comments on commit 90d3094

Please sign in to comment.