Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api): add AI API support #236

Merged
merged 4 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
17 changes: 17 additions & 0 deletions src/Crowdin.Api/AI/ActionRule.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

using System.Collections.Generic;
using JetBrains.Annotations;
using Newtonsoft.Json;

namespace Crowdin.Api.AI
{
[PublicAPI]
public class ActionRule
{
[JsonProperty("action")]
public AiPromptAction? Action { get; set; }

[JsonProperty("availableAiModelIds")]
public List<string> AvailableAiModelIds { get; set; }
}
}
36 changes: 36 additions & 0 deletions src/Crowdin.Api/AI/AddAiPromptRequest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

using System.Collections.Generic;
using JetBrains.Annotations;
using Newtonsoft.Json;

#nullable enable

namespace Crowdin.Api.AI
{
[PublicAPI]
public class AddAiPromptRequest
{
#pragma warning disable CS8618
[JsonProperty("name")]
public string Name { get; set; }

[JsonProperty("action")]
public AiPromptAction Action { get; set; }

[JsonProperty("aiProviderId")]
public int AiProviderId { get; set; }

[JsonProperty("aiModelId")]
public string AiModelId { get; set; }

[JsonProperty("config")]
public AiPromptConfiguration Configuration { get; set; }
#pragma warning restore CS8618

[JsonProperty("isEnabled")]
public bool? IsEnabled { get; set; }

[JsonProperty("enabledProjectIds")]
public ICollection<int>? EnabledProjectIds { get; set; }
}
}
32 changes: 32 additions & 0 deletions src/Crowdin.Api/AI/AddAiProviderRequest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

using JetBrains.Annotations;
using Newtonsoft.Json;

#nullable enable

namespace Crowdin.Api.AI
{
[PublicAPI]
public class AddAiProviderRequest
{
#pragma warning disable CS8618
[JsonProperty("name")]
public string Name { get; set; }
#pragma warning restore CS8618

[JsonProperty("type")]
public AiProviderType Type { get; set; }

[JsonProperty("credentials")]
public AiProviderCredentials? Credentials { get; set; }

[JsonProperty("config")]
public AiProviderConfiguration? Configuration { get; set; }

[JsonProperty("isEnabled")]
public bool? IsEnabled { get; set; }

[JsonProperty("useSystemCredentials")]
public bool? UseSystemCredentials { get; set; }
}
}
Loading
Loading