From 37bda2d59d9fd70225d69287a41fb29104d65e7e Mon Sep 17 00:00:00 2001 From: Stefan Bratanov Date: Mon, 19 Feb 2024 08:26:55 +0200 Subject: [PATCH] Remove instance_id from chat completions --- .../jvm/openai/CreateChatCompletionRequest.java | 12 ------------ .../io/github/stefanbratanov/jvm/openai/OpenAI.java | 2 +- .../stefanbratanov/jvm/openai/TestDataUtil.java | 1 - 3 files changed, 1 insertion(+), 14 deletions(-) diff --git a/src/main/java/io/github/stefanbratanov/jvm/openai/CreateChatCompletionRequest.java b/src/main/java/io/github/stefanbratanov/jvm/openai/CreateChatCompletionRequest.java index b2d415f..1bc2497 100644 --- a/src/main/java/io/github/stefanbratanov/jvm/openai/CreateChatCompletionRequest.java +++ b/src/main/java/io/github/stefanbratanov/jvm/openai/CreateChatCompletionRequest.java @@ -9,7 +9,6 @@ public record CreateChatCompletionRequest( String model, List messages, Optional frequencyPenalty, - Optional instanceId, Optional> logitBias, Optional logprobs, Optional topLogprobs, @@ -49,7 +48,6 @@ public static class Builder { private final List messages = new LinkedList<>(); private Optional frequencyPenalty = Optional.empty(); - private Optional instanceId = Optional.empty(); private Optional> logitBias = Optional.empty(); private Optional logprobs = Optional.empty(); private Optional topLogprobs = Optional.empty(); @@ -104,15 +102,6 @@ public Builder frequencyPenalty(double frequencyPenalty) { return this; } - /** - * @param instanceId A unique identifier to a custom instance to execute the request. The - * requesting organization is required to have access to the instance. - */ - public Builder instanceId(String instanceId) { - this.instanceId = Optional.of(instanceId); - return this; - } - /** * @param logitBias A map that maps tokens (specified by their token ID in the tokenizer) to an * associated bias value from -100 to 100. Mathematically, the bias is added to the logits @@ -316,7 +305,6 @@ public CreateChatCompletionRequest build() { model, List.copyOf(messages), frequencyPenalty, - instanceId, logitBias, logprobs, topLogprobs, diff --git a/src/main/java/io/github/stefanbratanov/jvm/openai/OpenAI.java b/src/main/java/io/github/stefanbratanov/jvm/openai/OpenAI.java index c4e4bd4..b74b88c 100644 --- a/src/main/java/io/github/stefanbratanov/jvm/openai/OpenAI.java +++ b/src/main/java/io/github/stefanbratanov/jvm/openai/OpenAI.java @@ -194,7 +194,7 @@ public Builder httpClient(HttpClient httpClient) { } /** - * @param requestTimeout a timeout in the form of a {@link Duration} which will be set for all + * @param requestTimeout a timeout in the form of a {@link Duration} which will be set for the * API requests. If none is set, there will be no timeout. */ public Builder requestTimeout(Duration requestTimeout) { diff --git a/src/test/java/io/github/stefanbratanov/jvm/openai/TestDataUtil.java b/src/test/java/io/github/stefanbratanov/jvm/openai/TestDataUtil.java index 2f9a67f..df10e93 100644 --- a/src/test/java/io/github/stefanbratanov/jvm/openai/TestDataUtil.java +++ b/src/test/java/io/github/stefanbratanov/jvm/openai/TestDataUtil.java @@ -34,7 +34,6 @@ public CreateChatCompletionRequest randomCreateChatCompletionRequest() { .model(randomModel()) .messages(listOf(randomInt(1, 3), this::randomChatMessage)) .frequencyPenalty(randomDouble(-2.0, 2.0)) - .instanceId(randomString(7)) .logitBias(randomLogitBias(randomInt(0, 6))) .logprobs(randomBoolean()) .topLogprobs(randomInt(0, 5))