Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .castiron.stats.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
schema_version: 1
generation_id: a7e57032-d27d-48a3-8369-86ac183c1c69
openapi_spec_hash: 0fa065837f86231ded0decb63dbdf0b7
openapi_transformed_spec_hash: 56311e2848d7e223897e87450386621c
generation_id: 6ad22e41-f8ac-4742-a376-c4fa7138f3ea
openapi_spec_hash: 7b8e0964b34b0cf993d2e2946e8eac7a
openapi_transformed_spec_hash: 2e5cad7379e2d90af0d91139bb2d3333
config_hash: c504b91d0d2bff67085cca331d9ad209
codegen_sha: b8eda29979a71e324dae3e5888b5e9277b86bc50
codegen_hash: ef0001ba574b6ca8564d676bfeb592de087e42a10a1e53e243dd0e3a5900950b
codegen_sha: 2437018cf842c6666b53169433c8741b2f8ad0d6
codegen_hash: e9c19ac1312d42abbb99e5dedd3c142b030562edd0eb3b81a48c9033d1e8ed8c
18 changes: 18 additions & 0 deletions api_reference/openapi.transformed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33179,6 +33179,24 @@ paths:
minLength: 0
maxLength: 1048576
description: Only return sessions whose root agent has this ID. Omit to return sessions for all agents.
- name: metadata
in: query
required: false
schema:
type: object
additionalProperties:
type: string
minLength: 0
maxLength: 512
propertyNames:
type: string
minLength: 1
maxLength: 64
minProperties: 0
maxProperties: 16
description: Exact string matches supplied as `metadata[key]=value`. All supplied pairs must match. Up to 16 pairs, with keys from 1 to 64 characters and values up to 512 characters. New sessions and metadata updates may take time to appear in filtered results.
style: deepObject
explode: true
responses:
'200':
description: A page of sessions.
Expand Down
4 changes: 2 additions & 2 deletions scripts/castiron/generated-files.json
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@
},
"src/resources/beta/agents/sessions/sessions.ts": {
"mode": "100644",
"sha256": "9ba36d2ffec97b6aeaf1b7b3ede5bf6eefa06f2e8d427610613aea8fbe340011"
"sha256": "51e48fe4066d9dbaabb2dcadbaff5176d9def697ea57af9a48e80ca35cbe28b0"
},
"src/resources/beta/agents/sessions/subagents.ts": {
"mode": "100644",
Expand Down Expand Up @@ -1175,7 +1175,7 @@
},
"tests/api-resources/beta/agents/sessions/sessions.test.ts": {
"mode": "100644",
"sha256": "0dce16789849a21f6357a8d0f165666a3da2a96a362a8661e20f2884bf27afa9"
"sha256": "bcfe27c25052097d7f90925a15d2c28759d2f660aeed13d3410294485c773f75"
},
"tests/api-resources/beta/agents/sessions/subagents/items.test.ts": {
"mode": "100644",
Expand Down
10 changes: 9 additions & 1 deletion src/resources/beta/agents/sessions/sessions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ export class Sessions extends APIResource {
): PagePromise<AgentSessionsPage, AgentsAPI.AgentSession> {
const normalizeRequestOptionsForQueryOptions = normalizeRequestOptionsForQuery(
query,
['after', 'agent_id', 'limit', 'order'],
['after', 'agent_id', 'limit', 'metadata', 'order'],
options,
);
if (normalizeRequestOptionsForQueryOptions !== undefined) {
Expand Down Expand Up @@ -647,6 +647,14 @@ export interface SessionListParams extends CursorPageParams {
*/
agent_id?: string;

/**
* Exact string matches supplied as `metadata[key]=value`. All supplied pairs must
* match. Up to 16 pairs, with keys from 1 to 64 characters and values up to 512
* characters. New sessions and metadata updates may take time to appear in
* filtered results.
*/
metadata?: { [key: string]: string };

/**
* The order in which resources are returned. Defaults to `desc`.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ describe('resource sessions', () => {
after: 'after',
agent_id: 'agent_id',
limit: 1,
metadata: { foo: 'string' },
order: 'asc',
},
{ path: '/_stainless_unknown_path' },
Expand Down
Loading