Skip to content

Commit ee175a9

Browse files
feat(api): Add connectors support for MCP tool
1 parent fdc5fdd commit ee175a9

File tree

10 files changed

+674
-116
lines changed

10 files changed

+674
-116
lines changed

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 119
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-4bcdfe525558e67a09b32dec7a573e87b94bab47db3951eb4a86a4dafb60296c.yml
3-
openapi_spec_hash: 49e7e46bfe9f61b7b7a60e36840c0cd7
4-
config_hash: e4514526ae01126a61f9b6c14a351737
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-ddbdf9343316047e8a773c54fb24e4a8d225955e202a1888fde6f9c8898ebf98.yml
3+
openapi_spec_hash: 9802f6dd381558466c897f6e387e06ca
4+
config_hash: fe0ea26680ac2075a6cd66416aefe7db

openai-java-core/src/main/kotlin/com/openai/models/evals/runs/RunCancelResponse.kt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6221,6 +6221,17 @@ private constructor(
62216221
/** Alias for calling [addTool] with `Tool.ofMcp(mcp)`. */
62226222
fun addTool(mcp: Tool.Mcp) = addTool(Tool.ofMcp(mcp))
62236223

6224+
/**
6225+
* Alias for calling [addTool] with the following:
6226+
* ```java
6227+
* Tool.Mcp.builder()
6228+
* .serverLabel(serverLabel)
6229+
* .build()
6230+
* ```
6231+
*/
6232+
fun addMcpTool(serverLabel: String) =
6233+
addTool(Tool.Mcp.builder().serverLabel(serverLabel).build())
6234+
62246235
/**
62256236
* Alias for calling [addTool] with `Tool.ofCodeInterpreter(codeInterpreter)`.
62266237
*/

openai-java-core/src/main/kotlin/com/openai/models/evals/runs/RunCreateParams.kt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6106,6 +6106,17 @@ private constructor(
61066106
/** Alias for calling [addTool] with `Tool.ofMcp(mcp)`. */
61076107
fun addTool(mcp: Tool.Mcp) = addTool(Tool.ofMcp(mcp))
61086108

6109+
/**
6110+
* Alias for calling [addTool] with the following:
6111+
* ```java
6112+
* Tool.Mcp.builder()
6113+
* .serverLabel(serverLabel)
6114+
* .build()
6115+
* ```
6116+
*/
6117+
fun addMcpTool(serverLabel: String) =
6118+
addTool(Tool.Mcp.builder().serverLabel(serverLabel).build())
6119+
61096120
/**
61106121
* Alias for calling [addTool] with `Tool.ofCodeInterpreter(codeInterpreter)`.
61116122
*/

openai-java-core/src/main/kotlin/com/openai/models/evals/runs/RunCreateResponse.kt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6221,6 +6221,17 @@ private constructor(
62216221
/** Alias for calling [addTool] with `Tool.ofMcp(mcp)`. */
62226222
fun addTool(mcp: Tool.Mcp) = addTool(Tool.ofMcp(mcp))
62236223

6224+
/**
6225+
* Alias for calling [addTool] with the following:
6226+
* ```java
6227+
* Tool.Mcp.builder()
6228+
* .serverLabel(serverLabel)
6229+
* .build()
6230+
* ```
6231+
*/
6232+
fun addMcpTool(serverLabel: String) =
6233+
addTool(Tool.Mcp.builder().serverLabel(serverLabel).build())
6234+
62246235
/**
62256236
* Alias for calling [addTool] with `Tool.ofCodeInterpreter(codeInterpreter)`.
62266237
*/

openai-java-core/src/main/kotlin/com/openai/models/evals/runs/RunListResponse.kt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6221,6 +6221,17 @@ private constructor(
62216221
/** Alias for calling [addTool] with `Tool.ofMcp(mcp)`. */
62226222
fun addTool(mcp: Tool.Mcp) = addTool(Tool.ofMcp(mcp))
62236223

6224+
/**
6225+
* Alias for calling [addTool] with the following:
6226+
* ```java
6227+
* Tool.Mcp.builder()
6228+
* .serverLabel(serverLabel)
6229+
* .build()
6230+
* ```
6231+
*/
6232+
fun addMcpTool(serverLabel: String) =
6233+
addTool(Tool.Mcp.builder().serverLabel(serverLabel).build())
6234+
62246235
/**
62256236
* Alias for calling [addTool] with `Tool.ofCodeInterpreter(codeInterpreter)`.
62266237
*/

openai-java-core/src/main/kotlin/com/openai/models/evals/runs/RunRetrieveResponse.kt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6221,6 +6221,17 @@ private constructor(
62216221
/** Alias for calling [addTool] with `Tool.ofMcp(mcp)`. */
62226222
fun addTool(mcp: Tool.Mcp) = addTool(Tool.ofMcp(mcp))
62236223

6224+
/**
6225+
* Alias for calling [addTool] with the following:
6226+
* ```java
6227+
* Tool.Mcp.builder()
6228+
* .serverLabel(serverLabel)
6229+
* .build()
6230+
* ```
6231+
*/
6232+
fun addMcpTool(serverLabel: String) =
6233+
addTool(Tool.Mcp.builder().serverLabel(serverLabel).build())
6234+
62246235
/**
62256236
* Alias for calling [addTool] with `Tool.ofCodeInterpreter(codeInterpreter)`.
62266237
*/

openai-java-core/src/main/kotlin/com/openai/models/responses/Response.kt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,6 +1237,17 @@ private constructor(
12371237
/** Alias for calling [addTool] with `Tool.ofMcp(mcp)`. */
12381238
fun addTool(mcp: Tool.Mcp) = addTool(Tool.ofMcp(mcp))
12391239

1240+
/**
1241+
* Alias for calling [addTool] with the following:
1242+
* ```java
1243+
* Tool.Mcp.builder()
1244+
* .serverLabel(serverLabel)
1245+
* .build()
1246+
* ```
1247+
*/
1248+
fun addMcpTool(serverLabel: String) =
1249+
addTool(Tool.Mcp.builder().serverLabel(serverLabel).build())
1250+
12401251
/** Alias for calling [addTool] with `Tool.ofCodeInterpreter(codeInterpreter)`. */
12411252
fun addTool(codeInterpreter: Tool.CodeInterpreter) =
12421253
addTool(Tool.ofCodeInterpreter(codeInterpreter))

openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseCreateParams.kt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1219,6 +1219,16 @@ private constructor(
12191219
/** Alias for calling [addTool] with `Tool.ofMcp(mcp)`. */
12201220
fun addTool(mcp: Tool.Mcp) = apply { body.addTool(mcp) }
12211221

1222+
/**
1223+
* Alias for calling [addTool] with the following:
1224+
* ```java
1225+
* Tool.Mcp.builder()
1226+
* .serverLabel(serverLabel)
1227+
* .build()
1228+
* ```
1229+
*/
1230+
fun addMcpTool(serverLabel: String) = apply { body.addMcpTool(serverLabel) }
1231+
12221232
/** Alias for calling [addTool] with `Tool.ofCodeInterpreter(codeInterpreter)`. */
12231233
fun addTool(codeInterpreter: Tool.CodeInterpreter) = apply { body.addTool(codeInterpreter) }
12241234

@@ -2859,6 +2869,17 @@ private constructor(
28592869
/** Alias for calling [addTool] with `Tool.ofMcp(mcp)`. */
28602870
fun addTool(mcp: Tool.Mcp) = addTool(Tool.ofMcp(mcp))
28612871

2872+
/**
2873+
* Alias for calling [addTool] with the following:
2874+
* ```java
2875+
* Tool.Mcp.builder()
2876+
* .serverLabel(serverLabel)
2877+
* .build()
2878+
* ```
2879+
*/
2880+
fun addMcpTool(serverLabel: String) =
2881+
addTool(Tool.Mcp.builder().serverLabel(serverLabel).build())
2882+
28622883
/** Alias for calling [addTool] with `Tool.ofCodeInterpreter(codeInterpreter)`. */
28632884
fun addTool(codeInterpreter: Tool.CodeInterpreter) =
28642885
addTool(Tool.ofCodeInterpreter(codeInterpreter))

0 commit comments

Comments
 (0)