openai 7.24.0 → 7.26.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 +38 -0
- package/client.d.mts +5 -6
- package/client.d.mts.map +1 -1
- package/client.d.ts +5 -6
- package/client.d.ts.map +1 -1
- package/client.js +38 -10
- package/client.js.map +1 -1
- package/client.mjs +39 -11
- package/client.mjs.map +1 -1
- package/core/streaming.d.mts +4 -0
- package/core/streaming.d.mts.map +1 -1
- package/core/streaming.d.ts +4 -0
- package/core/streaming.d.ts.map +1 -1
- package/core/streaming.js +6 -0
- package/core/streaming.js.map +1 -1
- package/core/streaming.mjs +6 -0
- package/core/streaming.mjs.map +1 -1
- package/helpers/beta/agents/standard-schema.d.mts +7 -0
- package/helpers/beta/agents/standard-schema.d.mts.map +1 -0
- package/helpers/beta/agents/standard-schema.d.ts +7 -0
- package/helpers/beta/agents/standard-schema.d.ts.map +1 -0
- package/helpers/beta/agents/standard-schema.js +12 -0
- package/helpers/beta/agents/standard-schema.js.map +1 -0
- package/helpers/beta/agents/standard-schema.mjs +9 -0
- package/helpers/beta/agents/standard-schema.mjs.map +1 -0
- package/helpers/beta/agents/zod.d.mts +10 -0
- package/helpers/beta/agents/zod.d.mts.map +1 -0
- package/helpers/beta/agents/zod.d.ts +10 -0
- package/helpers/beta/agents/zod.d.ts.map +1 -0
- package/helpers/beta/agents/zod.js +12 -0
- package/helpers/beta/agents/zod.js.map +1 -0
- package/helpers/beta/agents/zod.mjs +9 -0
- package/helpers/beta/agents/zod.mjs.map +1 -0
- package/internal/realtime-credentials.d.mts +22 -1
- package/internal/realtime-credentials.d.mts.map +1 -1
- package/internal/realtime-credentials.d.ts +22 -1
- package/internal/realtime-credentials.d.ts.map +1 -1
- package/internal/realtime-credentials.js +48 -4
- package/internal/realtime-credentials.js.map +1 -1
- package/internal/realtime-credentials.mjs +45 -4
- package/internal/realtime-credentials.mjs.map +1 -1
- package/internal/responses-ws-credentials.d.mts +23 -0
- package/internal/responses-ws-credentials.d.mts.map +1 -0
- package/internal/responses-ws-credentials.d.ts +23 -0
- package/internal/responses-ws-credentials.d.ts.map +1 -0
- package/internal/responses-ws-credentials.js +108 -0
- package/internal/responses-ws-credentials.js.map +1 -0
- package/internal/responses-ws-credentials.mjs +104 -0
- package/internal/responses-ws-credentials.mjs.map +1 -0
- package/internal/ws-adapter-node.d.mts +4 -0
- package/internal/ws-adapter-node.d.mts.map +1 -1
- package/internal/ws-adapter-node.d.ts +4 -0
- package/internal/ws-adapter-node.d.ts.map +1 -1
- package/internal/ws-adapter-node.js +56 -0
- package/internal/ws-adapter-node.js.map +1 -1
- package/internal/ws-adapter-node.mjs +55 -0
- package/internal/ws-adapter-node.mjs.map +1 -1
- package/internal/ws.d.mts +27 -4
- package/internal/ws.d.mts.map +1 -1
- package/internal/ws.d.ts +27 -4
- package/internal/ws.d.ts.map +1 -1
- package/internal/ws.js +105 -5
- package/internal/ws.js.map +1 -1
- package/internal/ws.mjs +102 -4
- package/internal/ws.mjs.map +1 -1
- package/lib/agents/agent-session-stream.d.mts +13 -4
- package/lib/agents/agent-session-stream.d.mts.map +1 -1
- package/lib/agents/agent-session-stream.d.ts +13 -4
- package/lib/agents/agent-session-stream.d.ts.map +1 -1
- package/lib/agents/agent-session-stream.js +24 -21
- package/lib/agents/agent-session-stream.js.map +1 -1
- package/lib/agents/agent-session-stream.mjs +24 -21
- package/lib/agents/agent-session-stream.mjs.map +1 -1
- package/lib/beta/agents/agent-session-create-stream.d.mts +15 -0
- package/lib/beta/agents/agent-session-create-stream.d.mts.map +1 -0
- package/lib/beta/agents/agent-session-create-stream.d.ts +15 -0
- package/lib/beta/agents/agent-session-create-stream.d.ts.map +1 -0
- package/lib/beta/agents/agent-session-create-stream.js +25 -0
- package/lib/beta/agents/agent-session-create-stream.js.map +1 -0
- package/lib/beta/agents/agent-session-create-stream.mjs +22 -0
- package/lib/beta/agents/agent-session-create-stream.mjs.map +1 -0
- package/lib/beta/agents/agent-turn-result-collector.d.mts +17 -0
- package/lib/beta/agents/agent-turn-result-collector.d.mts.map +1 -0
- package/lib/beta/agents/agent-turn-result-collector.d.ts +17 -0
- package/lib/beta/agents/agent-turn-result-collector.d.ts.map +1 -0
- package/lib/beta/agents/agent-turn-result-collector.js +99 -0
- package/lib/beta/agents/agent-turn-result-collector.js.map +1 -0
- package/lib/beta/agents/agent-turn-result-collector.mjs +95 -0
- package/lib/beta/agents/agent-turn-result-collector.mjs.map +1 -0
- package/lib/beta/agents/agent-turn-result-error.d.mts +16 -0
- package/lib/beta/agents/agent-turn-result-error.d.mts.map +1 -0
- package/lib/beta/agents/agent-turn-result-error.d.ts +16 -0
- package/lib/beta/agents/agent-turn-result-error.d.ts.map +1 -0
- package/lib/beta/agents/agent-turn-result-error.js +22 -0
- package/lib/beta/agents/agent-turn-result-error.js.map +1 -0
- package/lib/beta/agents/agent-turn-result-error.mjs +18 -0
- package/lib/beta/agents/agent-turn-result-error.mjs.map +1 -0
- package/lib/beta/agents/agent-turn-result.d.mts +12 -0
- package/lib/beta/agents/agent-turn-result.d.mts.map +1 -0
- package/lib/beta/agents/agent-turn-result.d.ts +12 -0
- package/lib/beta/agents/agent-turn-result.d.ts.map +1 -0
- package/lib/beta/agents/agent-turn-result.js +22 -0
- package/lib/beta/agents/agent-turn-result.js.map +1 -0
- package/lib/beta/agents/agent-turn-result.mjs +18 -0
- package/lib/beta/agents/agent-turn-result.mjs.map +1 -0
- package/lib/beta/agents/function-tool.d.mts +27 -0
- package/lib/beta/agents/function-tool.d.mts.map +1 -0
- package/lib/beta/agents/function-tool.d.ts +27 -0
- package/lib/beta/agents/function-tool.d.ts.map +1 -0
- package/lib/beta/agents/function-tool.js +48 -0
- package/lib/beta/agents/function-tool.js.map +1 -0
- package/lib/beta/agents/function-tool.mjs +45 -0
- package/lib/beta/agents/function-tool.mjs.map +1 -0
- package/lib/beta/agents/output-format-types.d.mts +11 -0
- package/lib/beta/agents/output-format-types.d.mts.map +1 -0
- package/lib/beta/agents/output-format-types.d.ts +11 -0
- package/lib/beta/agents/output-format-types.d.ts.map +1 -0
- package/lib/beta/agents/output-format-types.js +3 -0
- package/lib/beta/agents/output-format-types.js.map +1 -0
- package/lib/beta/agents/output-format-types.mjs +2 -0
- package/lib/beta/agents/output-format-types.mjs.map +1 -0
- package/lib/beta/agents/output-format.d.mts +8 -0
- package/lib/beta/agents/output-format.d.mts.map +1 -0
- package/lib/beta/agents/output-format.d.ts +8 -0
- package/lib/beta/agents/output-format.d.ts.map +1 -0
- package/lib/beta/agents/output-format.js +20 -0
- package/lib/beta/agents/output-format.js.map +1 -0
- package/lib/beta/agents/output-format.mjs +14 -0
- package/lib/beta/agents/output-format.mjs.map +1 -0
- package/lib/beta/agents/output-parse-error.d.mts +11 -0
- package/lib/beta/agents/output-parse-error.d.mts.map +1 -0
- package/lib/beta/agents/output-parse-error.d.ts +11 -0
- package/lib/beta/agents/output-parse-error.d.ts.map +1 -0
- package/lib/beta/agents/output-parse-error.js +22 -0
- package/lib/beta/agents/output-parse-error.js.map +1 -0
- package/lib/beta/agents/output-parse-error.mjs +18 -0
- package/lib/beta/agents/output-parse-error.mjs.map +1 -0
- package/lib/beta/agents/parse-result.d.mts +95 -0
- package/lib/beta/agents/parse-result.d.mts.map +1 -0
- package/lib/beta/agents/parse-result.d.ts +95 -0
- package/lib/beta/agents/parse-result.d.ts.map +1 -0
- package/lib/beta/agents/parse-result.js +116 -0
- package/lib/beta/agents/parse-result.js.map +1 -0
- package/lib/beta/agents/parse-result.mjs +110 -0
- package/lib/beta/agents/parse-result.mjs.map +1 -0
- package/lib/beta/agents/parsed-agent-turn-result.d.mts +8 -0
- package/lib/beta/agents/parsed-agent-turn-result.d.mts.map +1 -0
- package/lib/beta/agents/parsed-agent-turn-result.d.ts +8 -0
- package/lib/beta/agents/parsed-agent-turn-result.d.ts.map +1 -0
- package/lib/beta/agents/parsed-agent-turn-result.js +14 -0
- package/lib/beta/agents/parsed-agent-turn-result.js.map +1 -0
- package/lib/beta/agents/parsed-agent-turn-result.mjs +10 -0
- package/lib/beta/agents/parsed-agent-turn-result.mjs.map +1 -0
- package/lib/beta/agents/result-collection.d.mts +15 -0
- package/lib/beta/agents/result-collection.d.mts.map +1 -0
- package/lib/beta/agents/result-collection.d.ts +15 -0
- package/lib/beta/agents/result-collection.d.ts.map +1 -0
- package/lib/beta/agents/result-collection.js +110 -0
- package/lib/beta/agents/result-collection.js.map +1 -0
- package/lib/beta/agents/result-collection.mjs +106 -0
- package/lib/beta/agents/result-collection.mjs.map +1 -0
- package/lib/beta/agents/tool-output.d.mts +7 -0
- package/lib/beta/agents/tool-output.d.mts.map +1 -0
- package/lib/beta/agents/tool-output.d.ts +7 -0
- package/lib/beta/agents/tool-output.d.ts.map +1 -0
- package/lib/beta/agents/tool-output.js +26 -0
- package/lib/beta/agents/tool-output.js.map +1 -0
- package/lib/beta/agents/tool-output.mjs +23 -0
- package/lib/beta/agents/tool-output.mjs.map +1 -0
- package/lib/responses/responses-websocket-session.d.mts +1 -1
- package/lib/responses/responses-websocket-session.d.mts.map +1 -1
- package/lib/responses/responses-websocket-session.d.ts +1 -1
- package/lib/responses/responses-websocket-session.d.ts.map +1 -1
- package/lib/responses/responses-websocket-session.js +12 -2
- package/lib/responses/responses-websocket-session.js.map +1 -1
- package/lib/responses/responses-websocket-session.mjs +12 -2
- package/lib/responses/responses-websocket-session.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/audio/speech.d.mts +1 -1
- package/resources/audio/speech.d.ts +1 -1
- package/resources/audio/speech.js +1 -1
- package/resources/audio/speech.mjs +1 -1
- package/resources/beta/agents/agents.d.mts +574 -11
- package/resources/beta/agents/agents.d.mts.map +1 -1
- package/resources/beta/agents/agents.d.ts +574 -11
- package/resources/beta/agents/agents.d.ts.map +1 -1
- package/resources/beta/agents/agents.js.map +1 -1
- package/resources/beta/agents/agents.mjs.map +1 -1
- package/resources/beta/agents/environments/templates.d.mts +56 -3
- package/resources/beta/agents/environments/templates.d.mts.map +1 -1
- package/resources/beta/agents/environments/templates.d.ts +56 -3
- package/resources/beta/agents/environments/templates.d.ts.map +1 -1
- package/resources/beta/agents/index.d.mts +1 -1
- package/resources/beta/agents/index.d.mts.map +1 -1
- package/resources/beta/agents/index.d.ts +1 -1
- package/resources/beta/agents/index.d.ts.map +1 -1
- package/resources/beta/agents/index.js.map +1 -1
- package/resources/beta/agents/index.mjs.map +1 -1
- package/resources/beta/agents/sessions/events.d.mts +16 -12
- package/resources/beta/agents/sessions/events.d.mts.map +1 -1
- package/resources/beta/agents/sessions/events.d.ts +16 -12
- package/resources/beta/agents/sessions/events.d.ts.map +1 -1
- package/resources/beta/agents/sessions/events.js +16 -12
- package/resources/beta/agents/sessions/events.js.map +1 -1
- package/resources/beta/agents/sessions/events.mjs +16 -12
- package/resources/beta/agents/sessions/events.mjs.map +1 -1
- package/resources/beta/agents/sessions/index.d.mts +1 -0
- package/resources/beta/agents/sessions/index.d.mts.map +1 -1
- package/resources/beta/agents/sessions/index.d.ts +1 -0
- package/resources/beta/agents/sessions/index.d.ts.map +1 -1
- package/resources/beta/agents/sessions/index.js +3 -1
- package/resources/beta/agents/sessions/index.js.map +1 -1
- package/resources/beta/agents/sessions/index.mjs +1 -0
- package/resources/beta/agents/sessions/index.mjs.map +1 -1
- package/resources/beta/agents/sessions/sessions.d.mts +16 -4
- package/resources/beta/agents/sessions/sessions.d.mts.map +1 -1
- package/resources/beta/agents/sessions/sessions.d.ts +16 -4
- package/resources/beta/agents/sessions/sessions.d.ts.map +1 -1
- package/resources/beta/agents/sessions/sessions.js +17 -4
- package/resources/beta/agents/sessions/sessions.js.map +1 -1
- package/resources/beta/agents/sessions/sessions.mjs +17 -4
- package/resources/beta/agents/sessions/sessions.mjs.map +1 -1
- package/resources/beta/agents/sessions/traces.d.mts +68 -0
- package/resources/beta/agents/sessions/traces.d.mts.map +1 -0
- package/resources/beta/agents/sessions/traces.d.ts +68 -0
- package/resources/beta/agents/sessions/traces.d.ts.map +1 -0
- package/resources/beta/agents/sessions/traces.js +81 -0
- package/resources/beta/agents/sessions/traces.js.map +1 -0
- package/resources/beta/agents/sessions/traces.mjs +77 -0
- package/resources/beta/agents/sessions/traces.mjs.map +1 -0
- package/resources/beta/beta.d.mts +2 -2
- package/resources/beta/beta.d.mts.map +1 -1
- package/resources/beta/beta.d.ts +2 -2
- package/resources/beta/beta.d.ts.map +1 -1
- package/resources/beta/beta.js.map +1 -1
- package/resources/beta/beta.mjs.map +1 -1
- package/resources/beta/index.d.mts +1 -1
- package/resources/beta/index.d.mts.map +1 -1
- package/resources/beta/index.d.ts +1 -1
- package/resources/beta/index.d.ts.map +1 -1
- package/resources/beta/index.js.map +1 -1
- package/resources/beta/index.mjs.map +1 -1
- package/resources/beta/responses/ws-base.d.mts +3 -1
- package/resources/beta/responses/ws-base.d.mts.map +1 -1
- package/resources/beta/responses/ws-base.d.ts +3 -1
- package/resources/beta/responses/ws-base.d.ts.map +1 -1
- package/resources/beta/responses/ws-base.js +35 -6
- package/resources/beta/responses/ws-base.js.map +1 -1
- package/resources/beta/responses/ws-base.mjs +35 -6
- package/resources/beta/responses/ws-base.mjs.map +1 -1
- package/resources/beta/responses/ws.d.mts +10 -0
- package/resources/beta/responses/ws.d.mts.map +1 -1
- package/resources/beta/responses/ws.d.ts +10 -0
- package/resources/beta/responses/ws.d.ts.map +1 -1
- package/resources/beta/responses/ws.js +23 -22
- package/resources/beta/responses/ws.js.map +1 -1
- package/resources/beta/responses/ws.mjs +24 -23
- package/resources/beta/responses/ws.mjs.map +1 -1
- package/resources/chat/completions/completions.d.mts +1 -1
- package/resources/chat/completions/completions.d.mts.map +1 -1
- package/resources/chat/completions/completions.d.ts +1 -1
- package/resources/chat/completions/completions.d.ts.map +1 -1
- package/resources/evals/runs/runs.js +1 -1
- package/resources/evals/runs/runs.js.map +1 -1
- package/resources/evals/runs/runs.mjs +1 -1
- package/resources/evals/runs/runs.mjs.map +1 -1
- package/resources/live/forks/forks.d.mts +5 -1
- package/resources/live/forks/forks.d.mts.map +1 -1
- package/resources/live/forks/forks.d.ts +5 -1
- package/resources/live/forks/forks.d.ts.map +1 -1
- package/resources/live/live.d.mts +5 -1
- package/resources/live/live.d.mts.map +1 -1
- package/resources/live/live.d.ts +5 -1
- package/resources/live/live.d.ts.map +1 -1
- package/resources/live/live.js.map +1 -1
- package/resources/live/live.mjs.map +1 -1
- package/resources/responses/ws-base.d.mts +3 -1
- package/resources/responses/ws-base.d.mts.map +1 -1
- package/resources/responses/ws-base.d.ts +3 -1
- package/resources/responses/ws-base.d.ts.map +1 -1
- package/resources/responses/ws-base.js +35 -6
- package/resources/responses/ws-base.js.map +1 -1
- package/resources/responses/ws-base.mjs +35 -6
- package/resources/responses/ws-base.mjs.map +1 -1
- package/resources/responses/ws.d.mts +10 -0
- package/resources/responses/ws.d.mts.map +1 -1
- package/resources/responses/ws.d.ts +10 -0
- package/resources/responses/ws.d.ts.map +1 -1
- package/resources/responses/ws.js +23 -22
- package/resources/responses/ws.js.map +1 -1
- package/resources/responses/ws.mjs +24 -23
- package/resources/responses/ws.mjs.map +1 -1
- package/src/client.ts +55 -19
- package/src/core/streaming.ts +9 -0
- package/src/helpers/beta/agents/standard-schema.ts +13 -0
- package/src/helpers/beta/agents/zod.ts +10 -0
- package/src/internal/realtime-credentials.ts +70 -4
- package/src/internal/responses-ws-credentials.ts +160 -0
- package/src/internal/ws-adapter-node.ts +66 -0
- package/src/internal/ws.ts +139 -11
- package/src/lib/agents/agent-session-stream.ts +36 -24
- package/src/lib/beta/agents/agent-session-create-stream.ts +36 -0
- package/src/lib/beta/agents/agent-turn-result-collector.ts +122 -0
- package/src/lib/beta/agents/agent-turn-result-error.ts +33 -0
- package/src/lib/beta/agents/agent-turn-result.ts +22 -0
- package/src/lib/beta/agents/function-tool.ts +60 -0
- package/src/lib/beta/agents/output-format-types.ts +12 -0
- package/src/lib/beta/agents/output-format.ts +20 -0
- package/src/lib/beta/agents/output-parse-error.ts +16 -0
- package/src/lib/beta/agents/parse-result.ts +133 -0
- package/src/lib/beta/agents/parsed-agent-turn-result.ts +12 -0
- package/src/lib/beta/agents/result-collection.ts +115 -0
- package/src/lib/beta/agents/tool-output.ts +22 -0
- package/src/lib/responses/responses-websocket-session.ts +14 -3
- package/src/resources/audio/speech.ts +1 -1
- package/src/resources/beta/agents/agents.ts +697 -6
- package/src/resources/beta/agents/environments/templates.ts +64 -3
- package/src/resources/beta/agents/index.ts +3 -0
- package/src/resources/beta/agents/sessions/events.ts +16 -12
- package/src/resources/beta/agents/sessions/index.ts +1 -0
- package/src/resources/beta/agents/sessions/sessions.ts +48 -18
- package/src/resources/beta/agents/sessions/traces.ts +298 -0
- package/src/resources/beta/beta.ts +6 -0
- package/src/resources/beta/index.ts +3 -0
- package/src/resources/beta/responses/ws-base.ts +40 -6
- package/src/resources/beta/responses/ws.ts +37 -27
- package/src/resources/chat/completions/completions.ts +1 -1
- package/src/resources/evals/runs/runs.ts +1 -1
- package/src/resources/live/forks/forks.ts +6 -1
- package/src/resources/live/live.ts +6 -1
- package/src/resources/responses/ws-base.ts +40 -6
- package/src/resources/responses/ws.ts +37 -27
- package/src/tsconfig.dist-src-node.d.ts +7 -0
- package/src/tsconfig.dist-src.d.ts +3 -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
|
@@ -414,6 +414,11 @@ export interface EnvironmentTemplate {
|
|
|
414
414
|
* The Unix timestamp, in seconds, when the template was last updated.
|
|
415
415
|
*/
|
|
416
416
|
updated_at: number;
|
|
417
|
+
|
|
418
|
+
/**
|
|
419
|
+
* Desktop configuration for each OpenAI-hosted environment.
|
|
420
|
+
*/
|
|
421
|
+
desktop?: EnvironmentTemplate.Desktop;
|
|
417
422
|
}
|
|
418
423
|
|
|
419
424
|
export namespace EnvironmentTemplate {
|
|
@@ -466,7 +471,7 @@ export namespace EnvironmentTemplate {
|
|
|
466
471
|
*
|
|
467
472
|
* - `enabled` - Allows unrestricted network access.
|
|
468
473
|
* - `disabled` - Disables network access.
|
|
469
|
-
* - `restricted` -
|
|
474
|
+
* - `restricted` - Applies the configured domain restrictions.
|
|
470
475
|
*/
|
|
471
476
|
access: 'enabled' | 'disabled' | 'restricted';
|
|
472
477
|
|
|
@@ -535,6 +540,16 @@ export namespace EnvironmentTemplate {
|
|
|
535
540
|
*/
|
|
536
541
|
type: 'inline';
|
|
537
542
|
}
|
|
543
|
+
|
|
544
|
+
/**
|
|
545
|
+
* Desktop configuration for each OpenAI-hosted environment.
|
|
546
|
+
*/
|
|
547
|
+
export interface Desktop {
|
|
548
|
+
/**
|
|
549
|
+
* Whether the environment provisions a desktop and browser proxy.
|
|
550
|
+
*/
|
|
551
|
+
enabled: boolean;
|
|
552
|
+
}
|
|
538
553
|
}
|
|
539
554
|
|
|
540
555
|
/**
|
|
@@ -564,6 +579,12 @@ export interface TemplateCreateParams {
|
|
|
564
579
|
*/
|
|
565
580
|
capability_directories?: Array<string> | null;
|
|
566
581
|
|
|
582
|
+
/**
|
|
583
|
+
* Desktop provisioning. Omission or null inherits the template setting, or
|
|
584
|
+
* defaults to disabled.
|
|
585
|
+
*/
|
|
586
|
+
desktop?: TemplateCreateParams.Desktop | null;
|
|
587
|
+
|
|
567
588
|
/**
|
|
568
589
|
* Environment variables made available to the agent.
|
|
569
590
|
*/
|
|
@@ -608,6 +629,17 @@ export interface TemplateCreateParams {
|
|
|
608
629
|
}
|
|
609
630
|
|
|
610
631
|
export namespace TemplateCreateParams {
|
|
632
|
+
/**
|
|
633
|
+
* Desktop provisioning. Omission or null inherits the template setting, or
|
|
634
|
+
* defaults to disabled.
|
|
635
|
+
*/
|
|
636
|
+
export interface Desktop {
|
|
637
|
+
/**
|
|
638
|
+
* Whether to provision the desktop and its browser proxy.
|
|
639
|
+
*/
|
|
640
|
+
enabled: boolean;
|
|
641
|
+
}
|
|
642
|
+
|
|
611
643
|
/**
|
|
612
644
|
* Network access policy for the environment. Defaults to disabled for GA requests
|
|
613
645
|
* and enabled for beta requests.
|
|
@@ -618,7 +650,7 @@ export namespace TemplateCreateParams {
|
|
|
618
650
|
*
|
|
619
651
|
* - `enabled` - Allows unrestricted network access.
|
|
620
652
|
* - `disabled` - Disables network access.
|
|
621
|
-
* - `restricted` -
|
|
653
|
+
* - `restricted` - Applies the configured domain restrictions.
|
|
622
654
|
*/
|
|
623
655
|
access: 'enabled' | 'disabled' | 'restricted';
|
|
624
656
|
|
|
@@ -626,6 +658,13 @@ export namespace TemplateCreateParams {
|
|
|
626
658
|
* Domains the environment may access when network access is restricted.
|
|
627
659
|
*/
|
|
628
660
|
allowed_domains?: Array<string> | null;
|
|
661
|
+
|
|
662
|
+
/**
|
|
663
|
+
* Domains blocked for both executor and browser when access is restricted. A
|
|
664
|
+
* nonempty list requires `access: restricted` and cannot be combined with nonempty
|
|
665
|
+
* `allowed_domains`. Wildcard domains are not supported.
|
|
666
|
+
*/
|
|
667
|
+
blocked_domains?: Array<string> | null;
|
|
629
668
|
}
|
|
630
669
|
|
|
631
670
|
/**
|
|
@@ -655,6 +694,11 @@ export interface TemplateUpdateParams {
|
|
|
655
694
|
*/
|
|
656
695
|
capability_directories?: Array<string> | null;
|
|
657
696
|
|
|
697
|
+
/**
|
|
698
|
+
* Replacement desktop configuration, or null to disable the desktop.
|
|
699
|
+
*/
|
|
700
|
+
desktop?: TemplateUpdateParams.Desktop | null;
|
|
701
|
+
|
|
658
702
|
/**
|
|
659
703
|
* Replacement confidential environment values.
|
|
660
704
|
*/
|
|
@@ -699,6 +743,16 @@ export interface TemplateUpdateParams {
|
|
|
699
743
|
}
|
|
700
744
|
|
|
701
745
|
export namespace TemplateUpdateParams {
|
|
746
|
+
/**
|
|
747
|
+
* Replacement desktop configuration, or null to disable the desktop.
|
|
748
|
+
*/
|
|
749
|
+
export interface Desktop {
|
|
750
|
+
/**
|
|
751
|
+
* Whether to provision the desktop and its browser proxy.
|
|
752
|
+
*/
|
|
753
|
+
enabled: boolean;
|
|
754
|
+
}
|
|
755
|
+
|
|
702
756
|
/**
|
|
703
757
|
* Network access available after setup completes. Omit to preserve the current
|
|
704
758
|
* policy, or pass `null` to reset to disabled for GA requests or enabled for beta
|
|
@@ -710,7 +764,7 @@ export namespace TemplateUpdateParams {
|
|
|
710
764
|
*
|
|
711
765
|
* - `enabled` - Allows unrestricted network access.
|
|
712
766
|
* - `disabled` - Disables network access.
|
|
713
|
-
* - `restricted` -
|
|
767
|
+
* - `restricted` - Applies the configured domain restrictions.
|
|
714
768
|
*/
|
|
715
769
|
access: 'enabled' | 'disabled' | 'restricted';
|
|
716
770
|
|
|
@@ -718,6 +772,13 @@ export namespace TemplateUpdateParams {
|
|
|
718
772
|
* Domains the environment may access when network access is restricted.
|
|
719
773
|
*/
|
|
720
774
|
allowed_domains?: Array<string> | null;
|
|
775
|
+
|
|
776
|
+
/**
|
|
777
|
+
* Domains blocked for both executor and browser when access is restricted. A
|
|
778
|
+
* nonempty list requires `access: restricted` and cannot be combined with nonempty
|
|
779
|
+
* `allowed_domains`. Wildcard domains are not supported.
|
|
780
|
+
*/
|
|
781
|
+
blocked_domains?: Array<string> | null;
|
|
721
782
|
}
|
|
722
783
|
|
|
723
784
|
/**
|
|
@@ -17,11 +17,12 @@ function resolveResourceRequestOptions(
|
|
|
17
17
|
|
|
18
18
|
export class Events extends APIResource {
|
|
19
19
|
/**
|
|
20
|
-
* Submits message, cancellation,
|
|
21
|
-
* Cancellation can recover a still-open turn
|
|
22
|
-
* marking it cancelled and abandoning
|
|
23
|
-
* published files, and existing terminal
|
|
24
|
-
* acceptance, not durable completion.
|
|
20
|
+
* Submits message, cancellation, tool-result, or computer-use approval-response
|
|
21
|
+
* events to a managed agent session. Cancellation can recover a still-open turn
|
|
22
|
+
* whose backend execution has ended by marking it cancelled and abandoning
|
|
23
|
+
* unpublished outputs. Saved results, published files, and existing terminal
|
|
24
|
+
* outcomes are preserved. HTTP 202 confirms acceptance, not durable completion.
|
|
25
|
+
* See
|
|
25
26
|
* [session events](https://developers.openai.com/api/docs/guides/agents-api/sessions/events).
|
|
26
27
|
*
|
|
27
28
|
* @example
|
|
@@ -31,13 +32,16 @@ export class Events extends APIResource {
|
|
|
31
32
|
* {
|
|
32
33
|
* events: [
|
|
33
34
|
* {
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
35
|
+
* request_id: 'request_id',
|
|
36
|
+
* response: {
|
|
37
|
+
* action: 'submit',
|
|
38
|
+
* fields: [
|
|
39
|
+
* { field_id: 'field_id', value: 'value' },
|
|
40
|
+
* ],
|
|
41
|
+
* type: 'browser_authentication',
|
|
42
|
+
* },
|
|
43
|
+
* type:
|
|
44
|
+
* 'agent.session.input.computer_use_approval_request_result',
|
|
41
45
|
* },
|
|
42
46
|
* ],
|
|
43
47
|
* },
|
|
@@ -21,4 +21,5 @@ export {
|
|
|
21
21
|
type SessionListParams,
|
|
22
22
|
} from './sessions';
|
|
23
23
|
export { Subagents, type SubagentRetrieveParams, type SubagentListParams } from './subagents/index';
|
|
24
|
+
export { Traces, type SessionTrace, type TraceListParams, type SessionTracesPage } from './traces';
|
|
24
25
|
export { Turns, type Turn, type TurnRetrieveParams, type TurnListParams, type TurnsPage } from './turns';
|
|
@@ -4,6 +4,12 @@ import {
|
|
|
4
4
|
AgentSessionStream,
|
|
5
5
|
type AgentSessionStreamParams,
|
|
6
6
|
} from '../../../../lib/agents/agent-session-stream';
|
|
7
|
+
import {
|
|
8
|
+
type AgentSessionCreateStream,
|
|
9
|
+
withAgentTurnResult,
|
|
10
|
+
} from '../../../../lib/beta/agents/agent-session-create-stream';
|
|
11
|
+
import type { AgentOutputFormat } from '../../../../lib/beta/agents/output-format-types';
|
|
12
|
+
import { captureAgentOutput } from '../../../../lib/beta/agents/parse-result';
|
|
7
13
|
import { APIResource } from '../../../../core/resource';
|
|
8
14
|
import * as SessionsAPI from './sessions';
|
|
9
15
|
import * as AgentsAPI from '../agents';
|
|
@@ -23,13 +29,15 @@ import * as EventsAPI from './events';
|
|
|
23
29
|
import { EventCreateParams, Events } from './events';
|
|
24
30
|
import * as ItemsAPI from './items';
|
|
25
31
|
import { ItemListParams, Items } from './items';
|
|
32
|
+
import * as TracesAPI from './traces';
|
|
33
|
+
import { SessionTrace, SessionTracesPage, TraceListParams, Traces } from './traces';
|
|
26
34
|
import * as TurnsAPI from './turns';
|
|
27
35
|
import { Turn, TurnListParams, TurnRetrieveParams, Turns, TurnsPage } from './turns';
|
|
28
36
|
import * as SubagentsAPI from './subagents/subagents';
|
|
29
37
|
import { SubagentListParams, SubagentRetrieveParams, Subagents } from './subagents/subagents';
|
|
30
38
|
import { APIPromise } from '../../../../core/api-promise';
|
|
31
39
|
import { CursorPage, type CursorPageParams, PagePromise } from '../../../../core/pagination';
|
|
32
|
-
import { Stream } from '../../../../core/streaming';
|
|
40
|
+
import type { Stream } from '../../../../core/streaming';
|
|
33
41
|
import { buildHeaders } from '../../../../internal/headers';
|
|
34
42
|
import { RequestOptions } from '../../../../internal/request-options';
|
|
35
43
|
import { path } from '../../../../internal/utils/path';
|
|
@@ -150,7 +158,11 @@ function normalizeRequestOptionsForQuery(
|
|
|
150
158
|
|
|
151
159
|
export class Sessions extends APIResource {
|
|
152
160
|
/** Stream one turn on an idle session with a single input writer. See AgentSessionStream for lifecycle and tool handling. */
|
|
153
|
-
stream
|
|
161
|
+
stream<T = never>(
|
|
162
|
+
sessionID: string,
|
|
163
|
+
params: AgentSessionStreamParams<T>,
|
|
164
|
+
options?: RequestOptions,
|
|
165
|
+
): AgentSessionStream<T> {
|
|
154
166
|
return new AgentSessionStream(this, sessionID, params, options);
|
|
155
167
|
}
|
|
156
168
|
|
|
@@ -158,6 +170,7 @@ export class Sessions extends APIResource {
|
|
|
158
170
|
artifacts: ArtifactsAPI.Artifacts = new ArtifactsAPI.Artifacts(this._client);
|
|
159
171
|
items: ItemsAPI.Items = new ItemsAPI.Items(this._client);
|
|
160
172
|
events: EventsAPI.Events = new EventsAPI.Events(this._client);
|
|
173
|
+
traces: TracesAPI.Traces = new TracesAPI.Traces(this._client);
|
|
161
174
|
turns: TurnsAPI.Turns = new TurnsAPI.Turns(this._client);
|
|
162
175
|
|
|
163
176
|
/**
|
|
@@ -173,29 +186,38 @@ export class Sessions extends APIResource {
|
|
|
173
186
|
* });
|
|
174
187
|
* ```
|
|
175
188
|
*/
|
|
176
|
-
create(
|
|
177
|
-
|
|
178
|
-
body: SessionCreateParamsStreaming,
|
|
189
|
+
create<T>(
|
|
190
|
+
body: SessionCreateParamsStreaming & { agent: { text: { format: AgentOutputFormat<T> } } },
|
|
179
191
|
options?: RequestOptions,
|
|
180
|
-
): APIPromise<
|
|
192
|
+
): APIPromise<AgentSessionCreateStream<T>>;
|
|
193
|
+
create(body: SessionCreateParamsNonStreaming, options?: RequestOptions): APIPromise<AgentsAPI.AgentSession>;
|
|
194
|
+
create(body: SessionCreateParamsStreaming, options?: RequestOptions): APIPromise<AgentSessionCreateStream>;
|
|
181
195
|
create(
|
|
182
196
|
body: SessionCreateParamsBase,
|
|
183
197
|
options?: RequestOptions,
|
|
184
|
-
): APIPromise<
|
|
198
|
+
): APIPromise<AgentSessionCreateStream | AgentsAPI.AgentSession>;
|
|
185
199
|
create(
|
|
186
200
|
body: SessionCreateParams,
|
|
187
201
|
options?: RequestOptions,
|
|
188
|
-
): APIPromise<AgentsAPI.AgentSession> | APIPromise<
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
202
|
+
): APIPromise<AgentsAPI.AgentSession> | APIPromise<AgentSessionCreateStream> {
|
|
203
|
+
const output = captureAgentOutput(body, options);
|
|
204
|
+
return this._client
|
|
205
|
+
.post<AgentsAPI.AgentSession | Stream<AgentsAPI.AgentSessionEvent>>(
|
|
206
|
+
'/agents/sessions',
|
|
207
|
+
resolveResourceRequestOptions(output.options, (options) => ({
|
|
208
|
+
body: output.body,
|
|
209
|
+
...options,
|
|
210
|
+
headers: buildHeaders([{ 'OpenAI-Beta': 'agents=v1' }, options?.headers]),
|
|
211
|
+
stream: output.body.stream ?? false,
|
|
212
|
+
__security: { bearerAuth: true },
|
|
213
|
+
})),
|
|
214
|
+
)
|
|
215
|
+
._thenUnwrap((data, { options }) =>
|
|
216
|
+
// SAFETY: defaultParseResponse uses this same resolved flag to return the configured stream instance.
|
|
217
|
+
options.stream
|
|
218
|
+
? withAgentTurnResult(data as Stream<AgentsAPI.AgentSessionEvent>, output.format)
|
|
219
|
+
: data,
|
|
220
|
+
) as APIPromise<AgentsAPI.AgentSession> | APIPromise<AgentSessionCreateStream>;
|
|
199
221
|
}
|
|
200
222
|
|
|
201
223
|
/**
|
|
@@ -587,6 +609,7 @@ Sessions.Subagents = Subagents;
|
|
|
587
609
|
Sessions.Artifacts = Artifacts;
|
|
588
610
|
Sessions.Items = Items;
|
|
589
611
|
Sessions.Events = Events;
|
|
612
|
+
Sessions.Traces = Traces;
|
|
590
613
|
Sessions.Turns = Turns;
|
|
591
614
|
|
|
592
615
|
export declare namespace Sessions {
|
|
@@ -619,6 +642,13 @@ export declare namespace Sessions {
|
|
|
619
642
|
|
|
620
643
|
export { Events as Events, type EventCreateParams as EventCreateParams };
|
|
621
644
|
|
|
645
|
+
export {
|
|
646
|
+
Traces as Traces,
|
|
647
|
+
type SessionTrace as SessionTrace,
|
|
648
|
+
type SessionTracesPage as SessionTracesPage,
|
|
649
|
+
type TraceListParams as TraceListParams,
|
|
650
|
+
};
|
|
651
|
+
|
|
622
652
|
export {
|
|
623
653
|
Turns as Turns,
|
|
624
654
|
type Turn as Turn,
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Castiron. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../../../core/resource';
|
|
4
|
+
import { CursorPage, type CursorPageParams, PagePromise } from '../../../../core/pagination';
|
|
5
|
+
import { buildHeaders } from '../../../../internal/headers';
|
|
6
|
+
import { RequestOptions } from '../../../../internal/request-options';
|
|
7
|
+
import { path } from '../../../../internal/utils/path';
|
|
8
|
+
|
|
9
|
+
function resolveResourceRequestOptions(
|
|
10
|
+
options: RequestOptions | undefined,
|
|
11
|
+
buildOptions: (options: RequestOptions | undefined) => RequestOptions | Promise<RequestOptions>,
|
|
12
|
+
): Promise<RequestOptions> {
|
|
13
|
+
return Promise.resolve(options).then(buildOptions);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// Recognizable options across SDK runtime versions. Keep this independent of
|
|
17
|
+
// private RequestOptions fields so older handwritten runtimes still compile.
|
|
18
|
+
const normalizeRequestOptionsForQueryKeys = new Set([
|
|
19
|
+
'method',
|
|
20
|
+
'path',
|
|
21
|
+
'query',
|
|
22
|
+
'body',
|
|
23
|
+
'headers',
|
|
24
|
+
'maxRetries',
|
|
25
|
+
'stream',
|
|
26
|
+
'timeout',
|
|
27
|
+
'httpAgent',
|
|
28
|
+
'fetchOptions',
|
|
29
|
+
'signal',
|
|
30
|
+
'idempotencyKey',
|
|
31
|
+
'defaultBaseURL',
|
|
32
|
+
'__metadata',
|
|
33
|
+
'__binaryRequest',
|
|
34
|
+
'__binaryResponse',
|
|
35
|
+
'__streamClass',
|
|
36
|
+
'__security',
|
|
37
|
+
'__synthesizeEventData',
|
|
38
|
+
]);
|
|
39
|
+
|
|
40
|
+
function normalizeRequestOptionsForQuery(
|
|
41
|
+
value: unknown,
|
|
42
|
+
queryKeys: ReadonlyArray<string>,
|
|
43
|
+
options: RequestOptions | undefined,
|
|
44
|
+
):
|
|
45
|
+
| ({
|
|
46
|
+
[K in 'headers' | 'maxRetries' | 'timeout' | 'signal' | 'idempotencyKey' | 'query']?: RequestOptions[K];
|
|
47
|
+
} & {
|
|
48
|
+
[
|
|
49
|
+
K in
|
|
50
|
+
| 'method'
|
|
51
|
+
| 'path'
|
|
52
|
+
| 'body'
|
|
53
|
+
| 'stream'
|
|
54
|
+
| 'httpAgent'
|
|
55
|
+
| 'fetchOptions'
|
|
56
|
+
| 'defaultBaseURL'
|
|
57
|
+
| '__metadata'
|
|
58
|
+
| '__binaryRequest'
|
|
59
|
+
| '__binaryResponse'
|
|
60
|
+
| '__streamClass'
|
|
61
|
+
| '__security'
|
|
62
|
+
| '__synthesizeEventData'
|
|
63
|
+
]?: never;
|
|
64
|
+
})
|
|
65
|
+
| undefined {
|
|
66
|
+
if (typeof value !== 'object' || value === null) return undefined;
|
|
67
|
+
// Optional never fields can still be explicitly undefined unless consumers
|
|
68
|
+
// enable exactOptionalPropertyTypes. Snapshot data without invoking getters.
|
|
69
|
+
const entries = Object.entries(Object.getOwnPropertyDescriptors(value)).filter(
|
|
70
|
+
([, descriptor]) => descriptor.enumerable && (!('value' in descriptor) || descriptor.value !== undefined),
|
|
71
|
+
);
|
|
72
|
+
const keys = entries.map(([key]) => key);
|
|
73
|
+
const requestOnly = keys.some(
|
|
74
|
+
(key) => normalizeRequestOptionsForQueryKeys.has(key) && !queryKeys.includes(key),
|
|
75
|
+
);
|
|
76
|
+
if (!requestOnly) return undefined;
|
|
77
|
+
// Declared query fields, including stream, must use the query argument.
|
|
78
|
+
// Mixing them with request-only options is ambiguous and could change the return type.
|
|
79
|
+
if (
|
|
80
|
+
options !== undefined ||
|
|
81
|
+
keys.some((key) => !normalizeRequestOptionsForQueryKeys.has(key) || queryKeys.includes(key))
|
|
82
|
+
) {
|
|
83
|
+
throw new TypeError('Query parameters and request options must be passed as separate arguments.');
|
|
84
|
+
}
|
|
85
|
+
// The query position must not gain authority to change the request destination
|
|
86
|
+
// or transport. Those overrides require the explicit request options argument.
|
|
87
|
+
if (
|
|
88
|
+
keys.some(
|
|
89
|
+
(key) => !['headers', 'maxRetries', 'timeout', 'signal', 'idempotencyKey', 'query'].includes(key),
|
|
90
|
+
)
|
|
91
|
+
) {
|
|
92
|
+
throw new TypeError('Pass transport overrides in the explicit request options argument.');
|
|
93
|
+
}
|
|
94
|
+
// Copy only the validated fields. Spreading value would reintroduce undefined
|
|
95
|
+
// transport overrides, and deleting them would mutate the caller's object.
|
|
96
|
+
return Object.fromEntries(
|
|
97
|
+
entries.map(([key, descriptor]) => {
|
|
98
|
+
if ('value' in descriptor) return [key, descriptor.value];
|
|
99
|
+
return [key, descriptor.get ? Reflect.apply(descriptor.get, value, []) : undefined];
|
|
100
|
+
}),
|
|
101
|
+
) as {
|
|
102
|
+
[K in 'headers' | 'maxRetries' | 'timeout' | 'signal' | 'idempotencyKey' | 'query']?: RequestOptions[K];
|
|
103
|
+
} & {
|
|
104
|
+
[
|
|
105
|
+
K in
|
|
106
|
+
| 'method'
|
|
107
|
+
| 'path'
|
|
108
|
+
| 'body'
|
|
109
|
+
| 'stream'
|
|
110
|
+
| 'httpAgent'
|
|
111
|
+
| 'fetchOptions'
|
|
112
|
+
| 'defaultBaseURL'
|
|
113
|
+
| '__metadata'
|
|
114
|
+
| '__binaryRequest'
|
|
115
|
+
| '__binaryResponse'
|
|
116
|
+
| '__streamClass'
|
|
117
|
+
| '__security'
|
|
118
|
+
| '__synthesizeEventData'
|
|
119
|
+
]?: never;
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export class Traces extends APIResource {
|
|
124
|
+
/**
|
|
125
|
+
* Lists published root-turn traces as OTLP JSON, ordered by turn creation time and
|
|
126
|
+
* ID. Unpublished traces are skipped. Each page returns data available when read;
|
|
127
|
+
* it does not wait for late traces. Trace reads and the JSON response are limited
|
|
128
|
+
* to 16 MiB per request. If the limit is exceeded, request fewer traces.
|
|
129
|
+
*
|
|
130
|
+
* @example
|
|
131
|
+
* ```ts
|
|
132
|
+
* // Automatically fetches more pages as needed.
|
|
133
|
+
* for await (const sessionTrace of client.beta.agents.sessions.traces.list(
|
|
134
|
+
* 'session_id',
|
|
135
|
+
* )) {
|
|
136
|
+
* // ...
|
|
137
|
+
* }
|
|
138
|
+
* ```
|
|
139
|
+
*/
|
|
140
|
+
list(
|
|
141
|
+
sessionID: string,
|
|
142
|
+
query?:
|
|
143
|
+
| (TraceListParams &
|
|
144
|
+
(
|
|
145
|
+
| {
|
|
146
|
+
[
|
|
147
|
+
K in
|
|
148
|
+
| 'method'
|
|
149
|
+
| 'path'
|
|
150
|
+
| 'query'
|
|
151
|
+
| 'body'
|
|
152
|
+
| 'headers'
|
|
153
|
+
| 'maxRetries'
|
|
154
|
+
| 'stream'
|
|
155
|
+
| 'timeout'
|
|
156
|
+
| 'httpAgent'
|
|
157
|
+
| 'fetchOptions'
|
|
158
|
+
| 'signal'
|
|
159
|
+
| 'idempotencyKey'
|
|
160
|
+
| 'defaultBaseURL'
|
|
161
|
+
| '__metadata'
|
|
162
|
+
| '__binaryRequest'
|
|
163
|
+
| '__binaryResponse'
|
|
164
|
+
| '__streamClass'
|
|
165
|
+
| '__security'
|
|
166
|
+
| '__synthesizeEventData'
|
|
167
|
+
]?: never;
|
|
168
|
+
}
|
|
169
|
+
| null
|
|
170
|
+
| undefined
|
|
171
|
+
))
|
|
172
|
+
| null
|
|
173
|
+
| undefined,
|
|
174
|
+
options?: RequestOptions,
|
|
175
|
+
): PagePromise<SessionTracesPage, SessionTrace>;
|
|
176
|
+
list(
|
|
177
|
+
sessionID: string,
|
|
178
|
+
options?: {
|
|
179
|
+
[K in 'headers' | 'maxRetries' | 'timeout' | 'signal' | 'idempotencyKey' | 'query']?: RequestOptions[K];
|
|
180
|
+
} & {
|
|
181
|
+
[
|
|
182
|
+
K in
|
|
183
|
+
| 'method'
|
|
184
|
+
| 'path'
|
|
185
|
+
| 'body'
|
|
186
|
+
| 'stream'
|
|
187
|
+
| 'httpAgent'
|
|
188
|
+
| 'fetchOptions'
|
|
189
|
+
| 'defaultBaseURL'
|
|
190
|
+
| '__metadata'
|
|
191
|
+
| '__binaryRequest'
|
|
192
|
+
| '__binaryResponse'
|
|
193
|
+
| '__streamClass'
|
|
194
|
+
| '__security'
|
|
195
|
+
| '__synthesizeEventData'
|
|
196
|
+
]?: never;
|
|
197
|
+
},
|
|
198
|
+
): PagePromise<SessionTracesPage, SessionTrace>;
|
|
199
|
+
list(
|
|
200
|
+
sessionID: string,
|
|
201
|
+
query:
|
|
202
|
+
| TraceListParams
|
|
203
|
+
| ({
|
|
204
|
+
[
|
|
205
|
+
K in 'headers' | 'maxRetries' | 'timeout' | 'signal' | 'idempotencyKey' | 'query'
|
|
206
|
+
]?: RequestOptions[K];
|
|
207
|
+
} & {
|
|
208
|
+
[
|
|
209
|
+
K in
|
|
210
|
+
| 'method'
|
|
211
|
+
| 'path'
|
|
212
|
+
| 'body'
|
|
213
|
+
| 'stream'
|
|
214
|
+
| 'httpAgent'
|
|
215
|
+
| 'fetchOptions'
|
|
216
|
+
| 'defaultBaseURL'
|
|
217
|
+
| '__metadata'
|
|
218
|
+
| '__binaryRequest'
|
|
219
|
+
| '__binaryResponse'
|
|
220
|
+
| '__streamClass'
|
|
221
|
+
| '__security'
|
|
222
|
+
| '__synthesizeEventData'
|
|
223
|
+
]?: never;
|
|
224
|
+
})
|
|
225
|
+
| null
|
|
226
|
+
| undefined = {},
|
|
227
|
+
options?: RequestOptions,
|
|
228
|
+
): PagePromise<SessionTracesPage, SessionTrace> {
|
|
229
|
+
const normalizeRequestOptionsForQueryOptions = normalizeRequestOptionsForQuery(
|
|
230
|
+
query,
|
|
231
|
+
['after', 'limit', 'order'],
|
|
232
|
+
options,
|
|
233
|
+
);
|
|
234
|
+
if (normalizeRequestOptionsForQueryOptions !== undefined) {
|
|
235
|
+
options = normalizeRequestOptionsForQueryOptions;
|
|
236
|
+
query = {};
|
|
237
|
+
}
|
|
238
|
+
query = query as TraceListParams | null | undefined;
|
|
239
|
+
return this._client.getAPIList(
|
|
240
|
+
path`/agents/sessions/${sessionID}/traces`,
|
|
241
|
+
CursorPage<SessionTrace>,
|
|
242
|
+
resolveResourceRequestOptions(options, (options) => ({
|
|
243
|
+
query,
|
|
244
|
+
...options,
|
|
245
|
+
headers: buildHeaders([{ 'OpenAI-Beta': 'agents=v1' }, options?.headers]),
|
|
246
|
+
__security: { bearerAuth: true },
|
|
247
|
+
})),
|
|
248
|
+
);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
export type SessionTracesPage = CursorPage<SessionTrace>;
|
|
253
|
+
|
|
254
|
+
export interface SessionTrace {
|
|
255
|
+
/**
|
|
256
|
+
* The root turn ID. Use this ID as the pagination anchor.
|
|
257
|
+
*/
|
|
258
|
+
id: string;
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* The Unix timestamp in seconds when the root turn was created.
|
|
262
|
+
*/
|
|
263
|
+
created_at: number;
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* The object type, which is always `agent.session.trace`.
|
|
267
|
+
*/
|
|
268
|
+
object: 'agent.session.trace';
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* An OTLP JSON ExportTraceServiceRequest containing resourceSpans. Only currently
|
|
272
|
+
* published data is returned; later trace updates are not awaited.
|
|
273
|
+
*/
|
|
274
|
+
otlp: { [key: string]: unknown };
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* The session that owns this trace.
|
|
278
|
+
*/
|
|
279
|
+
session_id: string;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
export interface TraceListParams extends CursorPageParams {
|
|
283
|
+
/**
|
|
284
|
+
* The order in which resources are returned. Defaults to `desc`.
|
|
285
|
+
*
|
|
286
|
+
* - `asc` - Returns resources in ascending order.
|
|
287
|
+
* - `desc` - Returns resources in descending order.
|
|
288
|
+
*/
|
|
289
|
+
order?: 'asc' | 'desc';
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
export declare namespace Traces {
|
|
293
|
+
export {
|
|
294
|
+
type SessionTrace as SessionTrace,
|
|
295
|
+
type SessionTracesPage as SessionTracesPage,
|
|
296
|
+
type TraceListParams as TraceListParams,
|
|
297
|
+
};
|
|
298
|
+
}
|
|
@@ -76,6 +76,9 @@ import {
|
|
|
76
76
|
import * as AgentsAPI from './agents/agents';
|
|
77
77
|
import {
|
|
78
78
|
Agent,
|
|
79
|
+
AgentBrowserAuthenticationCancelParam,
|
|
80
|
+
AgentBrowserAuthenticationSubmitParam,
|
|
81
|
+
AgentBrowserOriginAccessParam,
|
|
79
82
|
AgentCloseSubagentCallItem,
|
|
80
83
|
AgentCommandExecutionItem,
|
|
81
84
|
AgentContent,
|
|
@@ -451,6 +454,9 @@ export declare namespace Beta {
|
|
|
451
454
|
type TranscriptionSessionUpdatedEvent as TranscriptionSessionUpdatedEvent,
|
|
452
455
|
Agents as Agents,
|
|
453
456
|
type Agent as Agent,
|
|
457
|
+
type AgentBrowserAuthenticationCancelParam as AgentBrowserAuthenticationCancelParam,
|
|
458
|
+
type AgentBrowserAuthenticationSubmitParam as AgentBrowserAuthenticationSubmitParam,
|
|
459
|
+
type AgentBrowserOriginAccessParam as AgentBrowserOriginAccessParam,
|
|
454
460
|
type AgentCloseSubagentCallItem as AgentCloseSubagentCallItem,
|
|
455
461
|
type AgentCommandExecutionItem as AgentCommandExecutionItem,
|
|
456
462
|
type AgentContent as AgentContent,
|