Skip to content

Commit

Permalink
Regenerate client using the latest spec (#8234)
Browse files Browse the repository at this point in the history
  • Loading branch information
flobernd authored and github-actions[bot] committed Jun 12, 2024
1 parent 3d795e8 commit 2b88ab9
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public override MultisearchBody Read(ref Utf8JsonReader reader, Type typeToConve

if (property == "knn")
{
variant.Knn = JsonSerializer.Deserialize<ICollection<Elastic.Clients.Elasticsearch.Serverless.KnnSearch>?>(ref reader, options);
variant.Knn = SingleOrManySerializationHelper.Deserialize<Elastic.Clients.Elasticsearch.Serverless.KnnSearch>(ref reader, options);
continue;
}

Expand Down Expand Up @@ -131,7 +131,7 @@ public override MultisearchBody Read(ref Utf8JsonReader reader, Type typeToConve

if (property == "rescore")
{
variant.Rescore = JsonSerializer.Deserialize<ICollection<Elastic.Clients.Elasticsearch.Serverless.Core.Search.Rescore>?>(ref reader, options);
variant.Rescore = SingleOrManySerializationHelper.Deserialize<Elastic.Clients.Elasticsearch.Serverless.Core.Search.Rescore>(ref reader, options);
continue;
}

Expand Down Expand Up @@ -167,7 +167,7 @@ public override MultisearchBody Read(ref Utf8JsonReader reader, Type typeToConve

if (property == "sort")
{
variant.Sort = JsonSerializer.Deserialize<ICollection<Elastic.Clients.Elasticsearch.Serverless.SortOptions>?>(ref reader, options);
variant.Sort = SingleOrManySerializationHelper.Deserialize<Elastic.Clients.Elasticsearch.Serverless.SortOptions>(ref reader, options);
continue;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ public override IndexSettings Read(ref Utf8JsonReader reader, Type typeToConvert

if (property == "routing_path")
{
variant.RoutingPath = JsonSerializer.Deserialize<ICollection<string>?>(ref reader, options);
variant.RoutingPath = SingleOrManySerializationHelper.Deserialize<string>(ref reader, options);
continue;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public sealed partial class InferenceResponseResult
/// <para>If the model is trained for a text classification or zero shot classification task, the response is the<br/>predicted class.<br/>For named entity recognition (NER) tasks, it contains the annotated text output.<br/>For fill mask tasks, it contains the top prediction for replacing the mask token.<br/>For text embedding tasks, it contains the raw numerical text embedding values.<br/>For regression models, its a numerical value<br/>For classification models, it may be an integer, double, boolean or string depending on prediction type</para>
/// </summary>
[JsonInclude, JsonPropertyName("predicted_value")]
[SingleOrManyCollectionConverter(typeof(object))]
public IReadOnlyCollection<object>? PredictedValue { get; init; }

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ namespace Elastic.Clients.Elasticsearch.Inference;

public sealed partial class DeleteInferenceRequestParameters : RequestParameters
{
/// <summary>
/// <para>When true, the endpoint is not deleted, and a list of ingest processors which reference this endpoint is returned</para>
/// </summary>
public bool? DryRun { get => Q<bool?>("dry_run"); set => Q("dry_run", value); }

/// <summary>
/// <para>When true, the inference endpoint is forcefully deleted even if it is still being used by ingest processors or semantic text fields</para>
/// </summary>
public bool? Force { get => Q<bool?>("force"); set => Q("force", value); }
}

/// <summary>
Expand All @@ -53,6 +62,18 @@ public DeleteInferenceRequest(Elastic.Clients.Elasticsearch.Inference.TaskType?
internal override bool SupportsBody => false;

internal override string OperationName => "inference.delete";

/// <summary>
/// <para>When true, the endpoint is not deleted, and a list of ingest processors which reference this endpoint is returned</para>
/// </summary>
[JsonIgnore]
public bool? DryRun { get => Q<bool?>("dry_run"); set => Q("dry_run", value); }

/// <summary>
/// <para>When true, the inference endpoint is forcefully deleted even if it is still being used by ingest processors or semantic text fields</para>
/// </summary>
[JsonIgnore]
public bool? Force { get => Q<bool?>("force"); set => Q("force", value); }
}

/// <summary>
Expand All @@ -78,6 +99,9 @@ public DeleteInferenceRequestDescriptor(Elastic.Clients.Elasticsearch.Id inferen

internal override string OperationName => "inference.delete";

public DeleteInferenceRequestDescriptor DryRun(bool? dryRun = true) => Qs("dry_run", dryRun);
public DeleteInferenceRequestDescriptor Force(bool? force = true) => Qs("force", force);

public DeleteInferenceRequestDescriptor InferenceId(Elastic.Clients.Elasticsearch.Id inferenceId)
{
RouteValues.Required("inference_id", inferenceId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,6 @@ public sealed partial class DeleteInferenceResponse : ElasticsearchResponse
/// </summary>
[JsonInclude, JsonPropertyName("acknowledged")]
public bool Acknowledged { get; init; }
[JsonInclude, JsonPropertyName("pipelines")]
public IReadOnlyCollection<string> Pipelines { get; init; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public override MultisearchBody Read(ref Utf8JsonReader reader, Type typeToConve

if (property == "knn")
{
variant.Knn = JsonSerializer.Deserialize<ICollection<Elastic.Clients.Elasticsearch.KnnSearch>?>(ref reader, options);
variant.Knn = SingleOrManySerializationHelper.Deserialize<Elastic.Clients.Elasticsearch.KnnSearch>(ref reader, options);
continue;
}

Expand Down Expand Up @@ -131,7 +131,7 @@ public override MultisearchBody Read(ref Utf8JsonReader reader, Type typeToConve

if (property == "rescore")
{
variant.Rescore = JsonSerializer.Deserialize<ICollection<Elastic.Clients.Elasticsearch.Core.Search.Rescore>?>(ref reader, options);
variant.Rescore = SingleOrManySerializationHelper.Deserialize<Elastic.Clients.Elasticsearch.Core.Search.Rescore>(ref reader, options);
continue;
}

Expand Down Expand Up @@ -167,7 +167,7 @@ public override MultisearchBody Read(ref Utf8JsonReader reader, Type typeToConve

if (property == "sort")
{
variant.Sort = JsonSerializer.Deserialize<ICollection<Elastic.Clients.Elasticsearch.SortOptions>?>(ref reader, options);
variant.Sort = SingleOrManySerializationHelper.Deserialize<Elastic.Clients.Elasticsearch.SortOptions>(ref reader, options);
continue;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ public override IndexSettings Read(ref Utf8JsonReader reader, Type typeToConvert

if (property == "routing_path")
{
variant.RoutingPath = JsonSerializer.Deserialize<ICollection<string>?>(ref reader, options);
variant.RoutingPath = SingleOrManySerializationHelper.Deserialize<string>(ref reader, options);
continue;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public sealed partial class InferenceResponseResult
/// <para>If the model is trained for a text classification or zero shot classification task, the response is the<br/>predicted class.<br/>For named entity recognition (NER) tasks, it contains the annotated text output.<br/>For fill mask tasks, it contains the top prediction for replacing the mask token.<br/>For text embedding tasks, it contains the raw numerical text embedding values.<br/>For regression models, its a numerical value<br/>For classification models, it may be an integer, double, boolean or string depending on prediction type</para>
/// </summary>
[JsonInclude, JsonPropertyName("predicted_value")]
[SingleOrManyCollectionConverter(typeof(object))]
public IReadOnlyCollection<object>? PredictedValue { get; init; }

/// <summary>
Expand Down

0 comments on commit 2b88ab9

Please sign in to comment.