Skip to content

Commit 957d5e1

Browse files
chore: [OpenAI] Deprecate manually written clien and remove @Beta on generated client
1 parent 2291834 commit 957d5e1

File tree

105 files changed

+35
-133
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+35
-133
lines changed

foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/OpenAiClient.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,7 @@ public static OpenAiClient withCustomDestination(@Nonnull final Destination dest
112112
}
113113

114114
/**
115-
* Use this method to set a system prompt that should be used across multiple chat completions
116-
* with basic string prompts {@link #streamChatCompletionDeltas(OpenAiChatCompletionParameters)}.
115+
* Add a system prompt before user prompts.
117116
*
118117
* <p>Note: The system prompt is ignored on chat completions invoked with
119118
* OpenAiChatCompletionPrompt.
@@ -133,8 +132,10 @@ public OpenAiClient withSystemPrompt(@Nonnull final String systemPrompt) {
133132
* @param prompt a text message.
134133
* @return the completion output
135134
* @throws OpenAiClientException if the request fails
135+
* @deprecated Use {@link #chatCompletion(OpenAiChatCompletionRequest)} instead.
136136
*/
137137
@Nonnull
138+
@Deprecated
138139
public OpenAiChatCompletionOutput chatCompletion(@Nonnull final String prompt)
139140
throws OpenAiClientException {
140141
final OpenAiChatCompletionParameters parameters = new OpenAiChatCompletionParameters();
@@ -183,8 +184,10 @@ public CreateChatCompletionResponse chatCompletion(
183184
* @param parameters the completion request.
184185
* @return the completion output
185186
* @throws OpenAiClientException if the request fails
187+
* @deprecated Use {@link #chatCompletion(OpenAiChatCompletionRequest)} instead.
186188
*/
187189
@Nonnull
190+
@Deprecated
188191
public OpenAiChatCompletionOutput chatCompletion(
189192
@Nonnull final OpenAiChatCompletionParameters parameters) throws OpenAiClientException {
190193
warnIfUnsupportedUsage();
@@ -321,8 +324,10 @@ public Stream<OpenAiChatCompletionDelta> streamChatCompletionDeltas(
321324
* @param parameters The prompt, including a list of messages.
322325
* @return A stream of message deltas
323326
* @throws OpenAiClientException if the request fails or if the finish reason is content_filter
327+
* @deprecated Use {@link #streamChatCompletionDeltas(OpenAiChatCompletionRequest)} instead.
324328
*/
325329
@Nonnull
330+
@Deprecated
326331
public Stream<com.sap.ai.sdk.foundationmodels.openai.model.OpenAiChatCompletionDelta>
327332
streamChatCompletionDeltas(@Nonnull final OpenAiChatCompletionParameters parameters)
328333
throws OpenAiClientException {
@@ -383,6 +388,7 @@ public EmbeddingsCreate200Response embedding(@Nonnull final EmbeddingsCreateRequ
383388
* @throws OpenAiClientException if the request fails
384389
*/
385390
@Nonnull
391+
@Deprecated
386392
public OpenAiEmbeddingOutput embedding(@Nonnull final OpenAiEmbeddingParameters parameters)
387393
throws OpenAiClientException {
388394
return execute("/embeddings", parameters, OpenAiEmbeddingOutput.class);

foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionFunctionCall.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
* should be called, as generated by the model.
3434
*/
3535
// CHECKSTYLE:OFF
36-
@com.google.common.annotations.Beta
3736
public class ChatCompletionFunctionCall
3837
// CHECKSTYLE:ON
3938
{

foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionFunctionCallOption.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
* forces the model to call that function.
3434
*/
3535
// CHECKSTYLE:OFF
36-
@com.google.common.annotations.Beta
3736
public class ChatCompletionFunctionCallOption
3837
// CHECKSTYLE:ON
3938
{

foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionFunctions.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
*/
3737
@Deprecated
3838
// CHECKSTYLE:OFF
39-
@com.google.common.annotations.Beta
4039
public class ChatCompletionFunctions
4140
// CHECKSTYLE:ON
4241
{

foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionMessageToolCall.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030

3131
/** ChatCompletionMessageToolCall */
3232
// CHECKSTYLE:OFF
33-
@com.google.common.annotations.Beta
3433
public class ChatCompletionMessageToolCall
3534
// CHECKSTYLE:ON
3635
{

foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionMessageToolCallChunk.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232

3333
/** ChatCompletionMessageToolCallChunk */
3434
// CHECKSTYLE:OFF
35-
@com.google.common.annotations.Beta
3635
public class ChatCompletionMessageToolCallChunk
3736
// CHECKSTYLE:ON
3837
{

foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionMessageToolCallChunkFunction.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030

3131
/** ChatCompletionMessageToolCallChunkFunction */
3232
// CHECKSTYLE:OFF
33-
@com.google.common.annotations.Beta
3433
public class ChatCompletionMessageToolCallChunkFunction
3534
// CHECKSTYLE:ON
3635
{

foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionMessageToolCallFunction.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030

3131
/** The function that the model called. */
3232
// CHECKSTYLE:OFF
33-
@com.google.common.annotations.Beta
3433
public class ChatCompletionMessageToolCallFunction
3534
// CHECKSTYLE:ON
3635
{

foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionNamedToolChoice.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232

3333
/** Specifies a tool the model should use. Use to force the model to call a specific function. */
3434
// CHECKSTYLE:OFF
35-
@com.google.common.annotations.Beta
3635
public class ChatCompletionNamedToolChoice
3736
// CHECKSTYLE:ON
3837
{

foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model/ChatCompletionNamedToolChoiceFunction.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030

3131
/** ChatCompletionNamedToolChoiceFunction */
3232
// CHECKSTYLE:OFF
33-
@com.google.common.annotations.Beta
3433
public class ChatCompletionNamedToolChoiceFunction
3534
// CHECKSTYLE:ON
3635
{

0 commit comments

Comments
 (0)