Skip to content

Commit f8e3645

Browse files
committed
refactor: rename generic type parameter from I to InputT in OpenAiTool
1 parent ad89753 commit f8e3645

File tree

1 file changed

+6
-6
lines changed
  • foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai

1 file changed

+6
-6
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
* request. This tool generates a JSON schema based on the provided class representing the
2929
* function's request structure.
3030
*
31-
* @param <I> the type of the input argument for the function
31+
* @param <InputT> the type of the input argument for the function
3232
* @see <a href="https://platform.openai.com/docs/guides/gpt/function-calling"/>OpenAI Function
3333
* @since 1.7.0
3434
*/
@@ -37,7 +37,7 @@
3737
@Getter(AccessLevel.PACKAGE)
3838
@Accessors(chain = true)
3939
@AllArgsConstructor(access = AccessLevel.PRIVATE)
40-
public class OpenAiTool<I> {
40+
public class OpenAiTool<InputT> {
4141

4242
/** The schema generator used to create JSON schemas. */
4343
@Nonnull private static final SchemaGenerator GENERATOR = createSchemaGenerator();
@@ -46,7 +46,7 @@ public class OpenAiTool<I> {
4646
@Nonnull private String name;
4747

4848
/** The model class for function request. */
49-
@Nonnull private Class<I> requestClass;
49+
@Nonnull private Class<InputT> requestClass;
5050

5151
/** An optional description of the function. */
5252
@Nullable private String description;
@@ -55,7 +55,7 @@ public class OpenAiTool<I> {
5555
@Nullable private Boolean strict;
5656

5757
/** The function to be called. */
58-
@Nullable private Function<I, ?> function;
58+
@Nullable private Function<InputT, ?> function;
5959

6060
/**
6161
* Constructs an {@code OpenAiFunctionTool} with the specified name and a model class that
@@ -64,12 +64,12 @@ public class OpenAiTool<I> {
6464
* @param name the name of the function
6565
* @param requestClass the model class for function request
6666
*/
67-
public OpenAiTool(@Nonnull final String name, @Nonnull final Class<I> requestClass) {
67+
public OpenAiTool(@Nonnull final String name, @Nonnull final Class<InputT> requestClass) {
6868
this(name, requestClass, null, null, null);
6969
}
7070

7171
@Nonnull
72-
Object execute(@Nonnull final I argument) {
72+
Object execute(@Nonnull final InputT argument) {
7373
if (getFunction() == null) {
7474
throw new IllegalStateException("No function configured to execute.");
7575
}

0 commit comments

Comments
 (0)