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 4dff21b commit 9f093f2
Show file tree
Hide file tree
Showing 3 changed files with 240 additions and 0 deletions.
43 changes: 43 additions & 0 deletions algoliasearch/src/main/java/com/algolia/api/IngestionClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -2830,6 +2830,49 @@ public CompletableFuture<ListTasksResponseV1> listTasksV1Async() throws AlgoliaR
return this.listTasksV1Async(null, null, null, null, null, null, null, null, null, null);
}

/**
* Retrieves a list of existing LLM transformation helpers.
*
* @param requestOptions The requestOptions to send along with the query, they will be merged with
* the transporter requestOptions.
* @throws AlgoliaRuntimeException If it fails to process the API call
*/
public TransformationModels listTransformationModels(RequestOptions requestOptions) throws AlgoliaRuntimeException {
return LaunderThrowable.await(listTransformationModelsAsync(requestOptions));
}

/**
* Retrieves a list of existing LLM transformation helpers.
*
* @throws AlgoliaRuntimeException If it fails to process the API call
*/
public TransformationModels listTransformationModels() throws AlgoliaRuntimeException {
return this.listTransformationModels(null);
}

/**
* (asynchronously) Retrieves a list of existing LLM transformation helpers.
*
* @param requestOptions The requestOptions to send along with the query, they will be merged with
* the transporter requestOptions.
* @throws AlgoliaRuntimeException If it fails to process the API call
*/
public CompletableFuture<TransformationModels> listTransformationModelsAsync(RequestOptions requestOptions)
throws AlgoliaRuntimeException {
HttpRequest request = HttpRequest.builder().setPath("/1/transformations/copilot").setMethod("GET").build();

return executeAsync(request, requestOptions, new TypeReference<TransformationModels>() {});
}

/**
* (asynchronously) Retrieves a list of existing LLM transformation helpers.
*
* @throws AlgoliaRuntimeException If it fails to process the API call
*/
public CompletableFuture<TransformationModels> listTransformationModelsAsync() throws AlgoliaRuntimeException {
return this.listTransformationModelsAsync(null);
}

/**
* Retrieves a list of transformations.
*
Expand Down
128 changes: 128 additions & 0 deletions algoliasearch/src/main/java/com/algolia/model/ingestion/Model.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
// 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.

package com.algolia.model.ingestion;

import com.fasterxml.jackson.annotation.*;
import com.fasterxml.jackson.databind.annotation.*;
import java.util.Objects;

/** Model */
public class Model {

@JsonProperty("fullname")
private String fullname;

@JsonProperty("modelName")
private String modelName;

@JsonProperty("systemPrompt")
private String systemPrompt;

@JsonProperty("id")
private String id;

@JsonProperty("provider")
private String provider;

public Model setFullname(String fullname) {
this.fullname = fullname;
return this;
}

/** Get fullname */
@javax.annotation.Nonnull
public String getFullname() {
return fullname;
}

public Model setModelName(String modelName) {
this.modelName = modelName;
return this;
}

/** Get modelName */
@javax.annotation.Nonnull
public String getModelName() {
return modelName;
}

public Model setSystemPrompt(String systemPrompt) {
this.systemPrompt = systemPrompt;
return this;
}

/** Get systemPrompt */
@javax.annotation.Nonnull
public String getSystemPrompt() {
return systemPrompt;
}

public Model setId(String id) {
this.id = id;
return this;
}

/** Get id */
@javax.annotation.Nonnull
public String getId() {
return id;
}

public Model setProvider(String provider) {
this.provider = provider;
return this;
}

/** Get provider */
@javax.annotation.Nonnull
public String getProvider() {
return provider;
}

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Model model = (Model) o;
return (
Objects.equals(this.fullname, model.fullname) &&
Objects.equals(this.modelName, model.modelName) &&
Objects.equals(this.systemPrompt, model.systemPrompt) &&
Objects.equals(this.id, model.id) &&
Objects.equals(this.provider, model.provider)
);
}

@Override
public int hashCode() {
return Objects.hash(fullname, modelName, systemPrompt, id, provider);
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Model {\n");
sb.append(" fullname: ").append(toIndentedString(fullname)).append("\n");
sb.append(" modelName: ").append(toIndentedString(modelName)).append("\n");
sb.append(" systemPrompt: ").append(toIndentedString(systemPrompt)).append("\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" provider: ").append(toIndentedString(provider)).append("\n");
sb.append("}");
return sb.toString();
}

/**
* Convert the given object to string with each line indented by 4 spaces (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
// 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.

package com.algolia.model.ingestion;

import com.fasterxml.jackson.annotation.*;
import com.fasterxml.jackson.databind.annotation.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

/** List of available AI models for transformation purposes. */
public class TransformationModels {

@JsonProperty("llms")
private List<Model> llms = new ArrayList<>();

public TransformationModels setLlms(List<Model> llms) {
this.llms = llms;
return this;
}

public TransformationModels addLlms(Model llmsItem) {
this.llms.add(llmsItem);
return this;
}

/** Get llms */
@javax.annotation.Nonnull
public List<Model> getLlms() {
return llms;
}

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
TransformationModels transformationModels = (TransformationModels) o;
return Objects.equals(this.llms, transformationModels.llms);
}

@Override
public int hashCode() {
return Objects.hash(llms);
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class TransformationModels {\n");
sb.append(" llms: ").append(toIndentedString(llms)).append("\n");
sb.append("}");
return sb.toString();
}

/**
* Convert the given object to string with each line indented by 4 spaces (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

0 comments on commit 9f093f2

Please sign in to comment.