Skip to content

Commit 5871f8b

Browse files
feat(api): api update
1 parent 5213191 commit 5871f8b

7 files changed

Lines changed: 72 additions & 7 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 30
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/arcade-ai%2Farcade-engine-6ff494eafa2c154892716407682bb2296cff4f18c45765c5fb16bdf36f452ae1.yml
3-
openapi_spec_hash: 63dde2481a7d51042a241bfba232b0b0
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/arcade-ai%2Farcade-engine-299395b669a4d14b85501de63b43317c15964a7491e11eb92fb42909bbf8b68b.yml
3+
openapi_spec_hash: 7d17916818ff231f5a79ae345b0dc01b
44
config_hash: bf64816643634a621cd0ffd93d9c4347

arcade-java-core/src/main/kotlin/dev/arcade/models/tools/ToolListParams.kt

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,13 @@ import java.util.Objects
1414
import java.util.Optional
1515
import kotlin.jvm.optionals.getOrNull
1616

17-
/** Returns a page of tools from the engine configuration, optionally filtered by toolkit */
17+
/**
18+
* Returns a page of tools from the engine configuration, optionally filtered by toolkit and/or
19+
* metadata
20+
*/
1821
class ToolListParams
1922
private constructor(
23+
private val filter: String?,
2024
private val includeAllVersions: Boolean?,
2125
private val includeFormat: List<IncludeFormat>?,
2226
private val limit: Long?,
@@ -27,6 +31,13 @@ private constructor(
2731
private val additionalQueryParams: QueryParams,
2832
) : Params {
2933

34+
/**
35+
* JSON metadata filter. Array fields (service_domains, operations): shorthand array or object
36+
* with any_of/all_of/none_of operators (case-insensitive). Boolean fields: read_only,
37+
* destructive, idempotent, open_world. Extras: case-sensitive key-value subset match.
38+
*/
39+
fun filter(): Optional<String> = Optional.ofNullable(filter)
40+
3041
/** Include all versions of each tool */
3142
fun includeAllVersions(): Optional<Boolean> = Optional.ofNullable(includeAllVersions)
3243

@@ -64,6 +75,7 @@ private constructor(
6475
/** A builder for [ToolListParams]. */
6576
class Builder internal constructor() {
6677

78+
private var filter: String? = null
6779
private var includeAllVersions: Boolean? = null
6880
private var includeFormat: MutableList<IncludeFormat>? = null
6981
private var limit: Long? = null
@@ -75,6 +87,7 @@ private constructor(
7587

7688
@JvmSynthetic
7789
internal fun from(toolListParams: ToolListParams) = apply {
90+
filter = toolListParams.filter
7891
includeAllVersions = toolListParams.includeAllVersions
7992
includeFormat = toolListParams.includeFormat?.toMutableList()
8093
limit = toolListParams.limit
@@ -85,6 +98,17 @@ private constructor(
8598
additionalQueryParams = toolListParams.additionalQueryParams.toBuilder()
8699
}
87100

101+
/**
102+
* JSON metadata filter. Array fields (service_domains, operations): shorthand array or
103+
* object with any_of/all_of/none_of operators (case-insensitive). Boolean fields:
104+
* read_only, destructive, idempotent, open_world. Extras: case-sensitive key-value subset
105+
* match.
106+
*/
107+
fun filter(filter: String?) = apply { this.filter = filter }
108+
109+
/** Alias for calling [Builder.filter] with `filter.orElse(null)`. */
110+
fun filter(filter: Optional<String>) = filter(filter.getOrNull())
111+
88112
/** Include all versions of each tool */
89113
fun includeAllVersions(includeAllVersions: Boolean?) = apply {
90114
this.includeAllVersions = includeAllVersions
@@ -266,6 +290,7 @@ private constructor(
266290
*/
267291
fun build(): ToolListParams =
268292
ToolListParams(
293+
filter,
269294
includeAllVersions,
270295
includeFormat?.toImmutable(),
271296
limit,
@@ -282,6 +307,7 @@ private constructor(
282307
override fun _queryParams(): QueryParams =
283308
QueryParams.builder()
284309
.apply {
310+
filter?.let { put("filter", it) }
285311
includeAllVersions?.let { put("include_all_versions", it.toString()) }
286312
includeFormat?.let { put("include_format", it.joinToString(",") { it.toString() }) }
287313
limit?.let { put("limit", it.toString()) }
@@ -433,6 +459,7 @@ private constructor(
433459
}
434460

435461
return other is ToolListParams &&
462+
filter == other.filter &&
436463
includeAllVersions == other.includeAllVersions &&
437464
includeFormat == other.includeFormat &&
438465
limit == other.limit &&
@@ -445,6 +472,7 @@ private constructor(
445472

446473
override fun hashCode(): Int =
447474
Objects.hash(
475+
filter,
448476
includeAllVersions,
449477
includeFormat,
450478
limit,
@@ -456,5 +484,5 @@ private constructor(
456484
)
457485

458486
override fun toString() =
459-
"ToolListParams{includeAllVersions=$includeAllVersions, includeFormat=$includeFormat, limit=$limit, offset=$offset, toolkit=$toolkit, userId=$userId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
487+
"ToolListParams{filter=$filter, includeAllVersions=$includeAllVersions, includeFormat=$includeFormat, limit=$limit, offset=$offset, toolkit=$toolkit, userId=$userId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
460488
}

arcade-java-core/src/main/kotlin/dev/arcade/models/tools/formatted/FormattedListParams.kt

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import kotlin.jvm.optionals.getOrNull
1515
*/
1616
class FormattedListParams
1717
private constructor(
18+
private val filter: String?,
1819
private val format: String?,
1920
private val includeAllVersions: Boolean?,
2021
private val limit: Long?,
@@ -25,6 +26,13 @@ private constructor(
2526
private val additionalQueryParams: QueryParams,
2627
) : Params {
2728

29+
/**
30+
* JSON metadata filter. Array fields (service_domains, operations): shorthand array or object
31+
* with any_of/all_of/none_of operators (case-insensitive). Boolean fields: read_only,
32+
* destructive, idempotent, open_world. Extras: case-sensitive key-value subset match.
33+
*/
34+
fun filter(): Optional<String> = Optional.ofNullable(filter)
35+
2836
/** Provider format */
2937
fun format(): Optional<String> = Optional.ofNullable(format)
3038

@@ -62,6 +70,7 @@ private constructor(
6270
/** A builder for [FormattedListParams]. */
6371
class Builder internal constructor() {
6472

73+
private var filter: String? = null
6574
private var format: String? = null
6675
private var includeAllVersions: Boolean? = null
6776
private var limit: Long? = null
@@ -73,6 +82,7 @@ private constructor(
7382

7483
@JvmSynthetic
7584
internal fun from(formattedListParams: FormattedListParams) = apply {
85+
filter = formattedListParams.filter
7686
format = formattedListParams.format
7787
includeAllVersions = formattedListParams.includeAllVersions
7888
limit = formattedListParams.limit
@@ -83,6 +93,17 @@ private constructor(
8393
additionalQueryParams = formattedListParams.additionalQueryParams.toBuilder()
8494
}
8595

96+
/**
97+
* JSON metadata filter. Array fields (service_domains, operations): shorthand array or
98+
* object with any_of/all_of/none_of operators (case-insensitive). Boolean fields:
99+
* read_only, destructive, idempotent, open_world. Extras: case-sensitive key-value subset
100+
* match.
101+
*/
102+
fun filter(filter: String?) = apply { this.filter = filter }
103+
104+
/** Alias for calling [Builder.filter] with `filter.orElse(null)`. */
105+
fun filter(filter: Optional<String>) = filter(filter.getOrNull())
106+
86107
/** Provider format */
87108
fun format(format: String?) = apply { this.format = format }
88109

@@ -251,6 +272,7 @@ private constructor(
251272
*/
252273
fun build(): FormattedListParams =
253274
FormattedListParams(
275+
filter,
254276
format,
255277
includeAllVersions,
256278
limit,
@@ -267,6 +289,7 @@ private constructor(
267289
override fun _queryParams(): QueryParams =
268290
QueryParams.builder()
269291
.apply {
292+
filter?.let { put("filter", it) }
270293
format?.let { put("format", it) }
271294
includeAllVersions?.let { put("include_all_versions", it.toString()) }
272295
limit?.let { put("limit", it.toString()) }
@@ -283,6 +306,7 @@ private constructor(
283306
}
284307

285308
return other is FormattedListParams &&
309+
filter == other.filter &&
286310
format == other.format &&
287311
includeAllVersions == other.includeAllVersions &&
288312
limit == other.limit &&
@@ -295,6 +319,7 @@ private constructor(
295319

296320
override fun hashCode(): Int =
297321
Objects.hash(
322+
filter,
298323
format,
299324
includeAllVersions,
300325
limit,
@@ -306,5 +331,5 @@ private constructor(
306331
)
307332

308333
override fun toString() =
309-
"FormattedListParams{format=$format, includeAllVersions=$includeAllVersions, limit=$limit, offset=$offset, toolkit=$toolkit, userId=$userId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
334+
"FormattedListParams{filter=$filter, format=$format, includeAllVersions=$includeAllVersions, limit=$limit, offset=$offset, toolkit=$toolkit, userId=$userId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
310335
}

arcade-java-core/src/main/kotlin/dev/arcade/services/async/ToolServiceAsync.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ interface ToolServiceAsync {
3838

3939
fun formatted(): FormattedServiceAsync
4040

41-
/** Returns a page of tools from the engine configuration, optionally filtered by toolkit */
41+
/**
42+
* Returns a page of tools from the engine configuration, optionally filtered by toolkit and/or
43+
* metadata
44+
*/
4245
fun list(): CompletableFuture<ToolListPageAsync> = list(ToolListParams.none())
4346

4447
/** @see list */

arcade-java-core/src/main/kotlin/dev/arcade/services/blocking/ToolService.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ interface ToolService {
3838

3939
fun formatted(): FormattedService
4040

41-
/** Returns a page of tools from the engine configuration, optionally filtered by toolkit */
41+
/**
42+
* Returns a page of tools from the engine configuration, optionally filtered by toolkit and/or
43+
* metadata
44+
*/
4245
fun list(): ToolListPage = list(ToolListParams.none())
4346

4447
/** @see list */

arcade-java-core/src/test/kotlin/dev/arcade/models/tools/ToolListParamsTest.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ internal class ToolListParamsTest {
1111
@Test
1212
fun create() {
1313
ToolListParams.builder()
14+
.filter("filter")
1415
.includeAllVersions(true)
1516
.addIncludeFormat(ToolListParams.IncludeFormat.ARCADE)
1617
.limit(0L)
@@ -24,6 +25,7 @@ internal class ToolListParamsTest {
2425
fun queryParams() {
2526
val params =
2627
ToolListParams.builder()
28+
.filter("filter")
2729
.includeAllVersions(true)
2830
.addIncludeFormat(ToolListParams.IncludeFormat.ARCADE)
2931
.limit(0L)
@@ -37,6 +39,7 @@ internal class ToolListParamsTest {
3739
assertThat(queryParams)
3840
.isEqualTo(
3941
QueryParams.builder()
42+
.put("filter", "filter")
4043
.put("include_all_versions", "true")
4144
.put("include_format", listOf("arcade").joinToString(","))
4245
.put("limit", "0")

arcade-java-core/src/test/kotlin/dev/arcade/models/tools/formatted/FormattedListParamsTest.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ internal class FormattedListParamsTest {
1111
@Test
1212
fun create() {
1313
FormattedListParams.builder()
14+
.filter("filter")
1415
.format("format")
1516
.includeAllVersions(true)
1617
.limit(0L)
@@ -24,6 +25,7 @@ internal class FormattedListParamsTest {
2425
fun queryParams() {
2526
val params =
2627
FormattedListParams.builder()
28+
.filter("filter")
2729
.format("format")
2830
.includeAllVersions(true)
2931
.limit(0L)
@@ -37,6 +39,7 @@ internal class FormattedListParamsTest {
3739
assertThat(queryParams)
3840
.isEqualTo(
3941
QueryParams.builder()
42+
.put("filter", "filter")
4043
.put("format", "format")
4144
.put("include_all_versions", "true")
4245
.put("limit", "0")

0 commit comments

Comments
 (0)