Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 27 additions & 2 deletions src/libs/Reka/Generated/Reka.ChatClient.CreateChatCompletion.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,25 @@ namespace Reka
{
public partial class ChatClient
{


private static readonly global::Reka.EndPointSecurityRequirement s_CreateChatCompletionSecurityRequirement0 =
new global::Reka.EndPointSecurityRequirement
{
Authorizations = new global::Reka.EndPointAuthorizationRequirement[]
{ new global::Reka.EndPointAuthorizationRequirement
{
Type = "ApiKey",
Location = "Header",
Name = "X-Api-Key",
FriendlyName = "ApiKeyInHeader",
},
},
};
private static readonly global::Reka.EndPointSecurityRequirement[] s_CreateChatCompletionSecurityRequirements =
new global::Reka.EndPointSecurityRequirement[]
{ s_CreateChatCompletionSecurityRequirement0,
};
partial void PrepareCreateChatCompletionArguments(
global::System.Net.Http.HttpClient httpClient,
global::Reka.CreateChatCompletionRequest request);
Expand Down Expand Up @@ -41,9 +60,15 @@ partial void ProcessCreateChatCompletionResponseContent(
httpClient: HttpClient,
request: request);


var __authorizations = global::Reka.EndPointSecurityResolver.ResolveAuthorizations(
availableAuthorizations: Authorizations,
securityRequirements: s_CreateChatCompletionSecurityRequirements,
operationName: "CreateChatCompletionAsync");

var __pathBuilder = new global::Reka.PathBuilder(
path: "/v1/chat/completions",
baseUri: HttpClient.BaseAddress);
baseUri: HttpClient.BaseAddress);
var __path = __pathBuilder.ToString();
using var __httpRequest = new global::System.Net.Http.HttpRequestMessage(
method: global::System.Net.Http.HttpMethod.Post,
Expand All @@ -53,7 +78,7 @@ partial void ProcessCreateChatCompletionResponseContent(
__httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher;
#endif

foreach (var __authorization in Authorizations)
foreach (var __authorization in __authorizations)
{
if (__authorization.Type == "Http" ||
__authorization.Type == "OAuth2")
Expand Down
4 changes: 2 additions & 2 deletions src/libs/Reka/Generated/Reka.ChatClient.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace Reka
{
/// <summary>
/// Chat completion operations<br/>
/// Chat completion operations.<br/>
/// If no httpClient is provided, a new one will be created.<br/>
/// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
/// </summary>
Expand All @@ -13,7 +13,7 @@ public sealed partial class ChatClient : global::Reka.IChatClient, global::Syste
/// <summary>
/// Reka API
/// </summary>
public const string DefaultBaseUrl = "https://api.reka.ai";
public const string DefaultBaseUrl = "https://api.reka.ai/";

private bool _disposeHttpClient = true;

Expand Down
2 changes: 1 addition & 1 deletion src/libs/Reka/Generated/Reka.IChatClient.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace Reka
{
/// <summary>
/// Chat completion operations<br/>
/// Chat completion operations.<br/>
/// If no httpClient is provided, a new one will be created.<br/>
/// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion src/libs/Reka/Generated/Reka.IModelsClient.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace Reka
{
/// <summary>
/// Model management operations<br/>
/// Model management operations.<br/>
/// If no httpClient is provided, a new one will be created.<br/>
/// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public partial interface IRekaClient
/// Authorize using ApiKey authentication.
/// </summary>
/// <param name="apiKey"></param>

public void AuthorizeUsingApiKeyInHeader(
string apiKey);
}
Expand Down
6 changes: 3 additions & 3 deletions src/libs/Reka/Generated/Reka.IRekaClient.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,17 @@ public partial interface IRekaClient : global::System.IDisposable


/// <summary>
/// Chat completion operations
/// Chat completion operations.
/// </summary>
public ChatClient Chat { get; }

/// <summary>
/// Model management operations
/// Model management operations.
/// </summary>
public ModelsClient Models { get; }

/// <summary>
/// Speech transcription and translation operations
/// Speech transcription and translation operations.
/// </summary>
public SpeechClient Speech { get; }

Expand Down
2 changes: 1 addition & 1 deletion src/libs/Reka/Generated/Reka.ISpeechClient.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace Reka
{
/// <summary>
/// Speech transcription and translation operations<br/>
/// Speech transcription and translation operations.<br/>
/// If no httpClient is provided, a new one will be created.<br/>
/// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
/// </summary>
Expand Down
29 changes: 27 additions & 2 deletions src/libs/Reka/Generated/Reka.ModelsClient.ListModels.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,25 @@ namespace Reka
{
public partial class ModelsClient
{


private static readonly global::Reka.EndPointSecurityRequirement s_ListModelsSecurityRequirement0 =
new global::Reka.EndPointSecurityRequirement
{
Authorizations = new global::Reka.EndPointAuthorizationRequirement[]
{ new global::Reka.EndPointAuthorizationRequirement
{
Type = "ApiKey",
Location = "Header",
Name = "X-Api-Key",
FriendlyName = "ApiKeyInHeader",
},
},
};
private static readonly global::Reka.EndPointSecurityRequirement[] s_ListModelsSecurityRequirements =
new global::Reka.EndPointSecurityRequirement[]
{ s_ListModelsSecurityRequirement0,
};
partial void PrepareListModelsArguments(
global::System.Net.Http.HttpClient httpClient);
partial void PrepareListModelsRequest(
Expand Down Expand Up @@ -33,9 +52,15 @@ partial void ProcessListModelsResponseContent(
PrepareListModelsArguments(
httpClient: HttpClient);


var __authorizations = global::Reka.EndPointSecurityResolver.ResolveAuthorizations(
availableAuthorizations: Authorizations,
securityRequirements: s_ListModelsSecurityRequirements,
operationName: "ListModelsAsync");

var __pathBuilder = new global::Reka.PathBuilder(
path: "/v1/models",
baseUri: HttpClient.BaseAddress);
baseUri: HttpClient.BaseAddress);
var __path = __pathBuilder.ToString();
using var __httpRequest = new global::System.Net.Http.HttpRequestMessage(
method: global::System.Net.Http.HttpMethod.Get,
Expand All @@ -45,7 +70,7 @@ partial void ProcessListModelsResponseContent(
__httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher;
#endif

foreach (var __authorization in Authorizations)
foreach (var __authorization in __authorizations)
{
if (__authorization.Type == "Http" ||
__authorization.Type == "OAuth2")
Expand Down
4 changes: 2 additions & 2 deletions src/libs/Reka/Generated/Reka.ModelsClient.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace Reka
{
/// <summary>
/// Model management operations<br/>
/// Model management operations.<br/>
/// If no httpClient is provided, a new one will be created.<br/>
/// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
/// </summary>
Expand All @@ -13,7 +13,7 @@ public sealed partial class ModelsClient : global::Reka.IModelsClient, global::S
/// <summary>
/// Reka API
/// </summary>
public const string DefaultBaseUrl = "https://api.reka.ai";
public const string DefaultBaseUrl = "https://api.reka.ai/";

private bool _disposeHttpClient = true;

Expand Down
34 changes: 34 additions & 0 deletions src/libs/Reka/Generated/Reka.PathBuilder.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,40 @@ public PathBuilder AddOptionalParameter<T>(
return this;
}

/// <summary>
/// Adds a pre-serialized query string fragment to the URL.
/// </summary>
/// <param name="value">The serialized query string value.</param>
/// <returns>The current <see cref="PathBuilder"/> instance.</returns>
public PathBuilder AddRawQueryString(
string value)
{
if (string.IsNullOrWhiteSpace(value))
{
return this;
}

value = value.TrimStart('?', '&');
if (value.Length == 0)
{
return this;
}

if (_firstParameter)
{
_stringBuilder.Append('?');
_firstParameter = false;
}
else
{
_stringBuilder.Append('&');
}

_stringBuilder.Append(value);

return this;
}

/// <summary>
/// Returns the constructed URL as a string.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,24 @@ namespace Reka
{
public sealed partial class RekaClient
{

/// <inheritdoc/>
public void AuthorizeUsingApiKeyInHeader(
string apiKey)
{
apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey));

Authorizations.Clear();
for (var i = Authorizations.Count - 1; i >= 0; i--)
{
var __authorization = Authorizations[i];
if (__authorization.Type == "ApiKey" &&
__authorization.Location == "Header" &&
__authorization.Name == "X-Api-Key")
{
Authorizations.RemoveAt(i);
}
}

Authorizations.Add(new global::Reka.EndPointAuthorization
{
Type = "ApiKey",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ namespace Reka
public sealed partial class RekaClient
{
/// <inheritdoc cref="RekaClient(global::System.Net.Http.HttpClient?, global::System.Uri?, global::System.Collections.Generic.List{global::Reka.EndPointAuthorization}?, bool)"/>

public RekaClient(
string apiKey,
global::System.Net.Http.HttpClient? httpClient = null,
Expand Down
8 changes: 4 additions & 4 deletions src/libs/Reka/Generated/Reka.RekaClient.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public sealed partial class RekaClient : global::Reka.IRekaClient, global::Syste
/// <summary>
/// Reka API
/// </summary>
public const string DefaultBaseUrl = "https://api.reka.ai";
public const string DefaultBaseUrl = "https://api.reka.ai/";

private bool _disposeHttpClient = true;

Expand All @@ -38,7 +38,7 @@ public sealed partial class RekaClient : global::Reka.IRekaClient, global::Syste


/// <summary>
/// Chat completion operations
/// Chat completion operations.
/// </summary>
public ChatClient Chat => new ChatClient(HttpClient, authorizations: Authorizations)
{
Expand All @@ -47,7 +47,7 @@ public sealed partial class RekaClient : global::Reka.IRekaClient, global::Syste
};

/// <summary>
/// Model management operations
/// Model management operations.
/// </summary>
public ModelsClient Models => new ModelsClient(HttpClient, authorizations: Authorizations)
{
Expand All @@ -56,7 +56,7 @@ public sealed partial class RekaClient : global::Reka.IRekaClient, global::Syste
};

/// <summary>
/// Speech transcription and translation operations
/// Speech transcription and translation operations.
/// </summary>
public SpeechClient Speech => new SpeechClient(HttpClient, authorizations: Authorizations)
{
Expand Down
Loading
Loading