openai 7.18.0 → 7.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/README.md +6 -3
- package/client.d.mts.map +1 -1
- package/client.d.ts.map +1 -1
- package/client.js +13 -7
- package/client.js.map +1 -1
- package/client.mjs +13 -7
- package/client.mjs.map +1 -1
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.js +11 -7
- package/internal/parse.js.map +1 -1
- package/internal/parse.mjs +11 -7
- package/internal/parse.mjs.map +1 -1
- package/internal/utils/log.d.mts.map +1 -1
- package/internal/utils/log.d.ts.map +1 -1
- package/internal/utils/log.js +1 -0
- package/internal/utils/log.js.map +1 -1
- package/internal/utils/log.mjs +1 -0
- package/internal/utils/log.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/admin/organization/admin-api-keys.d.mts +13 -2
- package/resources/admin/organization/admin-api-keys.d.mts.map +1 -1
- package/resources/admin/organization/admin-api-keys.d.ts +13 -2
- package/resources/admin/organization/admin-api-keys.d.ts.map +1 -1
- package/resources/admin/organization/admin-api-keys.js +58 -11
- package/resources/admin/organization/admin-api-keys.js.map +1 -1
- package/resources/admin/organization/admin-api-keys.mjs +58 -11
- package/resources/admin/organization/admin-api-keys.mjs.map +1 -1
- package/resources/admin/organization/audit-logs.d.mts +56 -3
- package/resources/admin/organization/audit-logs.d.mts.map +1 -1
- package/resources/admin/organization/audit-logs.d.ts +56 -3
- package/resources/admin/organization/audit-logs.d.ts.map +1 -1
- package/resources/admin/organization/audit-logs.js +69 -11
- package/resources/admin/organization/audit-logs.js.map +1 -1
- package/resources/admin/organization/audit-logs.mjs +69 -11
- package/resources/admin/organization/audit-logs.mjs.map +1 -1
- package/resources/admin/organization/certificates.d.mts +16 -2
- package/resources/admin/organization/certificates.d.mts.map +1 -1
- package/resources/admin/organization/certificates.d.ts +16 -2
- package/resources/admin/organization/certificates.d.ts.map +1 -1
- package/resources/admin/organization/certificates.js +64 -24
- package/resources/admin/organization/certificates.js.map +1 -1
- package/resources/admin/organization/certificates.mjs +64 -24
- package/resources/admin/organization/certificates.mjs.map +1 -1
- package/resources/admin/organization/external-storage.d.mts +141 -0
- package/resources/admin/organization/external-storage.d.mts.map +1 -0
- package/resources/admin/organization/external-storage.d.ts +141 -0
- package/resources/admin/organization/external-storage.d.ts.map +1 -0
- package/resources/admin/organization/external-storage.js +146 -0
- package/resources/admin/organization/external-storage.js.map +1 -0
- package/resources/admin/organization/external-storage.mjs +142 -0
- package/resources/admin/organization/external-storage.mjs.map +1 -0
- package/resources/admin/organization/groups/groups.d.mts +8 -1
- package/resources/admin/organization/groups/groups.d.mts.map +1 -1
- package/resources/admin/organization/groups/groups.d.ts +8 -1
- package/resources/admin/organization/groups/groups.d.ts.map +1 -1
- package/resources/admin/organization/groups/groups.js +58 -11
- package/resources/admin/organization/groups/groups.js.map +1 -1
- package/resources/admin/organization/groups/groups.mjs +58 -11
- package/resources/admin/organization/groups/groups.mjs.map +1 -1
- package/resources/admin/organization/groups/roles.d.mts +8 -1
- package/resources/admin/organization/groups/roles.d.mts.map +1 -1
- package/resources/admin/organization/groups/roles.d.ts +8 -1
- package/resources/admin/organization/groups/roles.d.ts.map +1 -1
- package/resources/admin/organization/groups/roles.js +58 -13
- package/resources/admin/organization/groups/roles.js.map +1 -1
- package/resources/admin/organization/groups/roles.mjs +58 -13
- package/resources/admin/organization/groups/roles.mjs.map +1 -1
- package/resources/admin/organization/groups/users.d.mts +8 -1
- package/resources/admin/organization/groups/users.d.mts.map +1 -1
- package/resources/admin/organization/groups/users.d.ts +8 -1
- package/resources/admin/organization/groups/users.d.ts.map +1 -1
- package/resources/admin/organization/groups/users.js +58 -13
- package/resources/admin/organization/groups/users.js.map +1 -1
- package/resources/admin/organization/groups/users.mjs +58 -13
- package/resources/admin/organization/groups/users.mjs.map +1 -1
- package/resources/admin/organization/index.d.mts +1 -0
- package/resources/admin/organization/index.d.mts.map +1 -1
- package/resources/admin/organization/index.d.ts +1 -0
- package/resources/admin/organization/index.d.ts.map +1 -1
- package/resources/admin/organization/index.js +3 -1
- package/resources/admin/organization/index.js.map +1 -1
- package/resources/admin/organization/index.mjs +1 -0
- package/resources/admin/organization/index.mjs.map +1 -1
- package/resources/admin/organization/invites.d.mts +8 -1
- package/resources/admin/organization/invites.d.mts.map +1 -1
- package/resources/admin/organization/invites.d.ts +8 -1
- package/resources/admin/organization/invites.d.ts.map +1 -1
- package/resources/admin/organization/invites.js +58 -11
- package/resources/admin/organization/invites.js.map +1 -1
- package/resources/admin/organization/invites.mjs +58 -11
- package/resources/admin/organization/invites.mjs.map +1 -1
- package/resources/admin/organization/organization.d.mts +4 -0
- package/resources/admin/organization/organization.d.mts.map +1 -1
- package/resources/admin/organization/organization.d.ts +4 -0
- package/resources/admin/organization/organization.d.ts.map +1 -1
- package/resources/admin/organization/organization.js +4 -0
- package/resources/admin/organization/organization.js.map +1 -1
- package/resources/admin/organization/organization.mjs +4 -0
- package/resources/admin/organization/organization.mjs.map +1 -1
- package/resources/admin/organization/projects/api-keys.d.mts +8 -1
- package/resources/admin/organization/projects/api-keys.d.mts.map +1 -1
- package/resources/admin/organization/projects/api-keys.d.ts +8 -1
- package/resources/admin/organization/projects/api-keys.d.ts.map +1 -1
- package/resources/admin/organization/projects/api-keys.js +58 -13
- package/resources/admin/organization/projects/api-keys.js.map +1 -1
- package/resources/admin/organization/projects/api-keys.mjs +58 -13
- package/resources/admin/organization/projects/api-keys.mjs.map +1 -1
- package/resources/admin/organization/projects/certificates.d.mts +8 -1
- package/resources/admin/organization/projects/certificates.d.mts.map +1 -1
- package/resources/admin/organization/projects/certificates.d.ts +8 -1
- package/resources/admin/organization/projects/certificates.d.ts.map +1 -1
- package/resources/admin/organization/projects/certificates.js +58 -13
- package/resources/admin/organization/projects/certificates.js.map +1 -1
- package/resources/admin/organization/projects/certificates.mjs +58 -13
- package/resources/admin/organization/projects/certificates.mjs.map +1 -1
- package/resources/admin/organization/projects/groups/groups.d.mts +8 -1
- package/resources/admin/organization/projects/groups/groups.d.mts.map +1 -1
- package/resources/admin/organization/projects/groups/groups.d.ts +8 -1
- package/resources/admin/organization/projects/groups/groups.d.ts.map +1 -1
- package/resources/admin/organization/projects/groups/groups.js +58 -13
- package/resources/admin/organization/projects/groups/groups.js.map +1 -1
- package/resources/admin/organization/projects/groups/groups.mjs +58 -13
- package/resources/admin/organization/projects/groups/groups.mjs.map +1 -1
- package/resources/admin/organization/projects/projects.d.mts +8 -1
- package/resources/admin/organization/projects/projects.d.mts.map +1 -1
- package/resources/admin/organization/projects/projects.d.ts +8 -1
- package/resources/admin/organization/projects/projects.d.ts.map +1 -1
- package/resources/admin/organization/projects/projects.js +58 -11
- package/resources/admin/organization/projects/projects.js.map +1 -1
- package/resources/admin/organization/projects/projects.mjs +58 -11
- package/resources/admin/organization/projects/projects.mjs.map +1 -1
- package/resources/admin/organization/projects/rate-limits.d.mts +8 -1
- package/resources/admin/organization/projects/rate-limits.d.mts.map +1 -1
- package/resources/admin/organization/projects/rate-limits.d.ts +8 -1
- package/resources/admin/organization/projects/rate-limits.d.ts.map +1 -1
- package/resources/admin/organization/projects/rate-limits.js +58 -13
- package/resources/admin/organization/projects/rate-limits.js.map +1 -1
- package/resources/admin/organization/projects/rate-limits.mjs +58 -13
- package/resources/admin/organization/projects/rate-limits.mjs.map +1 -1
- package/resources/admin/organization/projects/roles.d.mts +8 -1
- package/resources/admin/organization/projects/roles.d.mts.map +1 -1
- package/resources/admin/organization/projects/roles.d.ts +8 -1
- package/resources/admin/organization/projects/roles.d.ts.map +1 -1
- package/resources/admin/organization/projects/roles.js +58 -13
- package/resources/admin/organization/projects/roles.js.map +1 -1
- package/resources/admin/organization/projects/roles.mjs +58 -13
- package/resources/admin/organization/projects/roles.mjs.map +1 -1
- package/resources/admin/organization/projects/service-accounts/service-accounts.d.mts +8 -1
- package/resources/admin/organization/projects/service-accounts/service-accounts.d.mts.map +1 -1
- package/resources/admin/organization/projects/service-accounts/service-accounts.d.ts +8 -1
- package/resources/admin/organization/projects/service-accounts/service-accounts.d.ts.map +1 -1
- package/resources/admin/organization/projects/service-accounts/service-accounts.js +58 -13
- package/resources/admin/organization/projects/service-accounts/service-accounts.js.map +1 -1
- package/resources/admin/organization/projects/service-accounts/service-accounts.mjs +58 -13
- package/resources/admin/organization/projects/service-accounts/service-accounts.mjs.map +1 -1
- package/resources/admin/organization/projects/spend-alerts.d.mts +8 -1
- package/resources/admin/organization/projects/spend-alerts.d.mts.map +1 -1
- package/resources/admin/organization/projects/spend-alerts.d.ts +8 -1
- package/resources/admin/organization/projects/spend-alerts.d.ts.map +1 -1
- package/resources/admin/organization/projects/spend-alerts.js +58 -13
- package/resources/admin/organization/projects/spend-alerts.js.map +1 -1
- package/resources/admin/organization/projects/spend-alerts.mjs +58 -13
- package/resources/admin/organization/projects/spend-alerts.mjs.map +1 -1
- package/resources/admin/organization/projects/users/users.d.mts +8 -1
- package/resources/admin/organization/projects/users/users.d.mts.map +1 -1
- package/resources/admin/organization/projects/users/users.d.ts +8 -1
- package/resources/admin/organization/projects/users/users.d.ts.map +1 -1
- package/resources/admin/organization/projects/users/users.js +58 -13
- package/resources/admin/organization/projects/users/users.js.map +1 -1
- package/resources/admin/organization/projects/users/users.mjs +58 -13
- package/resources/admin/organization/projects/users/users.mjs.map +1 -1
- package/resources/admin/organization/roles.d.mts +8 -1
- package/resources/admin/organization/roles.d.mts.map +1 -1
- package/resources/admin/organization/roles.d.ts +8 -1
- package/resources/admin/organization/roles.d.ts.map +1 -1
- package/resources/admin/organization/roles.js +58 -11
- package/resources/admin/organization/roles.js.map +1 -1
- package/resources/admin/organization/roles.mjs +58 -11
- package/resources/admin/organization/roles.mjs.map +1 -1
- package/resources/admin/organization/spend-alerts.d.mts +8 -1
- package/resources/admin/organization/spend-alerts.d.mts.map +1 -1
- package/resources/admin/organization/spend-alerts.d.ts +8 -1
- package/resources/admin/organization/spend-alerts.d.ts.map +1 -1
- package/resources/admin/organization/spend-alerts.js +58 -11
- package/resources/admin/organization/spend-alerts.js.map +1 -1
- package/resources/admin/organization/spend-alerts.mjs +58 -11
- package/resources/admin/organization/spend-alerts.mjs.map +1 -1
- package/resources/admin/organization/users/roles.d.mts +8 -1
- package/resources/admin/organization/users/roles.d.mts.map +1 -1
- package/resources/admin/organization/users/roles.d.ts +8 -1
- package/resources/admin/organization/users/roles.d.ts.map +1 -1
- package/resources/admin/organization/users/roles.js +58 -13
- package/resources/admin/organization/users/roles.js.map +1 -1
- package/resources/admin/organization/users/roles.mjs +58 -13
- package/resources/admin/organization/users/roles.mjs.map +1 -1
- package/resources/admin/organization/users/users.d.mts +8 -1
- package/resources/admin/organization/users/users.d.mts.map +1 -1
- package/resources/admin/organization/users/users.d.ts +8 -1
- package/resources/admin/organization/users/users.d.ts.map +1 -1
- package/resources/admin/organization/users/users.js +58 -11
- package/resources/admin/organization/users/users.js.map +1 -1
- package/resources/admin/organization/users/users.mjs +58 -11
- package/resources/admin/organization/users/users.mjs.map +1 -1
- package/resources/batches.d.mts +8 -1
- package/resources/batches.d.mts.map +1 -1
- package/resources/batches.d.ts +8 -1
- package/resources/batches.d.ts.map +1 -1
- package/resources/batches.js +58 -3
- package/resources/batches.js.map +1 -1
- package/resources/batches.mjs +58 -3
- package/resources/batches.mjs.map +1 -1
- package/resources/beta/agents/agents.d.mts +67 -46
- package/resources/beta/agents/agents.d.mts.map +1 -1
- package/resources/beta/agents/agents.d.ts +67 -46
- package/resources/beta/agents/agents.d.ts.map +1 -1
- package/resources/beta/agents/agents.js +58 -12
- package/resources/beta/agents/agents.js.map +1 -1
- package/resources/beta/agents/agents.mjs +58 -12
- package/resources/beta/agents/agents.mjs.map +1 -1
- package/resources/beta/agents/environments/files.d.mts +5 -1
- package/resources/beta/agents/environments/files.d.mts.map +1 -1
- package/resources/beta/agents/environments/files.d.ts +5 -1
- package/resources/beta/agents/environments/files.d.ts.map +1 -1
- package/resources/beta/agents/environments/templates.d.mts +24 -13
- package/resources/beta/agents/environments/templates.d.mts.map +1 -1
- package/resources/beta/agents/environments/templates.d.ts +24 -13
- package/resources/beta/agents/environments/templates.d.ts.map +1 -1
- package/resources/beta/agents/environments/templates.js +58 -12
- package/resources/beta/agents/environments/templates.js.map +1 -1
- package/resources/beta/agents/environments/templates.mjs +58 -12
- package/resources/beta/agents/environments/templates.mjs.map +1 -1
- package/resources/beta/agents/sessions/artifacts.d.mts +17 -2
- package/resources/beta/agents/sessions/artifacts.d.mts.map +1 -1
- package/resources/beta/agents/sessions/artifacts.d.ts +17 -2
- package/resources/beta/agents/sessions/artifacts.d.ts.map +1 -1
- package/resources/beta/agents/sessions/artifacts.js +58 -14
- package/resources/beta/agents/sessions/artifacts.js.map +1 -1
- package/resources/beta/agents/sessions/artifacts.mjs +58 -14
- package/resources/beta/agents/sessions/artifacts.mjs.map +1 -1
- package/resources/beta/agents/sessions/events.d.mts +4 -1
- package/resources/beta/agents/sessions/events.d.mts.map +1 -1
- package/resources/beta/agents/sessions/events.d.ts +4 -1
- package/resources/beta/agents/sessions/events.d.ts.map +1 -1
- package/resources/beta/agents/sessions/events.js +4 -1
- package/resources/beta/agents/sessions/events.js.map +1 -1
- package/resources/beta/agents/sessions/events.mjs +4 -1
- package/resources/beta/agents/sessions/events.mjs.map +1 -1
- package/resources/beta/agents/sessions/items.d.mts +8 -1
- package/resources/beta/agents/sessions/items.d.mts.map +1 -1
- package/resources/beta/agents/sessions/items.d.ts +8 -1
- package/resources/beta/agents/sessions/items.d.ts.map +1 -1
- package/resources/beta/agents/sessions/items.js +58 -15
- package/resources/beta/agents/sessions/items.js.map +1 -1
- package/resources/beta/agents/sessions/items.mjs +58 -15
- package/resources/beta/agents/sessions/items.mjs.map +1 -1
- package/resources/beta/agents/sessions/sessions.d.mts +25 -8
- package/resources/beta/agents/sessions/sessions.d.mts.map +1 -1
- package/resources/beta/agents/sessions/sessions.d.ts +25 -8
- package/resources/beta/agents/sessions/sessions.d.ts.map +1 -1
- package/resources/beta/agents/sessions/sessions.js +61 -14
- package/resources/beta/agents/sessions/sessions.js.map +1 -1
- package/resources/beta/agents/sessions/sessions.mjs +61 -14
- package/resources/beta/agents/sessions/sessions.mjs.map +1 -1
- package/resources/beta/agents/sessions/subagents/subagents.d.mts +8 -1
- package/resources/beta/agents/sessions/subagents/subagents.d.mts.map +1 -1
- package/resources/beta/agents/sessions/subagents/subagents.d.ts +8 -1
- package/resources/beta/agents/sessions/subagents/subagents.d.ts.map +1 -1
- package/resources/beta/agents/sessions/subagents/subagents.js +58 -14
- package/resources/beta/agents/sessions/subagents/subagents.js.map +1 -1
- package/resources/beta/agents/sessions/subagents/subagents.mjs +58 -14
- package/resources/beta/agents/sessions/subagents/subagents.mjs.map +1 -1
- package/resources/beta/agents/sessions/turns.d.mts +11 -3
- package/resources/beta/agents/sessions/turns.d.mts.map +1 -1
- package/resources/beta/agents/sessions/turns.d.ts +11 -3
- package/resources/beta/agents/sessions/turns.d.ts.map +1 -1
- package/resources/beta/agents/sessions/turns.js +58 -15
- package/resources/beta/agents/sessions/turns.js.map +1 -1
- package/resources/beta/agents/sessions/turns.mjs +58 -15
- package/resources/beta/agents/sessions/turns.mjs.map +1 -1
- package/resources/beta/agents/vaults/credentials.d.mts +169 -24
- package/resources/beta/agents/vaults/credentials.d.mts.map +1 -1
- package/resources/beta/agents/vaults/credentials.d.ts +169 -24
- package/resources/beta/agents/vaults/credentials.d.ts.map +1 -1
- package/resources/beta/agents/vaults/credentials.js +58 -15
- package/resources/beta/agents/vaults/credentials.js.map +1 -1
- package/resources/beta/agents/vaults/credentials.mjs +58 -15
- package/resources/beta/agents/vaults/credentials.mjs.map +1 -1
- package/resources/beta/agents/vaults/index.d.mts +1 -1
- package/resources/beta/agents/vaults/index.d.mts.map +1 -1
- package/resources/beta/agents/vaults/index.d.ts +1 -1
- package/resources/beta/agents/vaults/index.d.ts.map +1 -1
- package/resources/beta/agents/vaults/index.js.map +1 -1
- package/resources/beta/agents/vaults/index.mjs.map +1 -1
- package/resources/beta/agents/vaults/vaults.d.mts +17 -6
- package/resources/beta/agents/vaults/vaults.d.mts.map +1 -1
- package/resources/beta/agents/vaults/vaults.d.ts +17 -6
- package/resources/beta/agents/vaults/vaults.d.ts.map +1 -1
- package/resources/beta/agents/vaults/vaults.js +58 -12
- package/resources/beta/agents/vaults/vaults.js.map +1 -1
- package/resources/beta/agents/vaults/vaults.mjs +58 -12
- package/resources/beta/agents/vaults/vaults.mjs.map +1 -1
- package/resources/beta/assistants.d.mts +8 -1
- package/resources/beta/assistants.d.mts.map +1 -1
- package/resources/beta/assistants.d.ts +8 -1
- package/resources/beta/assistants.d.ts.map +1 -1
- package/resources/beta/assistants.js +58 -5
- package/resources/beta/assistants.js.map +1 -1
- package/resources/beta/assistants.mjs +58 -5
- package/resources/beta/assistants.mjs.map +1 -1
- package/resources/beta/chatkit/threads.d.mts +16 -2
- package/resources/beta/chatkit/threads.d.mts.map +1 -1
- package/resources/beta/chatkit/threads.d.ts +16 -2
- package/resources/beta/chatkit/threads.d.ts.map +1 -1
- package/resources/beta/chatkit/threads.js +64 -24
- package/resources/beta/chatkit/threads.js.map +1 -1
- package/resources/beta/chatkit/threads.mjs +64 -24
- package/resources/beta/chatkit/threads.mjs.map +1 -1
- package/resources/beta/responses/responses.d.mts +15 -12
- package/resources/beta/responses/responses.d.mts.map +1 -1
- package/resources/beta/responses/responses.d.ts +15 -12
- package/resources/beta/responses/responses.d.ts.map +1 -1
- package/resources/beta/responses/responses.js.map +1 -1
- package/resources/beta/responses/responses.mjs.map +1 -1
- package/resources/beta/threads/messages.d.mts +8 -1
- package/resources/beta/threads/messages.d.mts.map +1 -1
- package/resources/beta/threads/messages.d.ts +8 -1
- package/resources/beta/threads/messages.d.ts.map +1 -1
- package/resources/beta/threads/messages.js +58 -5
- package/resources/beta/threads/messages.js.map +1 -1
- package/resources/beta/threads/messages.mjs +58 -5
- package/resources/beta/threads/messages.mjs.map +1 -1
- package/resources/beta/threads/runs/runs.d.mts +8 -1
- package/resources/beta/threads/runs/runs.d.mts.map +1 -1
- package/resources/beta/threads/runs/runs.d.ts +8 -1
- package/resources/beta/threads/runs/runs.d.ts.map +1 -1
- package/resources/beta/threads/runs/runs.js +58 -5
- package/resources/beta/threads/runs/runs.js.map +1 -1
- package/resources/beta/threads/runs/runs.mjs +58 -5
- package/resources/beta/threads/runs/runs.mjs.map +1 -1
- package/resources/chat/completions/completions.d.mts +13 -3
- package/resources/chat/completions/completions.d.mts.map +1 -1
- package/resources/chat/completions/completions.d.ts +13 -3
- package/resources/chat/completions/completions.d.ts.map +1 -1
- package/resources/chat/completions/completions.js +58 -12
- package/resources/chat/completions/completions.js.map +1 -1
- package/resources/chat/completions/completions.mjs +58 -12
- package/resources/chat/completions/completions.mjs.map +1 -1
- package/resources/chat/completions/messages.d.mts +8 -1
- package/resources/chat/completions/messages.d.mts.map +1 -1
- package/resources/chat/completions/messages.d.ts +8 -1
- package/resources/chat/completions/messages.d.ts.map +1 -1
- package/resources/chat/completions/messages.js +58 -14
- package/resources/chat/completions/messages.js.map +1 -1
- package/resources/chat/completions/messages.mjs +58 -14
- package/resources/chat/completions/messages.mjs.map +1 -1
- package/resources/containers/containers.d.mts +8 -1
- package/resources/containers/containers.d.mts.map +1 -1
- package/resources/containers/containers.d.ts +8 -1
- package/resources/containers/containers.d.ts.map +1 -1
- package/resources/containers/containers.js +58 -3
- package/resources/containers/containers.js.map +1 -1
- package/resources/containers/containers.mjs +58 -3
- package/resources/containers/containers.mjs.map +1 -1
- package/resources/containers/files/files.d.mts +8 -1
- package/resources/containers/files/files.d.mts.map +1 -1
- package/resources/containers/files/files.d.ts +8 -1
- package/resources/containers/files/files.d.ts.map +1 -1
- package/resources/containers/files/files.js +58 -3
- package/resources/containers/files/files.js.map +1 -1
- package/resources/containers/files/files.mjs +58 -3
- package/resources/containers/files/files.mjs.map +1 -1
- package/resources/conversations/conversations.d.mts +3 -4
- package/resources/conversations/conversations.d.mts.map +1 -1
- package/resources/conversations/conversations.d.ts +3 -4
- package/resources/conversations/conversations.d.ts.map +1 -1
- package/resources/conversations/conversations.js.map +1 -1
- package/resources/conversations/conversations.mjs.map +1 -1
- package/resources/conversations/items.d.mts +8 -1
- package/resources/conversations/items.d.mts.map +1 -1
- package/resources/conversations/items.d.ts +8 -1
- package/resources/conversations/items.d.ts.map +1 -1
- package/resources/conversations/items.js +58 -3
- package/resources/conversations/items.js.map +1 -1
- package/resources/conversations/items.mjs +58 -3
- package/resources/conversations/items.mjs.map +1 -1
- package/resources/evals/evals.d.mts +8 -1
- package/resources/evals/evals.d.mts.map +1 -1
- package/resources/evals/evals.d.ts +8 -1
- package/resources/evals/evals.d.ts.map +1 -1
- package/resources/evals/evals.js +58 -3
- package/resources/evals/evals.js.map +1 -1
- package/resources/evals/evals.mjs +58 -3
- package/resources/evals/evals.mjs.map +1 -1
- package/resources/evals/runs/runs.d.mts +8 -1
- package/resources/evals/runs/runs.d.mts.map +1 -1
- package/resources/evals/runs/runs.d.ts +8 -1
- package/resources/evals/runs/runs.d.ts.map +1 -1
- package/resources/evals/runs/runs.js +58 -3
- package/resources/evals/runs/runs.js.map +1 -1
- package/resources/evals/runs/runs.mjs +58 -3
- package/resources/evals/runs/runs.mjs.map +1 -1
- package/resources/files.d.mts +8 -1
- package/resources/files.d.mts.map +1 -1
- package/resources/files.d.ts +8 -1
- package/resources/files.d.ts.map +1 -1
- package/resources/files.js +58 -3
- package/resources/files.js.map +1 -1
- package/resources/files.mjs +58 -3
- package/resources/files.mjs.map +1 -1
- package/resources/fine-tuning/checkpoints/permissions.d.mts +16 -2
- package/resources/fine-tuning/checkpoints/permissions.d.mts.map +1 -1
- package/resources/fine-tuning/checkpoints/permissions.d.ts +16 -2
- package/resources/fine-tuning/checkpoints/permissions.d.ts.map +1 -1
- package/resources/fine-tuning/checkpoints/permissions.js +64 -26
- package/resources/fine-tuning/checkpoints/permissions.js.map +1 -1
- package/resources/fine-tuning/checkpoints/permissions.mjs +64 -26
- package/resources/fine-tuning/checkpoints/permissions.mjs.map +1 -1
- package/resources/fine-tuning/jobs/checkpoints.d.mts +8 -1
- package/resources/fine-tuning/jobs/checkpoints.d.mts.map +1 -1
- package/resources/fine-tuning/jobs/checkpoints.d.ts +8 -1
- package/resources/fine-tuning/jobs/checkpoints.d.ts.map +1 -1
- package/resources/fine-tuning/jobs/checkpoints.js +58 -13
- package/resources/fine-tuning/jobs/checkpoints.js.map +1 -1
- package/resources/fine-tuning/jobs/checkpoints.mjs +58 -13
- package/resources/fine-tuning/jobs/checkpoints.mjs.map +1 -1
- package/resources/fine-tuning/jobs/jobs.d.mts +16 -2
- package/resources/fine-tuning/jobs/jobs.d.mts.map +1 -1
- package/resources/fine-tuning/jobs/jobs.d.ts +16 -2
- package/resources/fine-tuning/jobs/jobs.d.ts.map +1 -1
- package/resources/fine-tuning/jobs/jobs.js +64 -24
- package/resources/fine-tuning/jobs/jobs.js.map +1 -1
- package/resources/fine-tuning/jobs/jobs.mjs +64 -24
- package/resources/fine-tuning/jobs/jobs.mjs.map +1 -1
- package/resources/images.d.mts +3 -4
- package/resources/images.d.mts.map +1 -1
- package/resources/images.d.ts +3 -4
- package/resources/images.d.ts.map +1 -1
- package/resources/index.d.mts +1 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/realtime/client-secrets.d.mts +7 -3
- package/resources/realtime/client-secrets.d.mts.map +1 -1
- package/resources/realtime/client-secrets.d.ts +7 -3
- package/resources/realtime/client-secrets.d.ts.map +1 -1
- package/resources/realtime/realtime.d.mts +17 -8
- package/resources/realtime/realtime.d.mts.map +1 -1
- package/resources/realtime/realtime.d.ts +17 -8
- package/resources/realtime/realtime.d.ts.map +1 -1
- package/resources/realtime/realtime.js.map +1 -1
- package/resources/realtime/realtime.mjs.map +1 -1
- package/resources/responses/input-items.d.mts +8 -1
- package/resources/responses/input-items.d.mts.map +1 -1
- package/resources/responses/input-items.d.ts +8 -1
- package/resources/responses/input-items.d.ts.map +1 -1
- package/resources/responses/input-items.js +58 -13
- package/resources/responses/input-items.js.map +1 -1
- package/resources/responses/input-items.mjs +58 -13
- package/resources/responses/input-items.mjs.map +1 -1
- package/resources/responses/responses.d.mts +26 -12
- package/resources/responses/responses.d.mts.map +1 -1
- package/resources/responses/responses.d.ts +26 -12
- package/resources/responses/responses.d.ts.map +1 -1
- package/resources/responses/responses.js +58 -0
- package/resources/responses/responses.js.map +1 -1
- package/resources/responses/responses.mjs +58 -0
- package/resources/responses/responses.mjs.map +1 -1
- package/resources/safety/cases.d.mts +26 -0
- package/resources/safety/cases.d.mts.map +1 -0
- package/resources/safety/cases.d.ts +26 -0
- package/resources/safety/cases.d.ts.map +1 -0
- package/resources/safety/cases.js +16 -0
- package/resources/safety/cases.js.map +1 -0
- package/resources/safety/cases.mjs +12 -0
- package/resources/safety/cases.mjs.map +1 -0
- package/resources/safety/index.d.mts +1 -0
- package/resources/safety/index.d.mts.map +1 -1
- package/resources/safety/index.d.ts +1 -0
- package/resources/safety/index.d.ts.map +1 -1
- package/resources/safety/index.js +3 -1
- package/resources/safety/index.js.map +1 -1
- package/resources/safety/index.mjs +1 -0
- package/resources/safety/index.mjs.map +1 -1
- package/resources/safety/safety.d.mts +4 -0
- package/resources/safety/safety.d.mts.map +1 -1
- package/resources/safety/safety.d.ts +4 -0
- package/resources/safety/safety.d.ts.map +1 -1
- package/resources/safety/safety.js +4 -0
- package/resources/safety/safety.js.map +1 -1
- package/resources/safety/safety.mjs +4 -0
- package/resources/safety/safety.mjs.map +1 -1
- package/resources/shared.d.mts +1 -1
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +1 -1
- package/resources/shared.d.ts.map +1 -1
- package/resources/skills/skills.d.mts +8 -1
- package/resources/skills/skills.d.mts.map +1 -1
- package/resources/skills/skills.d.ts +8 -1
- package/resources/skills/skills.d.ts.map +1 -1
- package/resources/skills/skills.js +58 -3
- package/resources/skills/skills.js.map +1 -1
- package/resources/skills/skills.mjs +58 -3
- package/resources/skills/skills.mjs.map +1 -1
- package/resources/skills/versions/versions.d.mts +8 -1
- package/resources/skills/versions/versions.d.mts.map +1 -1
- package/resources/skills/versions/versions.d.ts +8 -1
- package/resources/skills/versions/versions.d.ts.map +1 -1
- package/resources/skills/versions/versions.js +58 -3
- package/resources/skills/versions/versions.js.map +1 -1
- package/resources/skills/versions/versions.mjs +58 -3
- package/resources/skills/versions/versions.mjs.map +1 -1
- package/resources/vector-stores/files.d.mts +8 -1
- package/resources/vector-stores/files.d.mts.map +1 -1
- package/resources/vector-stores/files.d.ts +8 -1
- package/resources/vector-stores/files.d.ts.map +1 -1
- package/resources/vector-stores/files.js +58 -3
- package/resources/vector-stores/files.js.map +1 -1
- package/resources/vector-stores/files.mjs +58 -3
- package/resources/vector-stores/files.mjs.map +1 -1
- package/resources/vector-stores/vector-stores.d.mts +8 -1
- package/resources/vector-stores/vector-stores.d.mts.map +1 -1
- package/resources/vector-stores/vector-stores.d.ts +8 -1
- package/resources/vector-stores/vector-stores.d.ts.map +1 -1
- package/resources/vector-stores/vector-stores.js +58 -3
- package/resources/vector-stores/vector-stores.js.map +1 -1
- package/resources/vector-stores/vector-stores.mjs +58 -3
- package/resources/vector-stores/vector-stores.mjs.map +1 -1
- package/resources/videos.d.mts +16 -2
- package/resources/videos.d.mts.map +1 -1
- package/resources/videos.d.ts +16 -2
- package/resources/videos.d.ts.map +1 -1
- package/resources/videos.js +64 -12
- package/resources/videos.js.map +1 -1
- package/resources/videos.mjs +64 -12
- package/resources/videos.mjs.map +1 -1
- package/resources/webhooks/event-types.d.mts +17 -0
- package/resources/webhooks/event-types.d.mts.map +1 -0
- package/resources/webhooks/event-types.d.ts +17 -0
- package/resources/webhooks/event-types.d.ts.map +1 -0
- package/resources/webhooks/event-types.js +21 -0
- package/resources/webhooks/event-types.js.map +1 -0
- package/resources/webhooks/event-types.mjs +17 -0
- package/resources/webhooks/event-types.mjs.map +1 -0
- package/resources/webhooks/index.d.mts +1 -0
- package/resources/webhooks/index.d.mts.map +1 -1
- package/resources/webhooks/index.d.ts +1 -0
- package/resources/webhooks/index.d.ts.map +1 -1
- package/resources/webhooks/index.js +3 -0
- package/resources/webhooks/index.js.map +1 -1
- package/resources/webhooks/index.mjs +1 -0
- package/resources/webhooks/index.mjs.map +1 -1
- package/resources/webhooks/webhooks.d.mts +368 -2
- package/resources/webhooks/webhooks.d.mts.map +1 -1
- package/resources/webhooks/webhooks.d.ts +368 -2
- package/resources/webhooks/webhooks.d.ts.map +1 -1
- package/resources/webhooks/webhooks.js +168 -0
- package/resources/webhooks/webhooks.js.map +1 -1
- package/resources/webhooks/webhooks.mjs +168 -0
- package/resources/webhooks/webhooks.mjs.map +1 -1
- package/src/client.ts +16 -10
- package/src/internal/parse.ts +14 -10
- package/src/internal/utils/log.ts +1 -0
- package/src/resources/admin/organization/admin-api-keys.ts +206 -2
- package/src/resources/admin/organization/audit-logs.ts +270 -1
- package/src/resources/admin/organization/certificates.ts +295 -2
- package/src/resources/admin/organization/external-storage.ts +420 -0
- package/src/resources/admin/organization/groups/groups.ts +200 -1
- package/src/resources/admin/organization/groups/roles.ts +202 -1
- package/src/resources/admin/organization/groups/users.ts +202 -1
- package/src/resources/admin/organization/index.ts +10 -0
- package/src/resources/admin/organization/invites.ts +200 -1
- package/src/resources/admin/organization/organization.ts +24 -0
- package/src/resources/admin/organization/projects/api-keys.ts +202 -1
- package/src/resources/admin/organization/projects/certificates.ts +202 -1
- package/src/resources/admin/organization/projects/groups/groups.ts +202 -1
- package/src/resources/admin/organization/projects/projects.ts +200 -1
- package/src/resources/admin/organization/projects/rate-limits.ts +202 -1
- package/src/resources/admin/organization/projects/roles.ts +202 -1
- package/src/resources/admin/organization/projects/service-accounts/service-accounts.ts +202 -1
- package/src/resources/admin/organization/projects/spend-alerts.ts +202 -1
- package/src/resources/admin/organization/projects/users/users.ts +202 -1
- package/src/resources/admin/organization/roles.ts +200 -1
- package/src/resources/admin/organization/spend-alerts.ts +200 -1
- package/src/resources/admin/organization/users/roles.ts +202 -1
- package/src/resources/admin/organization/users/users.ts +200 -1
- package/src/resources/batches.ts +200 -1
- package/src/resources/beta/agents/agents.ts +260 -46
- package/src/resources/beta/agents/environments/files.ts +6 -1
- package/src/resources/beta/agents/environments/templates.ts +216 -13
- package/src/resources/beta/agents/sessions/artifacts.ts +213 -2
- package/src/resources/beta/agents/sessions/events.ts +4 -1
- package/src/resources/beta/agents/sessions/items.ts +202 -1
- package/src/resources/beta/agents/sessions/sessions.ts +218 -8
- package/src/resources/beta/agents/sessions/subagents/subagents.ts +202 -1
- package/src/resources/beta/agents/sessions/turns.ts +205 -3
- package/src/resources/beta/agents/vaults/credentials.ts +389 -23
- package/src/resources/beta/agents/vaults/index.ts +2 -0
- package/src/resources/beta/agents/vaults/vaults.ts +212 -4
- package/src/resources/beta/assistants.ts +200 -1
- package/src/resources/beta/chatkit/threads.ts +311 -2
- package/src/resources/beta/responses/responses.ts +15 -12
- package/src/resources/beta/threads/messages.ts +202 -1
- package/src/resources/beta/threads/runs/runs.ts +202 -1
- package/src/resources/chat/completions/completions.ts +205 -3
- package/src/resources/chat/completions/messages.ts +202 -1
- package/src/resources/containers/containers.ts +200 -1
- package/src/resources/containers/files/files.ts +202 -1
- package/src/resources/conversations/conversations.ts +3 -4
- package/src/resources/conversations/items.ts +202 -1
- package/src/resources/evals/evals.ts +200 -1
- package/src/resources/evals/runs/runs.ts +202 -1
- package/src/resources/files.ts +200 -1
- package/src/resources/fine-tuning/checkpoints/permissions.ts +297 -2
- package/src/resources/fine-tuning/jobs/checkpoints.ts +202 -1
- package/src/resources/fine-tuning/jobs/jobs.ts +295 -2
- package/src/resources/images.ts +3 -4
- package/src/resources/index.ts +1 -1
- package/src/resources/realtime/client-secrets.ts +7 -3
- package/src/resources/realtime/realtime.ts +17 -8
- package/src/resources/responses/input-items.ts +202 -1
- package/src/resources/responses/responses.ts +263 -13
- package/src/resources/safety/cases.ts +39 -0
- package/src/resources/safety/index.ts +1 -0
- package/src/resources/safety/safety.ts +6 -0
- package/src/resources/shared.ts +2 -2
- package/src/resources/skills/skills.ts +200 -1
- package/src/resources/skills/versions/versions.ts +202 -1
- package/src/resources/vector-stores/files.ts +202 -1
- package/src/resources/vector-stores/vector-stores.ts +200 -1
- package/src/resources/videos.ts +295 -2
- package/src/resources/webhooks/api.md +42 -21
- package/src/resources/webhooks/event-types.ts +21 -0
- package/src/resources/webhooks/index.ts +1 -0
- package/src/resources/webhooks/webhooks.ts +752 -1
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -6,23 +6,66 @@ const resource_1 = require("../../../../core/resource.js");
|
|
|
6
6
|
const pagination_1 = require("../../../../core/pagination.js");
|
|
7
7
|
const headers_1 = require("../../../../internal/headers.js");
|
|
8
8
|
const path_1 = require("../../../../internal/utils/path.js");
|
|
9
|
+
// Recognizable options across SDK runtime versions. Keep this independent of
|
|
10
|
+
// private RequestOptions fields so older handwritten runtimes still compile.
|
|
11
|
+
const normalizeRequestOptionsForQueryKeys = new Set([
|
|
12
|
+
'method',
|
|
13
|
+
'path',
|
|
14
|
+
'query',
|
|
15
|
+
'body',
|
|
16
|
+
'headers',
|
|
17
|
+
'maxRetries',
|
|
18
|
+
'stream',
|
|
19
|
+
'timeout',
|
|
20
|
+
'httpAgent',
|
|
21
|
+
'fetchOptions',
|
|
22
|
+
'signal',
|
|
23
|
+
'idempotencyKey',
|
|
24
|
+
'defaultBaseURL',
|
|
25
|
+
'__metadata',
|
|
26
|
+
'__binaryRequest',
|
|
27
|
+
'__binaryResponse',
|
|
28
|
+
'__streamClass',
|
|
29
|
+
'__security',
|
|
30
|
+
'__synthesizeEventData',
|
|
31
|
+
]);
|
|
32
|
+
function normalizeRequestOptionsForQuery(value, queryKeys, options) {
|
|
33
|
+
if (typeof value !== 'object' || value === null)
|
|
34
|
+
return undefined;
|
|
35
|
+
// Optional never fields can still be explicitly undefined unless consumers
|
|
36
|
+
// enable exactOptionalPropertyTypes. Snapshot data without invoking getters.
|
|
37
|
+
const entries = Object.entries(Object.getOwnPropertyDescriptors(value)).filter(([, descriptor]) => descriptor.enumerable && (!('value' in descriptor) || descriptor.value !== undefined));
|
|
38
|
+
const keys = entries.map(([key]) => key);
|
|
39
|
+
const requestOnly = keys.some((key) => normalizeRequestOptionsForQueryKeys.has(key) && !queryKeys.includes(key));
|
|
40
|
+
if (!requestOnly)
|
|
41
|
+
return undefined;
|
|
42
|
+
// Declared query fields, including stream, must use the query argument.
|
|
43
|
+
// Mixing them with request-only options is ambiguous and could change the return type.
|
|
44
|
+
if (options !== undefined ||
|
|
45
|
+
keys.some((key) => !normalizeRequestOptionsForQueryKeys.has(key) || queryKeys.includes(key))) {
|
|
46
|
+
throw new TypeError('Query parameters and request options must be passed as separate arguments.');
|
|
47
|
+
}
|
|
48
|
+
// The query position must not gain authority to change the request destination
|
|
49
|
+
// or transport. Those overrides require the explicit request options argument.
|
|
50
|
+
if (keys.some((key) => !['headers', 'maxRetries', 'timeout', 'signal', 'idempotencyKey', 'query'].includes(key))) {
|
|
51
|
+
throw new TypeError('Pass transport overrides in the explicit request options argument.');
|
|
52
|
+
}
|
|
53
|
+
// Copy only the validated fields. Spreading value would reintroduce undefined
|
|
54
|
+
// transport overrides, and deleting them would mutate the caller's object.
|
|
55
|
+
return Object.fromEntries(entries.map(([key, descriptor]) => {
|
|
56
|
+
if ('value' in descriptor)
|
|
57
|
+
return [key, descriptor.value];
|
|
58
|
+
return [key, descriptor.get ? Reflect.apply(descriptor.get, value, []) : undefined];
|
|
59
|
+
}));
|
|
60
|
+
}
|
|
9
61
|
class Items extends resource_1.APIResource {
|
|
10
|
-
/**
|
|
11
|
-
* Lists items produced by the session's root agent, including its interactions
|
|
12
|
-
* with subagents. Each subagent has its own item history. See
|
|
13
|
-
* [inspecting agent output](https://developers.openai.com/api/docs/guides/agents-api/observability).
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* ```ts
|
|
17
|
-
* // Automatically fetches more pages as needed.
|
|
18
|
-
* for await (const agentSessionItem of client.beta.agents.sessions.items.list(
|
|
19
|
-
* 'session_id',
|
|
20
|
-
* )) {
|
|
21
|
-
* // ...
|
|
22
|
-
* }
|
|
23
|
-
* ```
|
|
24
|
-
*/
|
|
25
62
|
list(sessionID, query = {}, options) {
|
|
63
|
+
const normalizeRequestOptionsForQueryOptions = normalizeRequestOptionsForQuery(query, ['after', 'limit', 'order'], options);
|
|
64
|
+
if (normalizeRequestOptionsForQueryOptions !== undefined) {
|
|
65
|
+
options = normalizeRequestOptionsForQueryOptions;
|
|
66
|
+
query = {};
|
|
67
|
+
}
|
|
68
|
+
query = query;
|
|
26
69
|
return this._client.getAPIList((0, path_1.path) `/agents/sessions/${sessionID}/items`, (pagination_1.CursorPage), {
|
|
27
70
|
query,
|
|
28
71
|
...options,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"items.js","sourceRoot":"","sources":["../../../../src/resources/beta/agents/sessions/items.ts"],"names":[],"mappings":";AAAA,qFAAqF;;;AAErF,2DAAwD;AAGxD,+DAA6F;AAC7F,6DAA4D;AAE5D,6DAAuD;AAEvD,MAAa,KAAM,SAAQ,sBAAW;
|
|
1
|
+
{"version":3,"file":"items.js","sourceRoot":"","sources":["../../../../src/resources/beta/agents/sessions/items.ts"],"names":[],"mappings":";AAAA,qFAAqF;;;AAErF,2DAAwD;AAGxD,+DAA6F;AAC7F,6DAA4D;AAE5D,6DAAuD;AAEvD,6EAA6E;AAC7E,6EAA6E;AAC7E,MAAM,mCAAmC,GAAG,IAAI,GAAG,CAAC;IAClD,QAAQ;IACR,MAAM;IACN,OAAO;IACP,MAAM;IACN,SAAS;IACT,YAAY;IACZ,QAAQ;IACR,SAAS;IACT,WAAW;IACX,cAAc;IACd,QAAQ;IACR,gBAAgB;IAChB,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,CAAC,EAAE,aAAa,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;YACzE,UAAU,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE;SACjC,CACF,CAAC;IACJ,CAAC;CACF;AA9HD,sBA8HC"}
|
|
@@ -3,23 +3,66 @@ import { APIResource } from "../../../../core/resource.mjs";
|
|
|
3
3
|
import { CursorPage } from "../../../../core/pagination.mjs";
|
|
4
4
|
import { buildHeaders } from "../../../../internal/headers.mjs";
|
|
5
5
|
import { path } from "../../../../internal/utils/path.mjs";
|
|
6
|
+
// Recognizable options across SDK runtime versions. Keep this independent of
|
|
7
|
+
// private RequestOptions fields so older handwritten runtimes still compile.
|
|
8
|
+
const normalizeRequestOptionsForQueryKeys = new Set([
|
|
9
|
+
'method',
|
|
10
|
+
'path',
|
|
11
|
+
'query',
|
|
12
|
+
'body',
|
|
13
|
+
'headers',
|
|
14
|
+
'maxRetries',
|
|
15
|
+
'stream',
|
|
16
|
+
'timeout',
|
|
17
|
+
'httpAgent',
|
|
18
|
+
'fetchOptions',
|
|
19
|
+
'signal',
|
|
20
|
+
'idempotencyKey',
|
|
21
|
+
'defaultBaseURL',
|
|
22
|
+
'__metadata',
|
|
23
|
+
'__binaryRequest',
|
|
24
|
+
'__binaryResponse',
|
|
25
|
+
'__streamClass',
|
|
26
|
+
'__security',
|
|
27
|
+
'__synthesizeEventData',
|
|
28
|
+
]);
|
|
29
|
+
function normalizeRequestOptionsForQuery(value, queryKeys, options) {
|
|
30
|
+
if (typeof value !== 'object' || value === null)
|
|
31
|
+
return undefined;
|
|
32
|
+
// Optional never fields can still be explicitly undefined unless consumers
|
|
33
|
+
// enable exactOptionalPropertyTypes. Snapshot data without invoking getters.
|
|
34
|
+
const entries = Object.entries(Object.getOwnPropertyDescriptors(value)).filter(([, descriptor]) => descriptor.enumerable && (!('value' in descriptor) || descriptor.value !== undefined));
|
|
35
|
+
const keys = entries.map(([key]) => key);
|
|
36
|
+
const requestOnly = keys.some((key) => normalizeRequestOptionsForQueryKeys.has(key) && !queryKeys.includes(key));
|
|
37
|
+
if (!requestOnly)
|
|
38
|
+
return undefined;
|
|
39
|
+
// Declared query fields, including stream, must use the query argument.
|
|
40
|
+
// Mixing them with request-only options is ambiguous and could change the return type.
|
|
41
|
+
if (options !== undefined ||
|
|
42
|
+
keys.some((key) => !normalizeRequestOptionsForQueryKeys.has(key) || queryKeys.includes(key))) {
|
|
43
|
+
throw new TypeError('Query parameters and request options must be passed as separate arguments.');
|
|
44
|
+
}
|
|
45
|
+
// The query position must not gain authority to change the request destination
|
|
46
|
+
// or transport. Those overrides require the explicit request options argument.
|
|
47
|
+
if (keys.some((key) => !['headers', 'maxRetries', 'timeout', 'signal', 'idempotencyKey', 'query'].includes(key))) {
|
|
48
|
+
throw new TypeError('Pass transport overrides in the explicit request options argument.');
|
|
49
|
+
}
|
|
50
|
+
// Copy only the validated fields. Spreading value would reintroduce undefined
|
|
51
|
+
// transport overrides, and deleting them would mutate the caller's object.
|
|
52
|
+
return Object.fromEntries(entries.map(([key, descriptor]) => {
|
|
53
|
+
if ('value' in descriptor)
|
|
54
|
+
return [key, descriptor.value];
|
|
55
|
+
return [key, descriptor.get ? Reflect.apply(descriptor.get, value, []) : undefined];
|
|
56
|
+
}));
|
|
57
|
+
}
|
|
6
58
|
export class Items extends APIResource {
|
|
7
|
-
/**
|
|
8
|
-
* Lists items produced by the session's root agent, including its interactions
|
|
9
|
-
* with subagents. Each subagent has its own item history. See
|
|
10
|
-
* [inspecting agent output](https://developers.openai.com/api/docs/guides/agents-api/observability).
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* ```ts
|
|
14
|
-
* // Automatically fetches more pages as needed.
|
|
15
|
-
* for await (const agentSessionItem of client.beta.agents.sessions.items.list(
|
|
16
|
-
* 'session_id',
|
|
17
|
-
* )) {
|
|
18
|
-
* // ...
|
|
19
|
-
* }
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
59
|
list(sessionID, query = {}, options) {
|
|
60
|
+
const normalizeRequestOptionsForQueryOptions = normalizeRequestOptionsForQuery(query, ['after', 'limit', 'order'], options);
|
|
61
|
+
if (normalizeRequestOptionsForQueryOptions !== undefined) {
|
|
62
|
+
options = normalizeRequestOptionsForQueryOptions;
|
|
63
|
+
query = {};
|
|
64
|
+
}
|
|
65
|
+
query = query;
|
|
23
66
|
return this._client.getAPIList(path `/agents/sessions/${sessionID}/items`, (CursorPage), {
|
|
24
67
|
query,
|
|
25
68
|
...options,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"items.mjs","sourceRoot":"","sources":["../../../../src/resources/beta/agents/sessions/items.ts"],"names":[],"mappings":"AAAA,qFAAqF;AAErF,OAAO,EAAE,WAAW,EAAE,sCAAkC;AAGxD,OAAO,EAAE,UAAU,EAAsC,wCAAoC;AAC7F,OAAO,EAAE,YAAY,EAAE,yCAAqC;AAE5D,OAAO,EAAE,IAAI,EAAE,4CAAwC;AAEvD,MAAM,OAAO,KAAM,SAAQ,WAAW;
|
|
1
|
+
{"version":3,"file":"items.mjs","sourceRoot":"","sources":["../../../../src/resources/beta/agents/sessions/items.ts"],"names":[],"mappings":"AAAA,qFAAqF;AAErF,OAAO,EAAE,WAAW,EAAE,sCAAkC;AAGxD,OAAO,EAAE,UAAU,EAAsC,wCAAoC;AAC7F,OAAO,EAAE,YAAY,EAAE,yCAAqC;AAE5D,OAAO,EAAE,IAAI,EAAE,4CAAwC;AAEvD,6EAA6E;AAC7E,6EAA6E;AAC7E,MAAM,mCAAmC,GAAG,IAAI,GAAG,CAAC;IAClD,QAAQ;IACR,MAAM;IACN,OAAO;IACP,MAAM;IACN,SAAS;IACT,YAAY;IACZ,QAAQ;IACR,SAAS;IACT,WAAW;IACX,cAAc;IACd,QAAQ;IACR,gBAAgB;IAChB,gBAAgB;IAChB,YAAY;IACZ,iBAAiB;IACjB,kBAAkB;IAClB,eAAe;IACf,YAAY;IACZ,uBAAuB;CACxB,CAAC,CA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AAI,EAAE;SACjC,CACF,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -77,10 +77,19 @@ export declare class Sessions extends APIResource {
|
|
|
77
77
|
* }
|
|
78
78
|
* ```
|
|
79
79
|
*/
|
|
80
|
-
list(query?: SessionListParams
|
|
80
|
+
list(query?: (SessionListParams & ({
|
|
81
|
+
[K in 'method' | 'path' | 'query' | 'body' | 'headers' | 'maxRetries' | 'stream' | 'timeout' | 'httpAgent' | 'fetchOptions' | 'signal' | 'idempotencyKey' | 'defaultBaseURL' | '__metadata' | '__binaryRequest' | '__binaryResponse' | '__streamClass' | '__security' | '__synthesizeEventData']?: never;
|
|
82
|
+
} | null | undefined)) | null | undefined, options?: RequestOptions): PagePromise<AgentSessionsPage, AgentsAPI.AgentSession>;
|
|
83
|
+
list(options?: {
|
|
84
|
+
[K in 'headers' | 'maxRetries' | 'timeout' | 'signal' | 'idempotencyKey' | 'query']?: RequestOptions[K];
|
|
85
|
+
} & {
|
|
86
|
+
[K in 'method' | 'path' | 'body' | 'stream' | 'httpAgent' | 'fetchOptions' | 'defaultBaseURL' | '__metadata' | '__binaryRequest' | '__binaryResponse' | '__streamClass' | '__security' | '__synthesizeEventData']?: never;
|
|
87
|
+
}): PagePromise<AgentSessionsPage, AgentsAPI.AgentSession>;
|
|
81
88
|
/**
|
|
82
89
|
* Removes a managed agent session from the public API and returns a deletion
|
|
83
|
-
* confirmation.
|
|
90
|
+
* confirmation. If backend execution has ended, deletion can cancel a still-open
|
|
91
|
+
* public turn and abandon unpublished outputs. Running execution must be cancelled
|
|
92
|
+
* first. Physical cleanup may continue asynchronously. See
|
|
84
93
|
* [managing sessions](https://developers.openai.com/api/docs/guides/agents-api/sessions/manage).
|
|
85
94
|
*
|
|
86
95
|
* @example
|
|
@@ -108,7 +117,10 @@ export interface SessionCreateParamsBase {
|
|
|
108
117
|
*/
|
|
109
118
|
agent_id?: string;
|
|
110
119
|
/**
|
|
111
|
-
* Initial input
|
|
120
|
+
* Initial input to submit when the session is created. A string is shorthand for a
|
|
121
|
+
* single user message. Required when `environment.type` is `none`, or when
|
|
122
|
+
* `stream` is `true` for an environment that is not `self_hosted`; optional for
|
|
123
|
+
* self-hosted and non-streaming execution environments.
|
|
112
124
|
*/
|
|
113
125
|
input?: string | Array<AgentsAPI.AgentSessionInputMessageParam> | null;
|
|
114
126
|
/**
|
|
@@ -143,11 +155,12 @@ export declare namespace SessionCreateParams {
|
|
|
143
155
|
*/
|
|
144
156
|
model?: string;
|
|
145
157
|
/**
|
|
146
|
-
*
|
|
158
|
+
* Configuration for creating and coordinating subagents.
|
|
147
159
|
*/
|
|
148
160
|
multi_agent?: AgentsAPI.MultiAgentConfigParam | null;
|
|
149
161
|
/**
|
|
150
|
-
*
|
|
162
|
+
* Configuration for model reasoning. Omit to keep the current settings; pass
|
|
163
|
+
* `null` to reset to the model's default effort.
|
|
151
164
|
*/
|
|
152
165
|
reasoning?: AgentsAPI.AgentReasoningParam | null;
|
|
153
166
|
/**
|
|
@@ -212,7 +225,7 @@ export declare namespace SessionUpdateParams {
|
|
|
212
225
|
*/
|
|
213
226
|
reasoning?: Agent.Reasoning;
|
|
214
227
|
/**
|
|
215
|
-
*
|
|
228
|
+
* Omit to keep the current tier. Null resets it to auto.
|
|
216
229
|
*
|
|
217
230
|
* - `auto` - Selects the service tier automatically.
|
|
218
231
|
* - `default` - Uses the default service tier.
|
|
@@ -228,18 +241,22 @@ export declare namespace SessionUpdateParams {
|
|
|
228
241
|
*/
|
|
229
242
|
interface Reasoning {
|
|
230
243
|
/**
|
|
231
|
-
*
|
|
244
|
+
* Omit to keep the current effort. Null selects the model's default effort.
|
|
232
245
|
*/
|
|
233
246
|
effort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | null;
|
|
234
247
|
}
|
|
235
248
|
}
|
|
236
249
|
}
|
|
237
|
-
export interface SessionListParams extends CursorPageParams {
|
|
250
|
+
export interface SessionListParams extends Omit<CursorPageParams, 'limit'> {
|
|
238
251
|
/**
|
|
239
252
|
* Only return sessions whose root agent has this ID. Omit to return sessions for
|
|
240
253
|
* all agents.
|
|
241
254
|
*/
|
|
242
255
|
agent_id?: string;
|
|
256
|
+
/**
|
|
257
|
+
* The maximum number of resources to return.
|
|
258
|
+
*/
|
|
259
|
+
limit?: number | null;
|
|
243
260
|
/**
|
|
244
261
|
* Sort order by the `created_at` timestamp. Use `asc` for ascending order or
|
|
245
262
|
* `desc` for descending order. Defaults to `desc`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sessions.d.mts","sourceRoot":"","sources":["../../../../src/resources/beta/agents/sessions/sessions.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,kBAAkB,EAClB,KAAK,wBAAwB,EAC9B,wDAAoD;AACrD,OAAO,EAAE,WAAW,EAAE,sCAAkC;AACxD,OAAO,KAAK,WAAW,uBAAmB;AAC1C,OAAO,KAAK,SAAS,sBAAkB;AACvC,OAAO,EAAE,iBAAiB,EAAE,sBAAkB;AAC9C,OAAO,KAAK,YAAY,wBAAoB;AAC5C,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EAClB,sBAAsB,EACtB,SAAS,EACT,eAAe,EACf,sBAAsB,EACtB,oBAAoB,EACrB,wBAAoB;AACrB,OAAO,KAAK,SAAS,qBAAiB;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,qBAAiB;AACrD,OAAO,KAAK,QAAQ,oBAAgB;AACpC,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,oBAAgB;AAChD,OAAO,KAAK,QAAQ,oBAAgB;AACpC,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,kBAAkB,EAAE,KAAK,EAAE,SAAS,EAAE,oBAAgB;AACrF,OAAO,KAAK,YAAY,kCAA8B;AACtD,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,SAAS,EAAE,kCAA8B;AAC9F,OAAO,EAAE,UAAU,EAAE,yCAAqC;AAC1D,OAAO,EAA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kBAAkB,IAAI,kBAAkB,GAC9C,CAAC;IAEF,OAAO,EACL,SAAS,IAAI,SAAS,EACtB,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,qBAAqB,IAAI,qBAAqB,GACpD,CAAC;IAEF,OAAO,EAAE,KAAK,IAAI,KAAK,EAAE,KAAK,cAAc,IAAI,cAAc,EAAE,CAAC;IAEjE,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,KAAK,iBAAiB,IAAI,iBAAiB,EAAE,CAAC;IAEzE,OAAO,EACL,KAAK,IAAI,KAAK,EACd,KAAK,IAAI,IAAI,IAAI,EACjB,KAAK,SAAS,IAAI,SAAS,EAC3B,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,cAAc,IAAI,cAAc,GACtC,CAAC;CACH;AAED,OAAO,EAAE,KAAK,iBAAiB,EAAE,CAAC"}
|
|
@@ -77,10 +77,19 @@ export declare class Sessions extends APIResource {
|
|
|
77
77
|
* }
|
|
78
78
|
* ```
|
|
79
79
|
*/
|
|
80
|
-
list(query?: SessionListParams
|
|
80
|
+
list(query?: (SessionListParams & ({
|
|
81
|
+
[K in 'method' | 'path' | 'query' | 'body' | 'headers' | 'maxRetries' | 'stream' | 'timeout' | 'httpAgent' | 'fetchOptions' | 'signal' | 'idempotencyKey' | 'defaultBaseURL' | '__metadata' | '__binaryRequest' | '__binaryResponse' | '__streamClass' | '__security' | '__synthesizeEventData']?: never;
|
|
82
|
+
} | null | undefined)) | null | undefined, options?: RequestOptions): PagePromise<AgentSessionsPage, AgentsAPI.AgentSession>;
|
|
83
|
+
list(options?: {
|
|
84
|
+
[K in 'headers' | 'maxRetries' | 'timeout' | 'signal' | 'idempotencyKey' | 'query']?: RequestOptions[K];
|
|
85
|
+
} & {
|
|
86
|
+
[K in 'method' | 'path' | 'body' | 'stream' | 'httpAgent' | 'fetchOptions' | 'defaultBaseURL' | '__metadata' | '__binaryRequest' | '__binaryResponse' | '__streamClass' | '__security' | '__synthesizeEventData']?: never;
|
|
87
|
+
}): PagePromise<AgentSessionsPage, AgentsAPI.AgentSession>;
|
|
81
88
|
/**
|
|
82
89
|
* Removes a managed agent session from the public API and returns a deletion
|
|
83
|
-
* confirmation.
|
|
90
|
+
* confirmation. If backend execution has ended, deletion can cancel a still-open
|
|
91
|
+
* public turn and abandon unpublished outputs. Running execution must be cancelled
|
|
92
|
+
* first. Physical cleanup may continue asynchronously. See
|
|
84
93
|
* [managing sessions](https://developers.openai.com/api/docs/guides/agents-api/sessions/manage).
|
|
85
94
|
*
|
|
86
95
|
* @example
|
|
@@ -108,7 +117,10 @@ export interface SessionCreateParamsBase {
|
|
|
108
117
|
*/
|
|
109
118
|
agent_id?: string;
|
|
110
119
|
/**
|
|
111
|
-
* Initial input
|
|
120
|
+
* Initial input to submit when the session is created. A string is shorthand for a
|
|
121
|
+
* single user message. Required when `environment.type` is `none`, or when
|
|
122
|
+
* `stream` is `true` for an environment that is not `self_hosted`; optional for
|
|
123
|
+
* self-hosted and non-streaming execution environments.
|
|
112
124
|
*/
|
|
113
125
|
input?: string | Array<AgentsAPI.AgentSessionInputMessageParam> | null;
|
|
114
126
|
/**
|
|
@@ -143,11 +155,12 @@ export declare namespace SessionCreateParams {
|
|
|
143
155
|
*/
|
|
144
156
|
model?: string;
|
|
145
157
|
/**
|
|
146
|
-
*
|
|
158
|
+
* Configuration for creating and coordinating subagents.
|
|
147
159
|
*/
|
|
148
160
|
multi_agent?: AgentsAPI.MultiAgentConfigParam | null;
|
|
149
161
|
/**
|
|
150
|
-
*
|
|
162
|
+
* Configuration for model reasoning. Omit to keep the current settings; pass
|
|
163
|
+
* `null` to reset to the model's default effort.
|
|
151
164
|
*/
|
|
152
165
|
reasoning?: AgentsAPI.AgentReasoningParam | null;
|
|
153
166
|
/**
|
|
@@ -212,7 +225,7 @@ export declare namespace SessionUpdateParams {
|
|
|
212
225
|
*/
|
|
213
226
|
reasoning?: Agent.Reasoning;
|
|
214
227
|
/**
|
|
215
|
-
*
|
|
228
|
+
* Omit to keep the current tier. Null resets it to auto.
|
|
216
229
|
*
|
|
217
230
|
* - `auto` - Selects the service tier automatically.
|
|
218
231
|
* - `default` - Uses the default service tier.
|
|
@@ -228,18 +241,22 @@ export declare namespace SessionUpdateParams {
|
|
|
228
241
|
*/
|
|
229
242
|
interface Reasoning {
|
|
230
243
|
/**
|
|
231
|
-
*
|
|
244
|
+
* Omit to keep the current effort. Null selects the model's default effort.
|
|
232
245
|
*/
|
|
233
246
|
effort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | null;
|
|
234
247
|
}
|
|
235
248
|
}
|
|
236
249
|
}
|
|
237
|
-
export interface SessionListParams extends CursorPageParams {
|
|
250
|
+
export interface SessionListParams extends Omit<CursorPageParams, 'limit'> {
|
|
238
251
|
/**
|
|
239
252
|
* Only return sessions whose root agent has this ID. Omit to return sessions for
|
|
240
253
|
* all agents.
|
|
241
254
|
*/
|
|
242
255
|
agent_id?: string;
|
|
256
|
+
/**
|
|
257
|
+
* The maximum number of resources to return.
|
|
258
|
+
*/
|
|
259
|
+
limit?: number | null;
|
|
243
260
|
/**
|
|
244
261
|
* Sort order by the `created_at` timestamp. Use `asc` for ascending order or
|
|
245
262
|
* `desc` for descending order. Defaults to `desc`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sessions.d.ts","sourceRoot":"","sources":["../../../../src/resources/beta/agents/sessions/sessions.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,kBAAkB,EAClB,KAAK,wBAAwB,EAC9B,uDAAoD;AACrD,OAAO,EAAE,WAAW,EAAE,qCAAkC;AACxD,OAAO,KAAK,WAAW,sBAAmB;AAC1C,OAAO,KAAK,SAAS,qBAAkB;AACvC,OAAO,EAAE,iBAAiB,EAAE,qBAAkB;AAC9C,OAAO,KAAK,YAAY,uBAAoB;AAC5C,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EAClB,sBAAsB,EACtB,SAAS,EACT,eAAe,EACf,sBAAsB,EACtB,oBAAoB,EACrB,uBAAoB;AACrB,OAAO,KAAK,SAAS,oBAAiB;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,oBAAiB;AACrD,OAAO,KAAK,QAAQ,mBAAgB;AACpC,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,mBAAgB;AAChD,OAAO,KAAK,QAAQ,mBAAgB;AACpC,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,kBAAkB,EAAE,KAAK,EAAE,SAAS,EAAE,mBAAgB;AACrF,OAAO,KAAK,YAAY,iCAA8B;AACtD,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,SAAS,EAAE,iCAA8B;AAC9F,OAAO,EAAE,UAAU,EAAE,wCAAqC;AAC1D,OAAO,EAAc,KAAK,gBAAgB,EAAE,WAAW,EAAE,uCAAoC;AAC7F,OAAO,EAAE,MAAM,EAAE,sCAAmC;AAEpD,OAAO,EAAE,cAAc,EAAE,gDAA6C;
|
|
1
|
+
{"version":3,"file":"sessions.d.ts","sourceRoot":"","sources":["../../../../src/resources/beta/agents/sessions/sessions.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,kBAAkB,EAClB,KAAK,wBAAwB,EAC9B,uDAAoD;AACrD,OAAO,EAAE,WAAW,EAAE,qCAAkC;AACxD,OAAO,KAAK,WAAW,sBAAmB;AAC1C,OAAO,KAAK,SAAS,qBAAkB;AACvC,OAAO,EAAE,iBAAiB,EAAE,qBAAkB;AAC9C,OAAO,KAAK,YAAY,uBAAoB;AAC5C,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EAClB,sBAAsB,EACtB,SAAS,EACT,eAAe,EACf,sBAAsB,E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,IAAI,SAAS,EAC3B,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,cAAc,IAAI,cAAc,GACtC,CAAC;CACH;AAED,OAAO,EAAE,KAAK,iBAAiB,EAAE,CAAC"}
|
|
@@ -18,6 +18,58 @@ const subagents_1 = require("./subagents/subagents.js");
|
|
|
18
18
|
const pagination_1 = require("../../../../core/pagination.js");
|
|
19
19
|
const headers_1 = require("../../../../internal/headers.js");
|
|
20
20
|
const path_1 = require("../../../../internal/utils/path.js");
|
|
21
|
+
// Recognizable options across SDK runtime versions. Keep this independent of
|
|
22
|
+
// private RequestOptions fields so older handwritten runtimes still compile.
|
|
23
|
+
const normalizeRequestOptionsForQueryKeys = new Set([
|
|
24
|
+
'method',
|
|
25
|
+
'path',
|
|
26
|
+
'query',
|
|
27
|
+
'body',
|
|
28
|
+
'headers',
|
|
29
|
+
'maxRetries',
|
|
30
|
+
'stream',
|
|
31
|
+
'timeout',
|
|
32
|
+
'httpAgent',
|
|
33
|
+
'fetchOptions',
|
|
34
|
+
'signal',
|
|
35
|
+
'idempotencyKey',
|
|
36
|
+
'defaultBaseURL',
|
|
37
|
+
'__metadata',
|
|
38
|
+
'__binaryRequest',
|
|
39
|
+
'__binaryResponse',
|
|
40
|
+
'__streamClass',
|
|
41
|
+
'__security',
|
|
42
|
+
'__synthesizeEventData',
|
|
43
|
+
]);
|
|
44
|
+
function normalizeRequestOptionsForQuery(value, queryKeys, options) {
|
|
45
|
+
if (typeof value !== 'object' || value === null)
|
|
46
|
+
return undefined;
|
|
47
|
+
// Optional never fields can still be explicitly undefined unless consumers
|
|
48
|
+
// enable exactOptionalPropertyTypes. Snapshot data without invoking getters.
|
|
49
|
+
const entries = Object.entries(Object.getOwnPropertyDescriptors(value)).filter(([, descriptor]) => descriptor.enumerable && (!('value' in descriptor) || descriptor.value !== undefined));
|
|
50
|
+
const keys = entries.map(([key]) => key);
|
|
51
|
+
const requestOnly = keys.some((key) => normalizeRequestOptionsForQueryKeys.has(key) && !queryKeys.includes(key));
|
|
52
|
+
if (!requestOnly)
|
|
53
|
+
return undefined;
|
|
54
|
+
// Declared query fields, including stream, must use the query argument.
|
|
55
|
+
// Mixing them with request-only options is ambiguous and could change the return type.
|
|
56
|
+
if (options !== undefined ||
|
|
57
|
+
keys.some((key) => !normalizeRequestOptionsForQueryKeys.has(key) || queryKeys.includes(key))) {
|
|
58
|
+
throw new TypeError('Query parameters and request options must be passed as separate arguments.');
|
|
59
|
+
}
|
|
60
|
+
// The query position must not gain authority to change the request destination
|
|
61
|
+
// or transport. Those overrides require the explicit request options argument.
|
|
62
|
+
if (keys.some((key) => !['headers', 'maxRetries', 'timeout', 'signal', 'idempotencyKey', 'query'].includes(key))) {
|
|
63
|
+
throw new TypeError('Pass transport overrides in the explicit request options argument.');
|
|
64
|
+
}
|
|
65
|
+
// Copy only the validated fields. Spreading value would reintroduce undefined
|
|
66
|
+
// transport overrides, and deleting them would mutate the caller's object.
|
|
67
|
+
return Object.fromEntries(entries.map(([key, descriptor]) => {
|
|
68
|
+
if ('value' in descriptor)
|
|
69
|
+
return [key, descriptor.value];
|
|
70
|
+
return [key, descriptor.get ? Reflect.apply(descriptor.get, value, []) : undefined];
|
|
71
|
+
}));
|
|
72
|
+
}
|
|
21
73
|
class Sessions extends resource_1.APIResource {
|
|
22
74
|
constructor() {
|
|
23
75
|
super(...arguments);
|
|
@@ -76,20 +128,13 @@ class Sessions extends resource_1.APIResource {
|
|
|
76
128
|
__security: { bearerAuth: true },
|
|
77
129
|
});
|
|
78
130
|
}
|
|
79
|
-
/**
|
|
80
|
-
* Lists managed agent sessions using ID-based pagination and the requested sort
|
|
81
|
-
* order. See
|
|
82
|
-
* [managing sessions](https://developers.openai.com/api/docs/guides/agents-api/sessions/manage).
|
|
83
|
-
*
|
|
84
|
-
* @example
|
|
85
|
-
* ```ts
|
|
86
|
-
* // Automatically fetches more pages as needed.
|
|
87
|
-
* for await (const agentSession of client.beta.agents.sessions.list()) {
|
|
88
|
-
* // ...
|
|
89
|
-
* }
|
|
90
|
-
* ```
|
|
91
|
-
*/
|
|
92
131
|
list(query = {}, options) {
|
|
132
|
+
const normalizeRequestOptionsForQueryOptions = normalizeRequestOptionsForQuery(query, ['after', 'agent_id', 'limit', 'order'], options);
|
|
133
|
+
if (normalizeRequestOptionsForQueryOptions !== undefined) {
|
|
134
|
+
options = normalizeRequestOptionsForQueryOptions;
|
|
135
|
+
query = {};
|
|
136
|
+
}
|
|
137
|
+
query = query;
|
|
93
138
|
return this._client.getAPIList('/agents/sessions', (pagination_1.CursorPage), {
|
|
94
139
|
query,
|
|
95
140
|
...options,
|
|
@@ -99,7 +144,9 @@ class Sessions extends resource_1.APIResource {
|
|
|
99
144
|
}
|
|
100
145
|
/**
|
|
101
146
|
* Removes a managed agent session from the public API and returns a deletion
|
|
102
|
-
* confirmation.
|
|
147
|
+
* confirmation. If backend execution has ended, deletion can cancel a still-open
|
|
148
|
+
* public turn and abandon unpublished outputs. Running execution must be cancelled
|
|
149
|
+
* first. Physical cleanup may continue asynchronously. See
|
|
103
150
|
* [managing sessions](https://developers.openai.com/api/docs/guides/agents-api/sessions/manage).
|
|
104
151
|
*
|
|
105
152
|
* @example
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sessions.js","sourceRoot":"","sources":["../../../../src/resources/beta/agents/sessions/sessions.ts"],"names":[],"mappings":";AAAA,qFAAqF;;;;AAErF,yFAGqD;AACrD,2DAAwD;AAIxD,qEAA4C;AAC5C,8CASqB;AACrB,+DAAsC;AACtC,wCAAqD;AACrD,6DAAoC;AACpC,sCAAgD;AAChD,6DAAoC;AACpC,sCAAqF;AACrF,+EAAsD;AACtD,wDAA8F;AAE9F,+DAA6F;AAE7F,6DAA4D;AAE5D,6DAAuD;AAEvD,MAAa,QAAS,SAAQ,sBAAW;IAAzC;;QAME,cAAS,GAA2B,IAAI,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC7E,cAAS,GAA2B,IAAI,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC7E,UAAK,GAAmB,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACzD,WAAM,GAAqB,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC9D,UAAK,GAAmB,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"sessions.js","sourceRoot":"","sources":["../../../../src/resources/beta/agents/sessions/sessions.ts"],"names":[],"mappings":";AAAA,qFAAqF;;;;AAErF,yFAGqD;AACrD,2DAAwD;AAIxD,qEAA4C;AAC5C,8CASqB;AACrB,+DAAsC;AACtC,wCAAqD;AACrD,6DAAoC;AACpC,sCAAgD;AAChD,6DAAoC;AACpC,sCAAqF;AACrF,+EAAsD;AACtD,wDAA8F;AAE9F,+DAA6F;AAE7F,6DAA4D;AAE5D,6DAAuD;AAEvD,6EAA6E;AAC7E,6EAA6E;AAC7E,MAAM,mCAAmC,GAAG,IAAI,GAAG,CAAC;IAClD,QAAQ;IACR,MAAM;IACN,OAAO;IACP,MAAM;IACN,SAAS;IACT,YAAY;IACZ,QAAQ;IACR,SAAS;IACT,WAAW;IACX,cAAc;IACd,QAAQ;IACR,gBAAgB;IAChB,gBAAgB;IAChB,YAAY;IACZ,iBAAiB;IACjB,kBAAkB;IAClB,eAAe;IACf,YAAY;IACZ,uBAAuB;CACxB,CAAC,CAAC;AAEH,SAAS,+BAA+B,CACtC,KAAc,EACd,SAAgC,EAChC,OAAmC;IAuBnC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,SAAS,CAAC;IAClE,2EAA2E;IAC3E,6EAA6E;IAC7E,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,yBAAyB,CAAC,KAAK,CAAC,CAAC,CAA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F,KAAK;YACL,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,aAAa,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;YACzE,UAAU,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE;SACjC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,SAAiB,EAAE,OAAwB;QAChD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,oBAAoB,SAAS,EAAE,EAAE;YAC9D,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,aAAa,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;YACzE,UAAU,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE;SACjC,CAAC,CAAC;IACL,CAAC;CACF;AAlOD,4BAkOC;AA+LD,QAAQ,CAAC,SAAS,GAAG,qBAAS,CAAC;AAC/B,QAAQ,CAAC,SAAS,GAAG,qBAAS,CAAC;AAC/B,QAAQ,CAAC,KAAK,GAAG,aAAK,CAAC;AACvB,QAAQ,CAAC,MAAM,GAAG,eAAM,CAAC;AACzB,QAAQ,CAAC,KAAK,GAAG,aAAK,CAAC"}
|
|
@@ -14,6 +14,58 @@ import { Subagents } from "./subagents/subagents.mjs";
|
|
|
14
14
|
import { CursorPage } from "../../../../core/pagination.mjs";
|
|
15
15
|
import { buildHeaders } from "../../../../internal/headers.mjs";
|
|
16
16
|
import { path } from "../../../../internal/utils/path.mjs";
|
|
17
|
+
// Recognizable options across SDK runtime versions. Keep this independent of
|
|
18
|
+
// private RequestOptions fields so older handwritten runtimes still compile.
|
|
19
|
+
const normalizeRequestOptionsForQueryKeys = new Set([
|
|
20
|
+
'method',
|
|
21
|
+
'path',
|
|
22
|
+
'query',
|
|
23
|
+
'body',
|
|
24
|
+
'headers',
|
|
25
|
+
'maxRetries',
|
|
26
|
+
'stream',
|
|
27
|
+
'timeout',
|
|
28
|
+
'httpAgent',
|
|
29
|
+
'fetchOptions',
|
|
30
|
+
'signal',
|
|
31
|
+
'idempotencyKey',
|
|
32
|
+
'defaultBaseURL',
|
|
33
|
+
'__metadata',
|
|
34
|
+
'__binaryRequest',
|
|
35
|
+
'__binaryResponse',
|
|
36
|
+
'__streamClass',
|
|
37
|
+
'__security',
|
|
38
|
+
'__synthesizeEventData',
|
|
39
|
+
]);
|
|
40
|
+
function normalizeRequestOptionsForQuery(value, queryKeys, options) {
|
|
41
|
+
if (typeof value !== 'object' || value === null)
|
|
42
|
+
return undefined;
|
|
43
|
+
// Optional never fields can still be explicitly undefined unless consumers
|
|
44
|
+
// enable exactOptionalPropertyTypes. Snapshot data without invoking getters.
|
|
45
|
+
const entries = Object.entries(Object.getOwnPropertyDescriptors(value)).filter(([, descriptor]) => descriptor.enumerable && (!('value' in descriptor) || descriptor.value !== undefined));
|
|
46
|
+
const keys = entries.map(([key]) => key);
|
|
47
|
+
const requestOnly = keys.some((key) => normalizeRequestOptionsForQueryKeys.has(key) && !queryKeys.includes(key));
|
|
48
|
+
if (!requestOnly)
|
|
49
|
+
return undefined;
|
|
50
|
+
// Declared query fields, including stream, must use the query argument.
|
|
51
|
+
// Mixing them with request-only options is ambiguous and could change the return type.
|
|
52
|
+
if (options !== undefined ||
|
|
53
|
+
keys.some((key) => !normalizeRequestOptionsForQueryKeys.has(key) || queryKeys.includes(key))) {
|
|
54
|
+
throw new TypeError('Query parameters and request options must be passed as separate arguments.');
|
|
55
|
+
}
|
|
56
|
+
// The query position must not gain authority to change the request destination
|
|
57
|
+
// or transport. Those overrides require the explicit request options argument.
|
|
58
|
+
if (keys.some((key) => !['headers', 'maxRetries', 'timeout', 'signal', 'idempotencyKey', 'query'].includes(key))) {
|
|
59
|
+
throw new TypeError('Pass transport overrides in the explicit request options argument.');
|
|
60
|
+
}
|
|
61
|
+
// Copy only the validated fields. Spreading value would reintroduce undefined
|
|
62
|
+
// transport overrides, and deleting them would mutate the caller's object.
|
|
63
|
+
return Object.fromEntries(entries.map(([key, descriptor]) => {
|
|
64
|
+
if ('value' in descriptor)
|
|
65
|
+
return [key, descriptor.value];
|
|
66
|
+
return [key, descriptor.get ? Reflect.apply(descriptor.get, value, []) : undefined];
|
|
67
|
+
}));
|
|
68
|
+
}
|
|
17
69
|
export class Sessions extends APIResource {
|
|
18
70
|
constructor() {
|
|
19
71
|
super(...arguments);
|
|
@@ -72,20 +124,13 @@ export class Sessions extends APIResource {
|
|
|
72
124
|
__security: { bearerAuth: true },
|
|
73
125
|
});
|
|
74
126
|
}
|
|
75
|
-
/**
|
|
76
|
-
* Lists managed agent sessions using ID-based pagination and the requested sort
|
|
77
|
-
* order. See
|
|
78
|
-
* [managing sessions](https://developers.openai.com/api/docs/guides/agents-api/sessions/manage).
|
|
79
|
-
*
|
|
80
|
-
* @example
|
|
81
|
-
* ```ts
|
|
82
|
-
* // Automatically fetches more pages as needed.
|
|
83
|
-
* for await (const agentSession of client.beta.agents.sessions.list()) {
|
|
84
|
-
* // ...
|
|
85
|
-
* }
|
|
86
|
-
* ```
|
|
87
|
-
*/
|
|
88
127
|
list(query = {}, options) {
|
|
128
|
+
const normalizeRequestOptionsForQueryOptions = normalizeRequestOptionsForQuery(query, ['after', 'agent_id', 'limit', 'order'], options);
|
|
129
|
+
if (normalizeRequestOptionsForQueryOptions !== undefined) {
|
|
130
|
+
options = normalizeRequestOptionsForQueryOptions;
|
|
131
|
+
query = {};
|
|
132
|
+
}
|
|
133
|
+
query = query;
|
|
89
134
|
return this._client.getAPIList('/agents/sessions', (CursorPage), {
|
|
90
135
|
query,
|
|
91
136
|
...options,
|
|
@@ -95,7 +140,9 @@ export class Sessions extends APIResource {
|
|
|
95
140
|
}
|
|
96
141
|
/**
|
|
97
142
|
* Removes a managed agent session from the public API and returns a deletion
|
|
98
|
-
* confirmation.
|
|
143
|
+
* confirmation. If backend execution has ended, deletion can cancel a still-open
|
|
144
|
+
* public turn and abandon unpublished outputs. Running execution must be cancelled
|
|
145
|
+
* first. Physical cleanup may continue asynchronously. See
|
|
99
146
|
* [managing sessions](https://developers.openai.com/api/docs/guides/agents-api/sessions/manage).
|
|
100
147
|
*
|
|
101
148
|
* @example
|