Skip to content

Commit

Permalink
feat(specs): add transformation copilot to ingestion (generated)
Browse files Browse the repository at this point in the history
algolia/api-clients-automation#3479

Co-authored-by: algolia-bot <accounts+algolia-api-client-bot@algolia.com>
Co-authored-by: Thomas Raffray <Fluf22@users.noreply.github.com>
  • Loading branch information
algolia-bot and Fluf22 committed Aug 6, 2024
1 parent 412b1b3 commit b802d68
Show file tree
Hide file tree
Showing 3 changed files with 309 additions and 0 deletions.
63 changes: 63 additions & 0 deletions algoliasearch/Clients/IngestionClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -969,6 +969,28 @@ public interface IIngestionClient
/// <returns>ListTasksResponseV1</returns>
ListTasksResponseV1 ListTasksV1(int? itemsPerPage = default, int? page = default, List<ActionType> action = default, bool? enabled = default, List<string> sourceID = default, List<string> destinationID = default, List<TriggerType> triggerType = default, TaskSortKeys? sort = default, OrderKeys? order = default, RequestOptions options = null, CancellationToken cancellationToken = default);

/// <summary>
/// Retrieves a list of existing LLM transformation helpers.
/// </summary>
/// <param name="options">Add extra http header or query parameters to Algolia.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <exception cref="ArgumentException">Thrown when arguments are not correct</exception>
/// <exception cref="Algolia.Search.Exceptions.AlgoliaApiException">Thrown when the API call was rejected by Algolia</exception>
/// <exception cref="Algolia.Search.Exceptions.AlgoliaUnreachableHostException">Thrown when the client failed to call the endpoint</exception>
/// <returns>Task of TransformationModels</returns>
Task<TransformationModels> ListTransformationModelsAsync(RequestOptions options = null, CancellationToken cancellationToken = default);

/// <summary>
/// Retrieves a list of existing LLM transformation helpers. (Synchronous version)
/// </summary>
/// <param name="options">Add extra http header or query parameters to Algolia.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <exception cref="ArgumentException">Thrown when arguments are not correct</exception>
/// <exception cref="Algolia.Search.Exceptions.AlgoliaApiException">Thrown when the API call was rejected by Algolia</exception>
/// <exception cref="Algolia.Search.Exceptions.AlgoliaUnreachableHostException">Thrown when the client failed to call the endpoint</exception>
/// <returns>TransformationModels</returns>
TransformationModels ListTransformationModels(RequestOptions options = null, CancellationToken cancellationToken = default);

/// <summary>
/// Retrieves a list of transformations.
/// </summary>
Expand Down Expand Up @@ -3282,6 +3304,47 @@ public ListTasksResponseV1 ListTasksV1(int? itemsPerPage = default, int? page =
AsyncHelper.RunSync(() => ListTasksV1Async(itemsPerPage, page, action, enabled, sourceID, destinationID, triggerType, sort, order, options, cancellationToken));


/// <summary>
/// Retrieves a list of existing LLM transformation helpers.
/// </summary>
///
/// Required API Key ACLs:
/// - addObject
/// - deleteIndex
/// - editSettings
/// <param name="options">Add extra http header or query parameters to Algolia.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <exception cref="ArgumentException">Thrown when arguments are not correct</exception>
/// <exception cref="Algolia.Search.Exceptions.AlgoliaApiException">Thrown when the API call was rejected by Algolia</exception>
/// <exception cref="Algolia.Search.Exceptions.AlgoliaUnreachableHostException">Thrown when the client failed to call the endpoint</exception>
/// <returns>Task of TransformationModels</returns>
public async Task<TransformationModels> ListTransformationModelsAsync(RequestOptions options = null, CancellationToken cancellationToken = default)
{
var requestOptions = new InternalRequestOptions(options);


return await _transport.ExecuteRequestAsync<TransformationModels>(new HttpMethod("GET"), "/1/transformations/copilot", requestOptions, cancellationToken).ConfigureAwait(false);
}


/// <summary>
/// Retrieves a list of existing LLM transformation helpers. (Synchronous version)
/// </summary>
///
/// Required API Key ACLs:
/// - addObject
/// - deleteIndex
/// - editSettings
/// <param name="options">Add extra http header or query parameters to Algolia.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <exception cref="ArgumentException">Thrown when arguments are not correct</exception>
/// <exception cref="Algolia.Search.Exceptions.AlgoliaApiException">Thrown when the API call was rejected by Algolia</exception>
/// <exception cref="Algolia.Search.Exceptions.AlgoliaUnreachableHostException">Thrown when the client failed to call the endpoint</exception>
/// <returns>TransformationModels</returns>
public TransformationModels ListTransformationModels(RequestOptions options = null, CancellationToken cancellationToken = default) =>
AsyncHelper.RunSync(() => ListTransformationModelsAsync(options, cancellationToken));


/// <summary>
/// Retrieves a list of transformations.
/// </summary>
Expand Down
151 changes: 151 additions & 0 deletions algoliasearch/Models/Ingestion/Model.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
//
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
//
using System;
using System.Text;
using System.Linq;
using System.Text.Json.Serialization;
using System.Collections.Generic;
using Algolia.Search.Serializer;
using System.Text.Json;

namespace Algolia.Search.Models.Ingestion;

/// <summary>
/// Model
/// </summary>
public partial class Model
{
/// <summary>
/// Initializes a new instance of the Model class.
/// </summary>
[JsonConstructor]
public Model() { }
/// <summary>
/// Initializes a new instance of the Model class.
/// </summary>
/// <param name="fullname">fullname (required).</param>
/// <param name="modelName">modelName (required).</param>
/// <param name="systemPrompt">systemPrompt (required).</param>
/// <param name="id">id (required).</param>
/// <param name="provider">provider (required).</param>
public Model(string fullname, string modelName, string systemPrompt, string id, string provider)
{
Fullname = fullname ?? throw new ArgumentNullException(nameof(fullname));
ModelName = modelName ?? throw new ArgumentNullException(nameof(modelName));
SystemPrompt = systemPrompt ?? throw new ArgumentNullException(nameof(systemPrompt));
Id = id ?? throw new ArgumentNullException(nameof(id));
Provider = provider ?? throw new ArgumentNullException(nameof(provider));
}

/// <summary>
/// Gets or Sets Fullname
/// </summary>
[JsonPropertyName("fullname")]
public string Fullname { get; set; }

/// <summary>
/// Gets or Sets ModelName
/// </summary>
[JsonPropertyName("modelName")]
public string ModelName { get; set; }

/// <summary>
/// Gets or Sets SystemPrompt
/// </summary>
[JsonPropertyName("systemPrompt")]
public string SystemPrompt { get; set; }

/// <summary>
/// Gets or Sets Id
/// </summary>
[JsonPropertyName("id")]
public string Id { get; set; }

/// <summary>
/// Gets or Sets Provider
/// </summary>
[JsonPropertyName("provider")]
public string Provider { get; set; }

/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append("class Model {\n");
sb.Append(" Fullname: ").Append(Fullname).Append("\n");
sb.Append(" ModelName: ").Append(ModelName).Append("\n");
sb.Append(" SystemPrompt: ").Append(SystemPrompt).Append("\n");
sb.Append(" Id: ").Append(Id).Append("\n");
sb.Append(" Provider: ").Append(Provider).Append("\n");
sb.Append("}\n");
return sb.ToString();
}

/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return JsonSerializer.Serialize(this, JsonConfig.Options);
}

/// <summary>
/// Returns true if objects are equal
/// </summary>
/// <param name="obj">Object to be compared</param>
/// <returns>Boolean</returns>
public override bool Equals(object obj)
{
if (obj is not Model input)
{
return false;
}

return
(Fullname == input.Fullname || (Fullname != null && Fullname.Equals(input.Fullname))) &&
(ModelName == input.ModelName || (ModelName != null && ModelName.Equals(input.ModelName))) &&
(SystemPrompt == input.SystemPrompt || (SystemPrompt != null && SystemPrompt.Equals(input.SystemPrompt))) &&
(Id == input.Id || (Id != null && Id.Equals(input.Id))) &&
(Provider == input.Provider || (Provider != null && Provider.Equals(input.Provider)));
}

/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
int hashCode = 41;
if (Fullname != null)
{
hashCode = (hashCode * 59) + Fullname.GetHashCode();
}
if (ModelName != null)
{
hashCode = (hashCode * 59) + ModelName.GetHashCode();
}
if (SystemPrompt != null)
{
hashCode = (hashCode * 59) + SystemPrompt.GetHashCode();
}
if (Id != null)
{
hashCode = (hashCode * 59) + Id.GetHashCode();
}
if (Provider != null)
{
hashCode = (hashCode * 59) + Provider.GetHashCode();
}
return hashCode;
}
}

}

95 changes: 95 additions & 0 deletions algoliasearch/Models/Ingestion/TransformationModels.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
//
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
//
using System;
using System.Text;
using System.Linq;
using System.Text.Json.Serialization;
using System.Collections.Generic;
using Algolia.Search.Serializer;
using System.Text.Json;

namespace Algolia.Search.Models.Ingestion;

/// <summary>
/// List of available AI models for transformation purposes.
/// </summary>
public partial class TransformationModels
{
/// <summary>
/// Initializes a new instance of the TransformationModels class.
/// </summary>
[JsonConstructor]
public TransformationModels() { }
/// <summary>
/// Initializes a new instance of the TransformationModels class.
/// </summary>
/// <param name="llms">llms (required).</param>
public TransformationModels(List<Model> llms)
{
Llms = llms ?? throw new ArgumentNullException(nameof(llms));
}

/// <summary>
/// Gets or Sets Llms
/// </summary>
[JsonPropertyName("llms")]
public List<Model> Llms { get; set; }

/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append("class TransformationModels {\n");
sb.Append(" Llms: ").Append(Llms).Append("\n");
sb.Append("}\n");
return sb.ToString();
}

/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return JsonSerializer.Serialize(this, JsonConfig.Options);
}

/// <summary>
/// Returns true if objects are equal
/// </summary>
/// <param name="obj">Object to be compared</param>
/// <returns>Boolean</returns>
public override bool Equals(object obj)
{
if (obj is not TransformationModels input)
{
return false;
}

return
(Llms == input.Llms || Llms != null && input.Llms != null && Llms.SequenceEqual(input.Llms));
}

/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
int hashCode = 41;
if (Llms != null)
{
hashCode = (hashCode * 59) + Llms.GetHashCode();
}
return hashCode;
}
}

}

0 comments on commit b802d68

Please sign in to comment.