From 72ed90ce1c71cf2a75ba4b24f8608fc31badfe2a Mon Sep 17 00:00:00 2001 From: Google Team Member Date: Fri, 12 Jun 2026 08:05:21 -0700 Subject: [PATCH] feat: introduce gaos sdk libs PiperOrigin-RevId: 931155009 --- .prettierignore | 2 - api-report/genai-node.api.md | 2 + api-report/genai-web.api.md | 2 + api-report/genai.api.md | 2 + eslint.config.mjs | 2 - package-lock.json | 9 +- package.json | 2 +- sdk-samples/package-lock.json | 668 ++++++++++++++- sdk-samples/package.json | 2 + src/gaos/OWNERS | 4 - src/gaos/core.ts | 21 - src/gaos/funcs/agents-create.ts | 175 ---- src/gaos/funcs/agents-delete.ts | 178 ---- src/gaos/funcs/agents-get.ts | 178 ---- src/gaos/funcs/agents-list.ts | 189 ----- src/gaos/funcs/interactions-cancel.ts | 200 ----- src/gaos/funcs/interactions-create.ts | 252 ------ src/gaos/funcs/interactions-delete.ts | 197 ----- src/gaos/funcs/interactions-get.ts | 283 ------- src/gaos/funcs/webhooks-create.ts | 175 ---- src/gaos/funcs/webhooks-delete.ts | 178 ---- src/gaos/funcs/webhooks-get.ts | 178 ---- src/gaos/funcs/webhooks-list.ts | 184 ----- src/gaos/funcs/webhooks-ping.ts | 183 ----- .../funcs/webhooks-rotate-signing-secret.ts | 185 ----- src/gaos/funcs/webhooks-update.ts | 192 ----- src/gaos/google-genai.ts | 776 ------------------ src/gaos/hooks/google-genai-auth.ts | 273 ------ src/gaos/hooks/hooks.ts | 140 ---- src/gaos/hooks/index.ts | 14 - src/gaos/hooks/registration.ts | 25 - src/gaos/hooks/types.ts | 116 --- src/gaos/index.ts | 20 - src/gaos/lib/base64.ts | 35 - src/gaos/lib/config.ts | 95 --- src/gaos/lib/encodings.ts | 537 ------------ src/gaos/lib/env.ts | 100 --- src/gaos/lib/event-streams.ts | 215 ----- src/gaos/lib/files.ts | 112 --- src/gaos/lib/http.ts | 331 -------- src/gaos/lib/logger.ts | 17 - src/gaos/lib/matchers.ts | 350 -------- src/gaos/lib/primitives.ts | 174 ---- src/gaos/lib/retries.ts | 226 ----- src/gaos/lib/sdks.ts | 505 ------------ src/gaos/lib/security.ts | 293 ------- src/gaos/lib/url.ts | 43 - src/gaos/models/agents/agent-list-response.ts | 18 - src/gaos/models/agents/agent-tool.ts | 22 - src/gaos/models/agents/agent.ts | 60 -- src/gaos/models/agents/index.ts | 15 - .../models/errors/cancel-interaction-by-id.ts | 86 -- src/gaos/models/errors/create-interaction.ts | 86 -- src/gaos/models/errors/delete-interaction.ts | 86 -- .../models/errors/get-interaction-by-id.ts | 86 -- .../errors/google-gen-ai-default-error.ts | 48 -- src/gaos/models/errors/google-gen-ai-error.ts | 43 - src/gaos/models/errors/http-client-errors.ts | 70 -- src/gaos/models/errors/index.ts | 19 - src/gaos/models/index.ts | 13 - src/gaos/models/interactions/agent-option.ts | 20 - src/gaos/models/interactions/allowed-tools.ts | 24 - .../models/interactions/allowlist-entry.ts | 25 - src/gaos/models/interactions/annotation.ts | 20 - .../models/interactions/arguments-delta.ts | 16 - src/gaos/models/interactions/audio-content.ts | 56 -- src/gaos/models/interactions/audio-delta.ts | 47 -- .../interactions/audio-response-format.ts | 54 -- .../code-execution-call-arguments.ts | 30 - .../interactions/code-execution-call-delta.ts | 25 - .../interactions/code-execution-call-step.ts | 32 - .../code-execution-result-delta.ts | 21 - .../code-execution-result-step.ts | 34 - .../models/interactions/code-execution.ts | 18 - src/gaos/models/interactions/computer-use.ts | 31 - src/gaos/models/interactions/content.ts | 27 - .../interactions/create-agent-interaction.ts | 111 --- .../interactions/create-model-interaction.ts | 103 --- .../deep-research-agent-config.ts | 39 - .../models/interactions/document-content.ts | 38 - .../models/interactions/document-delta.ts | 23 - .../interactions/dynamic-agent-config.ts | 19 - src/gaos/models/interactions/empty.ts | 24 - ...ironment-network-egress-allowlist-union.ts | 35 - src/gaos/models/interactions/environment.ts | 33 - src/gaos/models/interactions/error-event.ts | 43 - src/gaos/models/interactions/error.ts | 25 - src/gaos/models/interactions/file-citation.ts | 54 -- .../interactions/file-search-call-delta.ts | 19 - .../interactions/file-search-call-step.ts | 26 - .../interactions/file-search-result-delta.ts | 22 - .../interactions/file-search-result-step.ts | 26 - .../models/interactions/file-search-result.ts | 16 - src/gaos/models/interactions/file-search.ts | 30 - .../models/interactions/function-call-step.ts | 34 - .../interactions/function-result-delta.ts | 31 - .../interactions/function-result-step.ts | 50 -- src/gaos/models/interactions/function.ts | 30 - .../models/interactions/generation-config.ts | 63 -- .../google-maps-call-arguments.ts | 21 - .../interactions/google-maps-call-delta.ts | 25 - .../interactions/google-maps-call-step.ts | 32 - .../interactions/google-maps-result-delta.ts | 25 - .../interactions/google-maps-result-places.ts | 20 - .../interactions/google-maps-result-step.ts | 29 - .../models/interactions/google-maps-result.ts | 21 - src/gaos/models/interactions/google-maps.ts | 33 - .../google-search-call-arguments.ts | 21 - .../interactions/google-search-call-delta.ts | 25 - .../interactions/google-search-call-step.ts | 45 - .../google-search-result-delta.ts | 23 - .../interactions/google-search-result-step.ts | 36 - .../interactions/google-search-result.ts | 21 - src/gaos/models/interactions/google-search.ts | 28 - .../interactions/grounding-tool-count.ts | 34 - src/gaos/models/interactions/image-config.ts | 38 - src/gaos/models/interactions/image-content.ts | 47 -- src/gaos/models/interactions/image-delta.ts | 32 - .../interactions/image-response-format.ts | 74 -- src/gaos/models/interactions/index.ts | 129 --- .../interaction-completed-event.ts | 32 - .../interactions/interaction-created-event.ts | 32 - .../interaction-sse-event-interaction.ts | 74 -- .../interactions/interaction-sse-event.ts | 28 - .../interaction-sse-stream-event.ts | 17 - .../interactions/interaction-status-update.ts | 50 -- src/gaos/models/interactions/interaction.ts | 189 ----- .../models/interactions/interactions-input.ts | 19 - .../mcp-server-tool-call-delta.ts | 22 - .../interactions/mcp-server-tool-call-step.ts | 38 - .../mcp-server-tool-result-delta.ts | 31 - .../mcp-server-tool-result-step.ts | 50 -- src/gaos/models/interactions/mcp-server.ts | 39 - .../models/interactions/media-resolution.ts | 18 - .../models/interactions/modality-tokens.ts | 24 - .../models/interactions/model-output-step.ts | 21 - src/gaos/models/interactions/model.ts | 37 - .../models/interactions/place-citation.ts | 51 -- .../models/interactions/response-format.ts | 21 - .../models/interactions/response-modality.ts | 19 - src/gaos/models/interactions/retrieval.ts | 30 - .../models/interactions/review-snippet.ts | 32 - src/gaos/models/interactions/service-tier.ts | 13 - src/gaos/models/interactions/source.ts | 45 - src/gaos/models/interactions/speech-config.ts | 29 - .../models/interactions/step-delta-data.ts | 58 -- .../interactions/step-delta-metadata.ts | 23 - src/gaos/models/interactions/step-delta.ts | 31 - src/gaos/models/interactions/step-start.ts | 44 - src/gaos/models/interactions/step-stop.ts | 39 - src/gaos/models/interactions/step.ts | 51 -- .../interactions/text-annotation-delta.ts | 21 - src/gaos/models/interactions/text-content.ts | 28 - src/gaos/models/interactions/text-delta.ts | 16 - .../interactions/text-response-format.ts | 37 - .../models/interactions/thinking-level.ts | 18 - .../models/interactions/thinking-summaries.ts | 13 - .../interactions/thought-signature-delta.ts | 19 - src/gaos/models/interactions/thought-step.ts | 28 - .../interactions/thought-summary-content.ts | 16 - .../interactions/thought-summary-delta.ts | 18 - .../models/interactions/tool-choice-config.ts | 23 - .../models/interactions/tool-choice-type.ts | 18 - src/gaos/models/interactions/tool.ts | 35 - src/gaos/models/interactions/url-citation.ts | 38 - .../url-context-call-arguments.ts | 21 - .../interactions/url-context-call-delta.ts | 25 - .../interactions/url-context-call-step.ts | 40 - .../interactions/url-context-result-delta.ts | 23 - .../interactions/url-context-result-step.ts | 36 - .../models/interactions/url-context-result.ts | 35 - src/gaos/models/interactions/url-context.ts | 18 - src/gaos/models/interactions/usage.ts | 67 -- .../models/interactions/user-input-step.ts | 21 - .../interactions/vertex-ai-search-config.ts | 25 - src/gaos/models/interactions/video-content.ts | 48 -- src/gaos/models/interactions/video-delta.ts | 33 - .../models/interactions/webhook-config.ts | 31 - .../operations/cancel-interaction-by-id.ts | 29 - src/gaos/models/operations/create-agent.ts | 31 - .../models/operations/create-interaction.ts | 45 - src/gaos/models/operations/create-webhook.ts | 31 - src/gaos/models/operations/delete-agent.ts | 26 - .../models/operations/delete-interaction.ts | 29 - src/gaos/models/operations/delete-webhook.ts | 32 - src/gaos/models/operations/get-agent.ts | 26 - .../operations/get-interaction-by-id.ts | 50 -- src/gaos/models/operations/get-webhook.ts | 29 - src/gaos/models/operations/index.ts | 28 - src/gaos/models/operations/list-agents.ts | 28 - src/gaos/models/operations/list-webhooks.ts | 40 - src/gaos/models/operations/method-params.ts | 144 ---- src/gaos/models/operations/ping-webhook.ts | 38 - .../operations/rotate-signing-secret.ts | 38 - src/gaos/models/operations/update-webhook.ts | 39 - src/gaos/models/security.ts | 26 - src/gaos/models/webhooks/index.ts | 20 - .../models/webhooks/ping-webhook-request.ts | 16 - .../webhooks/rotate-signing-secret-request.ts | 28 - src/gaos/models/webhooks/signing-secret.ts | 25 - .../models/webhooks/webhook-list-response.ts | 30 - .../models/webhooks/webhook-ping-response.ts | 16 - .../webhook-rotate-signing-secret-response.ts | 21 - src/gaos/models/webhooks/webhook-update.ts | 58 -- src/gaos/models/webhooks/webhook.ts | 112 --- src/gaos/resources.ts | 713 ---------------- src/gaos/sdk/agents.ts | 93 --- src/gaos/sdk/index.ts | 13 - src/gaos/sdk/interactions.ts | 148 ---- src/gaos/sdk/sdk.ts | 33 - src/gaos/sdk/webhooks.ts | 154 ---- src/gaos/types/async.ts | 132 --- src/gaos/types/blobs.ts | 31 - src/gaos/types/fp.ts | 58 -- src/gaos/types/index.ts | 16 - src/gaos/types/operations.ts | 113 --- src/gaos/types/rfcdate.ts | 62 -- src/gaos/types/streams.ts | 29 - 218 files changed, 679 insertions(+), 14734 deletions(-) delete mode 100644 src/gaos/OWNERS delete mode 100644 src/gaos/core.ts delete mode 100644 src/gaos/funcs/agents-create.ts delete mode 100644 src/gaos/funcs/agents-delete.ts delete mode 100644 src/gaos/funcs/agents-get.ts delete mode 100644 src/gaos/funcs/agents-list.ts delete mode 100644 src/gaos/funcs/interactions-cancel.ts delete mode 100644 src/gaos/funcs/interactions-create.ts delete mode 100644 src/gaos/funcs/interactions-delete.ts delete mode 100644 src/gaos/funcs/interactions-get.ts delete mode 100644 src/gaos/funcs/webhooks-create.ts delete mode 100644 src/gaos/funcs/webhooks-delete.ts delete mode 100644 src/gaos/funcs/webhooks-get.ts delete mode 100644 src/gaos/funcs/webhooks-list.ts delete mode 100644 src/gaos/funcs/webhooks-ping.ts delete mode 100644 src/gaos/funcs/webhooks-rotate-signing-secret.ts delete mode 100644 src/gaos/funcs/webhooks-update.ts delete mode 100644 src/gaos/google-genai.ts delete mode 100644 src/gaos/hooks/google-genai-auth.ts delete mode 100644 src/gaos/hooks/hooks.ts delete mode 100644 src/gaos/hooks/index.ts delete mode 100644 src/gaos/hooks/registration.ts delete mode 100644 src/gaos/hooks/types.ts delete mode 100644 src/gaos/index.ts delete mode 100644 src/gaos/lib/base64.ts delete mode 100644 src/gaos/lib/config.ts delete mode 100644 src/gaos/lib/encodings.ts delete mode 100644 src/gaos/lib/env.ts delete mode 100644 src/gaos/lib/event-streams.ts delete mode 100644 src/gaos/lib/files.ts delete mode 100644 src/gaos/lib/http.ts delete mode 100644 src/gaos/lib/logger.ts delete mode 100644 src/gaos/lib/matchers.ts delete mode 100644 src/gaos/lib/primitives.ts delete mode 100644 src/gaos/lib/retries.ts delete mode 100644 src/gaos/lib/sdks.ts delete mode 100644 src/gaos/lib/security.ts delete mode 100644 src/gaos/lib/url.ts delete mode 100644 src/gaos/models/agents/agent-list-response.ts delete mode 100644 src/gaos/models/agents/agent-tool.ts delete mode 100644 src/gaos/models/agents/agent.ts delete mode 100644 src/gaos/models/agents/index.ts delete mode 100644 src/gaos/models/errors/cancel-interaction-by-id.ts delete mode 100644 src/gaos/models/errors/create-interaction.ts delete mode 100644 src/gaos/models/errors/delete-interaction.ts delete mode 100644 src/gaos/models/errors/get-interaction-by-id.ts delete mode 100644 src/gaos/models/errors/google-gen-ai-default-error.ts delete mode 100644 src/gaos/models/errors/google-gen-ai-error.ts delete mode 100644 src/gaos/models/errors/http-client-errors.ts delete mode 100644 src/gaos/models/errors/index.ts delete mode 100644 src/gaos/models/index.ts delete mode 100644 src/gaos/models/interactions/agent-option.ts delete mode 100644 src/gaos/models/interactions/allowed-tools.ts delete mode 100644 src/gaos/models/interactions/allowlist-entry.ts delete mode 100644 src/gaos/models/interactions/annotation.ts delete mode 100644 src/gaos/models/interactions/arguments-delta.ts delete mode 100644 src/gaos/models/interactions/audio-content.ts delete mode 100644 src/gaos/models/interactions/audio-delta.ts delete mode 100644 src/gaos/models/interactions/audio-response-format.ts delete mode 100644 src/gaos/models/interactions/code-execution-call-arguments.ts delete mode 100644 src/gaos/models/interactions/code-execution-call-delta.ts delete mode 100644 src/gaos/models/interactions/code-execution-call-step.ts delete mode 100644 src/gaos/models/interactions/code-execution-result-delta.ts delete mode 100644 src/gaos/models/interactions/code-execution-result-step.ts delete mode 100644 src/gaos/models/interactions/code-execution.ts delete mode 100644 src/gaos/models/interactions/computer-use.ts delete mode 100644 src/gaos/models/interactions/content.ts delete mode 100644 src/gaos/models/interactions/create-agent-interaction.ts delete mode 100644 src/gaos/models/interactions/create-model-interaction.ts delete mode 100644 src/gaos/models/interactions/deep-research-agent-config.ts delete mode 100644 src/gaos/models/interactions/document-content.ts delete mode 100644 src/gaos/models/interactions/document-delta.ts delete mode 100644 src/gaos/models/interactions/dynamic-agent-config.ts delete mode 100644 src/gaos/models/interactions/empty.ts delete mode 100644 src/gaos/models/interactions/environment-network-egress-allowlist-union.ts delete mode 100644 src/gaos/models/interactions/environment.ts delete mode 100644 src/gaos/models/interactions/error-event.ts delete mode 100644 src/gaos/models/interactions/error.ts delete mode 100644 src/gaos/models/interactions/file-citation.ts delete mode 100644 src/gaos/models/interactions/file-search-call-delta.ts delete mode 100644 src/gaos/models/interactions/file-search-call-step.ts delete mode 100644 src/gaos/models/interactions/file-search-result-delta.ts delete mode 100644 src/gaos/models/interactions/file-search-result-step.ts delete mode 100644 src/gaos/models/interactions/file-search-result.ts delete mode 100644 src/gaos/models/interactions/file-search.ts delete mode 100644 src/gaos/models/interactions/function-call-step.ts delete mode 100644 src/gaos/models/interactions/function-result-delta.ts delete mode 100644 src/gaos/models/interactions/function-result-step.ts delete mode 100644 src/gaos/models/interactions/function.ts delete mode 100644 src/gaos/models/interactions/generation-config.ts delete mode 100644 src/gaos/models/interactions/google-maps-call-arguments.ts delete mode 100644 src/gaos/models/interactions/google-maps-call-delta.ts delete mode 100644 src/gaos/models/interactions/google-maps-call-step.ts delete mode 100644 src/gaos/models/interactions/google-maps-result-delta.ts delete mode 100644 src/gaos/models/interactions/google-maps-result-places.ts delete mode 100644 src/gaos/models/interactions/google-maps-result-step.ts delete mode 100644 src/gaos/models/interactions/google-maps-result.ts delete mode 100644 src/gaos/models/interactions/google-maps.ts delete mode 100644 src/gaos/models/interactions/google-search-call-arguments.ts delete mode 100644 src/gaos/models/interactions/google-search-call-delta.ts delete mode 100644 src/gaos/models/interactions/google-search-call-step.ts delete mode 100644 src/gaos/models/interactions/google-search-result-delta.ts delete mode 100644 src/gaos/models/interactions/google-search-result-step.ts delete mode 100644 src/gaos/models/interactions/google-search-result.ts delete mode 100644 src/gaos/models/interactions/google-search.ts delete mode 100644 src/gaos/models/interactions/grounding-tool-count.ts delete mode 100644 src/gaos/models/interactions/image-config.ts delete mode 100644 src/gaos/models/interactions/image-content.ts delete mode 100644 src/gaos/models/interactions/image-delta.ts delete mode 100644 src/gaos/models/interactions/image-response-format.ts delete mode 100644 src/gaos/models/interactions/index.ts delete mode 100644 src/gaos/models/interactions/interaction-completed-event.ts delete mode 100644 src/gaos/models/interactions/interaction-created-event.ts delete mode 100644 src/gaos/models/interactions/interaction-sse-event-interaction.ts delete mode 100644 src/gaos/models/interactions/interaction-sse-event.ts delete mode 100644 src/gaos/models/interactions/interaction-sse-stream-event.ts delete mode 100644 src/gaos/models/interactions/interaction-status-update.ts delete mode 100644 src/gaos/models/interactions/interaction.ts delete mode 100644 src/gaos/models/interactions/interactions-input.ts delete mode 100644 src/gaos/models/interactions/mcp-server-tool-call-delta.ts delete mode 100644 src/gaos/models/interactions/mcp-server-tool-call-step.ts delete mode 100644 src/gaos/models/interactions/mcp-server-tool-result-delta.ts delete mode 100644 src/gaos/models/interactions/mcp-server-tool-result-step.ts delete mode 100644 src/gaos/models/interactions/mcp-server.ts delete mode 100644 src/gaos/models/interactions/media-resolution.ts delete mode 100644 src/gaos/models/interactions/modality-tokens.ts delete mode 100644 src/gaos/models/interactions/model-output-step.ts delete mode 100644 src/gaos/models/interactions/model.ts delete mode 100644 src/gaos/models/interactions/place-citation.ts delete mode 100644 src/gaos/models/interactions/response-format.ts delete mode 100644 src/gaos/models/interactions/response-modality.ts delete mode 100644 src/gaos/models/interactions/retrieval.ts delete mode 100644 src/gaos/models/interactions/review-snippet.ts delete mode 100644 src/gaos/models/interactions/service-tier.ts delete mode 100644 src/gaos/models/interactions/source.ts delete mode 100644 src/gaos/models/interactions/speech-config.ts delete mode 100644 src/gaos/models/interactions/step-delta-data.ts delete mode 100644 src/gaos/models/interactions/step-delta-metadata.ts delete mode 100644 src/gaos/models/interactions/step-delta.ts delete mode 100644 src/gaos/models/interactions/step-start.ts delete mode 100644 src/gaos/models/interactions/step-stop.ts delete mode 100644 src/gaos/models/interactions/step.ts delete mode 100644 src/gaos/models/interactions/text-annotation-delta.ts delete mode 100644 src/gaos/models/interactions/text-content.ts delete mode 100644 src/gaos/models/interactions/text-delta.ts delete mode 100644 src/gaos/models/interactions/text-response-format.ts delete mode 100644 src/gaos/models/interactions/thinking-level.ts delete mode 100644 src/gaos/models/interactions/thinking-summaries.ts delete mode 100644 src/gaos/models/interactions/thought-signature-delta.ts delete mode 100644 src/gaos/models/interactions/thought-step.ts delete mode 100644 src/gaos/models/interactions/thought-summary-content.ts delete mode 100644 src/gaos/models/interactions/thought-summary-delta.ts delete mode 100644 src/gaos/models/interactions/tool-choice-config.ts delete mode 100644 src/gaos/models/interactions/tool-choice-type.ts delete mode 100644 src/gaos/models/interactions/tool.ts delete mode 100644 src/gaos/models/interactions/url-citation.ts delete mode 100644 src/gaos/models/interactions/url-context-call-arguments.ts delete mode 100644 src/gaos/models/interactions/url-context-call-delta.ts delete mode 100644 src/gaos/models/interactions/url-context-call-step.ts delete mode 100644 src/gaos/models/interactions/url-context-result-delta.ts delete mode 100644 src/gaos/models/interactions/url-context-result-step.ts delete mode 100644 src/gaos/models/interactions/url-context-result.ts delete mode 100644 src/gaos/models/interactions/url-context.ts delete mode 100644 src/gaos/models/interactions/usage.ts delete mode 100644 src/gaos/models/interactions/user-input-step.ts delete mode 100644 src/gaos/models/interactions/vertex-ai-search-config.ts delete mode 100644 src/gaos/models/interactions/video-content.ts delete mode 100644 src/gaos/models/interactions/video-delta.ts delete mode 100644 src/gaos/models/interactions/webhook-config.ts delete mode 100644 src/gaos/models/operations/cancel-interaction-by-id.ts delete mode 100644 src/gaos/models/operations/create-agent.ts delete mode 100644 src/gaos/models/operations/create-interaction.ts delete mode 100644 src/gaos/models/operations/create-webhook.ts delete mode 100644 src/gaos/models/operations/delete-agent.ts delete mode 100644 src/gaos/models/operations/delete-interaction.ts delete mode 100644 src/gaos/models/operations/delete-webhook.ts delete mode 100644 src/gaos/models/operations/get-agent.ts delete mode 100644 src/gaos/models/operations/get-interaction-by-id.ts delete mode 100644 src/gaos/models/operations/get-webhook.ts delete mode 100644 src/gaos/models/operations/index.ts delete mode 100644 src/gaos/models/operations/list-agents.ts delete mode 100644 src/gaos/models/operations/list-webhooks.ts delete mode 100644 src/gaos/models/operations/method-params.ts delete mode 100644 src/gaos/models/operations/ping-webhook.ts delete mode 100644 src/gaos/models/operations/rotate-signing-secret.ts delete mode 100644 src/gaos/models/operations/update-webhook.ts delete mode 100644 src/gaos/models/security.ts delete mode 100644 src/gaos/models/webhooks/index.ts delete mode 100644 src/gaos/models/webhooks/ping-webhook-request.ts delete mode 100644 src/gaos/models/webhooks/rotate-signing-secret-request.ts delete mode 100644 src/gaos/models/webhooks/signing-secret.ts delete mode 100644 src/gaos/models/webhooks/webhook-list-response.ts delete mode 100644 src/gaos/models/webhooks/webhook-ping-response.ts delete mode 100644 src/gaos/models/webhooks/webhook-rotate-signing-secret-response.ts delete mode 100644 src/gaos/models/webhooks/webhook-update.ts delete mode 100644 src/gaos/models/webhooks/webhook.ts delete mode 100644 src/gaos/resources.ts delete mode 100644 src/gaos/sdk/agents.ts delete mode 100644 src/gaos/sdk/index.ts delete mode 100644 src/gaos/sdk/interactions.ts delete mode 100644 src/gaos/sdk/sdk.ts delete mode 100644 src/gaos/sdk/webhooks.ts delete mode 100644 src/gaos/types/async.ts delete mode 100644 src/gaos/types/blobs.ts delete mode 100644 src/gaos/types/fp.ts delete mode 100644 src/gaos/types/index.ts delete mode 100644 src/gaos/types/operations.ts delete mode 100644 src/gaos/types/rfcdate.ts delete mode 100644 src/gaos/types/streams.ts diff --git a/.prettierignore b/.prettierignore index 6e02530dd8..90f53fa213 100644 --- a/.prettierignore +++ b/.prettierignore @@ -11,5 +11,3 @@ dist-private/** # Ignore interactions files: src/interactions/** src/interactions-private/** -src/gaos/** -src/gaos-private/** diff --git a/api-report/genai-node.api.md b/api-report/genai-node.api.md index bd8ed95a69..0f01aeb2b1 100644 --- a/api-report/genai-node.api.md +++ b/api-report/genai-node.api.md @@ -4,6 +4,8 @@ ```ts +/// + import type { Client } from '@modelcontextprotocol/sdk/client/index.js'; import { GoogleAuthOptions } from 'google-auth-library'; import { ReadableStream as ReadableStream_2 } from 'stream/web'; diff --git a/api-report/genai-web.api.md b/api-report/genai-web.api.md index bd8ed95a69..0f01aeb2b1 100644 --- a/api-report/genai-web.api.md +++ b/api-report/genai-web.api.md @@ -4,6 +4,8 @@ ```ts +/// + import type { Client } from '@modelcontextprotocol/sdk/client/index.js'; import { GoogleAuthOptions } from 'google-auth-library'; import { ReadableStream as ReadableStream_2 } from 'stream/web'; diff --git a/api-report/genai.api.md b/api-report/genai.api.md index bd8ed95a69..0f01aeb2b1 100644 --- a/api-report/genai.api.md +++ b/api-report/genai.api.md @@ -4,6 +4,8 @@ ```ts +/// + import type { Client } from '@modelcontextprotocol/sdk/client/index.js'; import { GoogleAuthOptions } from 'google-auth-library'; import { ReadableStream as ReadableStream_2 } from 'stream/web'; diff --git a/eslint.config.mjs b/eslint.config.mjs index dcd9338161..1fe2dd2848 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -10,8 +10,6 @@ export default [ 'dist/**', 'src/interactions/**', 'src/interactions-private/**', - 'src/gaos/**', - 'src/gaos-private/**', ], }, { diff --git a/package-lock.json b/package-lock.json index 29bf012c45..1030ad23f2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -44,7 +44,7 @@ "tslib": "^2.8.1", "tsx": "^4.19.4", "typedoc": "^0.27.0", - "typescript": "~5.7.3", + "typescript": "~5.4.0", "typescript-eslint": "8.24.1", "undici": "^7.16.0", "undici-types": "^7.16.0", @@ -9847,11 +9847,10 @@ } }, "node_modules/typescript": { - "version": "5.7.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.3.tgz", - "integrity": "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==", + "version": "5.4.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", + "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", "dev": true, - "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" diff --git a/package.json b/package.json index e95e97b4ab..bf7f991418 100644 --- a/package.json +++ b/package.json @@ -150,7 +150,7 @@ "tslib": "^2.8.1", "tsx": "^4.19.4", "typedoc": "^0.27.0", - "typescript": "~5.7.3", + "typescript": "~5.4.0", "typescript-eslint": "8.24.1", "undici": "^7.16.0", "undici-types": "^7.16.0", diff --git a/sdk-samples/package-lock.json b/sdk-samples/package-lock.json index 0838cfbb30..2dffbc5dac 100644 --- a/sdk-samples/package-lock.json +++ b/sdk-samples/package-lock.json @@ -11,6 +11,7 @@ "license": "Apache-2.0", "dependencies": { "@google/genai": "file:..", + "@modelcontextprotocol/sdk": "^1.29.0", "cors": "^2.8.5", "express": "^4.21.2", "google-auth-library": "^10.6.2", @@ -24,7 +25,7 @@ }, "..": { "name": "@google/genai", - "version": "2.8.0", + "version": "2.0.1", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { @@ -62,7 +63,7 @@ "tslib": "^2.8.1", "tsx": "^4.19.4", "typedoc": "^0.27.0", - "typescript": "~5.7.3", + "typescript": "~5.4.0", "typescript-eslint": "8.24.1", "undici": "^7.16.0", "undici-types": "^7.16.0", @@ -527,6 +528,343 @@ "resolved": "..", "link": true }, + "node_modules/@hono/node-server": { + "version": "1.19.14", + "resolved": "https://registry.npmjs.org/@hono/node-server/-/node-server-1.19.14.tgz", + "integrity": "sha512-GwtvgtXxnWsucXvbQXkRgqksiH2Qed37H9xHZocE5sA3N8O8O8/8FA3uclQXxXVzc9XBZuEOMK7+r02FmSpHtw==", + "license": "MIT", + "engines": { + "node": ">=18.14.1" + }, + "peerDependencies": { + "hono": "^4" + } + }, + "node_modules/@modelcontextprotocol/sdk": { + "version": "1.29.0", + "resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.29.0.tgz", + "integrity": "sha512-zo37mZA9hJWpULgkRpowewez1y6ML5GsXJPY8FI0tBBCd77HEvza4jDqRKOXgHNn867PVGCyTdzqpz0izu5ZjQ==", + "license": "MIT", + "dependencies": { + "@hono/node-server": "^1.19.9", + "ajv": "^8.17.1", + "ajv-formats": "^3.0.1", + "content-type": "^1.0.5", + "cors": "^2.8.5", + "cross-spawn": "^7.0.5", + "eventsource": "^3.0.2", + "eventsource-parser": "^3.0.0", + "express": "^5.2.1", + "express-rate-limit": "^8.2.1", + "hono": "^4.11.4", + "jose": "^6.1.3", + "json-schema-typed": "^8.0.2", + "pkce-challenge": "^5.0.0", + "raw-body": "^3.0.0", + "zod": "^3.25 || ^4.0", + "zod-to-json-schema": "^3.25.1" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@cfworker/json-schema": "^4.1.1", + "zod": "^3.25 || ^4.0" + }, + "peerDependenciesMeta": { + "@cfworker/json-schema": { + "optional": true + }, + "zod": { + "optional": false + } + } + }, + "node_modules/@modelcontextprotocol/sdk/node_modules/accepts": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz", + "integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==", + "license": "MIT", + "dependencies": { + "mime-types": "^3.0.0", + "negotiator": "^1.0.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/@modelcontextprotocol/sdk/node_modules/body-parser": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.2.2.tgz", + "integrity": "sha512-oP5VkATKlNwcgvxi0vM0p/D3n2C3EReYVX+DNYs5TjZFn/oQt2j+4sVJtSMr18pdRr8wjTcBl6LoV+FUwzPmNA==", + "license": "MIT", + "dependencies": { + "bytes": "^3.1.2", + "content-type": "^1.0.5", + "debug": "^4.4.3", + "http-errors": "^2.0.0", + "iconv-lite": "^0.7.0", + "on-finished": "^2.4.1", + "qs": "^6.14.1", + "raw-body": "^3.0.1", + "type-is": "^2.0.1" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/@modelcontextprotocol/sdk/node_modules/content-disposition": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.1.0.tgz", + "integrity": "sha512-5jRCH9Z/+DRP7rkvY83B+yGIGX96OYdJmzngqnw2SBSxqCFPd0w2km3s5iawpGX8krnwSGmF0FW5Nhr0Hfai3g==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/@modelcontextprotocol/sdk/node_modules/cookie-signature": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.2.2.tgz", + "integrity": "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==", + "license": "MIT", + "engines": { + "node": ">=6.6.0" + } + }, + "node_modules/@modelcontextprotocol/sdk/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@modelcontextprotocol/sdk/node_modules/express": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/express/-/express-5.2.1.tgz", + "integrity": "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==", + "license": "MIT", + "dependencies": { + "accepts": "^2.0.0", + "body-parser": "^2.2.1", + "content-disposition": "^1.0.0", + "content-type": "^1.0.5", + "cookie": "^0.7.1", + "cookie-signature": "^1.2.1", + "debug": "^4.4.0", + "depd": "^2.0.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "finalhandler": "^2.1.0", + "fresh": "^2.0.0", + "http-errors": "^2.0.0", + "merge-descriptors": "^2.0.0", + "mime-types": "^3.0.0", + "on-finished": "^2.4.1", + "once": "^1.4.0", + "parseurl": "^1.3.3", + "proxy-addr": "^2.0.7", + "qs": "^6.14.0", + "range-parser": "^1.2.1", + "router": "^2.2.0", + "send": "^1.1.0", + "serve-static": "^2.2.0", + "statuses": "^2.0.1", + "type-is": "^2.0.1", + "vary": "^1.1.2" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/@modelcontextprotocol/sdk/node_modules/finalhandler": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-2.1.1.tgz", + "integrity": "sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "on-finished": "^2.4.1", + "parseurl": "^1.3.3", + "statuses": "^2.0.1" + }, + "engines": { + "node": ">= 18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/@modelcontextprotocol/sdk/node_modules/fresh": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-2.0.0.tgz", + "integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/@modelcontextprotocol/sdk/node_modules/iconv-lite": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.2.tgz", + "integrity": "sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/@modelcontextprotocol/sdk/node_modules/media-typer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.0.tgz", + "integrity": "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/@modelcontextprotocol/sdk/node_modules/merge-descriptors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-2.0.0.tgz", + "integrity": "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@modelcontextprotocol/sdk/node_modules/mime-db": { + "version": "1.54.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz", + "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/@modelcontextprotocol/sdk/node_modules/mime-types": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.2.tgz", + "integrity": "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==", + "license": "MIT", + "dependencies": { + "mime-db": "^1.54.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/@modelcontextprotocol/sdk/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/@modelcontextprotocol/sdk/node_modules/negotiator": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz", + "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/@modelcontextprotocol/sdk/node_modules/send": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/send/-/send-1.2.1.tgz", + "integrity": "sha512-1gnZf7DFcoIcajTjTwjwuDjzuz4PPcY2StKPlsGAQ1+YH20IRVrBaXSWmdjowTJ6u8Rc01PoYOGHXfP1mYcZNQ==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.3", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "fresh": "^2.0.0", + "http-errors": "^2.0.1", + "mime-types": "^3.0.2", + "ms": "^2.1.3", + "on-finished": "^2.4.1", + "range-parser": "^1.2.1", + "statuses": "^2.0.2" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/@modelcontextprotocol/sdk/node_modules/serve-static": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-2.2.1.tgz", + "integrity": "sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw==", + "license": "MIT", + "dependencies": { + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "parseurl": "^1.3.3", + "send": "^1.2.0" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/@modelcontextprotocol/sdk/node_modules/type-is": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.0.1.tgz", + "integrity": "sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw==", + "license": "MIT", + "dependencies": { + "content-type": "^1.0.5", + "media-typer": "^1.1.0", + "mime-types": "^3.0.0" + }, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/@socket.io/component-emitter": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.2.tgz", @@ -670,6 +1008,39 @@ "node": ">= 14" } }, + "node_modules/ajv": { + "version": "8.20.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.20.0.tgz", + "integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==", + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ajv-formats": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-3.0.1.tgz", + "integrity": "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==", + "license": "MIT", + "dependencies": { + "ajv": "^8.0.0" + }, + "peerDependencies": { + "ajv": "^8.0.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, "node_modules/array-flatten": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", @@ -865,6 +1236,20 @@ "url": "https://opencollective.com/express" } }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/data-uri-to-buffer": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz", @@ -1080,6 +1465,27 @@ "node": ">= 0.6" } }, + "node_modules/eventsource": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-3.0.7.tgz", + "integrity": "sha512-CRT1WTyuQoD771GW56XEZFQ/ZoSfWid1alKGDYMmkt2yl8UXrVR4pspqWNEcqKvVIzg6PAltWjxcSSPrboA4iA==", + "license": "MIT", + "dependencies": { + "eventsource-parser": "^3.0.1" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/eventsource-parser": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/eventsource-parser/-/eventsource-parser-3.0.8.tgz", + "integrity": "sha512-70QWGkr4snxr0OXLRWsFLeRBIRPuQOvt4s8QYjmUlmlkyTZkRqS7EDVRZtzU3TiyDbXSzaOeF0XUKy8PchzukQ==", + "license": "MIT", + "engines": { + "node": ">=18.0.0" + } + }, "node_modules/express": { "version": "4.22.1", "resolved": "https://registry.npmjs.org/express/-/express-4.22.1.tgz", @@ -1126,12 +1532,52 @@ "url": "https://opencollective.com/express" } }, + "node_modules/express-rate-limit": { + "version": "8.5.1", + "resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-8.5.1.tgz", + "integrity": "sha512-5O6KYmyJEpuPJV5hNTXKbAHWRqrzyu+OI3vUnSd2kXFubIVpG7ezpgxQy76Zo5GQZtrQBg86hF+CM/NX+cioiQ==", + "license": "MIT", + "dependencies": { + "ip-address": "^10.2.0" + }, + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://github.com/sponsors/express-rate-limit" + }, + "peerDependencies": { + "express": ">= 4.11" + } + }, "node_modules/extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", "license": "MIT" }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "license": "MIT" + }, + "node_modules/fast-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.2.tgz", + "integrity": "sha512-rVjf7ArG3LTk+FS6Yw81V1DLuZl1bRbNrev6Tmd/9RaroeeRRJhAt7jg/6YFxbvAQXUCavSoZhPPj6oOx+5KjQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "BSD-3-Clause" + }, "node_modules/fetch-blob": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz", @@ -1367,6 +1813,15 @@ "node": ">= 0.4" } }, + "node_modules/hono": { + "version": "4.12.18", + "resolved": "https://registry.npmjs.org/hono/-/hono-4.12.18.tgz", + "integrity": "sha512-RWzP96k/yv0PQfyXnWjs6zot20TqfpfsNXhOnev8d1InAxubW93L11/oNUc3tQqn2G0bSdAOBpX+2uDFHV7kdQ==", + "license": "MIT", + "engines": { + "node": ">=16.9.0" + } + }, "node_modules/http-errors": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz", @@ -1441,6 +1896,15 @@ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "license": "ISC" }, + "node_modules/ip-address": { + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.2.0.tgz", + "integrity": "sha512-/+S6j4E9AHvW9SWMSEY9Xfy66O5PWvVEJ08O0y5JGyEKQpojb0K0GKpz/v5HJ/G0vi3D2sjGK78119oXZeE0qA==", + "license": "MIT", + "engines": { + "node": ">= 12" + } + }, "node_modules/ipaddr.js": { "version": "1.9.1", "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", @@ -1450,6 +1914,27 @@ "node": ">= 0.10" } }, + "node_modules/is-promise": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz", + "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==", + "license": "MIT" + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "license": "ISC" + }, + "node_modules/jose": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/jose/-/jose-6.2.3.tgz", + "integrity": "sha512-YYVDInQKFJfR/xa3ojUTl8c2KoTwiL1R5Wg9YCydwH0x0B9grbzlg5HC7mMjCtUJjbQ/YnGEZIhI5tCgfTb4Hw==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/panva" + } + }, "node_modules/json-bigint": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz", @@ -1459,6 +1944,18 @@ "bignumber.js": "^9.0.0" } }, + "node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "license": "MIT" + }, + "node_modules/json-schema-typed": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/json-schema-typed/-/json-schema-typed-8.0.2.tgz", + "integrity": "sha512-fQhoXdcvc3V28x7C7BMs4P5+kNlgUURe2jmUT1T//oBRMDrqy1QPelJimwZGo7Hg9VPV3EQV5Bnq4hbFy2vetA==", + "license": "BSD-2-Clause" + }, "node_modules/jwa": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.1.tgz", @@ -1635,6 +2132,15 @@ "node": ">= 0.8" } }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, "node_modules/parseurl": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", @@ -1644,12 +2150,30 @@ "node": ">= 0.8" } }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/path-to-regexp": { "version": "0.1.13", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.13.tgz", "integrity": "sha512-A/AGNMFN3c8bOlvV9RreMdrv7jsmF9XIfDeCd87+I8RNg6s78BhJxMu69NEMHBSJFxKidViTEdruRwEk/WIKqA==", "license": "MIT" }, + "node_modules/pkce-challenge": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/pkce-challenge/-/pkce-challenge-5.0.1.tgz", + "integrity": "sha512-wQ0b/W4Fr01qtpHlqSqspcj3EhBvimsdh0KlHhH8HRZnMsEa0ea2fTULOXOS9ccQr3om+GcGRk4e+isrZWV8qQ==", + "license": "MIT", + "engines": { + "node": ">=16.20.0" + } + }, "node_modules/proxy-addr": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", @@ -1687,6 +2211,46 @@ "node": ">= 0.6" } }, + "node_modules/raw-body": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-3.0.2.tgz", + "integrity": "sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA==", + "license": "MIT", + "dependencies": { + "bytes": "~3.1.2", + "http-errors": "~2.0.1", + "iconv-lite": "~0.7.0", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/raw-body/node_modules/iconv-lite": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.2.tgz", + "integrity": "sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/resolve-pkg-maps": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", @@ -1697,6 +2261,55 @@ "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" } }, + "node_modules/router": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/router/-/router-2.2.0.tgz", + "integrity": "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.0", + "depd": "^2.0.0", + "is-promise": "^4.0.0", + "parseurl": "^1.3.3", + "path-to-regexp": "^8.0.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/router/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/router/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/router/node_modules/path-to-regexp": { + "version": "8.4.2", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.4.2.tgz", + "integrity": "sha512-qRcuIdP69NPm4qbACK+aDogI5CBDMi1jKe0ry5rSQJz8JVLsC7jV8XpiJjGRLLol3N+R5ihGYcrPLTno6pAdBA==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -1774,6 +2387,27 @@ "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", "license": "ISC" }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/side-channel": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", @@ -2049,6 +2683,27 @@ "node": ">= 8" } }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "license": "ISC" + }, "node_modules/ws": { "version": "8.18.3", "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.3.tgz", @@ -2078,6 +2733,15 @@ "funding": { "url": "https://github.com/sponsors/colinhacks" } + }, + "node_modules/zod-to-json-schema": { + "version": "3.25.2", + "resolved": "https://registry.npmjs.org/zod-to-json-schema/-/zod-to-json-schema-3.25.2.tgz", + "integrity": "sha512-O/PgfnpT1xKSDeQYSCfRI5Gy3hPf91mKVDuYLUHZJMiDFptvP41MSnWofm8dnCm0256ZNfZIM7DSzuSMAFnjHA==", + "license": "ISC", + "peerDependencies": { + "zod": "^3.25.28 || ^4" + } } } } diff --git a/sdk-samples/package.json b/sdk-samples/package.json index 36813433f3..85194bacba 100644 --- a/sdk-samples/package.json +++ b/sdk-samples/package.json @@ -12,6 +12,7 @@ }, "dependencies": { "@google/genai": "file:..", + "@modelcontextprotocol/sdk": "^1.29.0", "cors": "^2.8.5", "express": "^4.21.2", "google-auth-library": "^10.6.2", @@ -23,6 +24,7 @@ "tsx": "^4.19.0" }, "overrides": { + "@modelcontextprotocol/sdk": "$@modelcontextprotocol/sdk", "zod": "$zod" } } diff --git a/src/gaos/OWNERS b/src/gaos/OWNERS deleted file mode 100644 index da35fbc61a..0000000000 --- a/src/gaos/OWNERS +++ /dev/null @@ -1,4 +0,0 @@ -file://depot/google3/third_party/javascript/google_genai/OWNERS - -# Interactions API developers -file://depot/google3/labs/language/genai/interactions/OWNERS \ No newline at end of file diff --git a/src/gaos/core.ts b/src/gaos/core.ts deleted file mode 100644 index b84e9c9582..0000000000 --- a/src/gaos/core.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ClientSDK } from "./lib/sdks.js"; - -/** - * A minimal client to use when calling standalone SDK functions. Typically, an - * instance of this class would be instantiated once at the start of an - * application and passed around through some dependency injection mechanism to - * parts of an application that need to make SDK calls. - */ -export class GoogleGenAICore extends ClientSDK {} diff --git a/src/gaos/funcs/agents-create.ts b/src/gaos/funcs/agents-create.ts deleted file mode 100644 index 513f37e3a2..0000000000 --- a/src/gaos/funcs/agents-create.ts +++ /dev/null @@ -1,175 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { GoogleGenAICore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import * as agents from "../models/agents/index.js"; -import { GoogleGenAiError } from "../models/errors/google-gen-ai-error.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/http-client-errors.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Creates a new Agent (Typed version for SDK). - */ -export function agentsCreate( - client: GoogleGenAICore, - body: agents.Agent, - api_version?: string | undefined, - options?: RequestOptions, -): APIPromise< - Result< - agents.Agent, - | GoogleGenAiError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - > -> { - return new APIPromise($do( - client, - body, - api_version, - options, - )); -} - -async function $do( - client: GoogleGenAICore, - body: agents.Agent, - api_version?: string | undefined, - options?: RequestOptions, -): Promise< - [ - Result< - agents.Agent, - | GoogleGenAiError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - >, - APICall, - ] -> { - const input: operations.CreateAgentRequest = { - body: body, - api_version: api_version, - }; - - const payload = input; - const body$ = encodeJSON("body", payload.body, { explode: true }); - - const pathParams = { - api_version: encodeSimple( - "api_version", - payload.api_version ?? client._options.api_version, - { explode: false, charEncoding: "percent" }, - ), - }; - const path = pathToFunc("/{api_version}/agents")(pathParams); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const securityInput = await extractSecurity(client._options.security); - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - base_url: options?.server_url ?? client._baseURL ?? "", - operation_id: "CreateAgent", - o_auth2_scopes: null, - - resolved_security: requestSecurity, - - security_source: client._options.security, - retry_config: options?.retries - || client._options.retry_config - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 8000, - exponent: 2, - maxElapsedTime: 30000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retry_codes: options?.retry_codes || ["408", "409", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.server_url, - path: path, - headers: headers, - body: body$, - userAgent: client._options.user_agent, - timeout_ms: options?.timeout_ms || client._options.timeout_ms || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retry_config, - retryCodes: context.retry_codes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const [result] = await M.match< - agents.Agent, - | GoogleGenAiError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - >( - M.fail("4XX"), - M.fail("5XX"), - M.json("default"), - )(response, req); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/gaos/funcs/agents-delete.ts b/src/gaos/funcs/agents-delete.ts deleted file mode 100644 index 75551a3215..0000000000 --- a/src/gaos/funcs/agents-delete.ts +++ /dev/null @@ -1,178 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { GoogleGenAICore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { GoogleGenAiError } from "../models/errors/google-gen-ai-error.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/http-client-errors.js"; -import * as interactions from "../models/interactions/index.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Deletes an Agent. - */ -export function agentsDelete( - client: GoogleGenAICore, - id: string, - api_version?: string | undefined, - options?: Omit, -): APIPromise< - Result< - interactions.Empty, - | GoogleGenAiError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - > -> { - return new APIPromise($do( - client, - id, - api_version, - options, - )); -} - -async function $do( - client: GoogleGenAICore, - id: string, - api_version?: string | undefined, - options?: Omit, -): Promise< - [ - Result< - interactions.Empty, - | GoogleGenAiError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - >, - APICall, - ] -> { - const input: operations.DeleteAgentRequest = { - id: id, - api_version: api_version, - }; - - const payload = input; - const body = null; - - const pathParams = { - api_version: encodeSimple( - "api_version", - payload.api_version ?? client._options.api_version, - { explode: false, charEncoding: "percent" }, - ), - id: encodeSimple("id", payload.id, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/{api_version}/agents/{id}")(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const securityInput = await extractSecurity(client._options.security); - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - base_url: options?.server_url ?? client._baseURL ?? "", - operation_id: "DeleteAgent", - o_auth2_scopes: null, - - resolved_security: requestSecurity, - - security_source: client._options.security, - retry_config: options?.retries - || client._options.retry_config - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 8000, - exponent: 2, - maxElapsedTime: 30000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retry_codes: options?.retry_codes || ["408", "409", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "DELETE", - baseURL: options?.server_url, - path: path, - headers: headers, - body: body, - userAgent: client._options.user_agent, - timeout_ms: options?.timeout_ms || client._options.timeout_ms || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retry_config, - retryCodes: context.retry_codes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const [result] = await M.match< - interactions.Empty, - | GoogleGenAiError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - >( - M.fail("4XX"), - M.fail("5XX"), - M.json("default"), - )(response, req); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/gaos/funcs/agents-get.ts b/src/gaos/funcs/agents-get.ts deleted file mode 100644 index 21be363cf4..0000000000 --- a/src/gaos/funcs/agents-get.ts +++ /dev/null @@ -1,178 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { GoogleGenAICore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import * as agents from "../models/agents/index.js"; -import { GoogleGenAiError } from "../models/errors/google-gen-ai-error.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/http-client-errors.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Gets a specific Agent. - */ -export function agentsGet( - client: GoogleGenAICore, - id: string, - api_version?: string | undefined, - options?: Omit, -): APIPromise< - Result< - agents.Agent, - | GoogleGenAiError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - > -> { - return new APIPromise($do( - client, - id, - api_version, - options, - )); -} - -async function $do( - client: GoogleGenAICore, - id: string, - api_version?: string | undefined, - options?: Omit, -): Promise< - [ - Result< - agents.Agent, - | GoogleGenAiError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - >, - APICall, - ] -> { - const input: operations.GetAgentRequest = { - id: id, - api_version: api_version, - }; - - const payload = input; - const body = null; - - const pathParams = { - api_version: encodeSimple( - "api_version", - payload.api_version ?? client._options.api_version, - { explode: false, charEncoding: "percent" }, - ), - id: encodeSimple("id", payload.id, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/{api_version}/agents/{id}")(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const securityInput = await extractSecurity(client._options.security); - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - base_url: options?.server_url ?? client._baseURL ?? "", - operation_id: "GetAgent", - o_auth2_scopes: null, - - resolved_security: requestSecurity, - - security_source: client._options.security, - retry_config: options?.retries - || client._options.retry_config - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 8000, - exponent: 2, - maxElapsedTime: 30000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retry_codes: options?.retry_codes || ["408", "409", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.server_url, - path: path, - headers: headers, - body: body, - userAgent: client._options.user_agent, - timeout_ms: options?.timeout_ms || client._options.timeout_ms || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retry_config, - retryCodes: context.retry_codes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const [result] = await M.match< - agents.Agent, - | GoogleGenAiError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - >( - M.fail("4XX"), - M.fail("5XX"), - M.json("default"), - )(response, req); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/gaos/funcs/agents-list.ts b/src/gaos/funcs/agents-list.ts deleted file mode 100644 index 90d749e2be..0000000000 --- a/src/gaos/funcs/agents-list.ts +++ /dev/null @@ -1,189 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { GoogleGenAICore } from "../core.js"; -import { encodeFormQuery, encodeSimple } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import * as agents from "../models/agents/index.js"; -import { GoogleGenAiError } from "../models/errors/google-gen-ai-error.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/http-client-errors.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Lists all Agents. - */ -export function agentsList( - client: GoogleGenAICore, - api_version?: string | undefined, - parent?: string | undefined, - page_size?: number | undefined, - page_token?: string | undefined, - options?: Omit, -): APIPromise< - Result< - agents.AgentListResponse, - | GoogleGenAiError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - > -> { - return new APIPromise($do( - client, - api_version, - parent, - page_size, - page_token, - options, - )); -} - -async function $do( - client: GoogleGenAICore, - api_version?: string | undefined, - parent?: string | undefined, - page_size?: number | undefined, - page_token?: string | undefined, - options?: Omit, -): Promise< - [ - Result< - agents.AgentListResponse, - | GoogleGenAiError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - >, - APICall, - ] -> { - const input: operations.ListAgentsRequest | undefined = { - api_version: api_version, - parent: parent, - pageSize: page_size, - pageToken: page_token, - }; - - const payload = input; - const body = null; - - const pathParams = { - api_version: encodeSimple( - "api_version", - payload?.api_version ?? client._options.api_version, - { explode: false, charEncoding: "percent" }, - ), - }; - const path = pathToFunc("/{api_version}/agents")(pathParams); - - const query = encodeFormQuery({ - "pageSize": payload?.pageSize, - "pageToken": payload?.pageToken, - "parent": payload?.parent, - }); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const securityInput = await extractSecurity(client._options.security); - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - base_url: options?.server_url ?? client._baseURL ?? "", - operation_id: "ListAgents", - o_auth2_scopes: null, - - resolved_security: requestSecurity, - - security_source: client._options.security, - retry_config: options?.retries - || client._options.retry_config - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 8000, - exponent: 2, - maxElapsedTime: 30000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retry_codes: options?.retry_codes || ["408", "409", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.server_url, - path: path, - headers: headers, - query: query, - body: body, - userAgent: client._options.user_agent, - timeout_ms: options?.timeout_ms || client._options.timeout_ms || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retry_config, - retryCodes: context.retry_codes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const [result] = await M.match< - agents.AgentListResponse, - | GoogleGenAiError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - >( - M.fail("4XX"), - M.fail("5XX"), - M.json("default"), - )(response, req); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/gaos/funcs/interactions-cancel.ts b/src/gaos/funcs/interactions-cancel.ts deleted file mode 100644 index bba68b4ece..0000000000 --- a/src/gaos/funcs/interactions-cancel.ts +++ /dev/null @@ -1,200 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { GoogleGenAICore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { GoogleGenAiError } from "../models/errors/google-gen-ai-error.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/http-client-errors.js"; -import * as errors from "../models/errors/index.js"; -import * as interactions from "../models/interactions/index.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Canceling an interaction - * - * @remarks - * Cancels an interaction by id. This only applies to background interactions that are still running. - */ -export function interactionsCancel( - client: GoogleGenAICore, - id: string, - api_version?: string | undefined, - options?: Omit, -): APIPromise< - Result< - interactions.Interaction, - | errors.CancelInteractionByIdClientError - | errors.CancelInteractionByIdServerError - | GoogleGenAiError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - > -> { - return new APIPromise($do( - client, - id, - api_version, - options, - )); -} - -async function $do( - client: GoogleGenAICore, - id: string, - api_version?: string | undefined, - options?: Omit, -): Promise< - [ - Result< - interactions.Interaction, - | errors.CancelInteractionByIdClientError - | errors.CancelInteractionByIdServerError - | GoogleGenAiError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - >, - APICall, - ] -> { - const input: operations.CancelInteractionByIdRequest = { - id: id, - api_version: api_version, - }; - - const payload = input; - const body = null; - - const pathParams = { - api_version: encodeSimple( - "api_version", - payload.api_version ?? client._options.api_version, - { explode: false, charEncoding: "percent" }, - ), - id: encodeSimple("id", payload.id, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/{api_version}/interactions/{id}/cancel")( - pathParams, - ); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const securityInput = await extractSecurity(client._options.security); - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - base_url: options?.server_url ?? client._baseURL ?? "", - operation_id: "cancelInteractionById", - o_auth2_scopes: null, - - resolved_security: requestSecurity, - - security_source: client._options.security, - retry_config: options?.retries - || client._options.retry_config - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 8000, - exponent: 2, - maxElapsedTime: 30000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retry_codes: options?.retry_codes || ["408", "409", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.server_url, - path: path, - headers: headers, - body: body, - userAgent: client._options.user_agent, - timeout_ms: options?.timeout_ms || client._options.timeout_ms || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retry_config, - retryCodes: context.retry_codes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - httpMeta: { response: response, request: req }, - }; - - const [result] = await M.match< - interactions.Interaction, - | errors.CancelInteractionByIdClientError - | errors.CancelInteractionByIdServerError - | GoogleGenAiError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - >( - M.json(200), - M.jsonErr( - "4XX", - errors.CancelInteractionByIdClientError, - ), - M.jsonErr( - "5XX", - errors.CancelInteractionByIdServerError, - ), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/gaos/funcs/interactions-create.ts b/src/gaos/funcs/interactions-create.ts deleted file mode 100644 index 0849233b66..0000000000 --- a/src/gaos/funcs/interactions-create.ts +++ /dev/null @@ -1,252 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { GoogleGenAICore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { GoogleGenAiError } from "../models/errors/google-gen-ai-error.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/http-client-errors.js"; -import * as errors from "../models/errors/index.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Creating an interaction - * - * @remarks - * Creates a new interaction. - */ -export function interactionsCreate( - client: GoogleGenAICore, - body: operations.CreateInteractionRequestBody & { stream?: false }, - api_version?: string | undefined, - options?: RequestOptions, -): APIPromise< - Result< - operations.CreateInteractionResponse, - | errors.CreateInteractionClientError - | errors.CreateInteractionServerError - | GoogleGenAiError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - > ->; -export function interactionsCreate( - client: GoogleGenAICore, - body: operations.CreateInteractionRequestBody & { stream: true }, - api_version?: string | undefined, - options?: RequestOptions, -): APIPromise< - Result< - operations.CreateInteractionResponse, - | errors.CreateInteractionClientError - | errors.CreateInteractionServerError - | GoogleGenAiError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - > ->; -export function interactionsCreate( - client: GoogleGenAICore, - body: operations.CreateInteractionRequestBody, - api_version?: string | undefined, - options?: RequestOptions, -): APIPromise< - Result< - operations.CreateInteractionResponse, - | errors.CreateInteractionClientError - | errors.CreateInteractionServerError - | GoogleGenAiError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - > ->; -export function interactionsCreate( - client: GoogleGenAICore, - body: operations.CreateInteractionRequestBody, - api_version?: string | undefined, - options?: RequestOptions, -): APIPromise< - Result< - operations.CreateInteractionResponse, - | errors.CreateInteractionClientError - | errors.CreateInteractionServerError - | GoogleGenAiError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - > -> { - return new APIPromise($do( - client, - body, - api_version, - options, - )); -} - -async function $do( - client: GoogleGenAICore, - body: operations.CreateInteractionRequestBody, - api_version?: string | undefined, - options?: RequestOptions, -): Promise< - [ - Result< - operations.CreateInteractionResponse, - | errors.CreateInteractionClientError - | errors.CreateInteractionServerError - | GoogleGenAiError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - >, - APICall, - ] -> { - const input: operations.CreateInteractionRequest = { - body: body, - api_version: api_version, - }; - - const payload = input; - const body$ = encodeJSON("body", payload.body, { explode: true }); - - const pathParams = { - api_version: encodeSimple( - "api_version", - payload.api_version ?? client._options.api_version, - { explode: false, charEncoding: "percent" }, - ), - }; - const path = pathToFunc("/{api_version}/interactions")(pathParams); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: input?.body?.stream ? "text/event-stream" : "application/json", - })); - - const securityInput = await extractSecurity(client._options.security); - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - base_url: options?.server_url ?? client._baseURL ?? "", - operation_id: "CreateInteraction", - o_auth2_scopes: null, - - resolved_security: requestSecurity, - - security_source: client._options.security, - retry_config: options?.retries - || client._options.retry_config - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 8000, - exponent: 2, - maxElapsedTime: 30000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retry_codes: options?.retry_codes || ["408", "409", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.server_url, - path: path, - headers: headers, - body: body$, - userAgent: client._options.user_agent, - timeout_ms: options?.timeout_ms || client._options.timeout_ms || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retry_config, - retryCodes: context.retry_codes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - httpMeta: { response: response, request: req }, - }; - - const [result] = await M.match< - operations.CreateInteractionResponse, - | errors.CreateInteractionClientError - | errors.CreateInteractionServerError - | GoogleGenAiError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - >( - M.json(200), - M.sse(200, { - sentinel: "[DONE]", - flattened: true, - }), - M.jsonErr( - "4XX", - errors.CreateInteractionClientError, - ), - M.jsonErr( - "5XX", - errors.CreateInteractionServerError, - ), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/gaos/funcs/interactions-delete.ts b/src/gaos/funcs/interactions-delete.ts deleted file mode 100644 index 58cb8bbfef..0000000000 --- a/src/gaos/funcs/interactions-delete.ts +++ /dev/null @@ -1,197 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { GoogleGenAICore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { GoogleGenAiError } from "../models/errors/google-gen-ai-error.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/http-client-errors.js"; -import * as errors from "../models/errors/index.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Deleting an interaction - * - * @remarks - * Deletes the interaction by id. - */ -export function interactionsDelete( - client: GoogleGenAICore, - id: string, - api_version?: string | undefined, - options?: Omit, -): APIPromise< - Result< - void, - | errors.DeleteInteractionClientError - | errors.DeleteInteractionServerError - | GoogleGenAiError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - > -> { - return new APIPromise($do( - client, - id, - api_version, - options, - )); -} - -async function $do( - client: GoogleGenAICore, - id: string, - api_version?: string | undefined, - options?: Omit, -): Promise< - [ - Result< - void, - | errors.DeleteInteractionClientError - | errors.DeleteInteractionServerError - | GoogleGenAiError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - >, - APICall, - ] -> { - const input: operations.DeleteInteractionRequest = { - id: id, - api_version: api_version, - }; - - const payload = input; - const body = null; - - const pathParams = { - api_version: encodeSimple( - "api_version", - payload.api_version ?? client._options.api_version, - { explode: false, charEncoding: "percent" }, - ), - id: encodeSimple("id", payload.id, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/{api_version}/interactions/{id}")(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const securityInput = await extractSecurity(client._options.security); - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - base_url: options?.server_url ?? client._baseURL ?? "", - operation_id: "deleteInteraction", - o_auth2_scopes: null, - - resolved_security: requestSecurity, - - security_source: client._options.security, - retry_config: options?.retries - || client._options.retry_config - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 8000, - exponent: 2, - maxElapsedTime: 30000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retry_codes: options?.retry_codes || ["408", "409", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "DELETE", - baseURL: options?.server_url, - path: path, - headers: headers, - body: body, - userAgent: client._options.user_agent, - timeout_ms: options?.timeout_ms || client._options.timeout_ms || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retry_config, - retryCodes: context.retry_codes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - httpMeta: { response: response, request: req }, - }; - - const [result] = await M.match< - void, - | errors.DeleteInteractionClientError - | errors.DeleteInteractionServerError - | GoogleGenAiError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - >( - M.nil(200), - M.jsonErr( - "4XX", - errors.DeleteInteractionClientError, - ), - M.jsonErr( - "5XX", - errors.DeleteInteractionServerError, - ), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/gaos/funcs/interactions-get.ts b/src/gaos/funcs/interactions-get.ts deleted file mode 100644 index 6e0364ccce..0000000000 --- a/src/gaos/funcs/interactions-get.ts +++ /dev/null @@ -1,283 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { GoogleGenAICore } from "../core.js"; -import { encodeFormQuery, encodeSimple } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { GoogleGenAiError } from "../models/errors/google-gen-ai-error.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/http-client-errors.js"; -import * as errors from "../models/errors/index.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Retrieving an interaction - * - * @remarks - * Retrieves the full details of a single interaction based on its `Interaction.id`. - */ -export function interactionsGet( - client: GoogleGenAICore, - id: string, - stream?: false, - last_event_id?: string | undefined, - include_input?: boolean | undefined, - api_version?: string | undefined, - options?: Omit, -): APIPromise< - Result< - operations.GetInteractionByIdResponse, - | errors.GetInteractionByIdClientError - | errors.GetInteractionByIdServerError - | GoogleGenAiError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - > ->; -export function interactionsGet( - client: GoogleGenAICore, - id: string, - stream: true, - last_event_id?: string | undefined, - include_input?: boolean | undefined, - api_version?: string | undefined, - options?: Omit, -): APIPromise< - Result< - operations.GetInteractionByIdResponse, - | errors.GetInteractionByIdClientError - | errors.GetInteractionByIdServerError - | GoogleGenAiError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - > ->; -export function interactionsGet( - client: GoogleGenAICore, - id: string, - stream?: boolean | undefined, - last_event_id?: string | undefined, - include_input?: boolean | undefined, - api_version?: string | undefined, - options?: Omit, -): APIPromise< - Result< - operations.GetInteractionByIdResponse, - | errors.GetInteractionByIdClientError - | errors.GetInteractionByIdServerError - | GoogleGenAiError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - > ->; -export function interactionsGet( - client: GoogleGenAICore, - id: string, - stream?: boolean | undefined, - last_event_id?: string | undefined, - include_input?: boolean | undefined, - api_version?: string | undefined, - options?: Omit, -): APIPromise< - Result< - operations.GetInteractionByIdResponse, - | errors.GetInteractionByIdClientError - | errors.GetInteractionByIdServerError - | GoogleGenAiError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - > -> { - return new APIPromise($do( - client, - id, - stream, - last_event_id, - include_input, - api_version, - options, - )); -} - -async function $do( - client: GoogleGenAICore, - id: string, - stream?: boolean | undefined, - last_event_id?: string | undefined, - include_input?: boolean | undefined, - api_version?: string | undefined, - options?: Omit, -): Promise< - [ - Result< - operations.GetInteractionByIdResponse, - | errors.GetInteractionByIdClientError - | errors.GetInteractionByIdServerError - | GoogleGenAiError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - >, - APICall, - ] -> { - const input: operations.GetInteractionByIdRequest = { - id: id, - stream: stream, - last_event_id: last_event_id, - include_input: include_input, - api_version: api_version, - }; - - const payload = input; - const body = null; - - const pathParams = { - api_version: encodeSimple( - "api_version", - payload.api_version ?? client._options.api_version, - { explode: false, charEncoding: "percent" }, - ), - id: encodeSimple("id", payload.id, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/{api_version}/interactions/{id}")(pathParams); - - const query = encodeFormQuery({ - "include_input": payload.include_input, - "last_event_id": payload.last_event_id, - "stream": payload.stream, - }); - - const headers = new Headers(compactMap({ - Accept: input?.stream ? "text/event-stream" : "application/json", - })); - - const securityInput = await extractSecurity(client._options.security); - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - base_url: options?.server_url ?? client._baseURL ?? "", - operation_id: "getInteractionById", - o_auth2_scopes: null, - - resolved_security: requestSecurity, - - security_source: client._options.security, - retry_config: options?.retries - || client._options.retry_config - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 8000, - exponent: 2, - maxElapsedTime: 30000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retry_codes: options?.retry_codes || ["408", "409", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.server_url, - path: path, - headers: headers, - query: query, - body: body, - userAgent: client._options.user_agent, - timeout_ms: options?.timeout_ms || client._options.timeout_ms || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retry_config, - retryCodes: context.retry_codes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - httpMeta: { response: response, request: req }, - }; - - const [result] = await M.match< - operations.GetInteractionByIdResponse, - | errors.GetInteractionByIdClientError - | errors.GetInteractionByIdServerError - | GoogleGenAiError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - >( - M.json(200), - M.sse(200, { - sentinel: "[DONE]", - flattened: true, - }), - M.jsonErr( - "4XX", - errors.GetInteractionByIdClientError, - ), - M.jsonErr( - "5XX", - errors.GetInteractionByIdServerError, - ), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/gaos/funcs/webhooks-create.ts b/src/gaos/funcs/webhooks-create.ts deleted file mode 100644 index 6714f5bf0c..0000000000 --- a/src/gaos/funcs/webhooks-create.ts +++ /dev/null @@ -1,175 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { GoogleGenAICore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { GoogleGenAiError } from "../models/errors/google-gen-ai-error.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/http-client-errors.js"; -import * as operations from "../models/operations/index.js"; -import * as webhooks from "../models/webhooks/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Creates a new Webhook. - */ -export function webhooksCreate( - client: GoogleGenAICore, - body: webhooks.WebhookInput, - api_version?: string | undefined, - options?: RequestOptions, -): APIPromise< - Result< - webhooks.Webhook, - | GoogleGenAiError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - > -> { - return new APIPromise($do( - client, - body, - api_version, - options, - )); -} - -async function $do( - client: GoogleGenAICore, - body: webhooks.WebhookInput, - api_version?: string | undefined, - options?: RequestOptions, -): Promise< - [ - Result< - webhooks.Webhook, - | GoogleGenAiError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - >, - APICall, - ] -> { - const input: operations.CreateWebhookRequest = { - body: body, - api_version: api_version, - }; - - const payload = input; - const body$ = encodeJSON("body", payload.body, { explode: true }); - - const pathParams = { - api_version: encodeSimple( - "api_version", - payload.api_version ?? client._options.api_version, - { explode: false, charEncoding: "percent" }, - ), - }; - const path = pathToFunc("/{api_version}/webhooks")(pathParams); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const securityInput = await extractSecurity(client._options.security); - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - base_url: options?.server_url ?? client._baseURL ?? "", - operation_id: "CreateWebhook", - o_auth2_scopes: null, - - resolved_security: requestSecurity, - - security_source: client._options.security, - retry_config: options?.retries - || client._options.retry_config - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 8000, - exponent: 2, - maxElapsedTime: 30000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retry_codes: options?.retry_codes || ["408", "409", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.server_url, - path: path, - headers: headers, - body: body$, - userAgent: client._options.user_agent, - timeout_ms: options?.timeout_ms || client._options.timeout_ms || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retry_config, - retryCodes: context.retry_codes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const [result] = await M.match< - webhooks.Webhook, - | GoogleGenAiError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - >( - M.fail("4XX"), - M.fail("5XX"), - M.json("default"), - )(response, req); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/gaos/funcs/webhooks-delete.ts b/src/gaos/funcs/webhooks-delete.ts deleted file mode 100644 index f2c713e74e..0000000000 --- a/src/gaos/funcs/webhooks-delete.ts +++ /dev/null @@ -1,178 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { GoogleGenAICore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { GoogleGenAiError } from "../models/errors/google-gen-ai-error.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/http-client-errors.js"; -import * as interactions from "../models/interactions/index.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Deletes a Webhook. - */ -export function webhooksDelete( - client: GoogleGenAICore, - id: string, - api_version?: string | undefined, - options?: Omit, -): APIPromise< - Result< - interactions.Empty, - | GoogleGenAiError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - > -> { - return new APIPromise($do( - client, - id, - api_version, - options, - )); -} - -async function $do( - client: GoogleGenAICore, - id: string, - api_version?: string | undefined, - options?: Omit, -): Promise< - [ - Result< - interactions.Empty, - | GoogleGenAiError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - >, - APICall, - ] -> { - const input: operations.DeleteWebhookRequest = { - id: id, - api_version: api_version, - }; - - const payload = input; - const body = null; - - const pathParams = { - api_version: encodeSimple( - "api_version", - payload.api_version ?? client._options.api_version, - { explode: false, charEncoding: "percent" }, - ), - id: encodeSimple("id", payload.id, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/{api_version}/webhooks/{id}")(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const securityInput = await extractSecurity(client._options.security); - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - base_url: options?.server_url ?? client._baseURL ?? "", - operation_id: "DeleteWebhook", - o_auth2_scopes: null, - - resolved_security: requestSecurity, - - security_source: client._options.security, - retry_config: options?.retries - || client._options.retry_config - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 8000, - exponent: 2, - maxElapsedTime: 30000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retry_codes: options?.retry_codes || ["408", "409", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "DELETE", - baseURL: options?.server_url, - path: path, - headers: headers, - body: body, - userAgent: client._options.user_agent, - timeout_ms: options?.timeout_ms || client._options.timeout_ms || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retry_config, - retryCodes: context.retry_codes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const [result] = await M.match< - interactions.Empty, - | GoogleGenAiError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - >( - M.fail("4XX"), - M.fail("5XX"), - M.json("default"), - )(response, req); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/gaos/funcs/webhooks-get.ts b/src/gaos/funcs/webhooks-get.ts deleted file mode 100644 index cb81539857..0000000000 --- a/src/gaos/funcs/webhooks-get.ts +++ /dev/null @@ -1,178 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { GoogleGenAICore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { GoogleGenAiError } from "../models/errors/google-gen-ai-error.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/http-client-errors.js"; -import * as operations from "../models/operations/index.js"; -import * as webhooks from "../models/webhooks/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Gets a specific Webhook. - */ -export function webhooksGet( - client: GoogleGenAICore, - id: string, - api_version?: string | undefined, - options?: Omit, -): APIPromise< - Result< - webhooks.Webhook, - | GoogleGenAiError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - > -> { - return new APIPromise($do( - client, - id, - api_version, - options, - )); -} - -async function $do( - client: GoogleGenAICore, - id: string, - api_version?: string | undefined, - options?: Omit, -): Promise< - [ - Result< - webhooks.Webhook, - | GoogleGenAiError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - >, - APICall, - ] -> { - const input: operations.GetWebhookRequest = { - id: id, - api_version: api_version, - }; - - const payload = input; - const body = null; - - const pathParams = { - api_version: encodeSimple( - "api_version", - payload.api_version ?? client._options.api_version, - { explode: false, charEncoding: "percent" }, - ), - id: encodeSimple("id", payload.id, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/{api_version}/webhooks/{id}")(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const securityInput = await extractSecurity(client._options.security); - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - base_url: options?.server_url ?? client._baseURL ?? "", - operation_id: "GetWebhook", - o_auth2_scopes: null, - - resolved_security: requestSecurity, - - security_source: client._options.security, - retry_config: options?.retries - || client._options.retry_config - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 8000, - exponent: 2, - maxElapsedTime: 30000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retry_codes: options?.retry_codes || ["408", "409", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.server_url, - path: path, - headers: headers, - body: body, - userAgent: client._options.user_agent, - timeout_ms: options?.timeout_ms || client._options.timeout_ms || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retry_config, - retryCodes: context.retry_codes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const [result] = await M.match< - webhooks.Webhook, - | GoogleGenAiError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - >( - M.fail("4XX"), - M.fail("5XX"), - M.json("default"), - )(response, req); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/gaos/funcs/webhooks-list.ts b/src/gaos/funcs/webhooks-list.ts deleted file mode 100644 index 82c25976a8..0000000000 --- a/src/gaos/funcs/webhooks-list.ts +++ /dev/null @@ -1,184 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { GoogleGenAICore } from "../core.js"; -import { encodeFormQuery, encodeSimple } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { GoogleGenAiError } from "../models/errors/google-gen-ai-error.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/http-client-errors.js"; -import * as operations from "../models/operations/index.js"; -import * as webhooks from "../models/webhooks/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Lists all Webhooks. - */ -export function webhooksList( - client: GoogleGenAICore, - api_version?: string | undefined, - page_size?: number | undefined, - page_token?: string | undefined, - options?: Omit, -): APIPromise< - Result< - webhooks.WebhookListResponse, - | GoogleGenAiError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - > -> { - return new APIPromise($do( - client, - api_version, - page_size, - page_token, - options, - )); -} - -async function $do( - client: GoogleGenAICore, - api_version?: string | undefined, - page_size?: number | undefined, - page_token?: string | undefined, - options?: Omit, -): Promise< - [ - Result< - webhooks.WebhookListResponse, - | GoogleGenAiError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - >, - APICall, - ] -> { - const input: operations.ListWebhooksRequest | undefined = { - api_version: api_version, - page_size: page_size, - page_token: page_token, - }; - - const payload = input; - const body = null; - - const pathParams = { - api_version: encodeSimple( - "api_version", - payload?.api_version ?? client._options.api_version, - { explode: false, charEncoding: "percent" }, - ), - }; - const path = pathToFunc("/{api_version}/webhooks")(pathParams); - - const query = encodeFormQuery({ - "page_size": payload?.page_size, - "page_token": payload?.page_token, - }); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const securityInput = await extractSecurity(client._options.security); - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - base_url: options?.server_url ?? client._baseURL ?? "", - operation_id: "ListWebhooks", - o_auth2_scopes: null, - - resolved_security: requestSecurity, - - security_source: client._options.security, - retry_config: options?.retries - || client._options.retry_config - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 8000, - exponent: 2, - maxElapsedTime: 30000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retry_codes: options?.retry_codes || ["408", "409", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.server_url, - path: path, - headers: headers, - query: query, - body: body, - userAgent: client._options.user_agent, - timeout_ms: options?.timeout_ms || client._options.timeout_ms || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retry_config, - retryCodes: context.retry_codes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const [result] = await M.match< - webhooks.WebhookListResponse, - | GoogleGenAiError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - >( - M.fail("4XX"), - M.fail("5XX"), - M.json("default"), - )(response, req); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/gaos/funcs/webhooks-ping.ts b/src/gaos/funcs/webhooks-ping.ts deleted file mode 100644 index 88662ef76b..0000000000 --- a/src/gaos/funcs/webhooks-ping.ts +++ /dev/null @@ -1,183 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { GoogleGenAICore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { GoogleGenAiError } from "../models/errors/google-gen-ai-error.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/http-client-errors.js"; -import * as operations from "../models/operations/index.js"; -import * as webhooks from "../models/webhooks/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Sends a ping event to a Webhook. - */ -export function webhooksPing( - client: GoogleGenAICore, - id: string, - api_version?: string | undefined, - body?: webhooks.PingWebhookRequest | undefined, - options?: RequestOptions, -): APIPromise< - Result< - webhooks.WebhookPingResponse, - | GoogleGenAiError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - > -> { - return new APIPromise($do( - client, - id, - api_version, - body, - options, - )); -} - -async function $do( - client: GoogleGenAICore, - id: string, - api_version?: string | undefined, - body?: webhooks.PingWebhookRequest | undefined, - options?: RequestOptions, -): Promise< - [ - Result< - webhooks.WebhookPingResponse, - | GoogleGenAiError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - >, - APICall, - ] -> { - const input: operations.PingWebhookRequest = { - id: id, - api_version: api_version, - body: body, - }; - - const payload = input; - const body$ = encodeJSON("body", payload.body, { explode: true }); - - const pathParams = { - api_version: encodeSimple( - "api_version", - payload.api_version ?? client._options.api_version, - { explode: false, charEncoding: "percent" }, - ), - id: encodeSimple("id", payload.id, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/{api_version}/webhooks/{id}:ping")(pathParams); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const securityInput = await extractSecurity(client._options.security); - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - base_url: options?.server_url ?? client._baseURL ?? "", - operation_id: "PingWebhook", - o_auth2_scopes: null, - - resolved_security: requestSecurity, - - security_source: client._options.security, - retry_config: options?.retries - || client._options.retry_config - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 8000, - exponent: 2, - maxElapsedTime: 30000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retry_codes: options?.retry_codes || ["408", "409", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.server_url, - path: path, - headers: headers, - body: body$, - userAgent: client._options.user_agent, - timeout_ms: options?.timeout_ms || client._options.timeout_ms || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retry_config, - retryCodes: context.retry_codes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const [result] = await M.match< - webhooks.WebhookPingResponse, - | GoogleGenAiError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - >( - M.fail("4XX"), - M.fail("5XX"), - M.json("default"), - )(response, req); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/gaos/funcs/webhooks-rotate-signing-secret.ts b/src/gaos/funcs/webhooks-rotate-signing-secret.ts deleted file mode 100644 index dac1c23799..0000000000 --- a/src/gaos/funcs/webhooks-rotate-signing-secret.ts +++ /dev/null @@ -1,185 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { GoogleGenAICore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { GoogleGenAiError } from "../models/errors/google-gen-ai-error.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/http-client-errors.js"; -import * as operations from "../models/operations/index.js"; -import * as webhooks from "../models/webhooks/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Generates a new signing secret for a Webhook. - */ -export function webhooksRotateSigningSecret( - client: GoogleGenAICore, - id: string, - api_version?: string | undefined, - body?: webhooks.RotateSigningSecretRequest | undefined, - options?: RequestOptions, -): APIPromise< - Result< - webhooks.WebhookRotateSigningSecretResponse, - | GoogleGenAiError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - > -> { - return new APIPromise($do( - client, - id, - api_version, - body, - options, - )); -} - -async function $do( - client: GoogleGenAICore, - id: string, - api_version?: string | undefined, - body?: webhooks.RotateSigningSecretRequest | undefined, - options?: RequestOptions, -): Promise< - [ - Result< - webhooks.WebhookRotateSigningSecretResponse, - | GoogleGenAiError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - >, - APICall, - ] -> { - const input: operations.RotateSigningSecretRequest = { - id: id, - api_version: api_version, - body: body, - }; - - const payload = input; - const body$ = encodeJSON("body", payload.body, { explode: true }); - - const pathParams = { - api_version: encodeSimple( - "api_version", - payload.api_version ?? client._options.api_version, - { explode: false, charEncoding: "percent" }, - ), - id: encodeSimple("id", payload.id, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/{api_version}/webhooks/{id}:rotateSigningSecret")( - pathParams, - ); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const securityInput = await extractSecurity(client._options.security); - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - base_url: options?.server_url ?? client._baseURL ?? "", - operation_id: "RotateSigningSecret", - o_auth2_scopes: null, - - resolved_security: requestSecurity, - - security_source: client._options.security, - retry_config: options?.retries - || client._options.retry_config - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 8000, - exponent: 2, - maxElapsedTime: 30000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retry_codes: options?.retry_codes || ["408", "409", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.server_url, - path: path, - headers: headers, - body: body$, - userAgent: client._options.user_agent, - timeout_ms: options?.timeout_ms || client._options.timeout_ms || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retry_config, - retryCodes: context.retry_codes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const [result] = await M.match< - webhooks.WebhookRotateSigningSecretResponse, - | GoogleGenAiError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - >( - M.fail("4XX"), - M.fail("5XX"), - M.json("default"), - )(response, req); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/gaos/funcs/webhooks-update.ts b/src/gaos/funcs/webhooks-update.ts deleted file mode 100644 index fb447cbf34..0000000000 --- a/src/gaos/funcs/webhooks-update.ts +++ /dev/null @@ -1,192 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { GoogleGenAICore } from "../core.js"; -import { encodeFormQuery, encodeJSON, encodeSimple } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { GoogleGenAiError } from "../models/errors/google-gen-ai-error.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/http-client-errors.js"; -import * as operations from "../models/operations/index.js"; -import * as webhooks from "../models/webhooks/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Updates an existing Webhook. - */ -export function webhooksUpdate( - client: GoogleGenAICore, - id: string, - api_version?: string | undefined, - update_mask?: string | undefined, - body?: webhooks.WebhookUpdate | undefined, - options?: RequestOptions, -): APIPromise< - Result< - webhooks.Webhook, - | GoogleGenAiError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - > -> { - return new APIPromise($do( - client, - id, - api_version, - update_mask, - body, - options, - )); -} - -async function $do( - client: GoogleGenAICore, - id: string, - api_version?: string | undefined, - update_mask?: string | undefined, - body?: webhooks.WebhookUpdate | undefined, - options?: RequestOptions, -): Promise< - [ - Result< - webhooks.Webhook, - | GoogleGenAiError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - >, - APICall, - ] -> { - const input: operations.UpdateWebhookRequest = { - id: id, - api_version: api_version, - update_mask: update_mask, - body: body, - }; - - const payload = input; - const body$ = encodeJSON("body", payload.body, { explode: true }); - - const pathParams = { - api_version: encodeSimple( - "api_version", - payload.api_version ?? client._options.api_version, - { explode: false, charEncoding: "percent" }, - ), - id: encodeSimple("id", payload.id, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/{api_version}/webhooks/{id}")(pathParams); - - const query = encodeFormQuery({ - "update_mask": payload.update_mask, - }); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const securityInput = await extractSecurity(client._options.security); - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - base_url: options?.server_url ?? client._baseURL ?? "", - operation_id: "UpdateWebhook", - o_auth2_scopes: null, - - resolved_security: requestSecurity, - - security_source: client._options.security, - retry_config: options?.retries - || client._options.retry_config - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 8000, - exponent: 2, - maxElapsedTime: 30000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retry_codes: options?.retry_codes || ["408", "409", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "PATCH", - baseURL: options?.server_url, - path: path, - headers: headers, - query: query, - body: body$, - userAgent: client._options.user_agent, - timeout_ms: options?.timeout_ms || client._options.timeout_ms || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retry_config, - retryCodes: context.retry_codes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const [result] = await M.match< - webhooks.Webhook, - | GoogleGenAiError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - >( - M.fail("4XX"), - M.fail("5XX"), - M.json("default"), - )(response, req); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/gaos/google-genai.ts b/src/gaos/google-genai.ts deleted file mode 100644 index 280483adcb..0000000000 --- a/src/gaos/google-genai.ts +++ /dev/null @@ -1,776 +0,0 @@ -/* - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ - -import * as agents from "./models/agents/index.js"; -import * as interactions from "./models/interactions/index.js"; -import * as operations from "./models/operations/index.js"; -import * as webhooks from "./models/webhooks/index.js"; - -import type { APICall, APIPromise } from "./types/async.js"; -import { - GOOGLE_GENAI_API_REVISION, - GoogleGenAISecurityProvider, -} from "./hooks/google-genai-auth.js"; - -import { Stream } from "./lib/event-streams.js"; -import { GoogleGenAI } from "./sdk/sdk.js"; -import type { - CreateAgentInteractionParamsNonStreaming, - CreateAgentInteractionParamsStreaming, - CreateAgentParams, - CreateInteractionParams, - CreateInteractionParamsNonStreaming, - CreateInteractionParamsStreaming, - CreateModelInteractionParamsNonStreaming, - CreateModelInteractionParamsStreaming, - DeleteAgentParams, - GetAgentParams, - GetInteractionByIdParams, - GetInteractionByIdParamsNonStreaming, - GetInteractionByIdParamsStreaming, - ListAgentsParams, -} from "./models/operations/method-params.js"; -import { RequestOptions } from "./lib/sdks.js"; -import type { Result } from "./types/fp.js"; -import { SDKOptions } from "./lib/config.js"; -import { agentsCreate } from "./funcs/agents-create.js"; -import { agentsDelete } from "./funcs/agents-delete.js"; -import { agentsGet } from "./funcs/agents-get.js"; -import { agentsList } from "./funcs/agents-list.js"; -import { interactionsCancel } from "./funcs/interactions-cancel.js"; -import { interactionsCreate } from "./funcs/interactions-create.js"; -import { interactionsGet } from "./funcs/interactions-get.js"; -import { webhooksCreate } from "./funcs/webhooks-create.js"; -import { webhooksDelete } from "./funcs/webhooks-delete.js"; -import { webhooksGet } from "./funcs/webhooks-get.js"; -import { webhooksList } from "./funcs/webhooks-list.js"; -import { webhooksPing } from "./funcs/webhooks-ping.js"; -import { webhooksRotateSigningSecret } from "./funcs/webhooks-rotate-signing-secret.js"; -import { webhooksUpdate } from "./funcs/webhooks-update.js"; - -const LEGACY_LYRIA_MODELS: ReadonlySet = new Set([ - "lyria-3-pro-preview", - "lyria-3-clip-preview", -]); - -export { GOOGLE_GENAI_API_REVISION }; - -export interface GoogleGenAIParentClient { - isVertexAI(): boolean; - getProject(): string | undefined; - getLocation(): string | undefined; - getBaseUrl(): string; - getApiVersion(): string; - getDefaultHeaders?(): Record; - getAuthHeaders(url?: string): Headers | Promise; -} - -export function getGoogleGenAIServerURL( - parentClient: GoogleGenAIParentClient, -): string { - const serverURL = parentClient.getBaseUrl(); - if (!serverURL) { - throw new Error("Base URL must be set."); - } - - return serverURL.replace(/\/+$/, ""); -} - -export function getGoogleGenAIAPIVersion( - parentClient: GoogleGenAIParentClient, -): string { - const apiVersion = trimSlashes(parentClient.getApiVersion()); - const project = parentClient.getProject(); - const location = parentClient.getLocation(); - - if (parentClient.isVertexAI() && apiVersion && project && location) { - return ( - `${apiVersion}/projects/${encodeURIComponent(project)}` + - `/locations/${encodeURIComponent(location)}` - ); - } - - return apiVersion; -} - -export function buildGoogleGenAIClient( - parentClient: GoogleGenAIParentClient, - options: SDKOptions = {}, -): GoogleGenAI { - const sdk = new GoogleGenAI({ - ...options, - api_version: options.api_version ?? getGoogleGenAIAPIVersion(parentClient), - security: - options.security ?? - (new GoogleGenAISecurityProvider({ - defaultHeaders: parentClient.getDefaultHeaders?.(), - getAuthHeaders: (url) => parentClient.getAuthHeaders(url), - }) as SDKOptions["security"]), - server_url: options.server_url ?? getGoogleGenAIServerURL(parentClient), - }); - return sdk; -} - -export type GoogleGenAIRequestOptions = RequestOptions & { - timeout?: number; - maxRetries?: number; - defaultBaseURL?: string; - fetchOptions?: Omit; - query?: unknown; - body?: unknown; -}; - -export type GoogleGenAISdkHttpResponse = { - headers?: Record; - responseInternal: Response; - json(): Promise; -}; - -export type GoogleGenAIResponseWithSdkHttpResponse = T & { - sdkHttpResponse?: GoogleGenAISdkHttpResponse; -}; - -// `steps` is wire-optional (Vertex Lyria envelopes can omit it) but the -// bridge normalizes every interaction response to carry an array, so the -// public type matches the baseline SDK's required `steps`. -export type GoogleGenAIInteraction = GoogleGenAIResponseWithSdkHttpResponse< - Omit & { steps: interactions.Step[] } ->; - -export type GoogleGenAIInteractionSSEEvent = interactions.InteractionSSEEvent; - -export type InteractionCreateParams = CreateInteractionParams; - -export type InteractionCreateParamsNonStreaming = - CreateInteractionParamsNonStreaming; - -export type InteractionCreateParamsStreaming = - CreateInteractionParamsStreaming; - -export type InteractionGetParams = GetInteractionByIdParams; - -export type InteractionGetParamsNonStreaming = - GetInteractionByIdParamsNonStreaming; - -export type InteractionGetParamsStreaming = - GetInteractionByIdParamsStreaming; - -export type WebhookListParams = { - api_version?: string; - page_size?: number; - page_token?: string; -}; - -export type WebhookUpdateParams = { - api_version?: string; - update_mask?: string; -} & webhooks.WebhookUpdate; - -export type WebhookRotateSigningSecretParams = - webhooks.RotateSigningSecretRequest & { api_version?: string }; - -export type WebhookPingParams = { - api_version?: string; - body?: webhooks.PingWebhookRequest; -}; - -export class GeminiNextGenInteractions { - private sdk: GoogleGenAI | undefined; - - constructor(private readonly parentClient: GoogleGenAIParentClient) {} - - // The per-variant overloads are deliberately non-generic: signature help - // renders an instantiated type parameter as the inferred object literal, - // hiding the params type name (and property docs) from editors at matched - // call sites. - create( - params: CreateModelInteractionParamsNonStreaming, - options?: GoogleGenAIRequestOptions, - ): Promise; - create( - params: CreateAgentInteractionParamsNonStreaming, - options?: GoogleGenAIRequestOptions, - ): Promise; - create( - params: CreateModelInteractionParamsStreaming, - options?: GoogleGenAIRequestOptions, - ): Promise>; - create( - params: CreateAgentInteractionParamsStreaming, - options?: GoogleGenAIRequestOptions, - ): Promise>; - // The catch-all narrows on the inferred `stream` member so call sites - // that overload resolution routes here still get a precise return type. - create( - params: TParams, - options?: GoogleGenAIRequestOptions, - ): Promise< - TParams extends { stream: true } - ? Stream - : GoogleGenAIInteraction - >; - async create( - params: InteractionCreateParams, - options?: GoogleGenAIRequestOptions, - ): Promise< - GoogleGenAIInteraction | Stream - > { - const { api_version, ...request } = params; - if (request.stream === true) { - const response = await this.getClient(api_version).interactions.create( - { - ...(request as operations.CreateInteractionRequestBody), - stream: true, - api_version, - }, - toGoogleGenAIRequestOptions(options, true), - ); - return response as Stream; - } - - const response = await unwrapWithSdkHttpResponse( - interactionsCreate( - this.getClient(api_version), - request as operations.CreateInteractionRequestBody, - api_version, - toGoogleGenAIRequestOptions(options), - ), - ); - return addOutputPropertiesIfInteraction(response) as GoogleGenAIInteraction; - } - - get( - id: string, - params?: InteractionGetParamsNonStreaming | null, - options?: GoogleGenAIRequestOptions, - ): Promise; - get( - id: string, - params: InteractionGetParamsStreaming, - options?: GoogleGenAIRequestOptions, - ): Promise>; - get( - id: string, - params?: InteractionGetParams | null, - options?: GoogleGenAIRequestOptions, - ): Promise< - GoogleGenAIInteraction | Stream - >; - async get( - id: string, - params: InteractionGetParams | null | undefined = {}, - options?: GoogleGenAIRequestOptions, - ): Promise< - GoogleGenAIInteraction | Stream - > { - const { - api_version, - stream = false, - last_event_id, - include_input, - } = params ?? {}; - if (stream === true) { - const response = await this.getClient(api_version).interactions.get( - id, - { stream, last_event_id, include_input, api_version }, - toGoogleGenAIRequestOptions(options, true), - ); - return response as Stream; - } - - const response = await unwrapWithSdkHttpResponse( - interactionsGet( - this.getClient(api_version), - id, - stream, - last_event_id, - include_input, - api_version, - toGoogleGenAIRequestOptions(options), - ), - ); - return addOutputPropertiesIfInteraction(response) as GoogleGenAIInteraction; - } - - async delete( - id: string, - params: { api_version?: string } | null | undefined = {}, - options?: GoogleGenAIRequestOptions, - ): Promise { - return this.getClient(params?.api_version).interactions.delete( - id, - { api_version: params?.api_version }, - toGoogleGenAIRequestOptions(options), - ); - } - - async cancel( - id: string, - params: { api_version?: string } | null | undefined = {}, - options?: GoogleGenAIRequestOptions, - ): Promise { - return addOutputPropertiesIfInteraction( - await unwrapWithSdkHttpResponse( - interactionsCancel( - this.getClient(params?.api_version), - id, - params?.api_version, - toGoogleGenAIRequestOptions(options), - ), - ), - ) as GoogleGenAIInteraction; - } - - private getClient(apiVersion: string | undefined): GoogleGenAI { - if (apiVersion) { - return buildGoogleGenAIClient(this.parentClient, { - api_version: apiVersion, - }); - } - - this.sdk ??= buildGoogleGenAIClient(this.parentClient); - return this.sdk; - } -} - -export class GeminiNextGenAgents { - private sdk: GoogleGenAI | undefined; - - constructor(private readonly parentClient: GoogleGenAIParentClient) {} - - async create( - params: CreateAgentParams | null | undefined = {}, - options?: GoogleGenAIRequestOptions, - ): Promise { - const { api_version, ...body } = params ?? {}; - return unwrapWithSdkHttpResponse( - agentsCreate( - this.getClient(api_version), - body, - api_version, - toGoogleGenAIRequestOptions(options), - ), - ); - } - - async list( - params: ListAgentsParams | null | undefined = {}, - options?: GoogleGenAIRequestOptions, - ): Promise { - const { api_version, pageSize, pageToken, parent } = params ?? {}; - return unwrapWithSdkHttpResponse( - agentsList( - this.getClient(api_version), - api_version, - parent, - pageSize, - pageToken, - toGoogleGenAIRequestOptions(options), - ), - ); - } - - async get( - id: string, - params: GetAgentParams | null | undefined = {}, - options?: GoogleGenAIRequestOptions, - ): Promise { - return unwrapWithSdkHttpResponse( - agentsGet( - this.getClient(params?.api_version), - id, - params?.api_version, - toGoogleGenAIRequestOptions(options), - ), - ); - } - - async delete( - id: string, - params: DeleteAgentParams | null | undefined = {}, - options?: GoogleGenAIRequestOptions, - ): Promise { - return unwrapWithSdkHttpResponse( - agentsDelete( - this.getClient(params?.api_version), - id, - params?.api_version, - toGoogleGenAIRequestOptions(options), - ), - ); - } - - private getClient(apiVersion: string | undefined): GoogleGenAI { - if (apiVersion) { - return buildGoogleGenAIClient(this.parentClient, { - api_version: apiVersion, - }); - } - - this.sdk ??= buildGoogleGenAIClient(this.parentClient); - return this.sdk; - } -} - -export class GeminiNextGenWebhooks { - private sdk: GoogleGenAI | undefined; - - constructor(private readonly parentClient: GoogleGenAIParentClient) {} - - async create( - params: webhooks.WebhookInput & { api_version?: string }, - options?: GoogleGenAIRequestOptions, - ): Promise { - const { api_version, ...body } = params; - return unwrapWithSdkHttpResponse( - webhooksCreate( - this.getClient(), - body, - api_version, - toGoogleGenAIRequestOptions(options), - ), - ); - } - - async list( - params: WebhookListParams | null | undefined = {}, - options?: GoogleGenAIRequestOptions, - ): Promise { - const { api_version, page_size, page_token } = params ?? {}; - - return unwrapWithSdkHttpResponse( - webhooksList( - this.getClient(), - api_version, - page_size, - page_token, - toGoogleGenAIRequestOptions(options), - ), - ); - } - - async get( - id: string, - params: { api_version?: string } | null | undefined = {}, - options?: GoogleGenAIRequestOptions, - ): Promise { - return unwrapWithSdkHttpResponse( - webhooksGet( - this.getClient(), - id, - params?.api_version, - toGoogleGenAIRequestOptions(options), - ), - ); - } - - async update( - id: string, - params: WebhookUpdateParams | null | undefined = {}, - options?: GoogleGenAIRequestOptions, - ): Promise { - const { api_version, update_mask, ...body } = params ?? {}; - - return unwrapWithSdkHttpResponse( - webhooksUpdate( - this.getClient(), - id, - api_version, - update_mask, - body, - toGoogleGenAIRequestOptions(options), - ), - ); - } - - async delete( - id: string, - params: { api_version?: string } | null | undefined = {}, - options?: GoogleGenAIRequestOptions, - ): Promise { - return unwrapWithSdkHttpResponse( - webhooksDelete( - this.getClient(), - id, - params?.api_version, - toGoogleGenAIRequestOptions(options), - ), - ); - } - - async rotateSigningSecret( - id: string, - params: WebhookRotateSigningSecretParams | null | undefined = {}, - options?: GoogleGenAIRequestOptions, - ): Promise { - const { api_version, ...body } = params ?? {}; - return unwrapWithSdkHttpResponse( - webhooksRotateSigningSecret( - this.getClient(), - id, - api_version, - body, - toGoogleGenAIRequestOptions(options), - ), - ); - } - - async ping( - id: string, - params: WebhookPingParams | null | undefined = undefined, - options?: GoogleGenAIRequestOptions, - ): Promise { - const { api_version, body } = params ?? {}; - return unwrapWithSdkHttpResponse( - webhooksPing( - this.getClient(), - id, - api_version, - body, - toGoogleGenAIRequestOptions(options), - ), - ); - } - - private getClient(): GoogleGenAI { - this.sdk ??= buildGoogleGenAIClient(this.parentClient); - return this.sdk; - } -} - -function trimSlashes(value: string): string { - return value.replace(/^\/+|\/+$/g, ""); -} - -function toGoogleGenAIRequestOptions( - options: GoogleGenAIRequestOptions | undefined, - streaming = false, -): RequestOptions | undefined { - if (!options && !streaming) { - return undefined; - } - - const { - timeout, - maxRetries: _maxRetries, - defaultBaseURL, - query, - body, - fetchOptions, - ...rest - } = options ?? {}; - - const nextOptions: RequestOptions = { - ...rest, - }; - - if (isPlainObject(query)) { - nextOptions.extra_query = query; - } else { - warnIgnoredOption("query", query); - } - if (isPlainObject(body)) { - nextOptions.extra_body = body; - } else { - warnIgnoredOption("body", body); - } - - const fetch_options = rest.fetch_options ?? fetchOptions; - if (fetch_options) { - nextOptions.fetch_options = fetch_options; - } - const server_url = rest.server_url ?? defaultBaseURL; - if (server_url) { - nextOptions.server_url = server_url; - } - const timeout_ms = rest.timeout_ms ?? timeout; - if (timeout_ms !== undefined) { - nextOptions.timeout_ms = timeout_ms; - } - if (streaming) { - const headers = new Headers(nextOptions.headers ?? fetch_options?.headers); - headers.set("Accept", "text/event-stream"); - nextOptions.headers = headers; - } - - return nextOptions; -} - -function warnIgnoredOption(name: string, value: unknown): void { - if (value !== undefined && value !== null) { - console.warn( - `GoogleGenAI.interactions: request option ${name} is not supported by the Google GenAI interactions bridge and will be ignored.`, - ); - } -} - -async function unwrapWithSdkHttpResponse( - promise: APIPromise>, -): Promise> { - const [result, call] = await promise.$inspect(); - if (!result.ok) { - throw result.error; - } - - return attachSdkHttpResponse(result.value, call); -} - -function attachSdkHttpResponse( - value: T, - call: APICall, -): GoogleGenAIResponseWithSdkHttpResponse { - if (!isPlainObject(value) || call.status !== "complete") { - return value as GoogleGenAIResponseWithSdkHttpResponse; - } - - return { - ...value, - sdkHttpResponse: createSdkHttpResponse(call.response, value), - } as GoogleGenAIResponseWithSdkHttpResponse; -} - -function createSdkHttpResponse( - response: Response, - parsedBody: unknown, -): GoogleGenAISdkHttpResponse { - const headers: Record = {}; - for (const [key, value] of response.headers.entries()) { - headers[key] = value; - } - - return { - headers, - responseInternal: response, - json: async () => parsedBody, - }; -} - -function addOutputPropertiesIfInteraction(value: unknown): unknown { - const interaction = normalizeInteractionShape(value); - if (!interaction) { - return value; - } - - return addOutputProperties(interaction); -} - -function normalizeInteractionShape( - value: unknown, -): Record | undefined { - if (!isPlainObject(value)) { - return undefined; - } - - if (Array.isArray(value["steps"])) { - return value; - } - - if (isLegacyLyriaInteraction(value)) { - const outputs = value["outputs"]; - if (Array.isArray(outputs)) { - const { outputs: _outputs, ...rest } = value; - return { - ...rest, - steps: [{ type: "model_output", content: outputs }], - }; - } - } - - // Every interaction response carries a steps array on the public surface - // even when the wire payload omits it (e.g. Lyria envelopes). - return { - ...value, - steps: [], - }; -} - -function isLegacyLyriaInteraction(value: Record): boolean { - const model = value["model"]; - return typeof model === "string" && LEGACY_LYRIA_MODELS.has(model); -} - -function isPlainObject(value: unknown): value is Record { - return typeof value === "object" && value !== null && !Array.isArray(value); -} - -function addOutputProperties(interaction: Record): unknown { - const normalized = normalizeInteractionDates(interaction); - const steps = normalized["steps"] ?? []; - const textParts: string[] = []; - let collecting = false; - - outer: for (let i = steps.length - 1; i >= 0; i--) { - const step = steps[i]!; - if (step.type === "user_input") { - break; - } - if (step.type !== "model_output" || !step.content) { - if (collecting) { - break; - } - continue; - } - - const content = step.content; - for (let j = content.length - 1; j >= 0; j--) { - const item = content[j]!; - if (item.type === "text") { - collecting = true; - textParts.push(item.text ?? ""); - } else if (collecting) { - break outer; - } - } - } - - let output_image: unknown; - let output_audio: unknown; - let output_video: unknown; - - for (let i = steps.length - 1; i >= 0; i--) { - const step = steps[i]!; - if (step.type === "user_input") { - break; - } - if (step.type === "model_output" && step.content) { - for (let j = step.content.length - 1; j >= 0; j--) { - const content = step.content[j]!; - if (content.type === "image" && !output_image) { - output_image = content; - } - if (content.type === "audio" && !output_audio) { - output_audio = content; - } - if (content.type === "video" && !output_video) { - output_video = content; - } - } - } - } - - const output_text = textParts.reverse().join(""); - return { - ...normalized, - ...(output_text && { output_text }), - ...(output_image ? { output_image } : {}), - ...(output_audio ? { output_audio } : {}), - ...(output_video ? { output_video } : {}), - }; -} - -function normalizeInteractionDates( - interaction: Record, -): Record { - return { - ...interaction, - created: normalizeDateLike(interaction["created"]), - updated: normalizeDateLike(interaction["updated"]), - }; -} - -function normalizeDateLike(value: unknown): unknown { - return value instanceof Date ? value.toISOString() : value; -} diff --git a/src/gaos/hooks/google-genai-auth.ts b/src/gaos/hooks/google-genai-auth.ts deleted file mode 100644 index ed2a957b25..0000000000 --- a/src/gaos/hooks/google-genai-auth.ts +++ /dev/null @@ -1,273 +0,0 @@ -/* - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ - -import * as models from "../models/index.js"; -import { env } from "../lib/env.js"; -import { RequestInput } from "../lib/http.js"; -import { - BeforeCreateRequestContext, - BeforeCreateRequestHook, - BeforeRequestContext, - BeforeRequestHook, -} from "./types.js"; - -export const GOOGLE_GENAI_API_REVISION = "2026-05-20"; - -type GoogleGenAISecurity = models.Security; - -type GoogleGenAISecurityResolver = { - defaultHeaders?: HeadersInit | undefined; - getDefaultHeaders?: () => HeadersInit | undefined; - resolveGoogleGenAISecurity?: ( - url: string, - ) => - | GoogleGenAISecurity - | undefined - | Promise; -}; - -export class GoogleGenAISecurityProvider { - constructor( - private readonly options: { - defaultHeaders?: HeadersInit | undefined; - getAuthHeaders: (url?: string) => Headers | Promise; - }, - ) {} - - getDefaultHeaders(): HeadersInit | undefined { - return this.options.defaultHeaders; - } - - async resolveGoogleGenAISecurity( - url: string, - ): Promise { - return securityFromHeaders(await this.options.getAuthHeaders(url)); - } -} - -export class GoogleGenAIAuthHook - implements BeforeCreateRequestHook, BeforeRequestHook -{ - beforeCreateRequest( - _hookCtx: BeforeCreateRequestContext, - input: RequestInput, - ): RequestInput { - return { - ...input, - url: decodeSDKLevelAPIVersionPath(input.url), - }; - } - - async beforeRequest( - hookCtx: BeforeRequestContext, - request: Request, - ): Promise { - applyDefaultHeaders( - request.headers, - getStaticDefaultHeaders(hookCtx.security_source), - ); - applyApiRevision(hookCtx, request.headers); - applyUserProject(hookCtx, request.headers); - - if (hasAuthHeaders(request.headers)) { - return request; - } - - const security = await resolveSecurity( - hookCtx.security_source, - request.url, - ); - applyDefaultHeaders(request.headers, security?.default_headers); - applyAuth(request.headers, security); - - return request; - } -} - -function decodeSDKLevelAPIVersionPath(url: URL): URL { - const [, apiVersion, ...rest] = url.pathname.split("/"); - if (!apiVersion) { - return url; - } - - const decodedAPIVersion = decodeURIComponent(apiVersion); - if (!decodedAPIVersion.includes("/")) { - return url; - } - - const nextURL = new URL(url); - nextURL.pathname = `/${decodedAPIVersion}/${rest.join("/")}`; - return nextURL; -} - -async function resolveSecurity( - securitySource: unknown, - requestURL: string, -): Promise { - if (isSecurityResolver(securitySource)) { - return securitySource.resolveGoogleGenAISecurity(requestURL); - } - - const security = - typeof securitySource === "function" - ? await securitySource() - : securitySource; - - if (isSecurity(security)) { - return withEnvSecurity(security); - } - - return withEnvSecurity(undefined); -} - -function getStaticDefaultHeaders( - securitySource: unknown, -): HeadersInit | undefined { - if (isSecurityResolver(securitySource)) { - return ( - securitySource.getDefaultHeaders?.() ?? securitySource.defaultHeaders - ); - } - - if (isSecurity(securitySource)) { - return securitySource.default_headers; - } - - return undefined; -} - -function withEnvSecurity( - security: GoogleGenAISecurity | undefined, -): GoogleGenAISecurity | undefined { - const envVars = env(); - const nextSecurity: GoogleGenAISecurity = { - ...security, - api_key: security?.api_key ?? envVars.GOOGLE_GENAI_API_KEY, - access_token: security?.access_token ?? envVars.GOOGLE_GENAI_ACCESS_TOKEN, - }; - - return hasSecurityValue(nextSecurity) ? nextSecurity : undefined; -} - -function securityFromHeaders( - headers: Headers, -): GoogleGenAISecurity | undefined { - const defaultHeaders: Record = {}; - - for (const [key, value] of headers) { - const lowerKey = key.toLowerCase(); - if (lowerKey !== "authorization" && lowerKey !== "x-goog-api-key") { - defaultHeaders[key] = value; - } - } - - const security: GoogleGenAISecurity = { - access_token: headers.get("authorization") ?? undefined, - api_key: headers.get("x-goog-api-key") ?? undefined, - default_headers: Object.keys(defaultHeaders).length - ? defaultHeaders - : undefined, - }; - - return hasSecurityValue(security) ? security : undefined; -} - -function applyDefaultHeaders( - target: Headers, - source: HeadersInit | undefined, -): void { - if (!source) { - return; - } - - for (const [key, value] of new Headers(source)) { - if (target.get(key) === null) { - target.set(key, value); - } - } -} - -function applyApiRevision( - hookCtx: BeforeRequestContext, - headers: Headers, -): void { - if (headers.get("api-revision") === null) { - headers.set( - "Api-Revision", - hookCtx.options.api_revision ?? GOOGLE_GENAI_API_REVISION, - ); - } -} - -function applyUserProject( - hookCtx: BeforeRequestContext, - headers: Headers, -): void { - if ( - hookCtx.options.user_project !== undefined && - headers.get("x-goog-user-project") === null - ) { - headers.set("x-goog-user-project", hookCtx.options.user_project); - } -} - -function applyAuth( - headers: Headers, - security: GoogleGenAISecurity | undefined, -): void { - if (!security) { - return; - } - - if (security.api_key) { - headers.set("x-goog-api-key", security.api_key); - return; - } - - if (security.access_token) { - headers.set("Authorization", bearer(security.access_token)); - } -} - -function hasAuthHeaders(headers: Headers): boolean { - return ( - headers.get("authorization") !== null || - headers.get("x-goog-api-key") !== null - ); -} - -function bearer(token: string): string { - return token.slice(0, 7).toLowerCase() === "bearer " - ? token - : `Bearer ${token}`; -} - -function isSecurity(value: unknown): value is GoogleGenAISecurity { - return typeof value === "object" && value !== null; -} - -function isSecurityResolver( - value: unknown, -): value is GoogleGenAISecurityResolver & { - resolveGoogleGenAISecurity: NonNullable< - GoogleGenAISecurityResolver["resolveGoogleGenAISecurity"] - >; -} { - return ( - typeof value === "object" && - value !== null && - "resolveGoogleGenAISecurity" in value && - typeof value.resolveGoogleGenAISecurity === "function" - ); -} - -function hasSecurityValue(security: GoogleGenAISecurity): boolean { - return ( - security.api_key !== undefined || - security.access_token !== undefined || - security.default_headers !== undefined - ); -} diff --git a/src/gaos/hooks/hooks.ts b/src/gaos/hooks/hooks.ts deleted file mode 100644 index c28a05d8dc..0000000000 --- a/src/gaos/hooks/hooks.ts +++ /dev/null @@ -1,140 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { SDKOptions } from "../lib/config.js"; -import { RequestInput } from "../lib/http.js"; -import { - AfterErrorContext, - AfterErrorHook, - AfterSuccessContext, - AfterSuccessHook, - BeforeCreateRequestContext, - BeforeCreateRequestHook, - BeforeRequestContext, - BeforeRequestHook, - Hook, - Hooks, - SDKInitHook, -} from "./types.js"; - -import { initHooks } from "./registration.js"; - -export class SDKHooks implements Hooks { - sdkInitHooks: SDKInitHook[] = []; - beforeCreateRequestHooks: BeforeCreateRequestHook[] = []; - beforeRequestHooks: BeforeRequestHook[] = []; - afterSuccessHooks: AfterSuccessHook[] = []; - afterErrorHooks: AfterErrorHook[] = []; - - constructor() { - const presetHooks: Array = []; - - for (const hook of presetHooks) { - if ("sdkInit" in hook) { - this.registerSDKInitHook(hook); - } - if ("beforeCreateRequest" in hook) { - this.registerBeforeCreateRequestHook(hook); - } - if ("beforeRequest" in hook) { - this.registerBeforeRequestHook(hook); - } - if ("afterSuccess" in hook) { - this.registerAfterSuccessHook(hook); - } - if ("afterError" in hook) { - this.registerAfterErrorHook(hook); - } - } - initHooks(this); - } - - registerSDKInitHook(hook: SDKInitHook) { - this.sdkInitHooks.push(hook); - } - - registerBeforeCreateRequestHook(hook: BeforeCreateRequestHook) { - this.beforeCreateRequestHooks.push(hook); - } - - registerBeforeRequestHook(hook: BeforeRequestHook) { - this.beforeRequestHooks.push(hook); - } - - registerAfterSuccessHook(hook: AfterSuccessHook) { - this.afterSuccessHooks.push(hook); - } - - registerAfterErrorHook(hook: AfterErrorHook) { - this.afterErrorHooks.push(hook); - } - - sdkInit(opts: SDKOptions): SDKOptions { - return this.sdkInitHooks.reduce((opts, hook) => hook.sdkInit(opts), opts); - } - - beforeCreateRequest( - hookCtx: BeforeCreateRequestContext, - input: RequestInput, - ): RequestInput { - let inp = input; - - for (const hook of this.beforeCreateRequestHooks) { - inp = hook.beforeCreateRequest(hookCtx, inp); - } - - return inp; - } - - async beforeRequest( - hookCtx: BeforeRequestContext, - request: Request, - ): Promise { - let req = request; - - for (const hook of this.beforeRequestHooks) { - req = await hook.beforeRequest(hookCtx, req); - } - - return req; - } - - async afterSuccess( - hookCtx: AfterSuccessContext, - response: Response, - ): Promise { - let res = response; - - for (const hook of this.afterSuccessHooks) { - res = await hook.afterSuccess(hookCtx, res); - } - - return res; - } - - async afterError( - hookCtx: AfterErrorContext, - response: Response | null, - error: unknown, - ): Promise<{ response: Response | null; error: unknown }> { - let res = response; - let err = error; - - for (const hook of this.afterErrorHooks) { - const result = await hook.afterError(hookCtx, res, err); - res = result.response; - err = result.error; - } - - return { response: res, error: err }; - } -} diff --git a/src/gaos/hooks/index.ts b/src/gaos/hooks/index.ts deleted file mode 100644 index a2d0d4ef5d..0000000000 --- a/src/gaos/hooks/index.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export * from "./hooks.js"; -export * from "./types.js"; diff --git a/src/gaos/hooks/registration.ts b/src/gaos/hooks/registration.ts deleted file mode 100644 index 1f2a6fc2c4..0000000000 --- a/src/gaos/hooks/registration.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -import { GoogleGenAIAuthHook } from "./google-genai-auth.js"; -import { Hooks } from "./types.js"; - -/* - * This file is only ever generated once on the first generation and then is free to be modified. - * Any hooks you wish to add should be registered in the initHooks function. Feel free to define them - * in this file or in separate files in the hooks folder. - */ - -export function initHooks(hooks: Hooks) { - // Add hooks by calling hooks.register{ClientInit/BeforeCreateRequest/BeforeRequest/AfterSuccess/AfterError}Hook - // with an instance of a hook that implements that specific Hook interface - // Hooks are registered per SDK instance, and are valid for the lifetime of the SDK instance - const googleGenAIAuthHook = new GoogleGenAIAuthHook(); - hooks.registerBeforeCreateRequestHook(googleGenAIAuthHook); - hooks.registerBeforeRequestHook(googleGenAIAuthHook); -} diff --git a/src/gaos/hooks/types.ts b/src/gaos/hooks/types.ts deleted file mode 100644 index 6d67caaf36..0000000000 --- a/src/gaos/hooks/types.ts +++ /dev/null @@ -1,116 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { SDKOptions } from "../lib/config.js"; -import { RequestInput } from "../lib/http.js"; -import { RetryConfig } from "../lib/retries.js"; -import { SecurityState } from "../lib/security.js"; - -export type HookContext = { - base_url: string | URL; - operation_id: string; - o_auth2_scopes: string[] | null; - security_source?: any | (() => Promise); - retry_config: RetryConfig; - resolved_security: SecurityState | null; - options: SDKOptions; - timeout_ms?: number; -}; - -export type Awaitable = T | Promise; - -export type BeforeCreateRequestContext = HookContext & {}; -export type BeforeRequestContext = HookContext & {}; -export type AfterSuccessContext = HookContext & {}; -export type AfterErrorContext = HookContext & {}; - -/** - * SDKInitHook is called when the SDK is initializing. The - * hook can return a new baseURL and HTTP client to be used by the SDK. - */ -export interface SDKInitHook { - sdkInit: (opts: SDKOptions) => SDKOptions; -} - -export interface BeforeCreateRequestHook { - /** - * A hook that is called before the SDK creates a `Request` object. The hook - * can modify how a request is constructed since certain modifications, like - * changing the request URL, cannot be done on a request object directly. - */ - beforeCreateRequest: ( - hookCtx: BeforeCreateRequestContext, - input: RequestInput, - ) => RequestInput; -} - -export interface BeforeRequestHook { - /** - * A hook that is called before the SDK sends a request. The hook can - * introduce instrumentation code such as logging, tracing and metrics or - * replace the request before it is sent or throw an error to stop the - * request from being sent. - */ - beforeRequest: ( - hookCtx: BeforeRequestContext, - request: Request, - ) => Awaitable; -} - -export interface AfterSuccessHook { - /** - * A hook that is called after the SDK receives a response. The hook can - * introduce instrumentation code such as logging, tracing and metrics or - * modify the response before it is handled or throw an error to stop the - * response from being handled. - */ - afterSuccess: ( - hookCtx: AfterSuccessContext, - response: Response, - ) => Awaitable; -} - -export interface AfterErrorHook { - /** - * A hook that is called after the SDK encounters an error, or a - * non-successful response. The hook can introduce instrumentation code such - * as logging, tracing and metrics or modify the response or error values. - */ - afterError: ( - hookCtx: AfterErrorContext, - response: Response | null, - error: unknown, - ) => Awaitable<{ - response: Response | null; - error: unknown; - }>; -} - -export interface Hooks { - /** Registers a hook to be used by the SDK for initialization event. */ - registerSDKInitHook(hook: SDKInitHook): void; - /** Registers a hook to be used by the SDK for to modify `Request` construction. */ - registerBeforeCreateRequestHook(hook: BeforeCreateRequestHook): void; - /** Registers a hook to be used by the SDK for the before request event. */ - registerBeforeRequestHook(hook: BeforeRequestHook): void; - /** Registers a hook to be used by the SDK for the after success event. */ - registerAfterSuccessHook(hook: AfterSuccessHook): void; - /** Registers a hook to be used by the SDK for the after error event. */ - registerAfterErrorHook(hook: AfterErrorHook): void; -} - -export type Hook = - | SDKInitHook - | BeforeCreateRequestHook - | BeforeRequestHook - | AfterSuccessHook - | AfterErrorHook; diff --git a/src/gaos/index.ts b/src/gaos/index.ts deleted file mode 100644 index 6a48a863a0..0000000000 --- a/src/gaos/index.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export * from "./lib/config.js"; -export * as files from "./lib/files.js"; -export { HTTPClient } from "./lib/http.js"; -export type { Fetcher, HTTPClientOptions } from "./lib/http.js"; -export * from "./sdk/sdk.js"; -export { APIPromise } from "./types/async.js"; - -export * from "./resources.js"; diff --git a/src/gaos/lib/base64.ts b/src/gaos/lib/base64.ts deleted file mode 100644 index 858e6e2b7b..0000000000 --- a/src/gaos/lib/base64.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export function bytesToBase64(u8arr: Uint8Array): string { - return btoa(String.fromCodePoint(...u8arr)); -} - -export function bytesFromBase64(encoded: string): Uint8Array { - return Uint8Array.from(atob(encoded), (c) => c.charCodeAt(0)); -} - -export function stringToBytes(str: string): Uint8Array { - return new TextEncoder().encode(str); -} - -export function stringFromBytes(u8arr: Uint8Array): string { - return new TextDecoder().decode(u8arr); -} - -export function stringToBase64(str: string): string { - return bytesToBase64(stringToBytes(str)); -} - -export function stringFromBase64(b64str: string): string { - return stringFromBytes(bytesFromBase64(b64str)); -} diff --git a/src/gaos/lib/config.ts b/src/gaos/lib/config.ts deleted file mode 100644 index 48017e2185..0000000000 --- a/src/gaos/lib/config.ts +++ /dev/null @@ -1,95 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as models from "../models/index.js"; -import { HTTPClient } from "./http.js"; -import { Logger } from "./logger.js"; -import { RetryConfig } from "./retries.js"; -import { Params, pathToFunc } from "./url.js"; - -/** - * Contains the list of servers available to the SDK - */ -export const ServerList = [ - /** - * Global Endpoint - */ - "https://generativelanguage.googleapis.com", -] as const; - -export type SDKOptions = { - /** - * The security details required to authenticate the SDK - */ - security?: models.Security | (() => Promise) | undefined; - - /** - * Allows setting the api_version parameter for all supported operations - */ - api_version?: string | undefined; - - /** - * Allows setting the api_revision parameter for all supported operations - */ - api_revision?: string | undefined; - - /** - * Allows setting the user_project parameter for all supported operations - */ - user_project?: string | undefined; - - http_client?: HTTPClient; - /** - * Allows overriding the default server used by the SDK - */ - server_idx?: number | undefined; - /** - * Allows overriding the default server URL used by the SDK - */ - server_url?: string | undefined; - /** - * Allows overriding the default user agent used by the SDK - */ - user_agent?: string | undefined; - /** - * Allows overriding the default retry config used by the SDK - */ - retry_config?: RetryConfig; - timeout_ms?: number; - debug_logger?: Logger; -}; - -export function serverURLFromOptions(options: SDKOptions): URL | null { - let serverURL = options.server_url; - - const params: Params = {}; - - if (!serverURL) { - const serverIdx = options.server_idx ?? 0; - if (serverIdx < 0 || serverIdx >= ServerList.length) { - throw new Error(`Invalid server index ${serverIdx}`); - } - serverURL = ServerList[serverIdx] || ""; - } - - const u = pathToFunc(serverURL)(params); - return new URL(u); -} - -export const SDK_METADATA = { - language: "typescript", - openapiDocVersion: "v1beta", - sdkVersion: "2.4.1-preview.4", - genVersion: "2.903.2", - userAgent: - "speakeasy-sdk/typescript 2.4.1-preview.4 2.903.2 v1beta @google/genai", -} as const; diff --git a/src/gaos/lib/encodings.ts b/src/gaos/lib/encodings.ts deleted file mode 100644 index 6cd6ff2418..0000000000 --- a/src/gaos/lib/encodings.ts +++ /dev/null @@ -1,537 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { bytesToBase64 } from "./base64.js"; -import { isPlainObject } from "./primitives.js"; - -export class EncodingError extends Error { - constructor(message: string) { - super(message); - this.name = "EncodingError"; - } -} - -export function encodeMatrix( - key: string, - value: unknown, - options?: { explode?: boolean; charEncoding?: "percent" | "none" }, -): string | undefined { - let out = ""; - const pairs: [string, unknown][] = options?.explode - ? explode(key, value) - : [[key, value]]; - - if (pairs.every(([_, v]) => v == null)) { - return; - } - - const encodeString = (v: string) => { - return options?.charEncoding === "percent" ? encodeURIComponent(v) : v; - }; - const encodeValue = (v: unknown) => encodeString(serializeValue(v)); - - pairs.forEach(([pk, pv]) => { - let tmp = ""; - let encValue: string | null | undefined = null; - - if (pv == null) { - return; - } else if (Array.isArray(pv)) { - encValue = mapDefined(pv, (v) => `${encodeValue(v)}`)?.join(","); - } else if (isPlainObject(pv)) { - const mapped = mapDefinedEntries(Object.entries(pv), ([k, v]) => { - return `,${encodeString(k)},${encodeValue(v)}`; - }); - encValue = mapped?.join("").slice(1); - } else { - encValue = `${encodeValue(pv)}`; - } - - if (encValue == null) { - return; - } - - const keyPrefix = encodeString(pk); - tmp = `${keyPrefix}=${encValue}`; - // trim trailing '=' if value was empty - if (tmp === `${keyPrefix}=`) { - tmp = tmp.slice(0, -1); - } - - // If we end up with the nothing then skip forward - if (!tmp) { - return; - } - - out += `;${tmp}`; - }); - - return out; -} - -export function encodeLabel( - key: string, - value: unknown, - options?: { explode?: boolean; charEncoding?: "percent" | "none" }, -): string | undefined { - let out = ""; - const pairs: [string, unknown][] = options?.explode - ? explode(key, value) - : [[key, value]]; - - if (pairs.every(([_, v]) => v == null)) { - return; - } - - const encodeString = (v: string) => { - return options?.charEncoding === "percent" ? encodeURIComponent(v) : v; - }; - const encodeValue = (v: unknown) => encodeString(serializeValue(v)); - - pairs.forEach(([pk, pv]) => { - let encValue: string | null | undefined = ""; - - if (pv == null) { - return; - } else if (Array.isArray(pv)) { - encValue = mapDefined(pv, (v) => `${encodeValue(v)}`)?.join("."); - } else if (isPlainObject(pv)) { - const mapped = mapDefinedEntries(Object.entries(pv), ([k, v]) => { - return `.${encodeString(k)}.${encodeValue(v)}`; - }); - encValue = mapped?.join("").slice(1); - } else { - const k = options?.explode && isPlainObject(value) - ? `${encodeString(pk)}=` - : ""; - encValue = `${k}${encodeValue(pv)}`; - } - - out += encValue == null ? "" : `.${encValue}`; - }); - - return out; -} - -type FormEncoder = ( - key: string, - value: unknown, - options?: { explode?: boolean; charEncoding?: "percent" | "none" }, -) => string | undefined; - -function formEncoder(sep: string): FormEncoder { - return ( - key: string, - value: unknown, - options?: { explode?: boolean; charEncoding?: "percent" | "none" }, - ) => { - let out = ""; - const pairs: [string, unknown][] = options?.explode - ? explode(key, value) - : [[key, value]]; - - if (pairs.every(([_, v]) => v == null)) { - return; - } - - const encodeString = (v: string) => { - return options?.charEncoding === "percent" ? encodeURIComponent(v) : v; - }; - - const encodeValue = (v: unknown) => encodeString(serializeValue(v)); - - const encodedSep = encodeString(sep); - - pairs.forEach(([pk, pv]) => { - let tmp = ""; - let encValue: string | null | undefined = null; - - if (pv == null) { - return; - } else if (Array.isArray(pv)) { - encValue = mapDefined(pv, (v) => `${encodeValue(v)}`)?.join(encodedSep); - } else if (isPlainObject(pv)) { - encValue = mapDefinedEntries(Object.entries(pv), ([k, v]) => { - return `${encodeString(k)}${encodedSep}${encodeValue(v)}`; - })?.join(encodedSep); - } else { - encValue = `${encodeValue(pv)}`; - } - - if (encValue == null) { - return; - } - - tmp = `${encodeString(pk)}=${encValue}`; - - // If we end up with the nothing then skip forward - if (!tmp || tmp === "=") { - return; - } - - out += `&${tmp}`; - }); - - return out.slice(1); - }; -} - -export const encodeForm = formEncoder(","); -export const encodeSpaceDelimited = formEncoder(" "); -export const encodePipeDelimited = formEncoder("|"); - -export function encodeBodyForm( - key: string, - value: unknown, - options?: { explode?: boolean; charEncoding?: "percent" | "none" }, -): string { - let out = ""; - const pairs: [string, unknown][] = options?.explode - ? explode(key, value) - : [[key, value]]; - - const encodeString = (v: string) => { - return options?.charEncoding === "percent" ? encodeURIComponent(v) : v; - }; - - const encodeValue = (v: unknown) => encodeString(serializeValue(v)); - - pairs.forEach(([pk, pv]) => { - let tmp = ""; - let encValue = ""; - - if (pv == null) { - return; - } else if (Array.isArray(pv)) { - encValue = JSON.stringify(pv, jsonReplacer); - } else if (isPlainObject(pv)) { - encValue = JSON.stringify(pv, jsonReplacer); - } else { - encValue = `${encodeValue(pv)}`; - } - - tmp = `${encodeString(pk)}=${encValue}`; - - // If we end up with the nothing then skip forward - if (!tmp || tmp === "=") { - return; - } - - out += `&${tmp}`; - }); - - return out.slice(1); -} - -export function encodeDeepObject( - key: string, - value: unknown, - options?: { charEncoding?: "percent" | "none" }, -): string | undefined { - if (value == null) { - return; - } - - if (!isPlainObject(value)) { - throw new EncodingError( - `Value of parameter '${key}' which uses deepObject encoding must be an object or null`, - ); - } - - return encodeDeepObjectObject(key, value, options); -} - -export function encodeDeepObjectObject( - key: string, - value: unknown, - options?: { charEncoding?: "percent" | "none" }, -): string | undefined { - if (value == null) { - return; - } - - let out = ""; - - const encodeString = (v: string) => { - return options?.charEncoding === "percent" ? encodeURIComponent(v) : v; - }; - - if (!isPlainObject(value)) { - throw new EncodingError(`Expected parameter '${key}' to be an object.`); - } - - Object.entries(value).forEach(([ck, cv]) => { - if (cv == null) { - return; - } - - const pk = `${key}[${ck}]`; - - if (isPlainObject(cv)) { - const objOut = encodeDeepObjectObject(pk, cv, options); - - out += objOut == null ? "" : `&${objOut}`; - - return; - } - - const pairs: unknown[] = Array.isArray(cv) ? cv : [cv]; - const encoded = mapDefined(pairs, (v) => { - return `${encodeString(pk)}=${encodeString(serializeValue(v))}`; - })?.join("&"); - - out += encoded == null ? "" : `&${encoded}`; - }); - - return out.slice(1); -} - -export function encodeJSON( - key: string, - value: unknown, - options?: { explode?: boolean; charEncoding?: "percent" | "none" }, -): string | undefined { - if (typeof value === "undefined") { - return; - } - - const encodeString = (v: string) => { - return options?.charEncoding === "percent" ? encodeURIComponent(v) : v; - }; - - const encVal = encodeString(JSON.stringify(value, jsonReplacer)); - - return options?.explode ? encVal : `${encodeString(key)}=${encVal}`; -} - -export const encodeSimple = ( - key: string, - value: unknown, - options?: { explode?: boolean; charEncoding?: "percent" | "none" }, -): string | undefined => { - let out = ""; - const pairs: [string, unknown][] = options?.explode - ? explode(key, value) - : [[key, value]]; - - if (pairs.every(([_, v]) => v == null)) { - return; - } - - const encodeString = (v: string) => { - return options?.charEncoding === "percent" ? encodeURIComponent(v) : v; - }; - const encodeValue = (v: unknown) => encodeString(serializeValue(v)); - - pairs.forEach(([pk, pv]) => { - let tmp: string | null | undefined = ""; - - if (pv == null) { - return; - } else if (Array.isArray(pv)) { - tmp = mapDefined(pv, (v) => `${encodeValue(v)}`)?.join(","); - } else if (isPlainObject(pv)) { - const mapped = mapDefinedEntries(Object.entries(pv), ([k, v]) => { - return `,${encodeString(k)},${encodeValue(v)}`; - }); - tmp = mapped?.join("").slice(1); - } else { - const k = options?.explode && isPlainObject(value) ? `${pk}=` : ""; - tmp = `${k}${encodeValue(pv)}`; - } - - out += tmp ? `,${tmp}` : ""; - }); - - return out.slice(1); -}; - -function explode(key: string, value: unknown): [string, unknown][] { - if (Array.isArray(value)) { - return value.map((v) => [key, v]); - } else if (isPlainObject(value)) { - const o = value ?? {}; - return Object.entries(o).map(([k, v]) => [k, v]); - } else { - return [[key, value]]; - } -} - -function serializeValue(value: unknown): string { - if (value == null) { - return ""; - } else if (value instanceof Date) { - return value.toISOString(); - } else if (value instanceof Uint8Array) { - return bytesToBase64(value); - } else if (typeof value === "object") { - return JSON.stringify(value, jsonReplacer); - } - - return `${value}`; -} - -function jsonReplacer(_: string, value: unknown): unknown { - if (value instanceof Uint8Array) { - return bytesToBase64(value); - } else { - return value; - } -} - -function mapDefined(inp: T[], mapper: (v: T) => R): R[] | null { - const res = inp.reduce((acc, v) => { - if (v == null) { - return acc; - } - - const m = mapper(v); - if (m == null) { - return acc; - } - - acc.push(m); - - return acc; - }, []); - - return res.length ? res : null; -} - -function mapDefinedEntries( - inp: Iterable<[K, V]>, - mapper: (v: [K, V]) => R, -): R[] | null { - const acc: R[] = []; - for (const [k, v] of inp) { - if (v == null) { - continue; - } - - const m = mapper([k, v]); - if (m == null) { - continue; - } - - acc.push(m); - } - - return acc.length ? acc : null; -} - -export function queryJoin(...args: (string | undefined)[]): string { - return args.filter(Boolean).join("&"); -} - -type QueryEncoderOptions = { - explode?: boolean; - charEncoding?: "percent" | "none"; - allowEmptyValue?: string[]; -}; - -type QueryEncoder = ( - key: string, - value: unknown, - options?: QueryEncoderOptions, -) => string | undefined; - -type BulkQueryEncoder = ( - values: Record, - options?: QueryEncoderOptions, -) => string; - -export function queryEncoder(f: QueryEncoder): BulkQueryEncoder { - const bulkEncode = function( - values: Record, - options?: QueryEncoderOptions, - ): string { - const opts: QueryEncoderOptions = { - ...options, - explode: options?.explode ?? true, - charEncoding: options?.charEncoding ?? "percent", - }; - - const allowEmptySet = new Set(options?.allowEmptyValue ?? []); - - const encoded = Object.entries(values).map(([key, value]) => { - if (allowEmptySet.has(key)) { - if ( - value === undefined - || value === null - || value === "" - || (Array.isArray(value) && value.length === 0) - ) { - return `${encodeURIComponent(key)}=`; - } - } - return f(key, value, opts); - }); - return queryJoin(...encoded); - }; - - return bulkEncode; -} - -export const encodeJSONQuery = queryEncoder(encodeJSON); -export const encodeFormQuery = queryEncoder(encodeForm); -export const encodeSpaceDelimitedQuery = queryEncoder(encodeSpaceDelimited); -export const encodePipeDelimitedQuery = queryEncoder(encodePipeDelimited); -export const encodeDeepObjectQuery = queryEncoder(encodeDeepObject); - -function isBlobLike(val: unknown): val is Blob { - if (val instanceof Blob) { - return true; - } - - if (typeof val !== "object" || val == null || !(Symbol.toStringTag in val)) { - return false; - } - - const tag = val[Symbol.toStringTag]; - if (tag !== "Blob" && tag !== "File") { - return false; - } - - return "stream" in val && typeof val.stream === "function"; -} - -export function appendForm( - fd: FormData, - key: string, - value: unknown, - fileName?: string, -): void { - if (value == null) { - return; - } else if (isBlobLike(value)) { - if (fileName) { - fd.append(key, value as Blob, fileName); - } else { - fd.append(key, value as Blob); - } - } else if (Array.isArray(value)) { - value.forEach((v) => { - appendForm(fd, key, v); - }); - } else { - fd.append(key, String(value)); - } -} - -export async function normalizeBlob( - value: Pick, -): Promise { - if (value instanceof Blob) { - return value; - } - return new Blob([await value.arrayBuffer()], { type: value.type }); -} diff --git a/src/gaos/lib/env.ts b/src/gaos/lib/env.ts deleted file mode 100644 index 3c2b336523..0000000000 --- a/src/gaos/lib/env.ts +++ /dev/null @@ -1,100 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { SDKOptions } from "./config.js"; - -export interface Env { - GOOGLE_GENAI_API_KEY?: string | undefined; - GOOGLE_GENAI_ACCESS_TOKEN?: string | undefined; - - /** - * Sets the api_version parameter for all supported operations - */ - GOOGLE_GENAI_API_VERSION?: string | undefined; - - /** - * Sets the api_revision parameter for all supported operations - */ - GOOGLE_GENAI_API_REVISION?: string | undefined; - - /** - * Sets the user_project parameter for all supported operations - */ - GOOGLE_GENAI_USER_PROJECT?: string | undefined; - - GOOGLE_GENAI_DEBUG?: boolean | undefined; -} - -/** - * Checks for the existence of the Deno global object to determine the environment. - * @returns {boolean} True if the runtime is Deno, false otherwise. - */ -function isDeno() { - if ("Deno" in globalThis) { - return true; - } - - return false; -} - -let envMemo: Env | undefined = undefined; -/** - * Reads and validates environment variables. - */ -export function env(): Env { - if (envMemo) { - return envMemo; - } - - const globals = globalThis as { - Deno?: { env?: { toObject?: () => Record } }; - process?: { env?: Record }; - }; - - let envObject: Record = {}; - if (isDeno()) { - envObject = globals.Deno?.env?.toObject?.() ?? {}; - } else { - envObject = globals.process?.env ?? {}; - } - - envMemo = envObject as unknown as Env; - return envMemo; -} - -/** - * Clears the cached env object. Useful for testing with a fresh environment. - */ -export function resetEnv() { - envMemo = undefined; -} - -/** - * Populates global parameters with environment variables. - */ -export function fillGlobals(options: SDKOptions): SDKOptions { - const clone = { ...options }; - - const envVars = env(); - - if (typeof envVars.GOOGLE_GENAI_API_VERSION !== "undefined") { - clone.api_version ??= envVars.GOOGLE_GENAI_API_VERSION; - } - if (typeof envVars.GOOGLE_GENAI_API_REVISION !== "undefined") { - clone.api_revision ??= envVars.GOOGLE_GENAI_API_REVISION; - } - if (typeof envVars.GOOGLE_GENAI_USER_PROJECT !== "undefined") { - clone.user_project ??= envVars.GOOGLE_GENAI_USER_PROJECT; - } - - return clone; -} diff --git a/src/gaos/lib/event-streams.ts b/src/gaos/lib/event-streams.ts deleted file mode 100644 index d9a247cd89..0000000000 --- a/src/gaos/lib/event-streams.ts +++ /dev/null @@ -1,215 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -// Ensure ReadableStream always declares [Symbol.asyncIterator] so the -// override keyword works consistently regardless of installed type -// definitions (e.g. bun-types omits it from its ReadableStream). -declare global { - interface ReadableStream { - [Symbol.asyncIterator](): AsyncIterableIterator; - } -} - -export type SseMessage = { - data?: T | undefined; - event?: string | null | undefined; - id?: string | null | undefined; - retry?: number | null | undefined; -}; -export function tryParseJson(s: string): unknown { - try { - return JSON.parse(s); - } catch { - return s; - } -} - -export type WrapSseOptions = { - sentinel?: string; - flattened?: boolean; - dataRequired?: boolean; -}; -export function wrapEventStreamResponse( - body: ReadableStream, - opts: WrapSseOptions = {}, -): Stream { - const flattened = opts.flattened === true; - const sentinel = opts.sentinel ?? ""; - return new Stream( - body, - (rawEvent): IteratorResult => { - if (sentinel !== "" && rawEvent.data === sentinel) { - return { done: true, value: undefined }; - } - if (flattened) { - const data = rawEvent.data == null - ? undefined - : tryParseJson(rawEvent.data); - return { done: false, value: data as T }; - } - return { - done: false, - value: { - ...rawEvent, - data: rawEvent.data == null - ? rawEvent.data - : tryParseJson(rawEvent.data), - } as T, - }; - }, - { dataRequired: opts.dataRequired ?? true }, - ); -} -export class Stream extends ReadableStream { - constructor( - responseBody: ReadableStream, - parse: (x: SseMessage) => IteratorResult, - opts?: { dataRequired?: boolean }, - ) { - const upstream = responseBody.getReader(); - let buffer: Uint8Array = new Uint8Array(); - const state = { eventId: undefined as string | undefined }; - const dataRequired = opts?.dataRequired ?? true; - super({ - async pull(downstream) { - try { - while (true) { - const match = findBoundary(buffer); - if (!match) { - const chunk = await upstream.read(); - if (chunk.done) return downstream.close(); - buffer = concatBuffer(buffer, chunk.value); - continue; - } - const message = buffer.slice(0, match.index); - buffer = buffer.slice(match.index + match.length); - const item = parseMessage(message, parse, state, dataRequired); - if (item && !item.done) return downstream.enqueue(item.value); - if (item?.done) { - await upstream.cancel("done"); - return downstream.close(); - } - } - } catch (e) { - downstream.error(e); - await upstream.cancel(e); - } - }, - cancel: reason => upstream.cancel(reason), - }); - } - - // Polyfill for older browsers - override [Symbol.asyncIterator](): any { - const fn = (ReadableStream.prototype as any)[Symbol.asyncIterator]; - if (typeof fn === "function") return fn.call(this); - const reader = this.getReader(); - return { - next: async () => { - const r = await reader.read(); - if (r.done) { - reader.releaseLock(); - return { done: true, value: undefined }; - } - return { done: false, value: r.value }; - }, - throw: async (e: unknown) => { - await reader.cancel(e); - reader.releaseLock(); - return { done: true, value: undefined }; - }, - return: async () => { - await reader.cancel("done"); - reader.releaseLock(); - return { done: true, value: undefined }; - }, - [Symbol.asyncIterator]() { - return this; - }, - }; - } -} - -function concatBuffer(a: Uint8Array, b: Uint8Array): Uint8Array { - const c = new Uint8Array(a.length + b.length); - c.set(a, 0); - c.set(b, a.length); - return c; -} - -const CR = 13; -const LF = 10; -const BOUNDARIES = [ - [CR, LF, CR, LF], // \r\n\r\n - [CR, LF, CR], // \r\n\r - [CR, LF, LF], // \r\n\n - [CR, CR, LF], // \r\r\n - [LF, CR, LF], // \n\r\n - [CR, CR], // \r\r - [LF, CR], // \n\r - [LF, LF], // \n\n -]; - -function findBoundary( - buf: Uint8Array, -): { index: number; length: number } | null { - const len = buf.length; - for (let i = 0; i < len; i++) { - if (buf[i] !== CR && buf[i] !== LF) continue; - for (const boundary of BOUNDARIES) { - if (i + boundary.length > len) continue; - let match = true; - for (let j = 0; j < boundary.length; j++) { - if (buf[i + j] !== boundary[j]) { - match = false; - break; - } - } - if (match) return { index: i, length: boundary.length }; - } - } - return null; -} -function parseMessage( - chunk: Uint8Array, - parse: (x: SseMessage) => IteratorResult, - state: { eventId: string | undefined }, - dataRequired: boolean, -) { - const text = new TextDecoder().decode(chunk); - const lines = text.split(/\r\n|\r|\n/); - const dataLines: string[] = []; - const ret: SseMessage = {}; - let ignore = true; - for (const line of lines) { - if (!line || line.startsWith(":")) continue; - ignore = false; - const i = line.indexOf(":"); - let field = line; - let value = ""; - if (i > 0) { - field = line.slice(0, i); - value = line[i + 1] === " " ? line.slice(i + 2) : line.slice(i + 1); - } - if (field === "data") dataLines.push(value); - else if (field === "event") ret.event = value; - else if (field === "id" && !value.includes("\0")) state.eventId = value; - else if (field === "retry" && /^\d+$/.test(value)) { - ret.retry = Number(value); - } - } - if (ignore) return; - ret.id = state.eventId; - if (dataLines.length) ret.data = dataLines.join("\n"); - else if (dataRequired) return; // skip data-less events when data is required - return parse(ret); -} diff --git a/src/gaos/lib/files.ts b/src/gaos/lib/files.ts deleted file mode 100644 index b7402b6517..0000000000 --- a/src/gaos/lib/files.ts +++ /dev/null @@ -1,112 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -/** - * Consumes a stream and returns a concatenated array buffer. Useful in - * situations where we need to read the whole file because it forms part of a - * larger payload containing other fields, and we can't modify the underlying - * request structure. - */ -export async function readableStreamToArrayBuffer( - readable: ReadableStream, -): Promise { - const reader = readable.getReader(); - const chunks: Uint8Array[] = []; - - let totalLength = 0; - let done = false; - - while (!done) { - const { value, done: doneReading } = await reader.read(); - - if (doneReading) { - done = true; - } else { - chunks.push(value); - totalLength += value.length; - } - } - - const concatenatedChunks = new Uint8Array(totalLength); - let offset = 0; - - for (const chunk of chunks) { - concatenatedChunks.set(chunk, offset); - offset += chunk.length; - } - - return concatenatedChunks.buffer as ArrayBuffer; -} - -/** - * Determines the MIME content type based on a file's extension. - * Returns null if the extension is not recognized. - */ -export function getContentTypeFromFileName(fileName: string): string | null { - if (!fileName) return null; - - const ext = fileName.toLowerCase().split(".").pop(); - if (!ext) return null; - - const mimeTypes: Record = { - json: "application/json", - xml: "application/xml", - html: "text/html", - htm: "text/html", - txt: "text/plain", - csv: "text/csv", - pdf: "application/pdf", - png: "image/png", - jpg: "image/jpeg", - jpeg: "image/jpeg", - gif: "image/gif", - svg: "image/svg+xml", - js: "application/javascript", - css: "text/css", - zip: "application/zip", - tar: "application/x-tar", - gz: "application/gzip", - mp4: "video/mp4", - mp3: "audio/mpeg", - wav: "audio/wav", - webp: "image/webp", - ico: "image/x-icon", - woff: "font/woff", - woff2: "font/woff2", - ttf: "font/ttf", - otf: "font/otf", - }; - - return mimeTypes[ext] || null; -} - -/** - * Creates a Blob from file content with the given MIME type. - * - * Node.js Buffers are Uint8Array subclasses that may share a pooled - * ArrayBuffer (byteOffset > 0, byteLength < buffer.byteLength). Passing - * such a Buffer directly to `new Blob([buf])` can include the entire - * underlying pool on some runtimes, producing a Blob with extra bytes - * that corrupts multipart uploads. - * - * Copying into a standalone Uint8Array ensures the Blob receives only the - * intended bytes regardless of runtime behaviour. - */ -export function bytesToBlob( - content: Uint8Array | ArrayBuffer | Blob | string, - contentType: string, -): Blob { - if (content instanceof Uint8Array) { - return new Blob([new Uint8Array(content)], { type: contentType }); - } - return new Blob([content as BlobPart], { type: contentType }); -} diff --git a/src/gaos/lib/http.ts b/src/gaos/lib/http.ts deleted file mode 100644 index c7e9386456..0000000000 --- a/src/gaos/lib/http.ts +++ /dev/null @@ -1,331 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export type Fetcher = ( - input: RequestInfo | URL, - init?: RequestInit, -) => Promise; - -export type Awaitable = T | Promise; - -const DEFAULT_FETCHER: Fetcher = (input, init) => { - // If input is a Request and init is undefined, Bun will discard the method, - // headers, body and other options that were set on the request object. - // Node.js and browers would ignore an undefined init value. This check is - // therefore needed for interop with Bun. - if (init == null) { - return fetch(input); - } else { - return fetch(input, init); - } -}; - -export type RequestInput = { - /** - * The URL the request will use. - */ - url: URL; - /** - * Options used to create a [`Request`](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request). - */ - options?: RequestInit | undefined; -}; - -export interface HTTPClientOptions { - fetcher?: Fetcher; -} - -export type BeforeRequestHook = (req: Request) => Awaitable; -export type RequestErrorHook = (err: unknown, req: Request) => Awaitable; -export type ResponseHook = (res: Response, req: Request) => Awaitable; - -export class HTTPClient { - private fetcher: Fetcher; - private requestHooks: BeforeRequestHook[] = []; - private requestErrorHooks: RequestErrorHook[] = []; - private responseHooks: ResponseHook[] = []; - - constructor(private options: HTTPClientOptions = {}) { - this.fetcher = options.fetcher || DEFAULT_FETCHER; - } - - async request(request: Request): Promise { - let req = request; - for (const hook of this.requestHooks) { - const nextRequest = await hook(req); - if (nextRequest) { - req = nextRequest; - } - } - - try { - const res = await this.fetcher(req); - - for (const hook of this.responseHooks) { - await hook(res, req); - } - - return res; - } catch (err) { - for (const hook of this.requestErrorHooks) { - await hook(err, req); - } - - throw err; - } - } - - /** - * Registers a hook that is called before a request is made. The hook function - * can mutate the request or return a new request. This may be useful to add - * additional information to request such as request IDs and tracing headers. - */ - addHook(hook: "beforeRequest", fn: BeforeRequestHook): this; - /** - * Registers a hook that is called when a request cannot be made due to a - * network error. - */ - addHook(hook: "requestError", fn: RequestErrorHook): this; - /** - * Registers a hook that is called when a response has been received from the - * server. - */ - addHook(hook: "response", fn: ResponseHook): this; - addHook( - ...args: - | [hook: "beforeRequest", fn: BeforeRequestHook] - | [hook: "requestError", fn: RequestErrorHook] - | [hook: "response", fn: ResponseHook] - ) { - if (args[0] === "beforeRequest") { - this.requestHooks.push(args[1]); - } else if (args[0] === "requestError") { - this.requestErrorHooks.push(args[1]); - } else if (args[0] === "response") { - this.responseHooks.push(args[1]); - } else { - throw new Error(`Invalid hook type: ${args[0]}`); - } - return this; - } - - /** Removes a hook that was previously registered with `addHook`. */ - removeHook(hook: "beforeRequest", fn: BeforeRequestHook): this; - /** Removes a hook that was previously registered with `addHook`. */ - removeHook(hook: "requestError", fn: RequestErrorHook): this; - /** Removes a hook that was previously registered with `addHook`. */ - removeHook(hook: "response", fn: ResponseHook): this; - removeHook( - ...args: - | [hook: "beforeRequest", fn: BeforeRequestHook] - | [hook: "requestError", fn: RequestErrorHook] - | [hook: "response", fn: ResponseHook] - ): this { - let target: unknown[]; - if (args[0] === "beforeRequest") { - target = this.requestHooks; - } else if (args[0] === "requestError") { - target = this.requestErrorHooks; - } else if (args[0] === "response") { - target = this.responseHooks; - } else { - throw new Error(`Invalid hook type: ${args[0]}`); - } - - const index = target.findIndex((v) => v === args[1]); - if (index >= 0) { - target.splice(index, 1); - } - - return this; - } - - clone(): HTTPClient { - const child = new HTTPClient(this.options); - child.requestHooks = this.requestHooks.slice(); - child.requestErrorHooks = this.requestErrorHooks.slice(); - child.responseHooks = this.responseHooks.slice(); - - return child; - } -} - -export type StatusCodePredicate = number | string | (number | string)[]; - -// A semicolon surrounded by optional whitespace characters is used to separate -// segments in a media type string. -const mediaParamSeparator = /\s*;\s*/g; - -export function matchContentType(response: Response, pattern: string): boolean { - // `*` is a special case which means anything is acceptable. - if (pattern === "*") { - return true; - } - - let contentType = - response.headers.get("content-type")?.trim() || "application/octet-stream"; - contentType = contentType.toLowerCase(); - - const wantParts = pattern.toLowerCase().trim().split(mediaParamSeparator); - const [wantType = "", ...wantParams] = wantParts; - - if (wantType.split("/").length !== 2) { - return false; - } - - const gotParts = contentType.split(mediaParamSeparator); - const [gotType = "", ...gotParams] = gotParts; - - const [type = "", subtype = ""] = gotType.split("/"); - if (!type || !subtype) { - return false; - } - - if ( - wantType !== "*/*" && - gotType !== wantType && - `${type}/*` !== wantType && - `*/${subtype}` !== wantType - ) { - return false; - } - - if (gotParams.length < wantParams.length) { - return false; - } - - const params = new Set(gotParams); - for (const wantParam of wantParams) { - if (!params.has(wantParam)) { - return false; - } - } - - return true; -} - -const codeRangeRE = new RegExp("^[0-9]xx$", "i"); - -export function matchStatusCode( - response: Response, - codes: StatusCodePredicate, -): boolean { - const actual = `${response.status}`; - const expectedCodes = Array.isArray(codes) ? codes : [codes]; - if (!expectedCodes.length) { - return false; - } - - return expectedCodes.some((ec) => { - const code = `${ec}`; - - if (code === "default") { - return true; - } - - if (!codeRangeRE.test(`${code}`)) { - return code === actual; - } - - const expectFamily = code.charAt(0); - if (!expectFamily) { - throw new Error("Invalid status code range"); - } - - const actualFamily = actual.charAt(0); - if (!actualFamily) { - throw new Error(`Invalid response status code: ${actual}`); - } - - return actualFamily === expectFamily; - }); -} - -export function matchResponse( - response: Response, - code: StatusCodePredicate, - contentTypePattern: string, -): boolean { - return ( - matchStatusCode(response, code) && - matchContentType(response, contentTypePattern) - ); -} - -/** - * Uses various heurisitics to determine if an error is a connection error. - */ -export function isConnectionError(err: unknown): boolean { - if (typeof err !== "object" || err == null) { - return false; - } - - // Covers fetch in Deno as well - const isBrowserErr = - err instanceof TypeError && - err.message.toLowerCase().startsWith("failed to fetch"); - - const isNodeErr = - err instanceof TypeError && - err.message.toLowerCase().startsWith("fetch failed"); - - const isBunErr = "name" in err && err.name === "ConnectionError"; - - const isGenericErr = - "code" in err && - typeof err.code === "string" && - err.code.toLowerCase() === "econnreset"; - - return isBrowserErr || isNodeErr || isGenericErr || isBunErr; -} - -/** - * Uses various heurisitics to determine if an error is a timeout error. - */ -export function isTimeoutError(err: unknown): boolean { - if (typeof err !== "object" || err == null) { - return false; - } - - // Fetch in browser, Node.js, Bun, Deno - const isNative = "name" in err && err.name === "TimeoutError"; - const isLegacyNative = "code" in err && err.code === 23; - - // Node.js HTTP client and Axios - const isGenericErr = - "code" in err && - typeof err.code === "string" && - err.code.toLowerCase() === "econnaborted"; - - return isNative || isLegacyNative || isGenericErr; -} - -/** - * Uses various heurisitics to determine if an error is a abort error. - */ -export function isAbortError(err: unknown): boolean { - if (typeof err !== "object" || err == null) { - return false; - } - - // Fetch in browser, Node.js, Bun, Deno - const isNative = "name" in err && err.name === "AbortError"; - const isLegacyNative = "code" in err && err.code === 20; - - // Node.js HTTP client and Axios - const isGenericErr = - "code" in err && - typeof err.code === "string" && - err.code.toLowerCase() === "econnaborted"; - - return isNative || isLegacyNative || isGenericErr; -} diff --git a/src/gaos/lib/logger.ts b/src/gaos/lib/logger.ts deleted file mode 100644 index cd81ed6957..0000000000 --- a/src/gaos/lib/logger.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export interface Logger { - group(label?: string): void; - groupEnd(): void; - log(message: any, ...args: any[]): void; -} diff --git a/src/gaos/lib/matchers.ts b/src/gaos/lib/matchers.ts deleted file mode 100644 index a472b4856c..0000000000 --- a/src/gaos/lib/matchers.ts +++ /dev/null @@ -1,350 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { GoogleGenAiDefaultError } from "../models/errors/google-gen-ai-default-error.js"; -import { Result } from "../types/fp.js"; -import { wrapEventStreamResponse } from "./event-streams.js"; -import { matchResponse, matchStatusCode, StatusCodePredicate } from "./http.js"; -import { isPlainObject } from "./primitives.js"; - -export type Encoding = - | "jsonl" - | "json" - | "text" - | "bytes" - | "stream" - | "sse" - | "nil" - | "fail"; - -const DEFAULT_CONTENT_TYPES: Record = { - jsonl: "application/jsonl", - json: "application/json", - text: "text/plain", - bytes: "application/octet-stream", - stream: "application/octet-stream", - sse: "text/event-stream", - nil: "*", - fail: "*", -}; - -export type SseOptions = { - sentinel?: string; - flattened?: boolean; - dataRequired?: boolean; -}; -export type ErrorClassType = new( - data: any, - httpMeta: { request: Request; response: Response; body: string }, -) => unknown; - -type MatchOptions = { - ctype?: string; - hdrs?: boolean; - key?: string; - sseSentinel?: string; -}; - -export type ValueMatcher = MatchOptions & { - enc: Encoding; - codes: StatusCodePredicate; - __value?: V; - sse?: SseOptions; -}; - -export type ErrorMatcher = MatchOptions & { - enc: Encoding; - codes: StatusCodePredicate; - __error?: E; - errorClass: ErrorClassType | undefined; - sse?: SseOptions; - err: true; -}; - -export type FailMatcher = { - enc: "fail"; - codes: StatusCodePredicate; -}; - -export type Matcher = ValueMatcher | ErrorMatcher | FailMatcher; - -export function jsonErr( - codes: StatusCodePredicate, - errorClass: ErrorClassType | undefined, - options?: MatchOptions, -): ErrorMatcher { - return { ...options, err: true, enc: "json", codes, errorClass }; -} -export function json( - codes: StatusCodePredicate, - options?: MatchOptions, -): ValueMatcher { - return { ...options, enc: "json", codes }; -} - -export function jsonl( - codes: StatusCodePredicate, - options?: MatchOptions, -): ValueMatcher { - return { ...options, enc: "jsonl", codes }; -} - -export function jsonlErr( - codes: StatusCodePredicate, - errorClass: ErrorClassType | undefined, - options?: MatchOptions, -): ErrorMatcher { - return { ...options, err: true, enc: "jsonl", codes, errorClass }; -} - -export function textErr( - codes: StatusCodePredicate, - errorClass: ErrorClassType | undefined, - options?: MatchOptions, -): ErrorMatcher { - return { ...options, err: true, enc: "text", codes, errorClass }; -} -export function text( - codes: StatusCodePredicate, - options?: MatchOptions, -): ValueMatcher { - return { ...options, enc: "text", codes }; -} - -export function bytesErr( - codes: StatusCodePredicate, - errorClass: ErrorClassType | undefined, - options?: MatchOptions, -): ErrorMatcher { - return { ...options, err: true, enc: "bytes", codes, errorClass }; -} -export function bytes( - codes: StatusCodePredicate, - options?: MatchOptions, -): ValueMatcher { - return { ...options, enc: "bytes", codes }; -} - -export function streamErr( - codes: StatusCodePredicate, - errorClass: ErrorClassType | undefined, - options?: MatchOptions, -): ErrorMatcher { - return { ...options, err: true, enc: "stream", codes, errorClass }; -} -export function stream( - codes: StatusCodePredicate, - options?: MatchOptions, -): ValueMatcher { - return { ...options, enc: "stream", codes }; -} - -export function sseErr( - codes: StatusCodePredicate, - errorClass: ErrorClassType | undefined, - sse?: SseOptions, - options?: MatchOptions, -): ErrorMatcher { - return { - ...options, - err: true, - enc: "sse", - codes, - errorClass, - ...(sse ? { sse } : {}), - }; -} -export function sse( - codes: StatusCodePredicate, - sse?: SseOptions, - options?: MatchOptions, -): ValueMatcher { - return { ...options, enc: "sse", codes, ...(sse ? { sse } : {}) }; -} - -export function nilErr( - codes: StatusCodePredicate, - errorClass: ErrorClassType | undefined, - options?: MatchOptions, -): ErrorMatcher { - return { ...options, err: true, enc: "nil", codes, errorClass }; -} -export function nil( - codes: StatusCodePredicate, - options?: MatchOptions, -): ValueMatcher { - return { ...options, enc: "nil", codes }; -} - -export function fail(codes: StatusCodePredicate): FailMatcher { - return { enc: "fail", codes }; -} - -export type MatchedValue = Matchers extends Matcher[] - ? T - : never; -export type MatchedError = Matchers extends Matcher[] - ? E - : never; -export type MatchFunc = ( - response: Response, - request: Request, - options?: { resultKey?: string; extraFields?: Record }, -) => Promise<[result: Result, raw: unknown]>; - -export function match( - ...matchers: Array> -): MatchFunc { - return async function matchFunc( - response: Response, - request: Request, - options?: { resultKey?: string; extraFields?: Record }, - ): Promise<[result: Result, raw: unknown]> { - let raw: unknown; - let matcher: Matcher | undefined; - for (const match of matchers) { - const { codes } = match; - const ctpattern = "ctype" in match - ? match.ctype - : DEFAULT_CONTENT_TYPES[match.enc]; - if (ctpattern && matchResponse(response, codes, ctpattern)) { - matcher = match; - break; - } else if (!ctpattern && matchStatusCode(response, codes)) { - matcher = match; - break; - } - } - - if (!matcher) { - return [{ - ok: false, - error: new GoogleGenAiDefaultError( - "Unexpected Status or Content-Type", - { - response, - request, - body: await response.text().catch(() => ""), - }, - ), - }, raw]; - } - - const encoding = matcher.enc; - let body = ""; - switch (encoding) { - case "json": - body = await response.text(); - raw = JSON.parse(body); - break; - case "jsonl": - raw = response.body; - break; - case "bytes": - raw = new Uint8Array(await response.arrayBuffer()); - break; - case "stream": - raw = response.body; - break; - case "text": - body = await response.text(); - raw = body; - break; - case "sse": - if (response.body) { - const sseOpts = ("sse" in matcher && matcher.sse) || {}; - raw = wrapEventStreamResponse(response.body, sseOpts); - } else { - raw = null; - } - break; - case "nil": - body = await response.text(); - raw = undefined; - break; - case "fail": - body = await response.text(); - raw = body; - break; - default: - throw new Error( - `Unsupported response type: ${encoding satisfies never}`, - ); - } - - if (matcher.enc === "fail") { - return [{ - ok: false, - error: new GoogleGenAiDefaultError("API error occurred", { - request, - response, - body, - }), - }, raw]; - } - - const resultKey = matcher.key || options?.resultKey; - let data: unknown; - const headersField = matcher.hdrs - ? { headers: unpackHeaders(response.headers) } - : null; - - if ("err" in matcher) { - data = { - ...options?.extraFields, - ...headersField, - ...(isPlainObject(raw) ? raw : null), - }; - } else if (resultKey) { - data = { - ...options?.extraFields, - ...headersField, - [resultKey]: raw, - }; - } else if (matcher.hdrs) { - data = { - ...options?.extraFields, - ...headersField, - ...(isPlainObject(raw) ? raw : null), - }; - } else { - data = raw; - } - - if ("err" in matcher) { - // When the spec error response is a single error class, instantiate - // it with the data + httpMeta. When the spec defines a discriminated - // union of error variants (no class), `errorClass` is undefined and - // we pass the parsed payload through as the error value directly. - const errValue = matcher.errorClass - ? new matcher.errorClass(data, { request, response, body }) as E - : data as E; - return [{ ok: false, error: errValue }, raw]; - } - return [{ ok: true, value: data as T }, raw]; - }; -} - -const headerValRE = /, */; -/** - * Iterates over a Headers object and returns an object with all the header - * entries. Values are represented as an array to account for repeated headers. - */ -export function unpackHeaders(headers: Headers): Record { - const out: Record = {}; - - for (const [k, v] of headers.entries()) { - out[k] = v.split(headerValRE); - } - - return out; -} diff --git a/src/gaos/lib/primitives.ts b/src/gaos/lib/primitives.ts deleted file mode 100644 index bd70c063f0..0000000000 --- a/src/gaos/lib/primitives.ts +++ /dev/null @@ -1,174 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -class InvariantError extends Error { - constructor(message: string) { - super(message); - this.name = "InvariantError"; - } -} - -export function invariant( - condition: unknown, - message: string, -): asserts condition { - if (!condition) { - throw new InvariantError(message); - } -} - -export type ExactPartial = { - [P in keyof T]?: T[P] | undefined; -}; - -export type Remap = { - [k in keyof Inp as Mapping[k] extends string /* if we have a string mapping for this key then use it */ - ? Mapping[k] - : Mapping[k] extends null /* if the mapping is to `null` then drop the key */ - ? never - : k /* otherwise keep the key as-is */]: Inp[k]; -}; - -/** - * Converts or omits an object's keys according to a mapping. - * - * @param inp An object whose keys will be remapped - * @param mappings A mapping of original keys to new keys. If a key is not present in the mapping, it will be left as is. If a key is mapped to `null`, it will be removed in the resulting object. - * @returns A new object with keys remapped or omitted according to the mappings - */ -export function remap< - Inp extends Record, - const Mapping extends { [k in keyof Inp]?: string | null }, ->(inp: Inp, mappings: Mapping): Remap { - let out: any = {}; - - if (!Object.keys(mappings).length) { - out = inp; - return out; - } - - for (const [k, v] of Object.entries(inp)) { - const j = mappings[k]; - if (j === null) { - continue; - } - out[j ?? k] = v; - } - - return out; -} - -export function combineSignals( - ...signals: Array -): AbortSignal | null { - const filtered: AbortSignal[] = []; - for (const signal of signals) { - if (signal) { - filtered.push(signal); - } - } - - switch (filtered.length) { - case 0: - case 1: - return filtered[0] || null; - default: - if ("any" in AbortSignal && typeof AbortSignal.any === "function") { - return AbortSignal.any(filtered); - } - return abortSignalAny(filtered); - } -} - -export function abortSignalAny(signals: AbortSignal[]): AbortSignal { - const controller = new AbortController(); - const result = controller.signal; - if (!signals.length) { - return controller.signal; - } - - if (signals.length === 1) { - return signals[0] || controller.signal; - } - - for (const signal of signals) { - if (signal.aborted) { - return signal; - } - } - - function abort(this: AbortSignal) { - controller.abort(this.reason); - clean(); - } - - const signalRefs: WeakRef[] = []; - function clean() { - for (const signalRef of signalRefs) { - const signal = signalRef.deref(); - if (signal) { - signal.removeEventListener("abort", abort); - } - } - } - - for (const signal of signals) { - signalRefs.push(new WeakRef(signal)); - signal.addEventListener("abort", abort); - } - - return result; -} - -export function compactMap( - values: Record, -): Record { - const out: Record = {}; - - for (const [k, v] of Object.entries(values)) { - if (typeof v !== "undefined") { - out[k] = v; - } - } - - return out; -} - -export function allRequired>( - v: V, -): - | { - [K in keyof V]: NonNullable; - } - | undefined { - if (Object.values(v).every((x) => x == null)) { - return void 0; - } - - return v as ReturnType>; -} - -export function isPlainObject( - value: unknown, -): value is Record { - if (value === null || typeof value !== "object") return false; - if (Object.prototype.toString.call(value) !== "[object Object]") return false; - const proto = Object.getPrototypeOf(value); - if (proto === null || proto === Object.prototype) return true; - // cross-realm plain objects (vm contexts, iframes) inherit from a - // different realm's Object.prototype, which itself has a null prototype - try { - return Object.getPrototypeOf(proto) === null; - } catch { - return false; - } -} diff --git a/src/gaos/lib/retries.ts b/src/gaos/lib/retries.ts deleted file mode 100644 index bed2d15dc8..0000000000 --- a/src/gaos/lib/retries.ts +++ /dev/null @@ -1,226 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { isConnectionError, isTimeoutError } from "./http.js"; - -export type BackoffStrategy = { - initialInterval: number; - maxInterval: number; - exponent: number; - maxElapsedTime: number; -}; - -const defaultBackoff: BackoffStrategy = { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, -}; - -export type RetryConfig = - | { strategy: "none" } - | { - strategy: "backoff"; - backoff?: BackoffStrategy; - retryConnectionErrors?: boolean; - }; - -/** - * PermanentError is an error that is not recoverable. Throwing this error will - * cause a retry loop to terminate. - */ -export class PermanentError extends Error { - /** The underlying cause of the error. */ - override readonly cause: unknown; - - constructor(message: string, options?: { cause?: unknown }) { - let msg = message; - if (options?.cause) { - msg += `: ${options.cause}`; - } - - super(msg, options); - this.name = "PermanentError"; - // In older runtimes, the cause field would not have been assigned through - // the super() call. - if (typeof this.cause === "undefined") { - this.cause = options?.cause; - } - - Object.setPrototypeOf(this, PermanentError.prototype); - } -} - -/** - * TemporaryError is an error is used to signal that an HTTP request can be - * retried as part of a retry loop. If retry attempts are exhausted and this - * error is thrown, the response will be returned to the caller. - */ -export class TemporaryError extends Error { - response: Response; - - constructor(message: string, response: Response) { - super(message); - this.response = response; - this.name = "TemporaryError"; - - Object.setPrototypeOf(this, TemporaryError.prototype); - } -} - -export async function retry( - fetchFn: () => Promise, - options: { - config: RetryConfig; - statusCodes: string[]; - }, -): Promise { - switch (options.config.strategy) { - case "backoff": - return retryBackoff( - wrapFetcher(fetchFn, { - statusCodes: options.statusCodes, - retryConnectionErrors: !!options.config.retryConnectionErrors, - }), - options.config.backoff ?? defaultBackoff, - ); - default: - return await fetchFn(); - } -} - -function wrapFetcher( - fn: () => Promise, - options: { - statusCodes: string[]; - retryConnectionErrors: boolean; - }, -): () => Promise { - return async () => { - try { - const res = await fn(); - if (isRetryableResponse(res, options.statusCodes)) { - throw new TemporaryError( - "Response failed with retryable status code", - res, - ); - } - - return res; - } catch (err: unknown) { - if (err instanceof TemporaryError) { - throw err; - } - - if ( - options.retryConnectionErrors && - (isTimeoutError(err) || isConnectionError(err)) - ) { - throw err; - } - - throw new PermanentError("Permanent error", { cause: err }); - } - }; -} - -const codeRangeRE = new RegExp("^[0-9]xx$", "i"); - -function isRetryableResponse(res: Response, statusCodes: string[]): boolean { - const actual = `${res.status}`; - - return statusCodes.some((code) => { - if (!codeRangeRE.test(code)) { - return code === actual; - } - - const expectFamily = code.charAt(0); - if (!expectFamily) { - throw new Error("Invalid status code range"); - } - - const actualFamily = actual.charAt(0); - if (!actualFamily) { - throw new Error(`Invalid response status code: ${actual}`); - } - - return actualFamily === expectFamily; - }); -} - -async function retryBackoff( - fn: () => Promise, - strategy: BackoffStrategy, -): Promise { - const { maxElapsedTime, initialInterval, exponent, maxInterval } = strategy; - - const start = Date.now(); - let x = 0; - - while (true) { - try { - const res = await fn(); - return res; - } catch (err: unknown) { - if (err instanceof PermanentError) { - throw err.cause; - } - const elapsed = Date.now() - start; - if (elapsed > maxElapsedTime) { - if (err instanceof TemporaryError) { - return err.response; - } - - throw err; - } - - let retryInterval = 0; - if (err instanceof TemporaryError) { - retryInterval = retryIntervalFromResponse(err.response); - } - - if (retryInterval <= 0) { - retryInterval = - initialInterval * Math.pow(x, exponent) + Math.random() * 1000; - } - - const d = Math.min(retryInterval, maxInterval); - - await delay(d); - x++; - } - } -} - -function retryIntervalFromResponse(res: Response): number { - const retryVal = res.headers.get("retry-after") || ""; - if (!retryVal) { - return 0; - } - - const parsedNumber = Number(retryVal); - if (Number.isInteger(parsedNumber)) { - return parsedNumber * 1000; - } - - const parsedDate = Date.parse(retryVal); - if (Number.isInteger(parsedDate)) { - const deltaMS = parsedDate - Date.now(); - return deltaMS > 0 ? Math.ceil(deltaMS) : 0; - } - - return 0; -} - -async function delay(delay: number): Promise { - return new Promise((resolve) => setTimeout(resolve, delay)); -} diff --git a/src/gaos/lib/sdks.ts b/src/gaos/lib/sdks.ts deleted file mode 100644 index 35b91de807..0000000000 --- a/src/gaos/lib/sdks.ts +++ /dev/null @@ -1,505 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { SDKHooks } from "../hooks/hooks.js"; -import { HookContext } from "../hooks/types.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/http-client-errors.js"; -import { ERR, OK, Result } from "../types/fp.js"; -import { stringToBase64 } from "./base64.js"; -import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "./config.js"; -import { encodeForm } from "./encodings.js"; -import { env, fillGlobals } from "./env.js"; -import { - HTTPClient, - isAbortError, - isConnectionError, - isTimeoutError, - matchContentType, -} from "./http.js"; -import { Logger } from "./logger.js"; -import { combineSignals, isPlainObject } from "./primitives.js"; -import { retry, RetryConfig } from "./retries.js"; -import { SecurityState } from "./security.js"; - -export type RequestOptions = { - /** - * Sets a timeout, in milliseconds, on HTTP requests made by an SDK method. If - * `fetchOptions.signal` is set then it will take precedence over this option. - */ - timeout_ms?: number; - /** - * Set or override a retry policy on HTTP calls. - */ - retries?: RetryConfig; - /** - * Specifies the status codes which should be retried using the given retry policy. - */ - retry_codes?: string[]; - /** - * Overrides the base server URL that will be used by an operation. - */ - server_url?: string | URL; - /** - * @deprecated `fetchOptions` has been flattened into `RequestOptions`. - * - * Sets various request options on the `fetch` call made by an SDK method. - * - * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options|Request} - */ - fetch_options?: Omit; - /** - * Additional query parameters to set on the request URL. Entries replace - * any query parameters of the same name produced by the operation. Entries - * with null or undefined values are skipped, array values are encoded as - * repeated keys and plain object values are JSON-encoded. - */ - extra_query?: Record; - /** - * Additional fields to merge into the JSON object request body. Entries - * replace any fields of the same name produced by the operation. Entries - * with undefined values are skipped. Setting this option on an operation - * whose request body is not a JSON object results in an error. - */ - extra_body?: Record; -} & Omit; - -type RequestConfig = { - method: string; - path: string; - baseURL?: string | URL | undefined; - query?: string; - body?: RequestInit["body"]; - headers?: HeadersInit; - security?: SecurityState | null; - uaHeader?: string; - userAgent?: string | undefined; - timeout_ms?: number; -}; - -const gt: unknown = typeof globalThis === "undefined" ? null : globalThis; -const webWorkerLike = typeof gt === "object" - && gt != null - && "importScripts" in gt - && typeof gt["importScripts"] === "function"; -const isBrowserLike = webWorkerLike - || (typeof navigator !== "undefined" && "serviceWorker" in navigator) - || (typeof window === "object" && typeof window.document !== "undefined"); - -export class ClientSDK { - readonly _httpClient: HTTPClient; - readonly _hooks: SDKHooks; - readonly _logger?: Logger | undefined; - public readonly _baseURL: URL | null; - public readonly _options: SDKOptions & { hooks?: SDKHooks }; - - constructor(options: SDKOptions = {}) { - const opt = options as unknown; - if ( - typeof opt === "object" - && opt != null - && "hooks" in opt - && opt.hooks instanceof SDKHooks - ) { - this._hooks = opt.hooks; - } else { - this._hooks = new SDKHooks(); - } - const defaultHttpClient = new HTTPClient(); - options.http_client = options.http_client || defaultHttpClient; - options = this._hooks.sdkInit(options); - - const url = serverURLFromOptions(options); - if (url) { - url.pathname = url.pathname.replace(/\/+$/, "") + "/"; - } - this._baseURL = url; - this._httpClient = options.http_client || defaultHttpClient; - - this._options = { ...fillGlobals(options), hooks: this._hooks }; - - this._logger = this._options.debug_logger; - if (!this._logger && env().GOOGLE_GENAI_DEBUG) { - this._logger = console; - } - } - - public _createRequest( - context: HookContext, - conf: RequestConfig, - options?: RequestOptions, - ): Result { - const { method, path, query, headers: opHeaders, security } = conf; - - const base = conf.baseURL ?? this._baseURL; - if (!base) { - return ERR(new InvalidRequestError("No base URL provided for operation")); - } - const baseURL = new URL(base); - let reqURL: URL; - if (path) { - baseURL.pathname = baseURL.pathname.replace(/\/+$/, "") + "/"; - reqURL = new URL(path, baseURL); - if (!reqURL.search && baseURL.search) { - reqURL.search = baseURL.search; - } - } else { - reqURL = baseURL; - } - reqURL.hash = ""; - - // Appends already-encoded query pairs to a query string, replacing any - // existing pairs with the same key so later sources take precedence. - const mergeQuery = (current: string, additions: string): string => { - if (!additions) { - return current; - } - const additionKeys = new Set( - additions - .split("&") - .filter((pair) => pair !== "") - .map((pair) => pair.split("=")[0] ?? ""), - ); - const kept = current.split("&").filter((pair) => { - return pair !== "" && !additionKeys.has(pair.split("=")[0] ?? ""); - }); - return [...kept, additions].join("&"); - }; - - const encodeQueryRecord = (record: Record): string => { - return Object.entries(record) - .map(([k, v]) => { - if (v == null) { - return undefined; - } - const value = isPlainObject(v) ? JSON.stringify(v) : v; - return encodeForm(k, value, { - explode: Array.isArray(value), - charEncoding: "percent", - }); - }) - .filter((pair): pair is string => typeof pair !== "undefined") - .join("&"); - }; - - const finalQuery = [ - query || "", - encodeQueryRecord(options?.extra_query || {}), - encodeQueryRecord(security?.queryParams || {}), - ].reduce(mergeQuery, reqURL.search.slice(1)); - - if (finalQuery) { - reqURL.search = `?${finalQuery}`; - } - - const headers = new Headers(opHeaders); - - const username = security?.basic.username; - const password = security?.basic.password; - if (username != null || password != null) { - const encoded = stringToBase64( - [username || "", password || ""].join(":"), - ); - headers.set("Authorization", `Basic ${encoded}`); - } - - const securityHeaders = new Headers(security?.headers || {}); - for (const [k, v] of securityHeaders) { - headers.set(k, v); - } - - let cookie = headers.get("cookie") || ""; - for (const [k, v] of Object.entries(security?.cookies || {})) { - cookie += `; ${k}=${v}`; - } - cookie = cookie.startsWith("; ") ? cookie.slice(2) : cookie; - headers.set("cookie", cookie); - - const userHeaders = new Headers( - options?.headers ?? options?.fetch_options?.headers, - ); - for (const [k, v] of userHeaders) { - headers.set(k, v); - } - - // Only set user agent header in non-browser-like environments since CORS - // policy disallows setting it in browsers e.g. Chrome throws an error. - if (!isBrowserLike) { - headers.set( - conf.uaHeader ?? "user-agent", - conf.userAgent ?? SDK_METADATA.userAgent, - ); - } - - let reqBody = conf.body; - const extraBody = Object.fromEntries( - Object.entries(options?.extra_body || {}).filter( - ([, v]) => typeof v !== "undefined", - ), - ); - if (Object.keys(extraBody).length > 0) { - const contentType = new Headers(opHeaders).get("content-type") || ""; - const isJSON = /^(application|text)\/([^+]+\+)*json/.test(contentType); - if (!isJSON || (typeof reqBody !== "string" && reqBody != null)) { - return ERR( - new InvalidRequestError( - "extra_body can only be merged into JSON object request bodies", - ), - ); - } - let parsedBody: unknown; - try { - parsedBody = reqBody ? JSON.parse(reqBody) : {}; - } catch (err: unknown) { - return ERR( - new InvalidRequestError( - "extra_body can only be merged into JSON object request bodies", - { cause: err }, - ), - ); - } - if (!isPlainObject(parsedBody)) { - return ERR( - new InvalidRequestError( - "extra_body can only be merged into JSON object request bodies", - ), - ); - } - reqBody = JSON.stringify({ ...parsedBody, ...extraBody }); - headers.delete("content-length"); - } - - const fetchOptions: Omit = { - ...options?.fetch_options, - ...options, - }; - if ( - !fetchOptions?.signal && conf.timeout_ms != null && conf.timeout_ms > 0 - ) { - context.timeout_ms = conf.timeout_ms; - } - - if (conf.body instanceof ReadableStream) { - Object.assign(fetchOptions, { duplex: "half" }); - } - - let input; - try { - input = this._hooks.beforeCreateRequest(context, { - url: reqURL, - options: { - ...fetchOptions, - body: reqBody ?? null, - headers, - method, - }, - }); - } catch (err: unknown) { - return ERR( - new UnexpectedClientError("Create request hook failed to execute", { - cause: err, - }), - ); - } - - return OK(new Request(input.url, input.options)); - } - - public async _do( - request: Request, - options: { - context: HookContext; - isErrorStatusCode: (statusCode: number) => boolean; - retryConfig: RetryConfig; - retryCodes: string[]; - }, - ): Promise< - Result< - Response, - | RequestAbortedError - | RequestTimeoutError - | ConnectionError - | UnexpectedClientError - > - > { - const { context, isErrorStatusCode } = options; - const timeout_ms = context.timeout_ms; - - return retry( - async () => { - const cloned = request.clone(); - let attempt = cloned; - if (timeout_ms != null && timeout_ms > 0) { - const timeoutSignal = AbortSignal.timeout(timeout_ms); - const combined = combineSignals(cloned.signal, timeoutSignal) - ?? timeoutSignal; - attempt = new Request(cloned, { signal: combined }); - } - const req = await this._hooks.beforeRequest(context, attempt); - await logRequest(this._logger, req).catch((e) => - this._logger?.log("Failed to log request:", e) - ); - - let response = await this._httpClient.request(req); - - try { - if (isErrorStatusCode(response.status)) { - const result = await this._hooks.afterError( - context, - response, - null, - ); - if (result.error) { - throw result.error; - } - response = result.response || response; - } else { - response = await this._hooks.afterSuccess(context, response); - } - } finally { - await logResponse(this._logger, response, req) - .catch(e => this._logger?.log("Failed to log response:", e)); - } - - return response; - }, - { config: options.retryConfig, statusCodes: options.retryCodes }, - ).then( - (r) => OK(r), - (err) => { - switch (true) { - case isAbortError(err): - return ERR( - new RequestAbortedError("Request aborted by client", { - cause: err, - }), - ); - case isTimeoutError(err): - return ERR( - new RequestTimeoutError("Request timed out", { cause: err }), - ); - case isConnectionError(err): - return ERR( - new ConnectionError("Unable to make request", { cause: err }), - ); - default: - return ERR( - new UnexpectedClientError("Unexpected HTTP client error", { - cause: err, - }), - ); - } - }, - ); - } -} - -const jsonLikeContentTypeRE = /^(application|text)\/([^+]+\+)*json.*/; -const jsonlLikeContentTypeRE = - /^(application|text)\/([^+]+\+)*(jsonl|x-ndjson)\b.*/; -async function logRequest(logger: Logger | undefined, req: Request) { - if (!logger) { - return; - } - - const contentType = req.headers.get("content-type"); - const ct = contentType?.split(";")[0] || ""; - - logger.group(`> Request: ${req.method} ${req.url}`); - - logger.group("Headers:"); - for (const [k, v] of req.headers.entries()) { - logger.log(`${k}: ${v}`); - } - logger.groupEnd(); - - logger.group("Body:"); - switch (true) { - case jsonLikeContentTypeRE.test(ct): - logger.log(await req.clone().json()); - break; - case ct.startsWith("text/"): - logger.log(await req.clone().text()); - break; - case ct === "multipart/form-data": { - const body = await req.clone().formData(); - for (const [k, v] of body) { - const vlabel = v instanceof Blob ? "" : v; - logger.log(`${k}: ${vlabel}`); - } - break; - } - default: - logger.log(`<${contentType}>`); - break; - } - logger.groupEnd(); - - logger.groupEnd(); -} - -async function logResponse( - logger: Logger | undefined, - res: Response, - req: Request, -) { - if (!logger) { - return; - } - - const contentType = res.headers.get("content-type"); - const ct = contentType?.split(";")[0] || ""; - - logger.group(`< Response: ${req.method} ${req.url}`); - logger.log("Status Code:", res.status, res.statusText); - - logger.group("Headers:"); - for (const [k, v] of res.headers.entries()) { - logger.log(`${k}: ${v}`); - } - logger.groupEnd(); - - logger.group("Body:"); - switch (true) { - case matchContentType(res, "application/json") - || jsonLikeContentTypeRE.test(ct) && !jsonlLikeContentTypeRE.test(ct): - logger.log(await res.clone().json()); - break; - case matchContentType(res, "application/jsonl") - || jsonlLikeContentTypeRE.test(ct): - case matchContentType(res, "text/event-stream"): - logger.log(`<${contentType}>`); - break; - case matchContentType(res, "text/*"): - logger.log(await res.clone().text()); - break; - case matchContentType(res, "multipart/form-data"): { - const body = await res.clone().formData(); - for (const [k, v] of body) { - const vlabel = v instanceof Blob ? "" : v; - logger.log(`${k}: ${vlabel}`); - } - break; - } - default: - logger.log(`<${contentType}>`); - break; - } - logger.groupEnd(); - - logger.groupEnd(); -} diff --git a/src/gaos/lib/security.ts b/src/gaos/lib/security.ts deleted file mode 100644 index 8a89e1e42e..0000000000 --- a/src/gaos/lib/security.ts +++ /dev/null @@ -1,293 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as models from "../models/index.js"; -import { env } from "./env.js"; - -type OAuth2PasswordFlow = { - username: string; - password: string; - client_id?: string | undefined; - client_secret?: string | undefined; - token_url: string; -}; - -export enum SecurityErrorCode { - Incomplete = "incomplete", - UnrecognisedSecurityType = "unrecognized_security_type", -} - -export class SecurityError extends Error { - constructor( - public code: SecurityErrorCode, - message: string, - ) { - super(message); - this.name = "SecurityError"; - } - - static incomplete(): SecurityError { - return new SecurityError( - SecurityErrorCode.Incomplete, - "Security requirements not met in order to perform the operation", - ); - } - static unrecognizedType(type: string): SecurityError { - return new SecurityError( - SecurityErrorCode.UnrecognisedSecurityType, - `Unrecognised security type: ${type}`, - ); - } -} - -export type SecurityState = { - basic: { username?: string | undefined; password?: string | undefined }; - headers: Record; - queryParams: Record; - cookies: Record; - oauth2: ({ type: "password" } & OAuth2PasswordFlow) | { type: "none" }; -}; - -type SecurityInputBasic = { - type: "http:basic"; - value: - | { username?: string | undefined; password?: string | undefined } - | null - | undefined; -}; - -type SecurityInputBearer = { - type: "http:bearer"; - value: string | null | undefined; - fieldName: string; -}; - -type SecurityInputAPIKey = { - type: "apiKey:header" | "apiKey:query" | "apiKey:cookie"; - value: string | null | undefined; - fieldName: string; -}; - -type SecurityInputOIDC = { - type: "openIdConnect"; - value: string | null | undefined; - fieldName: string; -}; - -type SecurityInputOAuth2 = { - type: "oauth2"; - value: string | null | undefined; - fieldName: string; -}; - -type SecurityInputOAuth2ClientCredentials = { - type: "oauth2:client_credentials"; - value: - | { - client_id?: string | undefined; - client_secret?: string | undefined; - } - | null - | string - | undefined; - fieldName?: string; -}; - -type SecurityInputOAuth2PasswordCredentials = { - type: "oauth2:password"; - value: - | string - | null - | undefined; - fieldName?: string; -}; - -type SecurityInputCustom = { - type: "http:custom"; - value: any | null | undefined; - fieldName?: string; -}; - -export type SecurityInput = - | SecurityInputBasic - | SecurityInputBearer - | SecurityInputAPIKey - | SecurityInputOAuth2 - | SecurityInputOAuth2ClientCredentials - | SecurityInputOAuth2PasswordCredentials - | SecurityInputOIDC - | SecurityInputCustom; - -export function resolveSecurity( - ...options: SecurityInput[][] -): SecurityState | null { - const state: SecurityState = { - basic: {}, - headers: {}, - queryParams: {}, - cookies: {}, - oauth2: { type: "none" }, - }; - - const option = options.find((opts) => { - return opts.every((o) => { - if (o.value == null) { - return false; - } else if (o.type === "http:basic") { - return o.value.username != null || o.value.password != null; - } else if (o.type === "http:custom") { - return null; - } else if (o.type === "oauth2:password") { - return ( - typeof o.value === "string" && !!o.value - ); - } else if (o.type === "oauth2:client_credentials") { - if (typeof o.value == "string") { - return !!o.value; - } - return o.value.client_id != null || o.value.client_secret != null; - } else if (typeof o.value === "string") { - return !!o.value; - } else { - throw new Error( - `Unrecognized security type: ${o.type} (value type: ${typeof o - .value})`, - ); - } - }); - }); - if (option == null) { - return null; - } - - option.forEach((spec) => { - if (spec.value == null) { - return; - } - - const { type } = spec; - - switch (type) { - case "apiKey:header": - state.headers[spec.fieldName] = spec.value; - break; - case "apiKey:query": - state.queryParams[spec.fieldName] = spec.value; - break; - case "apiKey:cookie": - state.cookies[spec.fieldName] = spec.value; - break; - case "http:basic": - applyBasic(state, spec); - break; - case "http:custom": - break; - case "http:bearer": - applyBearer(state, spec); - break; - case "oauth2": - applyBearer(state, spec); - break; - case "oauth2:password": - applyBearer(state, spec); - break; - case "oauth2:client_credentials": - break; - case "openIdConnect": - applyBearer(state, spec); - break; - default: - throw SecurityError.unrecognizedType((spec satisfies never, type)); - } - }); - - return state; -} - -function applyBasic( - state: SecurityState, - spec: SecurityInputBasic, -) { - if (spec.value == null) { - return; - } - - state.basic = spec.value; -} - -function applyBearer( - state: SecurityState, - spec: - | SecurityInputBearer - | SecurityInputOAuth2 - | SecurityInputOIDC - | SecurityInputOAuth2PasswordCredentials, -) { - if (typeof spec.value !== "string" || !spec.value) { - return; - } - - let value = spec.value; - if (value.slice(0, 7).toLowerCase() !== "bearer ") { - value = `Bearer ${value}`; - } - - if (spec.fieldName !== undefined) { - state.headers[spec.fieldName] = value; - } -} - -export function resolveGlobalSecurity( - security: Partial | null | undefined, - allowedFields?: number[], -): SecurityState | null { - let inputs: SecurityInput[][] = [ - [ - { - fieldName: "apiKey", - type: "http:custom", - value: security?.api_key ?? env().GOOGLE_GENAI_API_KEY, - }, - { - fieldName: "accessToken", - type: "http:custom", - value: security?.access_token ?? env().GOOGLE_GENAI_ACCESS_TOKEN, - }, - { - fieldName: "defaultHeaders", - type: "http:custom", - value: security?.default_headers, - }, - ], - ]; - - if (allowedFields) { - inputs = allowedFields.map((i) => { - if (i < 0 || i >= inputs.length) { - throw new RangeError(`invalid allowedFields index ${i}`); - } - return inputs[i]!; - }); - } - - return resolveSecurity(...inputs); -} - -export async function extractSecurity< - T extends string | Record, ->(sec: T | (() => Promise) | undefined): Promise { - if (sec == null) { - return; - } - - return typeof sec === "function" ? sec() : sec; -} diff --git a/src/gaos/lib/url.ts b/src/gaos/lib/url.ts deleted file mode 100644 index e2bf5b4f4d..0000000000 --- a/src/gaos/lib/url.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -const hasOwn = Object.prototype.hasOwnProperty; - -export type Params = Partial>; - -export function pathToFunc( - pathPattern: string, - options?: { charEncoding?: "percent" | "none" }, -): (params?: Params) => string { - const paramRE = /\{([a-zA-Z0-9_][a-zA-Z0-9_-]*?)\}/g; - - return function buildURLPath(params: Record = {}): string { - return pathPattern - .replace(paramRE, function (_, placeholder) { - if (!hasOwn.call(params, placeholder)) { - throw new Error(`Parameter '${placeholder}' is required`); - } - - const value = params[placeholder]; - if (typeof value !== "string" && typeof value !== "number") { - throw new Error( - `Parameter '${placeholder}' must be a string or number`, - ); - } - - return options?.charEncoding === "percent" - ? encodeURIComponent(`${value}`) - : `${value}`; - }) - .replace(/^\/+/, ""); - }; -} diff --git a/src/gaos/models/agents/agent-list-response.ts b/src/gaos/models/agents/agent-list-response.ts deleted file mode 100644 index d34596d331..0000000000 --- a/src/gaos/models/agents/agent-list-response.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { Agent } from "./agent.js"; - -export type AgentListResponse = { - agents?: Array | undefined; - next_page_token?: string | undefined; -}; diff --git a/src/gaos/models/agents/agent-tool.ts b/src/gaos/models/agents/agent-tool.ts deleted file mode 100644 index 2408d967e9..0000000000 --- a/src/gaos/models/agents/agent-tool.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as interactions from "../interactions/index.js"; - -/** - * A tool that the agent can use. - */ -export type AgentTool = - | interactions.CodeExecution - | interactions.GoogleSearch - | interactions.URLContext - | interactions.MCPServer; diff --git a/src/gaos/models/agents/agent.ts b/src/gaos/models/agents/agent.ts deleted file mode 100644 index b8491674b2..0000000000 --- a/src/gaos/models/agents/agent.ts +++ /dev/null @@ -1,60 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as interactions from "../interactions/index.js"; -import { AgentTool } from "./agent-tool.js"; - -/** - * The environment configuration for the agent. - */ -export type BaseEnvironment = interactions.Environment | string; - -/** - * An agent definition for the CreateAgent API. - * - * @remarks - * This message is the target for annotation-parser-based JSON parsing. - * New format: - * { - * "id": "customer-sentinel", - * "base_agent": "", - * "system_instruction": "...", - * "base_environment": { "type": "remote", "sources": [...] }, - * "tools": [ {"type": "code_execution"} ] - * } - */ -export type Agent = { - /** - * The unique identifier for the agent. - */ - id?: string | undefined; - /** - * The base agent to extend. - */ - base_agent?: string | undefined; - /** - * System instruction for the agent. - */ - system_instruction?: string | undefined; - /** - * Agent description for developers to quickly read and understand. - */ - description?: string | undefined; - /** - * The tools available to the agent. - */ - tools?: Array | undefined; - /** - * The environment configuration for the agent. - */ - base_environment?: interactions.Environment | string | undefined; -}; diff --git a/src/gaos/models/agents/index.ts b/src/gaos/models/agents/index.ts deleted file mode 100644 index a4bda69935..0000000000 --- a/src/gaos/models/agents/index.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export * from "./agent-list-response.js"; -export * from "./agent-tool.js"; -export * from "./agent.js"; diff --git a/src/gaos/models/errors/cancel-interaction-by-id.ts b/src/gaos/models/errors/cancel-interaction-by-id.ts deleted file mode 100644 index 3d59d10942..0000000000 --- a/src/gaos/models/errors/cancel-interaction-by-id.ts +++ /dev/null @@ -1,86 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as interactions from "../interactions/index.js"; -import { GoogleGenAiError } from "./google-gen-ai-error.js"; - -/** - * Error cancelling interaction - */ -export type CancelInteractionByIdServerErrorData = { - /** - * Error message from an interaction. - */ - error: interactions.ErrorT; -}; - -/** - * Error cancelling interaction - */ -export class CancelInteractionByIdServerError extends GoogleGenAiError { - /** - * Error message from an interaction. - */ - error: interactions.ErrorT; - - /** The original data that was passed to this error instance. */ - data$: CancelInteractionByIdServerErrorData; - - constructor( - err: CancelInteractionByIdServerErrorData, - httpMeta: { response: Response; request: Request; body: string }, - ) { - const message = err.error?.message - || `API error occurred: ${JSON.stringify(err)}`; - super(message, httpMeta); - this.data$ = err; - this.error = err.error; - - this.name = "CancelInteractionByIdServerError"; - } -} - -/** - * Error cancelling interaction - */ -export type CancelInteractionByIdClientErrorData = { - /** - * Error message from an interaction. - */ - error: interactions.ErrorT; -}; - -/** - * Error cancelling interaction - */ -export class CancelInteractionByIdClientError extends GoogleGenAiError { - /** - * Error message from an interaction. - */ - error: interactions.ErrorT; - - /** The original data that was passed to this error instance. */ - data$: CancelInteractionByIdClientErrorData; - - constructor( - err: CancelInteractionByIdClientErrorData, - httpMeta: { response: Response; request: Request; body: string }, - ) { - const message = err.error?.message - || `API error occurred: ${JSON.stringify(err)}`; - super(message, httpMeta); - this.data$ = err; - this.error = err.error; - - this.name = "CancelInteractionByIdClientError"; - } -} diff --git a/src/gaos/models/errors/create-interaction.ts b/src/gaos/models/errors/create-interaction.ts deleted file mode 100644 index 0fc073f0c0..0000000000 --- a/src/gaos/models/errors/create-interaction.ts +++ /dev/null @@ -1,86 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as interactions from "../interactions/index.js"; -import { GoogleGenAiError } from "./google-gen-ai-error.js"; - -/** - * Error creating interaction - */ -export type CreateInteractionServerErrorData = { - /** - * Error message from an interaction. - */ - error: interactions.ErrorT; -}; - -/** - * Error creating interaction - */ -export class CreateInteractionServerError extends GoogleGenAiError { - /** - * Error message from an interaction. - */ - error: interactions.ErrorT; - - /** The original data that was passed to this error instance. */ - data$: CreateInteractionServerErrorData; - - constructor( - err: CreateInteractionServerErrorData, - httpMeta: { response: Response; request: Request; body: string }, - ) { - const message = err.error?.message - || `API error occurred: ${JSON.stringify(err)}`; - super(message, httpMeta); - this.data$ = err; - this.error = err.error; - - this.name = "CreateInteractionServerError"; - } -} - -/** - * Error creating interaction - */ -export type CreateInteractionClientErrorData = { - /** - * Error message from an interaction. - */ - error: interactions.ErrorT; -}; - -/** - * Error creating interaction - */ -export class CreateInteractionClientError extends GoogleGenAiError { - /** - * Error message from an interaction. - */ - error: interactions.ErrorT; - - /** The original data that was passed to this error instance. */ - data$: CreateInteractionClientErrorData; - - constructor( - err: CreateInteractionClientErrorData, - httpMeta: { response: Response; request: Request; body: string }, - ) { - const message = err.error?.message - || `API error occurred: ${JSON.stringify(err)}`; - super(message, httpMeta); - this.data$ = err; - this.error = err.error; - - this.name = "CreateInteractionClientError"; - } -} diff --git a/src/gaos/models/errors/delete-interaction.ts b/src/gaos/models/errors/delete-interaction.ts deleted file mode 100644 index 23d1ec0d24..0000000000 --- a/src/gaos/models/errors/delete-interaction.ts +++ /dev/null @@ -1,86 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as interactions from "../interactions/index.js"; -import { GoogleGenAiError } from "./google-gen-ai-error.js"; - -/** - * Error deleting interaction - */ -export type DeleteInteractionServerErrorData = { - /** - * Error message from an interaction. - */ - error: interactions.ErrorT; -}; - -/** - * Error deleting interaction - */ -export class DeleteInteractionServerError extends GoogleGenAiError { - /** - * Error message from an interaction. - */ - error: interactions.ErrorT; - - /** The original data that was passed to this error instance. */ - data$: DeleteInteractionServerErrorData; - - constructor( - err: DeleteInteractionServerErrorData, - httpMeta: { response: Response; request: Request; body: string }, - ) { - const message = err.error?.message - || `API error occurred: ${JSON.stringify(err)}`; - super(message, httpMeta); - this.data$ = err; - this.error = err.error; - - this.name = "DeleteInteractionServerError"; - } -} - -/** - * Error deleting interaction - */ -export type DeleteInteractionClientErrorData = { - /** - * Error message from an interaction. - */ - error: interactions.ErrorT; -}; - -/** - * Error deleting interaction - */ -export class DeleteInteractionClientError extends GoogleGenAiError { - /** - * Error message from an interaction. - */ - error: interactions.ErrorT; - - /** The original data that was passed to this error instance. */ - data$: DeleteInteractionClientErrorData; - - constructor( - err: DeleteInteractionClientErrorData, - httpMeta: { response: Response; request: Request; body: string }, - ) { - const message = err.error?.message - || `API error occurred: ${JSON.stringify(err)}`; - super(message, httpMeta); - this.data$ = err; - this.error = err.error; - - this.name = "DeleteInteractionClientError"; - } -} diff --git a/src/gaos/models/errors/get-interaction-by-id.ts b/src/gaos/models/errors/get-interaction-by-id.ts deleted file mode 100644 index 14e37c2b3b..0000000000 --- a/src/gaos/models/errors/get-interaction-by-id.ts +++ /dev/null @@ -1,86 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as interactions from "../interactions/index.js"; -import { GoogleGenAiError } from "./google-gen-ai-error.js"; - -/** - * Error getting interaction - */ -export type GetInteractionByIdServerErrorData = { - /** - * Error message from an interaction. - */ - error: interactions.ErrorT; -}; - -/** - * Error getting interaction - */ -export class GetInteractionByIdServerError extends GoogleGenAiError { - /** - * Error message from an interaction. - */ - error: interactions.ErrorT; - - /** The original data that was passed to this error instance. */ - data$: GetInteractionByIdServerErrorData; - - constructor( - err: GetInteractionByIdServerErrorData, - httpMeta: { response: Response; request: Request; body: string }, - ) { - const message = err.error?.message - || `API error occurred: ${JSON.stringify(err)}`; - super(message, httpMeta); - this.data$ = err; - this.error = err.error; - - this.name = "GetInteractionByIdServerError"; - } -} - -/** - * Error getting interaction - */ -export type GetInteractionByIdClientErrorData = { - /** - * Error message from an interaction. - */ - error: interactions.ErrorT; -}; - -/** - * Error getting interaction - */ -export class GetInteractionByIdClientError extends GoogleGenAiError { - /** - * Error message from an interaction. - */ - error: interactions.ErrorT; - - /** The original data that was passed to this error instance. */ - data$: GetInteractionByIdClientErrorData; - - constructor( - err: GetInteractionByIdClientErrorData, - httpMeta: { response: Response; request: Request; body: string }, - ) { - const message = err.error?.message - || `API error occurred: ${JSON.stringify(err)}`; - super(message, httpMeta); - this.data$ = err; - this.error = err.error; - - this.name = "GetInteractionByIdClientError"; - } -} diff --git a/src/gaos/models/errors/google-gen-ai-default-error.ts b/src/gaos/models/errors/google-gen-ai-default-error.ts deleted file mode 100644 index b600f230e7..0000000000 --- a/src/gaos/models/errors/google-gen-ai-default-error.ts +++ /dev/null @@ -1,48 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { GoogleGenAiError } from "./google-gen-ai-error.js"; - -/** The fallback error class if no more specific error class is matched */ -export class GoogleGenAiDefaultError extends GoogleGenAiError { - constructor( - message: string, - httpMeta: { - response: Response; - request: Request; - body: string; - }, - ) { - if (message) { - message += `: `; - } - message += `Status ${httpMeta.response.status}`; - const contentType = httpMeta.response.headers.get("content-type") || `""`; - if (contentType !== "application/json") { - message += ` Content-Type ${ - contentType.includes(" ") ? `"${contentType}"` : contentType - }`; - } - const body = httpMeta.body || `""`; - message += body.length > 100 ? "\n" : ". "; - let bodyDisplay = body; - if (body.length > 10000) { - const truncated = body.substring(0, 10000); - const remaining = body.length - 10000; - bodyDisplay = `${truncated}...and ${remaining} more chars`; - } - message += `Body: ${bodyDisplay}`; - message = message.trim(); - super(message, httpMeta); - this.name = "GoogleGenAiDefaultError"; - } -} diff --git a/src/gaos/models/errors/google-gen-ai-error.ts b/src/gaos/models/errors/google-gen-ai-error.ts deleted file mode 100644 index a2c49c89af..0000000000 --- a/src/gaos/models/errors/google-gen-ai-error.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -/** The base class for all HTTP error responses */ -export class GoogleGenAiError extends Error { - /** HTTP status code */ - public readonly statusCode: number; - /** HTTP body */ - public readonly body: string; - /** HTTP headers */ - public readonly headers: Headers; - /** HTTP content type */ - public readonly contentType: string; - /** Raw response */ - public readonly rawResponse: Response; - - constructor( - message: string, - httpMeta: { - response: Response; - request: Request; - body: string; - }, - ) { - super(message); - this.statusCode = httpMeta.response.status; - this.body = httpMeta.body; - this.headers = httpMeta.response.headers; - this.contentType = httpMeta.response.headers.get("content-type") || ""; - this.rawResponse = httpMeta.response; - - this.name = "GoogleGenAiError"; - } -} diff --git a/src/gaos/models/errors/http-client-errors.ts b/src/gaos/models/errors/http-client-errors.ts deleted file mode 100644 index 0bb22f796d..0000000000 --- a/src/gaos/models/errors/http-client-errors.ts +++ /dev/null @@ -1,70 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -/** - * Base class for all HTTP errors. - */ -export class HTTPClientError extends Error { - /** The underlying cause of the error. */ - override readonly cause: unknown; - override name = "HTTPClientError"; - constructor(message: string, opts?: { cause?: unknown }) { - let msg = message; - if (opts?.cause) { - msg += `: ${opts.cause}`; - } - - super(msg, opts); - // In older runtimes, the cause field would not have been assigned through - // the super() call. - if (typeof this.cause === "undefined") { - this.cause = opts?.cause; - } - } -} - -/** - * An error to capture unrecognised or unexpected errors when making HTTP calls. - */ -export class UnexpectedClientError extends HTTPClientError { - override name = "UnexpectedClientError"; -} - -/** - * An error that is raised when any inputs used to create a request are invalid. - */ -export class InvalidRequestError extends HTTPClientError { - override name = "InvalidRequestError"; -} - -/** - * An error that is raised when a HTTP request was aborted by the client error. - */ -export class RequestAbortedError extends HTTPClientError { - override readonly name = "RequestAbortedError"; -} - -/** - * An error that is raised when a HTTP request timed out due to an AbortSignal - * signal timeout. - */ -export class RequestTimeoutError extends HTTPClientError { - override readonly name = "RequestTimeoutError"; -} - -/** - * An error that is raised when a HTTP client is unable to make a request to - * a server. - */ -export class ConnectionError extends HTTPClientError { - override readonly name = "ConnectionError"; -} diff --git a/src/gaos/models/errors/index.ts b/src/gaos/models/errors/index.ts deleted file mode 100644 index e3f371da69..0000000000 --- a/src/gaos/models/errors/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export * from "./cancel-interaction-by-id.js"; -export * from "./create-interaction.js"; -export * from "./delete-interaction.js"; -export * from "./get-interaction-by-id.js"; -export * from "./google-gen-ai-default-error.js"; -export * from "./google-gen-ai-error.js"; -export * from "./http-client-errors.js"; diff --git a/src/gaos/models/index.ts b/src/gaos/models/index.ts deleted file mode 100644 index dd8c6c6bf5..0000000000 --- a/src/gaos/models/index.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export * from "./security.js"; diff --git a/src/gaos/models/interactions/agent-option.ts b/src/gaos/models/interactions/agent-option.ts deleted file mode 100644 index 782ec47036..0000000000 --- a/src/gaos/models/interactions/agent-option.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -/** - * The agent to interact with. - */ -export type AgentOption = - | "deep-research-pro-preview-12-2025" - | "deep-research-preview-04-2026" - | "deep-research-max-preview-04-2026" - | (string & {}); diff --git a/src/gaos/models/interactions/allowed-tools.ts b/src/gaos/models/interactions/allowed-tools.ts deleted file mode 100644 index e77b400bed..0000000000 --- a/src/gaos/models/interactions/allowed-tools.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ToolChoiceType } from "./tool-choice-type.js"; - -/** - * The configuration for allowed tools. - */ -export type AllowedTools = { - mode?: ToolChoiceType | undefined; - /** - * The names of the allowed tools. - */ - tools?: Array | undefined; -}; diff --git a/src/gaos/models/interactions/allowlist-entry.ts b/src/gaos/models/interactions/allowlist-entry.ts deleted file mode 100644 index d4ffb9685a..0000000000 --- a/src/gaos/models/interactions/allowlist-entry.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -/** - * A single domain allowlist rule with optional header injection. - */ -export type AllowlistEntry = { - /** - * Domain to allow outbound requests to. Supports wildcards (e.g. '*.googleapis.com'). Use '*' to allow all domains. - */ - domain: string; - /** - * Headers to inject on all outbound requests matching this domain. Each entry is a flat {header_name: header_value} object. The egress proxy injects these automatically. - */ - transform?: Array<{ [k: string]: string }> | undefined; -}; diff --git a/src/gaos/models/interactions/annotation.ts b/src/gaos/models/interactions/annotation.ts deleted file mode 100644 index c34849d9f2..0000000000 --- a/src/gaos/models/interactions/annotation.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { FileCitation } from "./file-citation.js"; -import { PlaceCitation } from "./place-citation.js"; -import { URLCitation } from "./url-citation.js"; - -/** - * Citation information for model-generated content. - */ -export type Annotation = FileCitation | PlaceCitation | URLCitation; diff --git a/src/gaos/models/interactions/arguments-delta.ts b/src/gaos/models/interactions/arguments-delta.ts deleted file mode 100644 index 1f15cf180d..0000000000 --- a/src/gaos/models/interactions/arguments-delta.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export type ArgumentsDelta = { - type: "arguments_delta"; - arguments?: string | undefined; -}; diff --git a/src/gaos/models/interactions/audio-content.ts b/src/gaos/models/interactions/audio-content.ts deleted file mode 100644 index 4e8ab6399c..0000000000 --- a/src/gaos/models/interactions/audio-content.ts +++ /dev/null @@ -1,56 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -/** - * The mime type of the audio. - */ -export type AudioContentMimeType = - | "audio/wav" - | "audio/mp3" - | "audio/aiff" - | "audio/aac" - | "audio/ogg" - | "audio/flac" - | "audio/mpeg" - | "audio/m4a" - | "audio/l16" - | "audio/opus" - | "audio/alaw" - | "audio/mulaw" - | (string & {}); - -/** - * An audio content block. - */ -export type AudioContent = { - type: "audio"; - /** - * The audio content. - */ - data?: string | undefined; - /** - * The URI of the audio. - */ - uri?: string | undefined; - /** - * The mime type of the audio. - */ - mime_type?: AudioContentMimeType | undefined; - /** - * The number of audio channels. - */ - channels?: number | undefined; - /** - * The sample rate of the audio. - */ - sample_rate?: number | undefined; -}; diff --git a/src/gaos/models/interactions/audio-delta.ts b/src/gaos/models/interactions/audio-delta.ts deleted file mode 100644 index 00fa74cc65..0000000000 --- a/src/gaos/models/interactions/audio-delta.ts +++ /dev/null @@ -1,47 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export type AudioDeltaMimeType = - | "audio/wav" - | "audio/mp3" - | "audio/aiff" - | "audio/aac" - | "audio/ogg" - | "audio/flac" - | "audio/mpeg" - | "audio/m4a" - | "audio/l16" - | "audio/opus" - | "audio/alaw" - | "audio/mulaw" - | (string & {}); - -export type AudioDelta = { - type: "audio"; - data?: string | undefined; - uri?: string | undefined; - mime_type?: AudioDeltaMimeType | undefined; - /** - * Deprecated. Use sample_rate instead. The value is ignored. - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - rate?: number | undefined; - /** - * The sample rate of the audio. - */ - sample_rate?: number | undefined; - /** - * The number of audio channels. - */ - channels?: number | undefined; -}; diff --git a/src/gaos/models/interactions/audio-response-format.ts b/src/gaos/models/interactions/audio-response-format.ts deleted file mode 100644 index 25173c2b02..0000000000 --- a/src/gaos/models/interactions/audio-response-format.ts +++ /dev/null @@ -1,54 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -/** - * The MIME type of the audio output. - */ -export type AudioResponseFormatMimeType = - | "audio/mp3" - | "audio/ogg_opus" - | "audio/l16" - | "audio/wav" - | "audio/alaw" - | "audio/mulaw" - | (string & {}); - -/** - * The delivery mode for the audio output. - */ -export type AudioResponseFormatDelivery = "inline" | "uri" | (string & {}); - -/** - * Configuration for audio output format. - */ -export type AudioResponseFormat = { - type: "audio"; - /** - * The MIME type of the audio output. - */ - mime_type?: AudioResponseFormatMimeType | undefined; - /** - * The delivery mode for the audio output. - */ - delivery?: AudioResponseFormatDelivery | undefined; - /** - * Sample rate in Hz. - */ - sample_rate?: number | undefined; - /** - * Bit rate in bits per second (bps). Only applicable for compressed formats - * - * @remarks - * (MP3, Opus). - */ - bit_rate?: number | undefined; -}; diff --git a/src/gaos/models/interactions/code-execution-call-arguments.ts b/src/gaos/models/interactions/code-execution-call-arguments.ts deleted file mode 100644 index 76fdb7dca6..0000000000 --- a/src/gaos/models/interactions/code-execution-call-arguments.ts +++ /dev/null @@ -1,30 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -/** - * Programming language of the `code`. - */ -export type Language = "python"; - -/** - * The arguments to pass to the code execution. - */ -export type CodeExecutionCallArguments = { - /** - * Programming language of the `code`. - */ - language?: Language | undefined; - /** - * The code to be executed. - */ - code?: string | undefined; -}; diff --git a/src/gaos/models/interactions/code-execution-call-delta.ts b/src/gaos/models/interactions/code-execution-call-delta.ts deleted file mode 100644 index 8d23bb9aa2..0000000000 --- a/src/gaos/models/interactions/code-execution-call-delta.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { CodeExecutionCallArguments } from "./code-execution-call-arguments.js"; - -export type CodeExecutionCallDelta = { - type: "code_execution_call"; - /** - * The arguments to pass to the code execution. - */ - arguments: CodeExecutionCallArguments; - /** - * A signature hash for backend validation. - */ - signature?: string | undefined; -}; diff --git a/src/gaos/models/interactions/code-execution-call-step.ts b/src/gaos/models/interactions/code-execution-call-step.ts deleted file mode 100644 index 60bbd48c47..0000000000 --- a/src/gaos/models/interactions/code-execution-call-step.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { CodeExecutionCallArguments } from "./code-execution-call-arguments.js"; - -/** - * Code execution call step. - */ -export type CodeExecutionCallStep = { - /** - * The arguments to pass to the code execution. - */ - arguments: CodeExecutionCallArguments; - /** - * Required. A unique ID for this specific tool call. - */ - id: string; - /** - * A signature hash for backend validation. - */ - signature?: string | undefined; - type: "code_execution_call"; -}; diff --git a/src/gaos/models/interactions/code-execution-result-delta.ts b/src/gaos/models/interactions/code-execution-result-delta.ts deleted file mode 100644 index 8f5bb4b8ee..0000000000 --- a/src/gaos/models/interactions/code-execution-result-delta.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export type CodeExecutionResultDelta = { - type: "code_execution_result"; - result: string; - is_error?: boolean | undefined; - /** - * A signature hash for backend validation. - */ - signature?: string | undefined; -}; diff --git a/src/gaos/models/interactions/code-execution-result-step.ts b/src/gaos/models/interactions/code-execution-result-step.ts deleted file mode 100644 index c6cec9c883..0000000000 --- a/src/gaos/models/interactions/code-execution-result-step.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -/** - * Code execution result step. - */ -export type CodeExecutionResultStep = { - type: "code_execution_result"; - /** - * Required. The output of the code execution. - */ - result: string; - /** - * Whether the code execution resulted in an error. - */ - is_error?: boolean | undefined; - /** - * Required. ID to match the ID from the function call block. - */ - call_id: string; - /** - * A signature hash for backend validation. - */ - signature?: string | undefined; -}; diff --git a/src/gaos/models/interactions/code-execution.ts b/src/gaos/models/interactions/code-execution.ts deleted file mode 100644 index 9eecee5c4f..0000000000 --- a/src/gaos/models/interactions/code-execution.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -/** - * A tool that can be used by the model to execute code. - */ -export type CodeExecution = { - type: "code_execution"; -}; diff --git a/src/gaos/models/interactions/computer-use.ts b/src/gaos/models/interactions/computer-use.ts deleted file mode 100644 index 803bc70ed5..0000000000 --- a/src/gaos/models/interactions/computer-use.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -/** - * The environment being operated. - */ -export type EnvironmentEnum = "browser"; - -/** - * A tool that can be used by the model to interact with the computer. - */ -export type ComputerUse = { - type: "computer_use"; - /** - * The environment being operated. - */ - environment?: EnvironmentEnum | undefined; - /** - * The list of predefined functions that are excluded from the model call. - */ - excluded_predefined_functions?: Array | undefined; -}; diff --git a/src/gaos/models/interactions/content.ts b/src/gaos/models/interactions/content.ts deleted file mode 100644 index 9e90369f1d..0000000000 --- a/src/gaos/models/interactions/content.ts +++ /dev/null @@ -1,27 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { AudioContent } from "./audio-content.js"; -import { DocumentContent } from "./document-content.js"; -import { ImageContent } from "./image-content.js"; -import { TextContent } from "./text-content.js"; -import { VideoContent } from "./video-content.js"; - -/** - * The content of the response. - */ -export type Content = - | TextContent - | ImageContent - | AudioContent - | DocumentContent - | VideoContent; diff --git a/src/gaos/models/interactions/create-agent-interaction.ts b/src/gaos/models/interactions/create-agent-interaction.ts deleted file mode 100644 index 01cb8dc469..0000000000 --- a/src/gaos/models/interactions/create-agent-interaction.ts +++ /dev/null @@ -1,111 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { AgentOption } from "./agent-option.js"; -import { DeepResearchAgentConfig } from "./deep-research-agent-config.js"; -import { DynamicAgentConfig } from "./dynamic-agent-config.js"; -import { Environment } from "./environment.js"; -import { InteractionsInput } from "./interactions-input.js"; -import { ResponseFormat } from "./response-format.js"; -import { ResponseModality } from "./response-modality.js"; -import { ServiceTier } from "./service-tier.js"; -import { Tool } from "./tool.js"; -import { Usage } from "./usage.js"; -import { WebhookConfig } from "./webhook-config.js"; - -/** - * The environment configuration for the interaction. Can be an object specifying remote environment sources or a string referencing an existing environment ID. - */ -export type CreateAgentInteractionEnvironment = Environment | string; - -/** - * Configuration parameters for the agent interaction. - */ -export type CreateAgentInteractionAgentConfig = - | DynamicAgentConfig - | DeepResearchAgentConfig; - -/** - * Enforces that the generated response is a JSON object that complies with the JSON schema specified in this field. - */ -export type CreateAgentInteractionResponseFormat = - | Array - | ResponseFormat; - -/** - * Parameters for creating agent interactions - */ -export type CreateAgentInteraction = { - /** - * The agent to interact with. - */ - agent: AgentOption; - /** - * Input only. Whether to run the model interaction in the background. - */ - background?: boolean | undefined; - /** - * Input only. Whether to store the response and request for later retrieval. - */ - store?: boolean | undefined; - /** - * Input only. Whether the interaction will be streamed. - */ - stream?: boolean | undefined; - /** - * The environment configuration for the interaction. Can be an object specifying remote environment sources or a string referencing an existing environment ID. - */ - environment?: Environment | string | undefined; - /** - * The ID of the previous interaction, if any. - */ - previous_interaction_id?: string | undefined; - /** - * The mime type of the response. This is required if response_format is set. - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - response_mime_type?: string | undefined; - /** - * The requested modalities of the response (TEXT, IMAGE, AUDIO). - */ - response_modalities?: Array | undefined; - service_tier?: ServiceTier | undefined; - /** - * System instruction for the interaction. - */ - system_instruction?: string | undefined; - /** - * A list of tool declarations the model may call during interaction. - */ - tools?: Array | undefined; - /** - * Statistics on the interaction request's token usage. - */ - usage?: Usage | undefined; - /** - * Message for configuring webhook events for a request. - */ - webhook_config?: WebhookConfig | undefined; - /** - * Configuration parameters for the agent interaction. - */ - agent_config?: DynamicAgentConfig | DeepResearchAgentConfig | undefined; - /** - * Enforces that the generated response is a JSON object that complies with the JSON schema specified in this field. - */ - response_format?: Array | ResponseFormat | undefined; - /** - * The input for the interaction. - */ - input: InteractionsInput; -}; diff --git a/src/gaos/models/interactions/create-model-interaction.ts b/src/gaos/models/interactions/create-model-interaction.ts deleted file mode 100644 index 1f1a9f9ae5..0000000000 --- a/src/gaos/models/interactions/create-model-interaction.ts +++ /dev/null @@ -1,103 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { Environment } from "./environment.js"; -import { GenerationConfig } from "./generation-config.js"; -import { InteractionsInput } from "./interactions-input.js"; -import { Model } from "./model.js"; -import { ResponseFormat } from "./response-format.js"; -import { ResponseModality } from "./response-modality.js"; -import { ServiceTier } from "./service-tier.js"; -import { Tool } from "./tool.js"; -import { Usage } from "./usage.js"; -import { WebhookConfig } from "./webhook-config.js"; - -/** - * The environment configuration for the interaction. Can be an object specifying remote environment sources or a string referencing an existing environment ID. - */ -export type CreateModelInteractionEnvironment = Environment | string; - -/** - * Enforces that the generated response is a JSON object that complies with the JSON schema specified in this field. - */ -export type CreateModelInteractionResponseFormat = - | Array - | ResponseFormat; - -/** - * Parameters for creating model interactions - */ -export type CreateModelInteraction = { - /** - * The model that will complete your prompt.\n\nSee [models](https://ai.google.dev/gemini-api/docs/models) for additional details. - */ - model: Model; - /** - * Input only. Whether to run the model interaction in the background. - */ - background?: boolean | undefined; - /** - * Input only. Whether to store the response and request for later retrieval. - */ - store?: boolean | undefined; - /** - * Input only. Whether the interaction will be streamed. - */ - stream?: boolean | undefined; - /** - * The environment configuration for the interaction. Can be an object specifying remote environment sources or a string referencing an existing environment ID. - */ - environment?: Environment | string | undefined; - /** - * The ID of the previous interaction, if any. - */ - previous_interaction_id?: string | undefined; - /** - * The mime type of the response. This is required if response_format is set. - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - response_mime_type?: string | undefined; - /** - * The requested modalities of the response (TEXT, IMAGE, AUDIO). - */ - response_modalities?: Array | undefined; - service_tier?: ServiceTier | undefined; - /** - * System instruction for the interaction. - */ - system_instruction?: string | undefined; - /** - * A list of tool declarations the model may call during interaction. - */ - tools?: Array | undefined; - /** - * Statistics on the interaction request's token usage. - */ - usage?: Usage | undefined; - /** - * Message for configuring webhook events for a request. - */ - webhook_config?: WebhookConfig | undefined; - /** - * Configuration parameters for model interactions. - */ - generation_config?: GenerationConfig | undefined; - /** - * Enforces that the generated response is a JSON object that complies with the JSON schema specified in this field. - */ - response_format?: Array | ResponseFormat | undefined; - /** - * The input for the interaction. - */ - input: InteractionsInput; -}; diff --git a/src/gaos/models/interactions/deep-research-agent-config.ts b/src/gaos/models/interactions/deep-research-agent-config.ts deleted file mode 100644 index ebd8807066..0000000000 --- a/src/gaos/models/interactions/deep-research-agent-config.ts +++ /dev/null @@ -1,39 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ThinkingSummaries } from "./thinking-summaries.js"; - -/** - * Whether to include visualizations in the response. - */ -export type Visualization = "off" | "auto" | (string & {}); - -/** - * Configuration for the Deep Research agent. - */ -export type DeepResearchAgentConfig = { - /** - * Enables human-in-the-loop planning for the Deep Research agent. If set to - * - * @remarks - * true, the Deep Research agent will provide a research plan in its response. - * The agent will then proceed only if the user confirms the plan in the next - * turn. - */ - collaborative_planning?: boolean | undefined; - thinking_summaries?: ThinkingSummaries | undefined; - type: "deep-research"; - /** - * Whether to include visualizations in the response. - */ - visualization?: Visualization | undefined; -}; diff --git a/src/gaos/models/interactions/document-content.ts b/src/gaos/models/interactions/document-content.ts deleted file mode 100644 index 0e269d3269..0000000000 --- a/src/gaos/models/interactions/document-content.ts +++ /dev/null @@ -1,38 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -/** - * The mime type of the document. - */ -export type DocumentContentMimeType = - | "application/pdf" - | "text/csv" - | (string & {}); - -/** - * A document content block. - */ -export type DocumentContent = { - type: "document"; - /** - * The document content. - */ - data?: string | undefined; - /** - * The URI of the document. - */ - uri?: string | undefined; - /** - * The mime type of the document. - */ - mime_type?: DocumentContentMimeType | undefined; -}; diff --git a/src/gaos/models/interactions/document-delta.ts b/src/gaos/models/interactions/document-delta.ts deleted file mode 100644 index eab5c4e491..0000000000 --- a/src/gaos/models/interactions/document-delta.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export type DocumentDeltaMimeType = - | "application/pdf" - | "text/csv" - | (string & {}); - -export type DocumentDelta = { - type: "document"; - data?: string | undefined; - uri?: string | undefined; - mime_type?: DocumentDeltaMimeType | undefined; -}; diff --git a/src/gaos/models/interactions/dynamic-agent-config.ts b/src/gaos/models/interactions/dynamic-agent-config.ts deleted file mode 100644 index 0b9dc7768f..0000000000 --- a/src/gaos/models/interactions/dynamic-agent-config.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -/** - * Configuration for dynamic agents. - */ -export type DynamicAgentConfig = { - type: "dynamic"; - [additionalProperties: string]: unknown; -}; diff --git a/src/gaos/models/interactions/empty.ts b/src/gaos/models/interactions/empty.ts deleted file mode 100644 index 71993461fc..0000000000 --- a/src/gaos/models/interactions/empty.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -/** - * A generic empty message that you can re-use to avoid defining duplicated - * - * @remarks - * empty messages in your APIs. A typical example is to use it as the request - * or the response type of an API method. For instance: - * - * service Foo { - * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); - * } - */ -export type Empty = {}; diff --git a/src/gaos/models/interactions/environment-network-egress-allowlist-union.ts b/src/gaos/models/interactions/environment-network-egress-allowlist-union.ts deleted file mode 100644 index dab72070fc..0000000000 --- a/src/gaos/models/interactions/environment-network-egress-allowlist-union.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { AllowlistEntry } from "./allowlist-entry.js"; - -/** - * Turns all network off. - */ -export type EnvironmentNetworkEgressAllowlistEnum = "disabled"; - -/** - * Outbound networking configuration for the sandbox. When specified, restricts which external domains the sandbox can reach. Omit entirely to allow all outbound traffic with no header injection. - */ -export type EnvironmentNetworkEgressAllowlist = { - /** - * List of allowed outbound domains. Only requests to listed domains are permitted. Use [{'domain': '*'}] to allow all domains while still injecting headers on specific ones. - */ - allowlist?: Array | undefined; -}; - -/** - * Outbound networking configuration for the sandbox. Accepts an object with an 'allowlist' array to restrict traffic, or the string 'disabled' to turn off all network access. Omit entirely to allow all outbound traffic with no header injection. - */ -export type EnvironmentNetworkEgressAllowlistUnion = - | EnvironmentNetworkEgressAllowlist - | EnvironmentNetworkEgressAllowlistEnum; diff --git a/src/gaos/models/interactions/environment.ts b/src/gaos/models/interactions/environment.ts deleted file mode 100644 index 04cea5c68c..0000000000 --- a/src/gaos/models/interactions/environment.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { EnvironmentNetworkEgressAllowlistUnion } from "./environment-network-egress-allowlist-union.js"; -import { Source } from "./source.js"; - -export type NetworkEnum = "disabled"; - -/** - * Network configuration for the environment. - */ -export type Network = EnvironmentNetworkEgressAllowlistUnion | NetworkEnum; - -/** - * Configuration for a custom environment. - */ -export type Environment = { - type: "remote"; - sources?: Array | undefined; - /** - * Network configuration for the environment. - */ - network?: EnvironmentNetworkEgressAllowlistUnion | NetworkEnum | undefined; -}; diff --git a/src/gaos/models/interactions/error-event.ts b/src/gaos/models/interactions/error-event.ts deleted file mode 100644 index cb41f491fa..0000000000 --- a/src/gaos/models/interactions/error-event.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ErrorT } from "./error.js"; -import { Usage } from "./usage.js"; - -/** - * Optional metadata accompanying ANY streamed event. - */ -export type ErrorEventMetadata = { - /** - * Statistics on the interaction request's token usage. - */ - total_usage?: Usage | undefined; -}; - -export type ErrorEvent = { - event_type: "error"; - /** - * Error message from an interaction. - */ - error?: ErrorT | undefined; - /** - * The event_id token to be used to resume the interaction stream, from - * - * @remarks - * this event. - */ - event_id?: string | undefined; - /** - * Optional metadata accompanying ANY streamed event. - */ - metadata?: ErrorEventMetadata | undefined; -}; diff --git a/src/gaos/models/interactions/error.ts b/src/gaos/models/interactions/error.ts deleted file mode 100644 index 065f3ee029..0000000000 --- a/src/gaos/models/interactions/error.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -/** - * Error message from an interaction. - */ -export type ErrorT = { - /** - * A URI that identifies the error type. - */ - code?: string | undefined; - /** - * A human-readable error message. - */ - message?: string | undefined; -}; diff --git a/src/gaos/models/interactions/file-citation.ts b/src/gaos/models/interactions/file-citation.ts deleted file mode 100644 index 75d938e399..0000000000 --- a/src/gaos/models/interactions/file-citation.ts +++ /dev/null @@ -1,54 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -/** - * A file citation annotation. - */ -export type FileCitation = { - type: "file_citation"; - /** - * The URI of the file. - */ - document_uri?: string | undefined; - /** - * The name of the file. - */ - file_name?: string | undefined; - /** - * Source attributed for a portion of the text. - */ - source?: string | undefined; - /** - * User provided metadata about the retrieved context. - */ - custom_metadata?: { [k: string]: any } | undefined; - /** - * Page number of the cited document, if applicable. - */ - page_number?: number | undefined; - /** - * Media ID in-case of image citations, if applicable. - */ - media_id?: string | undefined; - /** - * Start of segment of the response that is attributed to this source. - * - * @remarks - * - * Index indicates the start of the segment, measured in bytes. - */ - start_index?: number | undefined; - /** - * End of the attributed segment, exclusive. - */ - end_index?: number | undefined; -}; diff --git a/src/gaos/models/interactions/file-search-call-delta.ts b/src/gaos/models/interactions/file-search-call-delta.ts deleted file mode 100644 index 0e14f4fa26..0000000000 --- a/src/gaos/models/interactions/file-search-call-delta.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export type FileSearchCallDelta = { - type: "file_search_call"; - /** - * A signature hash for backend validation. - */ - signature?: string | undefined; -}; diff --git a/src/gaos/models/interactions/file-search-call-step.ts b/src/gaos/models/interactions/file-search-call-step.ts deleted file mode 100644 index e9f2877f2f..0000000000 --- a/src/gaos/models/interactions/file-search-call-step.ts +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -/** - * File Search call step. - */ -export type FileSearchCallStep = { - type: "file_search_call"; - /** - * Required. A unique ID for this specific tool call. - */ - id: string; - /** - * A signature hash for backend validation. - */ - signature?: string | undefined; -}; diff --git a/src/gaos/models/interactions/file-search-result-delta.ts b/src/gaos/models/interactions/file-search-result-delta.ts deleted file mode 100644 index 83a8df1f56..0000000000 --- a/src/gaos/models/interactions/file-search-result-delta.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { FileSearchResult } from "./file-search-result.js"; - -export type FileSearchResultDelta = { - type: "file_search_result"; - result: Array; - /** - * A signature hash for backend validation. - */ - signature?: string | undefined; -}; diff --git a/src/gaos/models/interactions/file-search-result-step.ts b/src/gaos/models/interactions/file-search-result-step.ts deleted file mode 100644 index 6785eebc10..0000000000 --- a/src/gaos/models/interactions/file-search-result-step.ts +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -/** - * File Search result step. - */ -export type FileSearchResultStep = { - type: "file_search_result"; - /** - * Required. ID to match the ID from the function call block. - */ - call_id: string; - /** - * A signature hash for backend validation. - */ - signature?: string | undefined; -}; diff --git a/src/gaos/models/interactions/file-search-result.ts b/src/gaos/models/interactions/file-search-result.ts deleted file mode 100644 index 5543a7b7e7..0000000000 --- a/src/gaos/models/interactions/file-search-result.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -/** - * The result of the File Search. - */ -export type FileSearchResult = {}; diff --git a/src/gaos/models/interactions/file-search.ts b/src/gaos/models/interactions/file-search.ts deleted file mode 100644 index efe7532189..0000000000 --- a/src/gaos/models/interactions/file-search.ts +++ /dev/null @@ -1,30 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -/** - * A tool that can be used by the model to search files. - */ -export type FileSearch = { - type: "file_search"; - /** - * The file search store names to search. - */ - file_search_store_names?: Array | undefined; - /** - * The number of semantic retrieval chunks to retrieve. - */ - top_k?: number | undefined; - /** - * Metadata filter to apply to the semantic retrieval documents and chunks. - */ - metadata_filter?: string | undefined; -}; diff --git a/src/gaos/models/interactions/function-call-step.ts b/src/gaos/models/interactions/function-call-step.ts deleted file mode 100644 index ec68d55f7b..0000000000 --- a/src/gaos/models/interactions/function-call-step.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -/** - * A function tool call step. - */ -export type FunctionCallStep = { - type: "function_call"; - /** - * Required. The name of the tool to call. - */ - name: string; - /** - * Required. The arguments to pass to the function. - */ - arguments: { [k: string]: any }; - /** - * Required. A unique ID for this specific tool call. - */ - id: string; - /** - * A signature hash for backend validation. - */ - signature?: string | undefined; -}; diff --git a/src/gaos/models/interactions/function-result-delta.ts b/src/gaos/models/interactions/function-result-delta.ts deleted file mode 100644 index 493d7e4bb9..0000000000 --- a/src/gaos/models/interactions/function-result-delta.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { Content } from "./content.js"; - -export type FunctionResultDeltaResult = {}; - -export type FunctionResultDeltaResultUnion = - | Array - | FunctionResultDeltaResult - | string; - -export type FunctionResultDelta = { - type: "function_result"; - name?: string | undefined; - is_error?: boolean | undefined; - /** - * Required. ID to match the ID from the function call block. - */ - call_id: string; - result: Array | FunctionResultDeltaResult | string; -}; diff --git a/src/gaos/models/interactions/function-result-step.ts b/src/gaos/models/interactions/function-result-step.ts deleted file mode 100644 index a08ecad0a4..0000000000 --- a/src/gaos/models/interactions/function-result-step.ts +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { Content } from "./content.js"; - -export type FunctionResultStepResult = {}; - -/** - * The result of the tool call. - */ -export type FunctionResultStepResultUnion = - | Array - | FunctionResultStepResult - | string; - -/** - * Result of a function tool call. - */ -export type FunctionResultStep = { - type: "function_result"; - /** - * The name of the tool that was called. - */ - name?: string | undefined; - /** - * Whether the tool call resulted in an error. - */ - is_error?: boolean | undefined; - /** - * Required. ID to match the ID from the function call block. - */ - call_id: string; - /** - * A signature hash for backend validation. - */ - signature?: string | undefined; - /** - * The result of the tool call. - */ - result: Array | FunctionResultStepResult | string; -}; diff --git a/src/gaos/models/interactions/function.ts b/src/gaos/models/interactions/function.ts deleted file mode 100644 index 6979cf5cc6..0000000000 --- a/src/gaos/models/interactions/function.ts +++ /dev/null @@ -1,30 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -/** - * A tool that can be used by the model. - */ -export type FunctionT = { - /** - * A description of the function. - */ - description?: string | undefined; - /** - * The name of the function. - */ - name?: string | undefined; - /** - * The JSON Schema for the function's parameters. - */ - parameters?: any | undefined; - type: "function"; -}; diff --git a/src/gaos/models/interactions/generation-config.ts b/src/gaos/models/interactions/generation-config.ts deleted file mode 100644 index a6ca8f20f9..0000000000 --- a/src/gaos/models/interactions/generation-config.ts +++ /dev/null @@ -1,63 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ImageConfig } from "./image-config.js"; -import { SpeechConfig } from "./speech-config.js"; -import { ThinkingLevel } from "./thinking-level.js"; -import { ThinkingSummaries } from "./thinking-summaries.js"; -import { ToolChoiceConfig } from "./tool-choice-config.js"; -import { ToolChoiceType } from "./tool-choice-type.js"; - -/** - * The tool choice configuration. - */ -export type ToolChoice = ToolChoiceType | ToolChoiceConfig; - -/** - * Configuration parameters for model interactions. - */ -export type GenerationConfig = { - /** - * The configuration for image interaction. - */ - image_config?: ImageConfig | undefined; - /** - * The maximum number of tokens to include in the response. - */ - max_output_tokens?: number | undefined; - /** - * Seed used in decoding for reproducibility. - */ - seed?: number | undefined; - /** - * Configuration for speech interaction. - */ - speech_config?: Array | undefined; - /** - * A list of character sequences that will stop output interaction. - */ - stop_sequences?: Array | undefined; - /** - * Controls the randomness of the output. - */ - temperature?: number | undefined; - thinking_level?: ThinkingLevel | undefined; - thinking_summaries?: ThinkingSummaries | undefined; - /** - * The tool choice configuration. - */ - tool_choice?: ToolChoiceType | ToolChoiceConfig | undefined; - /** - * The maximum cumulative probability of tokens to consider when sampling. - */ - top_p?: number | undefined; -}; diff --git a/src/gaos/models/interactions/google-maps-call-arguments.ts b/src/gaos/models/interactions/google-maps-call-arguments.ts deleted file mode 100644 index 37b123351e..0000000000 --- a/src/gaos/models/interactions/google-maps-call-arguments.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -/** - * The arguments to pass to the Google Maps tool. - */ -export type GoogleMapsCallArguments = { - /** - * The queries to be executed. - */ - queries?: Array | undefined; -}; diff --git a/src/gaos/models/interactions/google-maps-call-delta.ts b/src/gaos/models/interactions/google-maps-call-delta.ts deleted file mode 100644 index 8f515dc3f1..0000000000 --- a/src/gaos/models/interactions/google-maps-call-delta.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { GoogleMapsCallArguments } from "./google-maps-call-arguments.js"; - -export type GoogleMapsCallDelta = { - /** - * The arguments to pass to the Google Maps tool. - */ - arguments?: GoogleMapsCallArguments | undefined; - /** - * A signature hash for backend validation. - */ - signature?: string | undefined; - type: "google_maps_call"; -}; diff --git a/src/gaos/models/interactions/google-maps-call-step.ts b/src/gaos/models/interactions/google-maps-call-step.ts deleted file mode 100644 index df1973bc95..0000000000 --- a/src/gaos/models/interactions/google-maps-call-step.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { GoogleMapsCallArguments } from "./google-maps-call-arguments.js"; - -/** - * Google Maps call step. - */ -export type GoogleMapsCallStep = { - /** - * The arguments to pass to the Google Maps tool. - */ - arguments?: GoogleMapsCallArguments | undefined; - /** - * Required. A unique ID for this specific tool call. - */ - id: string; - /** - * A signature hash for backend validation. - */ - signature?: string | undefined; - type: "google_maps_call"; -}; diff --git a/src/gaos/models/interactions/google-maps-result-delta.ts b/src/gaos/models/interactions/google-maps-result-delta.ts deleted file mode 100644 index bcab185c06..0000000000 --- a/src/gaos/models/interactions/google-maps-result-delta.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { GoogleMapsResult } from "./google-maps-result.js"; - -export type GoogleMapsResultDelta = { - type: "google_maps_result"; - /** - * The results of the Google Maps. - */ - result?: Array | undefined; - /** - * A signature hash for backend validation. - */ - signature?: string | undefined; -}; diff --git a/src/gaos/models/interactions/google-maps-result-places.ts b/src/gaos/models/interactions/google-maps-result-places.ts deleted file mode 100644 index 61762fad1f..0000000000 --- a/src/gaos/models/interactions/google-maps-result-places.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ReviewSnippet } from "./review-snippet.js"; - -export type GoogleMapsResultPlaces = { - place_id?: string | undefined; - name?: string | undefined; - url?: string | undefined; - review_snippets?: Array | undefined; -}; diff --git a/src/gaos/models/interactions/google-maps-result-step.ts b/src/gaos/models/interactions/google-maps-result-step.ts deleted file mode 100644 index a4ce13cadb..0000000000 --- a/src/gaos/models/interactions/google-maps-result-step.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { GoogleMapsResult } from "./google-maps-result.js"; - -/** - * Google Maps result step. - */ -export type GoogleMapsResultStep = { - type: "google_maps_result"; - result: Array; - /** - * Required. ID to match the ID from the function call block. - */ - call_id: string; - /** - * A signature hash for backend validation. - */ - signature?: string | undefined; -}; diff --git a/src/gaos/models/interactions/google-maps-result.ts b/src/gaos/models/interactions/google-maps-result.ts deleted file mode 100644 index fd47aa8fba..0000000000 --- a/src/gaos/models/interactions/google-maps-result.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { GoogleMapsResultPlaces } from "./google-maps-result-places.js"; - -/** - * The result of the Google Maps. - */ -export type GoogleMapsResult = { - places?: Array | undefined; - widget_context_token?: string | undefined; -}; diff --git a/src/gaos/models/interactions/google-maps.ts b/src/gaos/models/interactions/google-maps.ts deleted file mode 100644 index d2d1e34d7c..0000000000 --- a/src/gaos/models/interactions/google-maps.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -/** - * A tool that can be used by the model to call Google Maps. - */ -export type GoogleMaps = { - type: "google_maps"; - /** - * Whether to return a widget context token in the tool call result of the - * - * @remarks - * response. - */ - enable_widget?: boolean | undefined; - /** - * The latitude of the user's location. - */ - latitude?: number | undefined; - /** - * The longitude of the user's location. - */ - longitude?: number | undefined; -}; diff --git a/src/gaos/models/interactions/google-search-call-arguments.ts b/src/gaos/models/interactions/google-search-call-arguments.ts deleted file mode 100644 index 97f221c218..0000000000 --- a/src/gaos/models/interactions/google-search-call-arguments.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -/** - * The arguments to pass to Google Search. - */ -export type GoogleSearchCallArguments = { - /** - * Web search queries for the following-up web search. - */ - queries?: Array | undefined; -}; diff --git a/src/gaos/models/interactions/google-search-call-delta.ts b/src/gaos/models/interactions/google-search-call-delta.ts deleted file mode 100644 index af1037097b..0000000000 --- a/src/gaos/models/interactions/google-search-call-delta.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { GoogleSearchCallArguments } from "./google-search-call-arguments.js"; - -export type GoogleSearchCallDelta = { - type: "google_search_call"; - /** - * The arguments to pass to Google Search. - */ - arguments: GoogleSearchCallArguments; - /** - * A signature hash for backend validation. - */ - signature?: string | undefined; -}; diff --git a/src/gaos/models/interactions/google-search-call-step.ts b/src/gaos/models/interactions/google-search-call-step.ts deleted file mode 100644 index c499c5a24e..0000000000 --- a/src/gaos/models/interactions/google-search-call-step.ts +++ /dev/null @@ -1,45 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { GoogleSearchCallArguments } from "./google-search-call-arguments.js"; - -/** - * The type of search grounding enabled. - */ -export type GoogleSearchCallStepSearchType = - | "web_search" - | "image_search" - | "enterprise_web_search" - | (string & {}); - -/** - * Google Search call step. - */ -export type GoogleSearchCallStep = { - /** - * The arguments to pass to Google Search. - */ - arguments?: GoogleSearchCallArguments | undefined; - /** - * Required. A unique ID for this specific tool call. - */ - id: string; - /** - * The type of search grounding enabled. - */ - search_type?: GoogleSearchCallStepSearchType | undefined; - /** - * A signature hash for backend validation. - */ - signature?: string | undefined; - type: "google_search_call"; -}; diff --git a/src/gaos/models/interactions/google-search-result-delta.ts b/src/gaos/models/interactions/google-search-result-delta.ts deleted file mode 100644 index 425449e217..0000000000 --- a/src/gaos/models/interactions/google-search-result-delta.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { GoogleSearchResult } from "./google-search-result.js"; - -export type GoogleSearchResultDelta = { - type: "google_search_result"; - result: Array; - is_error?: boolean | undefined; - /** - * A signature hash for backend validation. - */ - signature?: string | undefined; -}; diff --git a/src/gaos/models/interactions/google-search-result-step.ts b/src/gaos/models/interactions/google-search-result-step.ts deleted file mode 100644 index 632623b8d4..0000000000 --- a/src/gaos/models/interactions/google-search-result-step.ts +++ /dev/null @@ -1,36 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { GoogleSearchResult } from "./google-search-result.js"; - -/** - * Google Search result step. - */ -export type GoogleSearchResultStep = { - type: "google_search_result"; - /** - * The results of the Google Search. - */ - result?: Array | undefined; - /** - * Whether the Google Search resulted in an error. - */ - is_error?: boolean | undefined; - /** - * Required. ID to match the ID from the function call block. - */ - call_id: string; - /** - * A signature hash for backend validation. - */ - signature?: string | undefined; -}; diff --git a/src/gaos/models/interactions/google-search-result.ts b/src/gaos/models/interactions/google-search-result.ts deleted file mode 100644 index 0358d9e20b..0000000000 --- a/src/gaos/models/interactions/google-search-result.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -/** - * The result of the Google Search. - */ -export type GoogleSearchResult = { - /** - * Web content snippet that can be embedded in a web page or an app webview. - */ - search_suggestions?: string | undefined; -}; diff --git a/src/gaos/models/interactions/google-search.ts b/src/gaos/models/interactions/google-search.ts deleted file mode 100644 index a325acb3ae..0000000000 --- a/src/gaos/models/interactions/google-search.ts +++ /dev/null @@ -1,28 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export type GoogleSearchSearchType = - | "web_search" - | "image_search" - | "enterprise_web_search" - | (string & {}); - -/** - * A tool that can be used by the model to search Google. - */ -export type GoogleSearch = { - type: "google_search"; - /** - * The types of search grounding to enable. - */ - search_types?: Array | undefined; -}; diff --git a/src/gaos/models/interactions/grounding-tool-count.ts b/src/gaos/models/interactions/grounding-tool-count.ts deleted file mode 100644 index ca17720321..0000000000 --- a/src/gaos/models/interactions/grounding-tool-count.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -/** - * The grounding tool type associated with the count. - */ -export type GroundingToolCountType = - | "google_search" - | "google_maps" - | "retrieval" - | (string & {}); - -/** - * The number of grounding tool counts. - */ -export type GroundingToolCount = { - /** - * The grounding tool type associated with the count. - */ - type?: GroundingToolCountType | undefined; - /** - * The number of grounding tool counts. - */ - count?: number | undefined; -}; diff --git a/src/gaos/models/interactions/image-config.ts b/src/gaos/models/interactions/image-config.ts deleted file mode 100644 index 727146dafa..0000000000 --- a/src/gaos/models/interactions/image-config.ts +++ /dev/null @@ -1,38 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export type ImageConfigAspectRatio = - | "1:1" - | "2:3" - | "3:2" - | "3:4" - | "4:3" - | "4:5" - | "5:4" - | "9:16" - | "16:9" - | "21:9" - | "1:8" - | "8:1" - | "1:4" - | "4:1" - | (string & {}); - -export type ImageConfigImageSize = "1K" | "2K" | "4K" | "512" | (string & {}); - -/** - * The configuration for image interaction. - */ -export type ImageConfig = { - aspect_ratio?: ImageConfigAspectRatio | undefined; - image_size?: ImageConfigImageSize | undefined; -}; diff --git a/src/gaos/models/interactions/image-content.ts b/src/gaos/models/interactions/image-content.ts deleted file mode 100644 index 55b9994d1d..0000000000 --- a/src/gaos/models/interactions/image-content.ts +++ /dev/null @@ -1,47 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { MediaResolution } from "./media-resolution.js"; - -/** - * The mime type of the image. - */ -export type ImageContentMimeType = - | "image/png" - | "image/jpeg" - | "image/webp" - | "image/heic" - | "image/heif" - | "image/gif" - | "image/bmp" - | "image/tiff" - | (string & {}); - -/** - * An image content block. - */ -export type ImageContent = { - /** - * The image content. - */ - data?: string | undefined; - /** - * The mime type of the image. - */ - mime_type?: ImageContentMimeType | undefined; - resolution?: MediaResolution | undefined; - type: "image"; - /** - * The URI of the image. - */ - uri?: string | undefined; -}; diff --git a/src/gaos/models/interactions/image-delta.ts b/src/gaos/models/interactions/image-delta.ts deleted file mode 100644 index 32350580e4..0000000000 --- a/src/gaos/models/interactions/image-delta.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { MediaResolution } from "./media-resolution.js"; - -export type ImageDeltaMimeType = - | "image/png" - | "image/jpeg" - | "image/webp" - | "image/heic" - | "image/heif" - | "image/gif" - | "image/bmp" - | "image/tiff" - | (string & {}); - -export type ImageDelta = { - data?: string | undefined; - mime_type?: ImageDeltaMimeType | undefined; - resolution?: MediaResolution | undefined; - type: "image"; - uri?: string | undefined; -}; diff --git a/src/gaos/models/interactions/image-response-format.ts b/src/gaos/models/interactions/image-response-format.ts deleted file mode 100644 index 4adda8ea7b..0000000000 --- a/src/gaos/models/interactions/image-response-format.ts +++ /dev/null @@ -1,74 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -/** - * The MIME type of the image output. - */ -export type ImageResponseFormatMimeType = "image/jpeg"; - -/** - * The delivery mode for the image output. - */ -export type ImageResponseFormatDelivery = "inline" | "uri" | (string & {}); - -/** - * The aspect ratio for the image output. - */ -export type ImageResponseFormatAspectRatio = - | "1:1" - | "2:3" - | "3:2" - | "3:4" - | "4:3" - | "4:5" - | "5:4" - | "9:16" - | "16:9" - | "21:9" - | "1:8" - | "8:1" - | "1:4" - | "4:1" - | (string & {}); - -/** - * The size of the image output. - */ -export type ImageResponseFormatImageSize = - | "512" - | "1K" - | "2K" - | "4K" - | (string & {}); - -/** - * Configuration for image output format. - */ -export type ImageResponseFormat = { - type: "image"; - /** - * The MIME type of the image output. - */ - mime_type?: ImageResponseFormatMimeType | undefined; - /** - * The delivery mode for the image output. - */ - delivery?: ImageResponseFormatDelivery | undefined; - /** - * The aspect ratio for the image output. - */ - aspect_ratio?: ImageResponseFormatAspectRatio | undefined; - /** - * The size of the image output. - */ - image_size?: ImageResponseFormatImageSize | undefined; -}; diff --git a/src/gaos/models/interactions/index.ts b/src/gaos/models/interactions/index.ts deleted file mode 100644 index 8ba7173453..0000000000 --- a/src/gaos/models/interactions/index.ts +++ /dev/null @@ -1,129 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export * from "./agent-option.js"; -export * from "./allowed-tools.js"; -export * from "./allowlist-entry.js"; -export * from "./annotation.js"; -export * from "./arguments-delta.js"; -export * from "./audio-content.js"; -export * from "./audio-delta.js"; -export * from "./audio-response-format.js"; -export * from "./code-execution-call-arguments.js"; -export * from "./code-execution-call-delta.js"; -export * from "./code-execution-call-step.js"; -export * from "./code-execution-result-delta.js"; -export * from "./code-execution-result-step.js"; -export * from "./code-execution.js"; -export * from "./computer-use.js"; -export * from "./content.js"; -export * from "./create-agent-interaction.js"; -export * from "./create-model-interaction.js"; -export * from "./deep-research-agent-config.js"; -export * from "./document-content.js"; -export * from "./document-delta.js"; -export * from "./dynamic-agent-config.js"; -export * from "./empty.js"; -export * from "./environment-network-egress-allowlist-union.js"; -export * from "./environment.js"; -export * from "./error-event.js"; -export * from "./error.js"; -export * from "./file-citation.js"; -export * from "./file-search-call-delta.js"; -export * from "./file-search-call-step.js"; -export * from "./file-search-result-delta.js"; -export * from "./file-search-result-step.js"; -export * from "./file-search-result.js"; -export * from "./file-search.js"; -export * from "./function-call-step.js"; -export * from "./function-result-delta.js"; -export * from "./function-result-step.js"; -export * from "./function.js"; -export * from "./generation-config.js"; -export * from "./google-maps-call-arguments.js"; -export * from "./google-maps-call-delta.js"; -export * from "./google-maps-call-step.js"; -export * from "./google-maps-result-delta.js"; -export * from "./google-maps-result-places.js"; -export * from "./google-maps-result-step.js"; -export * from "./google-maps-result.js"; -export * from "./google-maps.js"; -export * from "./google-search-call-arguments.js"; -export * from "./google-search-call-delta.js"; -export * from "./google-search-call-step.js"; -export * from "./google-search-result-delta.js"; -export * from "./google-search-result-step.js"; -export * from "./google-search-result.js"; -export * from "./google-search.js"; -export * from "./grounding-tool-count.js"; -export * from "./image-config.js"; -export * from "./image-content.js"; -export * from "./image-delta.js"; -export * from "./image-response-format.js"; -export * from "./interaction-completed-event.js"; -export * from "./interaction-created-event.js"; -export * from "./interaction-sse-event-interaction.js"; -export * from "./interaction-sse-event.js"; -export * from "./interaction-sse-stream-event.js"; -export * from "./interaction-status-update.js"; -export * from "./interaction.js"; -export * from "./interactions-input.js"; -export * from "./mcp-server-tool-call-delta.js"; -export * from "./mcp-server-tool-call-step.js"; -export * from "./mcp-server-tool-result-delta.js"; -export * from "./mcp-server-tool-result-step.js"; -export * from "./mcp-server.js"; -export * from "./media-resolution.js"; -export * from "./modality-tokens.js"; -export * from "./model-output-step.js"; -export * from "./model.js"; -export * from "./place-citation.js"; -export * from "./response-format.js"; -export * from "./response-modality.js"; -export * from "./retrieval.js"; -export * from "./review-snippet.js"; -export * from "./service-tier.js"; -export * from "./source.js"; -export * from "./speech-config.js"; -export * from "./step-delta-data.js"; -export * from "./step-delta-metadata.js"; -export * from "./step-delta.js"; -export * from "./step-start.js"; -export * from "./step-stop.js"; -export * from "./step.js"; -export * from "./text-annotation-delta.js"; -export * from "./text-content.js"; -export * from "./text-delta.js"; -export * from "./text-response-format.js"; -export * from "./thinking-level.js"; -export * from "./thinking-summaries.js"; -export * from "./thought-signature-delta.js"; -export * from "./thought-step.js"; -export * from "./thought-summary-content.js"; -export * from "./thought-summary-delta.js"; -export * from "./tool-choice-config.js"; -export * from "./tool-choice-type.js"; -export * from "./tool.js"; -export * from "./url-citation.js"; -export * from "./url-context-call-arguments.js"; -export * from "./url-context-call-delta.js"; -export * from "./url-context-call-step.js"; -export * from "./url-context-result-delta.js"; -export * from "./url-context-result-step.js"; -export * from "./url-context-result.js"; -export * from "./url-context.js"; -export * from "./usage.js"; -export * from "./user-input-step.js"; -export * from "./vertex-ai-search-config.js"; -export * from "./video-content.js"; -export * from "./video-delta.js"; -export * from "./webhook-config.js"; diff --git a/src/gaos/models/interactions/interaction-completed-event.ts b/src/gaos/models/interactions/interaction-completed-event.ts deleted file mode 100644 index 7f97e7e384..0000000000 --- a/src/gaos/models/interactions/interaction-completed-event.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { InteractionSseEventInteraction } from "./interaction-sse-event-interaction.js"; - -export type InteractionCompletedEvent = { - /** - * The event_id token to be used to resume the interaction stream, from - * - * @remarks - * this event. - */ - event_id?: string | undefined; - event_type: "interaction.completed"; - /** - * Partial interaction resource emitted by interaction lifecycle SSE events. - * - * @remarks - * Streaming lifecycle payloads may omit fields that are only available on - * full non-streaming Interaction responses. - */ - interaction: InteractionSseEventInteraction; -}; diff --git a/src/gaos/models/interactions/interaction-created-event.ts b/src/gaos/models/interactions/interaction-created-event.ts deleted file mode 100644 index 5da71f89c5..0000000000 --- a/src/gaos/models/interactions/interaction-created-event.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { InteractionSseEventInteraction } from "./interaction-sse-event-interaction.js"; - -export type InteractionCreatedEvent = { - /** - * The event_id token to be used to resume the interaction stream, from - * - * @remarks - * this event. - */ - event_id?: string | undefined; - event_type: "interaction.created"; - /** - * Partial interaction resource emitted by interaction lifecycle SSE events. - * - * @remarks - * Streaming lifecycle payloads may omit fields that are only available on - * full non-streaming Interaction responses. - */ - interaction: InteractionSseEventInteraction; -}; diff --git a/src/gaos/models/interactions/interaction-sse-event-interaction.ts b/src/gaos/models/interactions/interaction-sse-event-interaction.ts deleted file mode 100644 index 04cd7a9ada..0000000000 --- a/src/gaos/models/interactions/interaction-sse-event-interaction.ts +++ /dev/null @@ -1,74 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ServiceTier } from "./service-tier.js"; -import { Step } from "./step.js"; -import { Usage } from "./usage.js"; - -/** - * Required. Output only. The status of the interaction. - */ -export type InteractionSseEventInteractionStatus = - | "in_progress" - | "requires_action" - | "completed" - | "failed" - | "cancelled" - | "incomplete" - | (string & {}); - -/** - * Partial interaction resource emitted by interaction lifecycle SSE events. - * - * @remarks - * Streaming lifecycle payloads may omit fields that are only available on - * full non-streaming Interaction responses. - */ -export type InteractionSseEventInteraction = { - /** - * Required. Output only. A unique identifier for the interaction completion. - */ - id: string; - /** - * Output only. The resource type. - */ - object?: string | undefined; - /** - * The model that will complete your prompt. - */ - model?: string | undefined; - /** - * The agent to interact with. - */ - agent?: string | undefined; - /** - * Required. Output only. The status of the interaction. - */ - status: InteractionSseEventInteractionStatus; - /** - * Output only. The time at which the response was created in ISO 8601 format. - */ - created?: string | undefined; - /** - * Output only. The time at which the response was last updated in ISO 8601 format. - */ - updated?: string | undefined; - service_tier?: ServiceTier | undefined; - /** - * Statistics on the interaction request's token usage. - */ - usage?: Usage | undefined; - /** - * Output only. The steps that make up the interaction, if included in this event. - */ - steps?: Array | undefined; -}; diff --git a/src/gaos/models/interactions/interaction-sse-event.ts b/src/gaos/models/interactions/interaction-sse-event.ts deleted file mode 100644 index aee3ae5238..0000000000 --- a/src/gaos/models/interactions/interaction-sse-event.ts +++ /dev/null @@ -1,28 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ErrorEvent } from "./error-event.js"; -import { InteractionCompletedEvent } from "./interaction-completed-event.js"; -import { InteractionCreatedEvent } from "./interaction-created-event.js"; -import { InteractionStatusUpdate } from "./interaction-status-update.js"; -import { StepDelta } from "./step-delta.js"; -import { StepStart } from "./step-start.js"; -import { StepStop } from "./step-stop.js"; - -export type InteractionSSEEvent = - | InteractionCreatedEvent - | InteractionCompletedEvent - | InteractionStatusUpdate - | ErrorEvent - | StepStart - | StepDelta - | StepStop; diff --git a/src/gaos/models/interactions/interaction-sse-stream-event.ts b/src/gaos/models/interactions/interaction-sse-stream-event.ts deleted file mode 100644 index 6c7d0e6033..0000000000 --- a/src/gaos/models/interactions/interaction-sse-stream-event.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { InteractionSSEEvent } from "./interaction-sse-event.js"; - -export type InteractionSSEStreamEvent = { - data: InteractionSSEEvent; -}; diff --git a/src/gaos/models/interactions/interaction-status-update.ts b/src/gaos/models/interactions/interaction-status-update.ts deleted file mode 100644 index 0241a566cf..0000000000 --- a/src/gaos/models/interactions/interaction-status-update.ts +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { Usage } from "./usage.js"; - -export type InteractionStatusUpdateStatus = - | "in_progress" - | "requires_action" - | "completed" - | "failed" - | "cancelled" - | "incomplete" - | "budget_exceeded" - | (string & {}); - -/** - * Optional metadata accompanying ANY streamed event. - */ -export type InteractionStatusUpdateMetadata = { - /** - * Statistics on the interaction request's token usage. - */ - total_usage?: Usage | undefined; -}; - -export type InteractionStatusUpdate = { - event_type: "interaction.status_update"; - interaction_id: string; - status: InteractionStatusUpdateStatus; - /** - * The event_id token to be used to resume the interaction stream, from - * - * @remarks - * this event. - */ - event_id?: string | undefined; - /** - * Optional metadata accompanying ANY streamed event. - */ - metadata?: InteractionStatusUpdateMetadata | undefined; -}; diff --git a/src/gaos/models/interactions/interaction.ts b/src/gaos/models/interactions/interaction.ts deleted file mode 100644 index 656629582b..0000000000 --- a/src/gaos/models/interactions/interaction.ts +++ /dev/null @@ -1,189 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { AgentOption } from "./agent-option.js"; -import { AudioContent } from "./audio-content.js"; -import { Content } from "./content.js"; -import { DeepResearchAgentConfig } from "./deep-research-agent-config.js"; -import { DynamicAgentConfig } from "./dynamic-agent-config.js"; -import { Environment } from "./environment.js"; -import { GenerationConfig } from "./generation-config.js"; -import { ImageContent } from "./image-content.js"; -import { InteractionsInput } from "./interactions-input.js"; -import { Model } from "./model.js"; -import { ResponseFormat } from "./response-format.js"; -import { ResponseModality } from "./response-modality.js"; -import { ServiceTier } from "./service-tier.js"; -import { Step } from "./step.js"; -import { Tool } from "./tool.js"; -import { Usage } from "./usage.js"; -import { VideoContent } from "./video-content.js"; -import { WebhookConfig } from "./webhook-config.js"; - -/** - * The environment configuration for the interaction. Can be an object specifying remote environment sources or a string referencing an existing environment ID. - */ -export type InteractionEnvironment = Environment | string; - -/** - * Required. Output only. The status of the interaction. - */ -export type InteractionStatus = - | "in_progress" - | "requires_action" - | "completed" - | "failed" - | "cancelled" - | "incomplete" - | (string & {}); - -/** - * Configuration parameters for the agent interaction. - */ -export type InteractionAgentConfig = - | DynamicAgentConfig - | DeepResearchAgentConfig; - -/** - * Enforces that the generated response is a JSON object that complies with the JSON schema specified in this field. - */ -export type InteractionResponseFormat = Array | ResponseFormat; - -/** - * The Interaction resource. - */ -export type Interaction = { - /** - * The model that will complete your prompt.\n\nSee [models](https://ai.google.dev/gemini-api/docs/models) for additional details. - */ - model?: Model | undefined; - /** - * The agent to interact with. - */ - agent?: AgentOption | undefined; - /** - * Output only. The time at which the response was created in ISO 8601 format - * - * @remarks - * (YYYY-MM-DDThh:mm:ssZ). - */ - created?: string | undefined; - /** - * The environment configuration for the interaction. Can be an object specifying remote environment sources or a string referencing an existing environment ID. - */ - environment?: Environment | string | undefined; - /** - * Output only. The environment ID for the interaction. Only populated if environment - * - * @remarks - * config is set in the request. - */ - environment_id?: string | undefined; - /** - * Required. Output only. A unique identifier for the interaction completion. - */ - id: string; - /** - * The ID of the previous interaction, if any. - */ - previous_interaction_id?: string | undefined; - /** - * The mime type of the response. This is required if response_format is set. - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - response_mime_type?: string | undefined; - /** - * The requested modalities of the response (TEXT, IMAGE, AUDIO). - */ - response_modalities?: Array | undefined; - /** - * Output only. The role of the interaction. - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - role?: string | undefined; - service_tier?: ServiceTier | undefined; - /** - * Required. Output only. The status of the interaction. - */ - status: InteractionStatus; - /** - * Output only. The steps that make up the interaction, when included in the response. - */ - steps?: Array | undefined; - /** - * System instruction for the interaction. - */ - system_instruction?: string | undefined; - /** - * A list of tool declarations the model may call during interaction. - */ - tools?: Array | undefined; - /** - * Output only. The time at which the response was last updated in ISO 8601 format - * - * @remarks - * (YYYY-MM-DDThh:mm:ssZ). - */ - updated?: string | undefined; - /** - * Statistics on the interaction request's token usage. - */ - usage?: Usage | undefined; - /** - * Message for configuring webhook events for a request. - */ - webhook_config?: WebhookConfig | undefined; - /** - * Configuration parameters for model interactions. - */ - generation_config?: GenerationConfig | undefined; - /** - * Configuration parameters for the agent interaction. - */ - agent_config?: DynamicAgentConfig | DeepResearchAgentConfig | undefined; - /** - * Enforces that the generated response is a JSON object that complies with the JSON schema specified in this field. - */ - response_format?: Array | ResponseFormat | undefined; - /** - * The input for the interaction. - */ - input?: InteractionsInput | undefined; - /** - * Output only. Legacy responses from the model. - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - outputs?: Array | undefined; - /** - * Concatenated text from the last model output in response to the current request. - * - * @remarks - * - * Note: this is added by the SDK. - */ - output_text?: string | undefined; - /** - * An image content block. - */ - output_image?: ImageContent | undefined; - /** - * An audio content block. - */ - output_audio?: AudioContent | undefined; - /** - * A video content block. - */ - output_video?: VideoContent | undefined; -}; diff --git a/src/gaos/models/interactions/interactions-input.ts b/src/gaos/models/interactions/interactions-input.ts deleted file mode 100644 index 11dc66aba7..0000000000 --- a/src/gaos/models/interactions/interactions-input.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { Content } from "./content.js"; -import { Step } from "./step.js"; - -/** - * The input for the interaction. - */ -export type InteractionsInput = string | Array | Array | Content; diff --git a/src/gaos/models/interactions/mcp-server-tool-call-delta.ts b/src/gaos/models/interactions/mcp-server-tool-call-delta.ts deleted file mode 100644 index 9344ce1557..0000000000 --- a/src/gaos/models/interactions/mcp-server-tool-call-delta.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export type MCPServerToolCallDelta = { - type: "mcp_server_tool_call"; - name: string; - server_name: string; - arguments: { [k: string]: any }; - /** - * A signature hash for backend validation. - */ - signature?: string | undefined; -}; diff --git a/src/gaos/models/interactions/mcp-server-tool-call-step.ts b/src/gaos/models/interactions/mcp-server-tool-call-step.ts deleted file mode 100644 index f57569dc24..0000000000 --- a/src/gaos/models/interactions/mcp-server-tool-call-step.ts +++ /dev/null @@ -1,38 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -/** - * MCPServer tool call step. - */ -export type MCPServerToolCallStep = { - type: "mcp_server_tool_call"; - /** - * Required. The name of the tool which was called. - */ - name: string; - /** - * Required. The name of the used MCP server. - */ - server_name: string; - /** - * Required. The JSON object of arguments for the function. - */ - arguments: { [k: string]: any }; - /** - * Required. A unique ID for this specific tool call. - */ - id: string; - /** - * A signature hash for backend validation. - */ - signature?: string | undefined; -}; diff --git a/src/gaos/models/interactions/mcp-server-tool-result-delta.ts b/src/gaos/models/interactions/mcp-server-tool-result-delta.ts deleted file mode 100644 index 58c9c09cde..0000000000 --- a/src/gaos/models/interactions/mcp-server-tool-result-delta.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { Content } from "./content.js"; - -export type MCPServerToolResultDeltaResult = {}; - -export type MCPServerToolResultDeltaResultUnion = - | Array - | MCPServerToolResultDeltaResult - | string; - -export type MCPServerToolResultDelta = { - type: "mcp_server_tool_result"; - name?: string | undefined; - server_name?: string | undefined; - /** - * A signature hash for backend validation. - */ - signature?: string | undefined; - result: Array | MCPServerToolResultDeltaResult | string; -}; diff --git a/src/gaos/models/interactions/mcp-server-tool-result-step.ts b/src/gaos/models/interactions/mcp-server-tool-result-step.ts deleted file mode 100644 index fbb50abf20..0000000000 --- a/src/gaos/models/interactions/mcp-server-tool-result-step.ts +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { Content } from "./content.js"; - -export type MCPServerToolResultStepResult = {}; - -/** - * The output from the MCP server call. Can be simple text or rich content. - */ -export type MCPServerToolResultStepResultUnion = - | Array - | MCPServerToolResultStepResult - | string; - -/** - * MCPServer tool result step. - */ -export type MCPServerToolResultStep = { - type: "mcp_server_tool_result"; - /** - * Name of the tool which is called for this specific tool call. - */ - name?: string | undefined; - /** - * The name of the used MCP server. - */ - server_name?: string | undefined; - /** - * Required. ID to match the ID from the function call block. - */ - call_id: string; - /** - * A signature hash for backend validation. - */ - signature?: string | undefined; - /** - * The output from the MCP server call. Can be simple text or rich content. - */ - result: Array | MCPServerToolResultStepResult | string; -}; diff --git a/src/gaos/models/interactions/mcp-server.ts b/src/gaos/models/interactions/mcp-server.ts deleted file mode 100644 index beb6a2395f..0000000000 --- a/src/gaos/models/interactions/mcp-server.ts +++ /dev/null @@ -1,39 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { AllowedTools } from "./allowed-tools.js"; - -/** - * A MCPServer is a server that can be called by the model to perform actions. - */ -export type MCPServer = { - type: "mcp_server"; - /** - * The name of the MCPServer. - */ - name?: string | undefined; - /** - * The full URL for the MCPServer endpoint. - * - * @remarks - * Example: "https://api.example.com/mcp" - */ - url?: string | undefined; - /** - * Optional: Fields for authentication headers, timeouts, etc., if needed. - */ - headers?: { [k: string]: string } | undefined; - /** - * The allowed tools. - */ - allowed_tools?: Array | undefined; -}; diff --git a/src/gaos/models/interactions/media-resolution.ts b/src/gaos/models/interactions/media-resolution.ts deleted file mode 100644 index c704fbe629..0000000000 --- a/src/gaos/models/interactions/media-resolution.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export type MediaResolution = - | "low" - | "medium" - | "high" - | "ultra_high" - | (string & {}); diff --git a/src/gaos/models/interactions/modality-tokens.ts b/src/gaos/models/interactions/modality-tokens.ts deleted file mode 100644 index fa6a09e8f8..0000000000 --- a/src/gaos/models/interactions/modality-tokens.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ResponseModality } from "./response-modality.js"; - -/** - * The token count for a single response modality. - */ -export type ModalityTokens = { - modality?: ResponseModality | undefined; - /** - * Number of tokens for the modality. - */ - tokens?: number | undefined; -}; diff --git a/src/gaos/models/interactions/model-output-step.ts b/src/gaos/models/interactions/model-output-step.ts deleted file mode 100644 index 307c202714..0000000000 --- a/src/gaos/models/interactions/model-output-step.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { Content } from "./content.js"; - -/** - * Output generated by the model. - */ -export type ModelOutputStep = { - type: "model_output"; - content?: Array | undefined; -}; diff --git a/src/gaos/models/interactions/model.ts b/src/gaos/models/interactions/model.ts deleted file mode 100644 index 6f912b1f20..0000000000 --- a/src/gaos/models/interactions/model.ts +++ /dev/null @@ -1,37 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -/** - * The model that will complete your prompt.\n\nSee [models](https://ai.google.dev/gemini-api/docs/models) for additional details. - */ -export type Model = - | "gemini-2.5-computer-use-preview-10-2025" - | "gemini-2.5-flash" - | "gemini-2.5-flash-image" - | "gemini-2.5-flash-lite" - | "gemini-2.5-flash-lite-preview-09-2025" - | "gemini-2.5-flash-native-audio-preview-12-2025" - | "gemini-2.5-flash-preview-09-2025" - | "gemini-2.5-flash-preview-tts" - | "gemini-2.5-pro" - | "gemini-2.5-pro-preview-tts" - | "gemini-3-flash-preview" - | "gemini-3-pro-image-preview" - | "gemini-3-pro-preview" - | "gemini-3.1-pro-preview" - | "gemini-3.1-flash-image-preview" - | "gemini-3.1-flash-lite" - | "gemini-3.1-flash-lite-preview" - | "gemini-3.1-flash-tts-preview" - | "lyria-3-clip-preview" - | "lyria-3-pro-preview" - | (string & {}); diff --git a/src/gaos/models/interactions/place-citation.ts b/src/gaos/models/interactions/place-citation.ts deleted file mode 100644 index 108145491e..0000000000 --- a/src/gaos/models/interactions/place-citation.ts +++ /dev/null @@ -1,51 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ReviewSnippet } from "./review-snippet.js"; - -/** - * A place citation annotation. - */ -export type PlaceCitation = { - type: "place_citation"; - /** - * The ID of the place, in `places/{place_id}` format. - */ - place_id?: string | undefined; - /** - * Title of the place. - */ - name?: string | undefined; - /** - * URI reference of the place. - */ - url?: string | undefined; - /** - * Snippets of reviews that are used to generate answers about the - * - * @remarks - * features of a given place in Google Maps. - */ - review_snippets?: Array | undefined; - /** - * Start of segment of the response that is attributed to this source. - * - * @remarks - * - * Index indicates the start of the segment, measured in bytes. - */ - start_index?: number | undefined; - /** - * End of the attributed segment, exclusive. - */ - end_index?: number | undefined; -}; diff --git a/src/gaos/models/interactions/response-format.ts b/src/gaos/models/interactions/response-format.ts deleted file mode 100644 index b505b94e30..0000000000 --- a/src/gaos/models/interactions/response-format.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { AudioResponseFormat } from "./audio-response-format.js"; -import { ImageResponseFormat } from "./image-response-format.js"; -import { TextResponseFormat } from "./text-response-format.js"; - -export type ResponseFormat = - | AudioResponseFormat - | ImageResponseFormat - | TextResponseFormat - | { [k: string]: any }; diff --git a/src/gaos/models/interactions/response-modality.ts b/src/gaos/models/interactions/response-modality.ts deleted file mode 100644 index dbdd396bd8..0000000000 --- a/src/gaos/models/interactions/response-modality.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export type ResponseModality = - | "text" - | "image" - | "audio" - | "video" - | "document" - | (string & {}); diff --git a/src/gaos/models/interactions/retrieval.ts b/src/gaos/models/interactions/retrieval.ts deleted file mode 100644 index 81c1b224c7..0000000000 --- a/src/gaos/models/interactions/retrieval.ts +++ /dev/null @@ -1,30 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { VertexAISearchConfig } from "./vertex-ai-search-config.js"; - -export type RetrievalType = "vertex_ai_search"; - -/** - * A tool that can be used by the model to retrieve files. - */ -export type Retrieval = { - /** - * The types of file retrieval to enable. - */ - retrieval_types?: Array | undefined; - type: "retrieval"; - /** - * Used to specify configuration for VertexAISearch. - */ - vertex_ai_search_config?: VertexAISearchConfig | undefined; -}; diff --git a/src/gaos/models/interactions/review-snippet.ts b/src/gaos/models/interactions/review-snippet.ts deleted file mode 100644 index 2c052f08f8..0000000000 --- a/src/gaos/models/interactions/review-snippet.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -/** - * Encapsulates a snippet of a user review that answers a question about - * - * @remarks - * the features of a specific place in Google Maps. - */ -export type ReviewSnippet = { - /** - * Title of the review. - */ - title?: string | undefined; - /** - * A link that corresponds to the user review on Google Maps. - */ - url?: string | undefined; - /** - * The ID of the review snippet. - */ - review_id?: string | undefined; -}; diff --git a/src/gaos/models/interactions/service-tier.ts b/src/gaos/models/interactions/service-tier.ts deleted file mode 100644 index 6bbf91da7c..0000000000 --- a/src/gaos/models/interactions/service-tier.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export type ServiceTier = "flex" | "standard" | "priority" | (string & {}); diff --git a/src/gaos/models/interactions/source.ts b/src/gaos/models/interactions/source.ts deleted file mode 100644 index 7d7494737d..0000000000 --- a/src/gaos/models/interactions/source.ts +++ /dev/null @@ -1,45 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export type SourceType = - | "gcs" - | "inline" - | "repository" - | "skill_registry" - | (string & {}); - -/** - * A source to be mounted into the environment. - */ -export type Source = { - type?: SourceType | undefined; - /** - * The source of the environment. - * - * @remarks - * For GCS, this is the GCS path. - * For GitHub, this is the GitHub path. - */ - source?: string | undefined; - /** - * Where the source should appear in the environment. - */ - target?: string | undefined; - /** - * The inline content if `type` is `INLINE`. - */ - content?: string | undefined; - /** - * Optional encoding for inline content (e.g. `base64`). - */ - encoding?: string | undefined; -}; diff --git a/src/gaos/models/interactions/speech-config.ts b/src/gaos/models/interactions/speech-config.ts deleted file mode 100644 index 4329733830..0000000000 --- a/src/gaos/models/interactions/speech-config.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -/** - * The configuration for speech interaction. - */ -export type SpeechConfig = { - /** - * The voice of the speaker. - */ - voice?: string | undefined; - /** - * The language of the speech. - */ - language?: string | undefined; - /** - * The speaker's name, it should match the speaker name given in the prompt. - */ - speaker?: string | undefined; -}; diff --git a/src/gaos/models/interactions/step-delta-data.ts b/src/gaos/models/interactions/step-delta-data.ts deleted file mode 100644 index 08fb4aba77..0000000000 --- a/src/gaos/models/interactions/step-delta-data.ts +++ /dev/null @@ -1,58 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ArgumentsDelta } from "./arguments-delta.js"; -import { AudioDelta } from "./audio-delta.js"; -import { CodeExecutionCallDelta } from "./code-execution-call-delta.js"; -import { CodeExecutionResultDelta } from "./code-execution-result-delta.js"; -import { DocumentDelta } from "./document-delta.js"; -import { FileSearchCallDelta } from "./file-search-call-delta.js"; -import { FileSearchResultDelta } from "./file-search-result-delta.js"; -import { FunctionResultDelta } from "./function-result-delta.js"; -import { GoogleMapsCallDelta } from "./google-maps-call-delta.js"; -import { GoogleMapsResultDelta } from "./google-maps-result-delta.js"; -import { GoogleSearchCallDelta } from "./google-search-call-delta.js"; -import { GoogleSearchResultDelta } from "./google-search-result-delta.js"; -import { ImageDelta } from "./image-delta.js"; -import { MCPServerToolCallDelta } from "./mcp-server-tool-call-delta.js"; -import { MCPServerToolResultDelta } from "./mcp-server-tool-result-delta.js"; -import { TextAnnotationDelta } from "./text-annotation-delta.js"; -import { TextDelta } from "./text-delta.js"; -import { ThoughtSignatureDelta } from "./thought-signature-delta.js"; -import { ThoughtSummaryDelta } from "./thought-summary-delta.js"; -import { URLContextCallDelta } from "./url-context-call-delta.js"; -import { URLContextResultDelta } from "./url-context-result-delta.js"; -import { VideoDelta } from "./video-delta.js"; - -export type StepDeltaData = - | ArgumentsDelta - | AudioDelta - | CodeExecutionCallDelta - | CodeExecutionResultDelta - | DocumentDelta - | FileSearchCallDelta - | FileSearchResultDelta - | FunctionResultDelta - | GoogleMapsCallDelta - | GoogleMapsResultDelta - | GoogleSearchCallDelta - | GoogleSearchResultDelta - | ImageDelta - | MCPServerToolCallDelta - | MCPServerToolResultDelta - | TextAnnotationDelta - | TextDelta - | ThoughtSignatureDelta - | ThoughtSummaryDelta - | URLContextCallDelta - | URLContextResultDelta - | VideoDelta; diff --git a/src/gaos/models/interactions/step-delta-metadata.ts b/src/gaos/models/interactions/step-delta-metadata.ts deleted file mode 100644 index 7b67c7b0f7..0000000000 --- a/src/gaos/models/interactions/step-delta-metadata.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { Usage } from "./usage.js"; - -/** - * Optional metadata accompanying ANY streamed event. - */ -export type StepDeltaMetadata = { - /** - * Statistics on the interaction request's token usage. - */ - total_usage?: Usage | undefined; -}; diff --git a/src/gaos/models/interactions/step-delta.ts b/src/gaos/models/interactions/step-delta.ts deleted file mode 100644 index 65dcd412db..0000000000 --- a/src/gaos/models/interactions/step-delta.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { StepDeltaData } from "./step-delta-data.js"; -import { StepDeltaMetadata } from "./step-delta-metadata.js"; - -export type StepDelta = { - event_type: "step.delta"; - index: number; - delta: StepDeltaData; - /** - * The event_id token to be used to resume the interaction stream, from - * - * @remarks - * this event. - */ - event_id?: string | undefined; - /** - * Optional metadata accompanying ANY streamed event. - */ - metadata?: StepDeltaMetadata | undefined; -}; diff --git a/src/gaos/models/interactions/step-start.ts b/src/gaos/models/interactions/step-start.ts deleted file mode 100644 index 5e3d9e2684..0000000000 --- a/src/gaos/models/interactions/step-start.ts +++ /dev/null @@ -1,44 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { Step } from "./step.js"; -import { Usage } from "./usage.js"; - -/** - * Optional metadata accompanying ANY streamed event. - */ -export type StepStartMetadata = { - /** - * Statistics on the interaction request's token usage. - */ - total_usage?: Usage | undefined; -}; - -export type StepStart = { - event_type: "step.start"; - index: number; - /** - * A step in the interaction. - */ - step: Step; - /** - * The event_id token to be used to resume the interaction stream, from - * - * @remarks - * this event. - */ - event_id?: string | undefined; - /** - * Optional metadata accompanying ANY streamed event. - */ - metadata?: StepStartMetadata | undefined; -}; diff --git a/src/gaos/models/interactions/step-stop.ts b/src/gaos/models/interactions/step-stop.ts deleted file mode 100644 index cc59152af4..0000000000 --- a/src/gaos/models/interactions/step-stop.ts +++ /dev/null @@ -1,39 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { Usage } from "./usage.js"; - -/** - * Optional metadata accompanying ANY streamed event. - */ -export type StepStopMetadata = { - /** - * Statistics on the interaction request's token usage. - */ - total_usage?: Usage | undefined; -}; - -export type StepStop = { - event_type: "step.stop"; - index: number; - /** - * The event_id token to be used to resume the interaction stream, from - * - * @remarks - * this event. - */ - event_id?: string | undefined; - /** - * Optional metadata accompanying ANY streamed event. - */ - metadata?: StepStopMetadata | undefined; -}; diff --git a/src/gaos/models/interactions/step.ts b/src/gaos/models/interactions/step.ts deleted file mode 100644 index 1d1ef6fd73..0000000000 --- a/src/gaos/models/interactions/step.ts +++ /dev/null @@ -1,51 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { CodeExecutionCallStep } from "./code-execution-call-step.js"; -import { CodeExecutionResultStep } from "./code-execution-result-step.js"; -import { FileSearchCallStep } from "./file-search-call-step.js"; -import { FileSearchResultStep } from "./file-search-result-step.js"; -import { FunctionCallStep } from "./function-call-step.js"; -import { FunctionResultStep } from "./function-result-step.js"; -import { GoogleMapsCallStep } from "./google-maps-call-step.js"; -import { GoogleMapsResultStep } from "./google-maps-result-step.js"; -import { GoogleSearchCallStep } from "./google-search-call-step.js"; -import { GoogleSearchResultStep } from "./google-search-result-step.js"; -import { MCPServerToolCallStep } from "./mcp-server-tool-call-step.js"; -import { MCPServerToolResultStep } from "./mcp-server-tool-result-step.js"; -import { ModelOutputStep } from "./model-output-step.js"; -import { ThoughtStep } from "./thought-step.js"; -import { URLContextCallStep } from "./url-context-call-step.js"; -import { URLContextResultStep } from "./url-context-result-step.js"; -import { UserInputStep } from "./user-input-step.js"; - -/** - * A step in the interaction. - */ -export type Step = - | UserInputStep - | ModelOutputStep - | ThoughtStep - | FunctionCallStep - | CodeExecutionCallStep - | URLContextCallStep - | MCPServerToolCallStep - | GoogleSearchCallStep - | FileSearchCallStep - | GoogleMapsCallStep - | FunctionResultStep - | CodeExecutionResultStep - | URLContextResultStep - | GoogleSearchResultStep - | MCPServerToolResultStep - | FileSearchResultStep - | GoogleMapsResultStep; diff --git a/src/gaos/models/interactions/text-annotation-delta.ts b/src/gaos/models/interactions/text-annotation-delta.ts deleted file mode 100644 index 67c62c8b2c..0000000000 --- a/src/gaos/models/interactions/text-annotation-delta.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { Annotation } from "./annotation.js"; - -export type TextAnnotationDelta = { - type: "text_annotation_delta"; - /** - * Citation information for model-generated content. - */ - annotations?: Array | undefined; -}; diff --git a/src/gaos/models/interactions/text-content.ts b/src/gaos/models/interactions/text-content.ts deleted file mode 100644 index 5808510fac..0000000000 --- a/src/gaos/models/interactions/text-content.ts +++ /dev/null @@ -1,28 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { Annotation } from "./annotation.js"; - -/** - * A text content block. - */ -export type TextContent = { - type: "text"; - /** - * Required. The text content. - */ - text: string; - /** - * Citation information for model-generated content. - */ - annotations?: Array | undefined; -}; diff --git a/src/gaos/models/interactions/text-delta.ts b/src/gaos/models/interactions/text-delta.ts deleted file mode 100644 index 706907ad6d..0000000000 --- a/src/gaos/models/interactions/text-delta.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export type TextDelta = { - type: "text"; - text: string; -}; diff --git a/src/gaos/models/interactions/text-response-format.ts b/src/gaos/models/interactions/text-response-format.ts deleted file mode 100644 index addb2b767a..0000000000 --- a/src/gaos/models/interactions/text-response-format.ts +++ /dev/null @@ -1,37 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -/** - * The MIME type of the text output. - */ -export type TextResponseFormatMimeType = - | "application/json" - | "text/plain" - | (string & {}); - -/** - * Configuration for text output format. - */ -export type TextResponseFormat = { - type: "text"; - /** - * The MIME type of the text output. - */ - mime_type?: TextResponseFormatMimeType | undefined; - /** - * The JSON schema that the output should conform to. Only applicable when - * - * @remarks - * mime_type is application/json. - */ - schema?: { [k: string]: any } | undefined; -}; diff --git a/src/gaos/models/interactions/thinking-level.ts b/src/gaos/models/interactions/thinking-level.ts deleted file mode 100644 index c03ce247d1..0000000000 --- a/src/gaos/models/interactions/thinking-level.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export type ThinkingLevel = - | "minimal" - | "low" - | "medium" - | "high" - | (string & {}); diff --git a/src/gaos/models/interactions/thinking-summaries.ts b/src/gaos/models/interactions/thinking-summaries.ts deleted file mode 100644 index b2a47fbf57..0000000000 --- a/src/gaos/models/interactions/thinking-summaries.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export type ThinkingSummaries = "auto" | "none" | (string & {}); diff --git a/src/gaos/models/interactions/thought-signature-delta.ts b/src/gaos/models/interactions/thought-signature-delta.ts deleted file mode 100644 index cf01cc1eed..0000000000 --- a/src/gaos/models/interactions/thought-signature-delta.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export type ThoughtSignatureDelta = { - type: "thought_signature"; - /** - * Signature to match the backend source to be part of the generation. - */ - signature?: string | undefined; -}; diff --git a/src/gaos/models/interactions/thought-step.ts b/src/gaos/models/interactions/thought-step.ts deleted file mode 100644 index db8c6fb003..0000000000 --- a/src/gaos/models/interactions/thought-step.ts +++ /dev/null @@ -1,28 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { Content } from "./content.js"; - -/** - * A thought step. - */ -export type ThoughtStep = { - type: "thought"; - /** - * A signature hash for backend validation. - */ - signature?: string | undefined; - /** - * A summary of the thought. - */ - summary?: Array | undefined; -}; diff --git a/src/gaos/models/interactions/thought-summary-content.ts b/src/gaos/models/interactions/thought-summary-content.ts deleted file mode 100644 index 4f6d7bfcb5..0000000000 --- a/src/gaos/models/interactions/thought-summary-content.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ImageContent } from "./image-content.js"; -import { TextContent } from "./text-content.js"; - -export type ThoughtSummaryContent = ImageContent | TextContent; diff --git a/src/gaos/models/interactions/thought-summary-delta.ts b/src/gaos/models/interactions/thought-summary-delta.ts deleted file mode 100644 index 604113514d..0000000000 --- a/src/gaos/models/interactions/thought-summary-delta.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ThoughtSummaryContent } from "./thought-summary-content.js"; - -export type ThoughtSummaryDelta = { - content?: ThoughtSummaryContent | undefined; - type: "thought_summary"; -}; diff --git a/src/gaos/models/interactions/tool-choice-config.ts b/src/gaos/models/interactions/tool-choice-config.ts deleted file mode 100644 index 47cb406466..0000000000 --- a/src/gaos/models/interactions/tool-choice-config.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { AllowedTools } from "./allowed-tools.js"; - -/** - * The tool choice configuration containing allowed tools. - */ -export type ToolChoiceConfig = { - /** - * The configuration for allowed tools. - */ - allowed_tools?: AllowedTools | undefined; -}; diff --git a/src/gaos/models/interactions/tool-choice-type.ts b/src/gaos/models/interactions/tool-choice-type.ts deleted file mode 100644 index 807b60e94e..0000000000 --- a/src/gaos/models/interactions/tool-choice-type.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export type ToolChoiceType = - | "auto" - | "any" - | "none" - | "validated" - | (string & {}); diff --git a/src/gaos/models/interactions/tool.ts b/src/gaos/models/interactions/tool.ts deleted file mode 100644 index 602c2755a8..0000000000 --- a/src/gaos/models/interactions/tool.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { CodeExecution } from "./code-execution.js"; -import { ComputerUse } from "./computer-use.js"; -import { FileSearch } from "./file-search.js"; -import { FunctionT } from "./function.js"; -import { GoogleMaps } from "./google-maps.js"; -import { GoogleSearch } from "./google-search.js"; -import { MCPServer } from "./mcp-server.js"; -import { Retrieval } from "./retrieval.js"; -import { URLContext } from "./url-context.js"; - -/** - * A tool that can be used by the model. - */ -export type Tool = - | CodeExecution - | ComputerUse - | FileSearch - | FunctionT - | GoogleMaps - | GoogleSearch - | MCPServer - | Retrieval - | URLContext; diff --git a/src/gaos/models/interactions/url-citation.ts b/src/gaos/models/interactions/url-citation.ts deleted file mode 100644 index 094c2ba9da..0000000000 --- a/src/gaos/models/interactions/url-citation.ts +++ /dev/null @@ -1,38 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -/** - * A URL citation annotation. - */ -export type URLCitation = { - type: "url_citation"; - /** - * The URL. - */ - url?: string | undefined; - /** - * The title of the URL. - */ - title?: string | undefined; - /** - * Start of segment of the response that is attributed to this source. - * - * @remarks - * - * Index indicates the start of the segment, measured in bytes. - */ - start_index?: number | undefined; - /** - * End of the attributed segment, exclusive. - */ - end_index?: number | undefined; -}; diff --git a/src/gaos/models/interactions/url-context-call-arguments.ts b/src/gaos/models/interactions/url-context-call-arguments.ts deleted file mode 100644 index 699e2367a0..0000000000 --- a/src/gaos/models/interactions/url-context-call-arguments.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -/** - * The arguments to pass to the URL context. - */ -export type URLContextCallArguments = { - /** - * The URLs to fetch. - */ - urls?: Array | undefined; -}; diff --git a/src/gaos/models/interactions/url-context-call-delta.ts b/src/gaos/models/interactions/url-context-call-delta.ts deleted file mode 100644 index d3731172bc..0000000000 --- a/src/gaos/models/interactions/url-context-call-delta.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { URLContextCallArguments } from "./url-context-call-arguments.js"; - -export type URLContextCallDelta = { - type: "url_context_call"; - /** - * The arguments to pass to the URL context. - */ - arguments: URLContextCallArguments; - /** - * A signature hash for backend validation. - */ - signature?: string | undefined; -}; diff --git a/src/gaos/models/interactions/url-context-call-step.ts b/src/gaos/models/interactions/url-context-call-step.ts deleted file mode 100644 index b5ac2e2423..0000000000 --- a/src/gaos/models/interactions/url-context-call-step.ts +++ /dev/null @@ -1,40 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -/** - * Required. The arguments to pass to the URL context. - */ -export type Arguments = { - /** - * The URLs to fetch. - */ - urls?: Array | undefined; -}; - -/** - * URL context call step. - */ -export type URLContextCallStep = { - /** - * Required. A unique ID for this specific tool call. - */ - id: string; - /** - * A signature hash for backend validation. - */ - signature?: string | undefined; - type: "url_context_call"; - /** - * Required. The arguments to pass to the URL context. - */ - arguments: Arguments; -}; diff --git a/src/gaos/models/interactions/url-context-result-delta.ts b/src/gaos/models/interactions/url-context-result-delta.ts deleted file mode 100644 index 35401659bd..0000000000 --- a/src/gaos/models/interactions/url-context-result-delta.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { URLContextResult } from "./url-context-result.js"; - -export type URLContextResultDelta = { - type: "url_context_result"; - result: Array; - is_error?: boolean | undefined; - /** - * A signature hash for backend validation. - */ - signature?: string | undefined; -}; diff --git a/src/gaos/models/interactions/url-context-result-step.ts b/src/gaos/models/interactions/url-context-result-step.ts deleted file mode 100644 index 1201b9d216..0000000000 --- a/src/gaos/models/interactions/url-context-result-step.ts +++ /dev/null @@ -1,36 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { URLContextResult } from "./url-context-result.js"; - -/** - * URL context result step. - */ -export type URLContextResultStep = { - type: "url_context_result"; - /** - * Required. The results of the URL context. - */ - result: Array; - /** - * Whether the URL context resulted in an error. - */ - is_error?: boolean | undefined; - /** - * Required. ID to match the ID from the function call block. - */ - call_id: string; - /** - * A signature hash for backend validation. - */ - signature?: string | undefined; -}; diff --git a/src/gaos/models/interactions/url-context-result.ts b/src/gaos/models/interactions/url-context-result.ts deleted file mode 100644 index 7d1e612290..0000000000 --- a/src/gaos/models/interactions/url-context-result.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -/** - * The status of the URL retrieval. - */ -export type URLContextResultStatus = - | "success" - | "error" - | "paywall" - | "unsafe" - | (string & {}); - -/** - * The result of the URL context. - */ -export type URLContextResult = { - /** - * The URL that was fetched. - */ - url?: string | undefined; - /** - * The status of the URL retrieval. - */ - status?: URLContextResultStatus | undefined; -}; diff --git a/src/gaos/models/interactions/url-context.ts b/src/gaos/models/interactions/url-context.ts deleted file mode 100644 index 91277ab883..0000000000 --- a/src/gaos/models/interactions/url-context.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -/** - * A tool that can be used by the model to fetch URL context. - */ -export type URLContext = { - type: "url_context"; -}; diff --git a/src/gaos/models/interactions/usage.ts b/src/gaos/models/interactions/usage.ts deleted file mode 100644 index 185402a0d7..0000000000 --- a/src/gaos/models/interactions/usage.ts +++ /dev/null @@ -1,67 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { GroundingToolCount } from "./grounding-tool-count.js"; -import { ModalityTokens } from "./modality-tokens.js"; - -/** - * Statistics on the interaction request's token usage. - */ -export type Usage = { - /** - * Number of tokens in the prompt (context). - */ - total_input_tokens?: number | undefined; - /** - * A breakdown of input token usage by modality. - */ - input_tokens_by_modality?: Array | undefined; - /** - * Number of tokens in the cached part of the prompt (the cached content). - */ - total_cached_tokens?: number | undefined; - /** - * A breakdown of cached token usage by modality. - */ - cached_tokens_by_modality?: Array | undefined; - /** - * Total number of tokens across all the generated responses. - */ - total_output_tokens?: number | undefined; - /** - * A breakdown of output token usage by modality. - */ - output_tokens_by_modality?: Array | undefined; - /** - * Number of tokens present in tool-use prompt(s). - */ - total_tool_use_tokens?: number | undefined; - /** - * A breakdown of tool-use token usage by modality. - */ - tool_use_tokens_by_modality?: Array | undefined; - /** - * Number of tokens of thoughts for thinking models. - */ - total_thought_tokens?: number | undefined; - /** - * Total token count for the interaction request (prompt + responses + other - * - * @remarks - * internal tokens). - */ - total_tokens?: number | undefined; - /** - * Grounding tool count. - */ - grounding_tool_count?: Array | undefined; -}; diff --git a/src/gaos/models/interactions/user-input-step.ts b/src/gaos/models/interactions/user-input-step.ts deleted file mode 100644 index c7dcbfc12f..0000000000 --- a/src/gaos/models/interactions/user-input-step.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { Content } from "./content.js"; - -/** - * Input provided by the user. - */ -export type UserInputStep = { - content?: Array | undefined; - type: "user_input"; -}; diff --git a/src/gaos/models/interactions/vertex-ai-search-config.ts b/src/gaos/models/interactions/vertex-ai-search-config.ts deleted file mode 100644 index e60f0ccd54..0000000000 --- a/src/gaos/models/interactions/vertex-ai-search-config.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -/** - * Used to specify configuration for VertexAISearch. - */ -export type VertexAISearchConfig = { - /** - * Optional. Used to specify Vertex AI Search engine. - */ - engine?: string | undefined; - /** - * Optional. Used to specify Vertex AI Search datastores. - */ - datastores?: Array | undefined; -}; diff --git a/src/gaos/models/interactions/video-content.ts b/src/gaos/models/interactions/video-content.ts deleted file mode 100644 index 207a02cccc..0000000000 --- a/src/gaos/models/interactions/video-content.ts +++ /dev/null @@ -1,48 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { MediaResolution } from "./media-resolution.js"; - -/** - * The mime type of the video. - */ -export type VideoContentMimeType = - | "video/mp4" - | "video/mpeg" - | "video/mpg" - | "video/mov" - | "video/avi" - | "video/x-flv" - | "video/webm" - | "video/wmv" - | "video/3gpp" - | (string & {}); - -/** - * A video content block. - */ -export type VideoContent = { - /** - * The video content. - */ - data?: string | undefined; - /** - * The mime type of the video. - */ - mime_type?: VideoContentMimeType | undefined; - resolution?: MediaResolution | undefined; - type: "video"; - /** - * The URI of the video. - */ - uri?: string | undefined; -}; diff --git a/src/gaos/models/interactions/video-delta.ts b/src/gaos/models/interactions/video-delta.ts deleted file mode 100644 index 6ec98d65e4..0000000000 --- a/src/gaos/models/interactions/video-delta.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { MediaResolution } from "./media-resolution.js"; - -export type VideoDeltaMimeType = - | "video/mp4" - | "video/mpeg" - | "video/mpg" - | "video/mov" - | "video/avi" - | "video/x-flv" - | "video/webm" - | "video/wmv" - | "video/3gpp" - | (string & {}); - -export type VideoDelta = { - data?: string | undefined; - mime_type?: VideoDeltaMimeType | undefined; - resolution?: MediaResolution | undefined; - type: "video"; - uri?: string | undefined; -}; diff --git a/src/gaos/models/interactions/webhook-config.ts b/src/gaos/models/interactions/webhook-config.ts deleted file mode 100644 index 1d550c3de4..0000000000 --- a/src/gaos/models/interactions/webhook-config.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -/** - * Message for configuring webhook events for a request. - */ -export type WebhookConfig = { - /** - * Optional. If set, these webhook URIs will be used for webhook events instead of the - * - * @remarks - * registered webhooks. - */ - uris?: Array | undefined; - /** - * Optional. The user metadata that will be returned on each event emission to the - * - * @remarks - * webhooks. - */ - user_metadata?: { [k: string]: any } | undefined; -}; diff --git a/src/gaos/models/operations/cancel-interaction-by-id.ts b/src/gaos/models/operations/cancel-interaction-by-id.ts deleted file mode 100644 index 718969a47b..0000000000 --- a/src/gaos/models/operations/cancel-interaction-by-id.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export type CancelInteractionByIdGlobals = { - /** - * Which version of the API to use. - */ - api_version?: string | undefined; -}; - -export type CancelInteractionByIdRequest = { - /** - * The unique identifier of the interaction to cancel. - */ - id: string; - /** - * Which version of the API to use. - */ - api_version?: string | undefined; -}; diff --git a/src/gaos/models/operations/create-agent.ts b/src/gaos/models/operations/create-agent.ts deleted file mode 100644 index 161d3eaf80..0000000000 --- a/src/gaos/models/operations/create-agent.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as agents from "../agents/index.js"; - -export type CreateAgentGlobals = { - /** - * Which version of the API to use. - */ - api_version?: string | undefined; -}; - -export type CreateAgentRequest = { - /** - * Which version of the API to use. - */ - api_version?: string | undefined; - /** - * The request body. - */ - body: agents.Agent; -}; diff --git a/src/gaos/models/operations/create-interaction.ts b/src/gaos/models/operations/create-interaction.ts deleted file mode 100644 index 38bad940c6..0000000000 --- a/src/gaos/models/operations/create-interaction.ts +++ /dev/null @@ -1,45 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { Stream } from "../../lib/event-streams.js"; -import * as interactions from "../interactions/index.js"; - -export type CreateInteractionGlobals = { - /** - * Which version of the API to use. - */ - api_version?: string | undefined; -}; - -/** - * The request body. - */ -export type CreateInteractionRequestBody = - | interactions.CreateModelInteraction - | interactions.CreateAgentInteraction; - -export type CreateInteractionRequest = { - /** - * Which version of the API to use. - */ - api_version?: string | undefined; - /** - * The request body. - */ - body: - | interactions.CreateModelInteraction - | interactions.CreateAgentInteraction; -}; - -export type CreateInteractionResponse = - | interactions.Interaction - | Stream; diff --git a/src/gaos/models/operations/create-webhook.ts b/src/gaos/models/operations/create-webhook.ts deleted file mode 100644 index 00ae4d298d..0000000000 --- a/src/gaos/models/operations/create-webhook.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as webhooks from "../webhooks/index.js"; - -export type CreateWebhookGlobals = { - /** - * Which version of the API to use. - */ - api_version?: string | undefined; -}; - -export type CreateWebhookRequest = { - /** - * Which version of the API to use. - */ - api_version?: string | undefined; - /** - * Required. The webhook to create. - */ - body: webhooks.WebhookInput; -}; diff --git a/src/gaos/models/operations/delete-agent.ts b/src/gaos/models/operations/delete-agent.ts deleted file mode 100644 index a1703fcba6..0000000000 --- a/src/gaos/models/operations/delete-agent.ts +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export type DeleteAgentGlobals = { - /** - * Which version of the API to use. - */ - api_version?: string | undefined; -}; - -export type DeleteAgentRequest = { - /** - * Which version of the API to use. - */ - api_version?: string | undefined; - id: string; -}; diff --git a/src/gaos/models/operations/delete-interaction.ts b/src/gaos/models/operations/delete-interaction.ts deleted file mode 100644 index e65fbe872f..0000000000 --- a/src/gaos/models/operations/delete-interaction.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export type DeleteInteractionGlobals = { - /** - * Which version of the API to use. - */ - api_version?: string | undefined; -}; - -export type DeleteInteractionRequest = { - /** - * The unique identifier of the interaction to delete. - */ - id: string; - /** - * Which version of the API to use. - */ - api_version?: string | undefined; -}; diff --git a/src/gaos/models/operations/delete-webhook.ts b/src/gaos/models/operations/delete-webhook.ts deleted file mode 100644 index 73359e238a..0000000000 --- a/src/gaos/models/operations/delete-webhook.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export type DeleteWebhookGlobals = { - /** - * Which version of the API to use. - */ - api_version?: string | undefined; -}; - -export type DeleteWebhookRequest = { - /** - * Which version of the API to use. - */ - api_version?: string | undefined; - /** - * Required. The ID of the webhook to delete. - * - * @remarks - * Format: `{webhook_id}` - */ - id: string; -}; diff --git a/src/gaos/models/operations/get-agent.ts b/src/gaos/models/operations/get-agent.ts deleted file mode 100644 index 8a86263cb8..0000000000 --- a/src/gaos/models/operations/get-agent.ts +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export type GetAgentGlobals = { - /** - * Which version of the API to use. - */ - api_version?: string | undefined; -}; - -export type GetAgentRequest = { - /** - * Which version of the API to use. - */ - api_version?: string | undefined; - id: string; -}; diff --git a/src/gaos/models/operations/get-interaction-by-id.ts b/src/gaos/models/operations/get-interaction-by-id.ts deleted file mode 100644 index b3e0095698..0000000000 --- a/src/gaos/models/operations/get-interaction-by-id.ts +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { Stream } from "../../lib/event-streams.js"; -import * as interactions from "../interactions/index.js"; - -export type GetInteractionByIdGlobals = { - /** - * Which version of the API to use. - */ - api_version?: string | undefined; -}; - -export type GetInteractionByIdRequest = { - /** - * The unique identifier of the interaction to retrieve. - */ - id: string; - /** - * If set to true, the generated content will be streamed incrementally. - */ - stream?: boolean | undefined; - /** - * Optional. If set, resumes the interaction stream from the next chunk after the event marked by the event id. Can only be used if `stream` is true. - */ - last_event_id?: string | undefined; - /** - * If set to true, includes the input in the response. - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - include_input?: boolean | undefined; - /** - * Which version of the API to use. - */ - api_version?: string | undefined; -}; - -export type GetInteractionByIdResponse = - | interactions.Interaction - | Stream; diff --git a/src/gaos/models/operations/get-webhook.ts b/src/gaos/models/operations/get-webhook.ts deleted file mode 100644 index 705e382c85..0000000000 --- a/src/gaos/models/operations/get-webhook.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export type GetWebhookGlobals = { - /** - * Which version of the API to use. - */ - api_version?: string | undefined; -}; - -export type GetWebhookRequest = { - /** - * Which version of the API to use. - */ - api_version?: string | undefined; - /** - * Required. The ID of the webhook to retrieve. - */ - id: string; -}; diff --git a/src/gaos/models/operations/index.ts b/src/gaos/models/operations/index.ts deleted file mode 100644 index e4aa452894..0000000000 --- a/src/gaos/models/operations/index.ts +++ /dev/null @@ -1,28 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export * from "./cancel-interaction-by-id.js"; -export * from "./create-agent.js"; -export * from "./create-interaction.js"; -export * from "./create-webhook.js"; -export * from "./delete-agent.js"; -export * from "./delete-interaction.js"; -export * from "./delete-webhook.js"; -export * from "./get-agent.js"; -export * from "./get-interaction-by-id.js"; -export * from "./get-webhook.js"; -export * from "./list-agents.js"; -export * from "./list-webhooks.js"; -export * from "./method-params.js"; -export * from "./ping-webhook.js"; -export * from "./rotate-signing-secret.js"; -export * from "./update-webhook.js"; diff --git a/src/gaos/models/operations/list-agents.ts b/src/gaos/models/operations/list-agents.ts deleted file mode 100644 index a02f17cd03..0000000000 --- a/src/gaos/models/operations/list-agents.ts +++ /dev/null @@ -1,28 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export type ListAgentsGlobals = { - /** - * Which version of the API to use. - */ - api_version?: string | undefined; -}; - -export type ListAgentsRequest = { - /** - * Which version of the API to use. - */ - api_version?: string | undefined; - parent?: string | undefined; - pageSize?: number | undefined; - pageToken?: string | undefined; -}; diff --git a/src/gaos/models/operations/list-webhooks.ts b/src/gaos/models/operations/list-webhooks.ts deleted file mode 100644 index a58e1c65e6..0000000000 --- a/src/gaos/models/operations/list-webhooks.ts +++ /dev/null @@ -1,40 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export type ListWebhooksGlobals = { - /** - * Which version of the API to use. - */ - api_version?: string | undefined; -}; - -export type ListWebhooksRequest = { - /** - * Which version of the API to use. - */ - api_version?: string | undefined; - /** - * Optional. The maximum number of webhooks to return. The service may return fewer than - * - * @remarks - * this value. If unspecified, at most 50 webhooks will be returned. - * The maximum value is 1000. - */ - page_size?: number | undefined; - /** - * Optional. A page token, received from a previous `ListWebhooks` call. - * - * @remarks - * Provide this to retrieve the subsequent page. - */ - page_token?: string | undefined; -}; diff --git a/src/gaos/models/operations/method-params.ts b/src/gaos/models/operations/method-params.ts deleted file mode 100644 index 73ed651832..0000000000 --- a/src/gaos/models/operations/method-params.ts +++ /dev/null @@ -1,144 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import type { CreateAgentInteraction } from "../interactions/create-agent-interaction.js"; -import type { CreateModelInteraction } from "../interactions/create-model-interaction.js"; -import type { CancelInteractionByIdRequest } from "./cancel-interaction-by-id.js"; -import type { CreateAgentRequest } from "./create-agent.js"; -import type { CreateInteractionRequest } from "./create-interaction.js"; -import type { CreateWebhookRequest } from "./create-webhook.js"; -import type { DeleteAgentRequest } from "./delete-agent.js"; -import type { DeleteInteractionRequest } from "./delete-interaction.js"; -import type { DeleteWebhookRequest } from "./delete-webhook.js"; -import type { GetAgentRequest } from "./get-agent.js"; -import type { GetInteractionByIdRequest } from "./get-interaction-by-id.js"; -import type { GetWebhookRequest } from "./get-webhook.js"; -import type { ListAgentsRequest } from "./list-agents.js"; -import type { ListWebhooksRequest } from "./list-webhooks.js"; -import type { UpdateWebhookRequest } from "./update-webhook.js"; - -export type CancelInteractionByIdParams = Omit< - CancelInteractionByIdRequest, - "id" ->; - -export type CreateAgentParams = - & Omit< - CreateAgentRequest, - "body" - > - & CreateAgentRequest["body"]; - -export type CreateInteractionParams = - & Omit< - CreateInteractionRequest, - "body" - > - & CreateInteractionRequest["body"]; - -export type CreateInteractionParamsNonStreaming = CreateInteractionParams & { - stream?: false | undefined; -}; - -export type CreateInteractionParamsStreaming = CreateInteractionParams & { - stream: true; -}; - -export type CreateModelInteractionParams = - & Omit< - CreateInteractionRequest, - "body" - > - & CreateModelInteraction; - -export type CreateModelInteractionParamsNonStreaming = - & CreateModelInteractionParams - & { - stream?: false | undefined; - }; - -export type CreateModelInteractionParamsStreaming = - & CreateModelInteractionParams - & { stream: true }; - -export type CreateAgentInteractionParams = - & Omit< - CreateInteractionRequest, - "body" - > - & CreateAgentInteraction; - -export type CreateAgentInteractionParamsNonStreaming = - & CreateAgentInteractionParams - & { - stream?: false | undefined; - }; - -export type CreateAgentInteractionParamsStreaming = - & CreateAgentInteractionParams - & { stream: true }; - -export type CreateWebhookParams = - & Omit< - CreateWebhookRequest, - "body" - > - & CreateWebhookRequest["body"]; - -export type DeleteAgentParams = Omit< - DeleteAgentRequest, - "id" ->; - -export type DeleteInteractionParams = Omit< - DeleteInteractionRequest, - "id" ->; - -export type DeleteWebhookParams = Omit< - DeleteWebhookRequest, - "id" ->; - -export type GetAgentParams = Omit< - GetAgentRequest, - "id" ->; - -export type GetInteractionByIdParams = Omit< - GetInteractionByIdRequest, - "id" ->; - -export type GetInteractionByIdParamsNonStreaming = GetInteractionByIdParams & { - stream?: false | undefined; -}; - -export type GetInteractionByIdParamsStreaming = GetInteractionByIdParams & { - stream: true; -}; - -export type GetWebhookParams = Omit< - GetWebhookRequest, - "id" ->; - -export type ListAgentsParams = ListAgentsRequest; - -export type ListWebhooksParams = ListWebhooksRequest; - -export type UpdateWebhookParams = - & Omit< - UpdateWebhookRequest, - "id" | "body" - > - & Partial>; diff --git a/src/gaos/models/operations/ping-webhook.ts b/src/gaos/models/operations/ping-webhook.ts deleted file mode 100644 index 3a8c1d8ee0..0000000000 --- a/src/gaos/models/operations/ping-webhook.ts +++ /dev/null @@ -1,38 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as webhooks from "../webhooks/index.js"; - -export type PingWebhookGlobals = { - /** - * Which version of the API to use. - */ - api_version?: string | undefined; -}; - -export type PingWebhookRequest = { - /** - * Which version of the API to use. - */ - api_version?: string | undefined; - /** - * Required. The ID of the webhook to ping. - * - * @remarks - * Format: `{webhook_id}` - */ - id: string; - /** - * The request body. - */ - body?: webhooks.PingWebhookRequest | undefined; -}; diff --git a/src/gaos/models/operations/rotate-signing-secret.ts b/src/gaos/models/operations/rotate-signing-secret.ts deleted file mode 100644 index e2e59f88e2..0000000000 --- a/src/gaos/models/operations/rotate-signing-secret.ts +++ /dev/null @@ -1,38 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as webhooks from "../webhooks/index.js"; - -export type RotateSigningSecretGlobals = { - /** - * Which version of the API to use. - */ - api_version?: string | undefined; -}; - -export type RotateSigningSecretRequest = { - /** - * Which version of the API to use. - */ - api_version?: string | undefined; - /** - * Required. The ID of the webhook for which to generate a signing secret. - * - * @remarks - * Format: `{webhook_id}` - */ - id: string; - /** - * The request body. - */ - body?: webhooks.RotateSigningSecretRequest | undefined; -}; diff --git a/src/gaos/models/operations/update-webhook.ts b/src/gaos/models/operations/update-webhook.ts deleted file mode 100644 index c899fddb37..0000000000 --- a/src/gaos/models/operations/update-webhook.ts +++ /dev/null @@ -1,39 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as webhooks from "../webhooks/index.js"; - -export type UpdateWebhookGlobals = { - /** - * Which version of the API to use. - */ - api_version?: string | undefined; -}; - -export type UpdateWebhookRequest = { - /** - * Which version of the API to use. - */ - api_version?: string | undefined; - /** - * Required. The ID of the webhook to update. - */ - id: string; - /** - * Optional. The list of fields to update. - */ - update_mask?: string | undefined; - /** - * Required. The webhook to update. - */ - body?: webhooks.WebhookUpdate | undefined; -}; diff --git a/src/gaos/models/security.ts b/src/gaos/models/security.ts deleted file mode 100644 index 83ece4fd1b..0000000000 --- a/src/gaos/models/security.ts +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export type Security = { - /** - * Gemini API key sent as x-goog-api-key. - */ - api_key?: string | undefined; - /** - * OAuth access token sent as a bearer Authorization header. - */ - access_token?: string | undefined; - /** - * Additional default headers to apply before request-specific headers and auth. - */ - default_headers?: { [k: string]: string } | undefined; -}; diff --git a/src/gaos/models/webhooks/index.ts b/src/gaos/models/webhooks/index.ts deleted file mode 100644 index d20482e8cb..0000000000 --- a/src/gaos/models/webhooks/index.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export * from "./ping-webhook-request.js"; -export * from "./rotate-signing-secret-request.js"; -export * from "./signing-secret.js"; -export * from "./webhook-list-response.js"; -export * from "./webhook-ping-response.js"; -export * from "./webhook-rotate-signing-secret-response.js"; -export * from "./webhook-update.js"; -export * from "./webhook.js"; diff --git a/src/gaos/models/webhooks/ping-webhook-request.ts b/src/gaos/models/webhooks/ping-webhook-request.ts deleted file mode 100644 index 66d3b68d99..0000000000 --- a/src/gaos/models/webhooks/ping-webhook-request.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -/** - * Request message for WebhookService.PingWebhook. - */ -export type PingWebhookRequest = {}; diff --git a/src/gaos/models/webhooks/rotate-signing-secret-request.ts b/src/gaos/models/webhooks/rotate-signing-secret-request.ts deleted file mode 100644 index 8e4f32c093..0000000000 --- a/src/gaos/models/webhooks/rotate-signing-secret-request.ts +++ /dev/null @@ -1,28 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -/** - * Optional. The revocation behavior for previous signing secrets. - */ -export type RevocationBehavior = - | "revoke_previous_secrets_after_h24" - | "revoke_previous_secrets_immediately"; - -/** - * Request message for WebhookService.RotateSigningSecret. - */ -export type RotateSigningSecretRequest = { - /** - * Optional. The revocation behavior for previous signing secrets. - */ - revocation_behavior?: RevocationBehavior | undefined; -}; diff --git a/src/gaos/models/webhooks/signing-secret.ts b/src/gaos/models/webhooks/signing-secret.ts deleted file mode 100644 index 54d906bd0d..0000000000 --- a/src/gaos/models/webhooks/signing-secret.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -/** - * Represents a signing secret used to verify webhook payloads. - */ -export type SigningSecret = { - /** - * Output only. The truncated version of the signing secret. - */ - truncated_secret?: string | undefined; - /** - * Output only. The expiration date of the signing secret. - */ - expire_time?: string | undefined; -}; diff --git a/src/gaos/models/webhooks/webhook-list-response.ts b/src/gaos/models/webhooks/webhook-list-response.ts deleted file mode 100644 index 666380289e..0000000000 --- a/src/gaos/models/webhooks/webhook-list-response.ts +++ /dev/null @@ -1,30 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { Webhook } from "./webhook.js"; - -/** - * Response message for WebhookService.ListWebhooks. - */ -export type WebhookListResponse = { - /** - * The webhooks. - */ - webhooks?: Array | undefined; - /** - * A token, which can be sent as `page_token` to retrieve the next page. - * - * @remarks - * If this field is omitted, there are no subsequent pages. - */ - next_page_token?: string | undefined; -}; diff --git a/src/gaos/models/webhooks/webhook-ping-response.ts b/src/gaos/models/webhooks/webhook-ping-response.ts deleted file mode 100644 index 82eebbac09..0000000000 --- a/src/gaos/models/webhooks/webhook-ping-response.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -/** - * Response message for WebhookService.PingWebhook. - */ -export type WebhookPingResponse = {}; diff --git a/src/gaos/models/webhooks/webhook-rotate-signing-secret-response.ts b/src/gaos/models/webhooks/webhook-rotate-signing-secret-response.ts deleted file mode 100644 index 26dd446f6b..0000000000 --- a/src/gaos/models/webhooks/webhook-rotate-signing-secret-response.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -/** - * Response message for WebhookService.RotateSigningSecret. - */ -export type WebhookRotateSigningSecretResponse = { - /** - * Output only. The newly generated signing secret. - */ - secret?: string | undefined; -}; diff --git a/src/gaos/models/webhooks/webhook-update.ts b/src/gaos/models/webhooks/webhook-update.ts deleted file mode 100644 index 41ba8ff7c6..0000000000 --- a/src/gaos/models/webhooks/webhook-update.ts +++ /dev/null @@ -1,58 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export type WebhookUpdateSubscribedEvent = - | "batch.succeeded" - | "batch.expired" - | "batch.failed" - | "interaction.requires_action" - | "interaction.completed" - | "interaction.failed" - | "video.generated" - | (string & {}); - -/** - * Optional. The state of the webhook. - */ -export type WebhookUpdateState = - | "enabled" - | "disabled" - | "disabled_due_to_failed_deliveries"; - -export type WebhookUpdate = { - /** - * Optional. The user-provided name of the webhook. - */ - name?: string | undefined; - /** - * Optional. The URI to which webhook events will be sent. - */ - uri?: string | undefined; - /** - * Optional. The events that the webhook is subscribed to. - * - * @remarks - * Available events: - * - batch.succeeded - * - batch.expired - * - batch.failed - * - interaction.requires_action - * - interaction.completed - * - interaction.failed - * - video.generated - */ - subscribed_events?: Array | undefined; - /** - * Optional. The state of the webhook. - */ - state?: WebhookUpdateState | undefined; -}; diff --git a/src/gaos/models/webhooks/webhook.ts b/src/gaos/models/webhooks/webhook.ts deleted file mode 100644 index 9d80413b1b..0000000000 --- a/src/gaos/models/webhooks/webhook.ts +++ /dev/null @@ -1,112 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { SigningSecret } from "./signing-secret.js"; - -export type WebhookSubscribedEvent = - | "batch.succeeded" - | "batch.expired" - | "batch.failed" - | "interaction.requires_action" - | "interaction.completed" - | "interaction.failed" - | "video.generated" - | (string & {}); - -/** - * Output only. The state of the webhook. - */ -export type WebhookState = - | "enabled" - | "disabled" - | "disabled_due_to_failed_deliveries" - | (string & {}); - -/** - * A Webhook resource. - */ -export type Webhook = { - /** - * Optional. The user-provided name of the webhook. - */ - name?: string | undefined; - /** - * Required. The URI to which webhook events will be sent. - */ - uri: string; - /** - * Required. The events that the webhook is subscribed to. - * - * @remarks - * Available events: - * - batch.succeeded - * - batch.expired - * - batch.failed - * - interaction.requires_action - * - interaction.completed - * - interaction.failed - * - video.generated - */ - subscribed_events: Array; - /** - * Output only. The timestamp when the webhook was created. - */ - create_time?: string | undefined; - /** - * Output only. The timestamp when the webhook was last updated. - */ - update_time?: string | undefined; - /** - * Output only. The signing secrets associated with this webhook. - */ - signing_secrets?: Array | undefined; - /** - * Output only. The state of the webhook. - */ - state?: WebhookState | undefined; - /** - * Output only. The new signing secret for the webhook. Only populated on create. - */ - new_signing_secret?: string | undefined; - /** - * Output only. The ID of the webhook. - */ - id?: string | undefined; -}; - -/** - * A Webhook resource. - */ -export type WebhookInput = { - /** - * Optional. The user-provided name of the webhook. - */ - name?: string | undefined; - /** - * Required. The URI to which webhook events will be sent. - */ - uri: string; - /** - * Required. The events that the webhook is subscribed to. - * - * @remarks - * Available events: - * - batch.succeeded - * - batch.expired - * - batch.failed - * - interaction.requires_action - * - interaction.completed - * - interaction.failed - * - video.generated - */ - subscribed_events: Array; -}; diff --git a/src/gaos/resources.ts b/src/gaos/resources.ts deleted file mode 100644 index 7040ce3548..0000000000 --- a/src/gaos/resources.ts +++ /dev/null @@ -1,713 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import type { AgentListResponse as AgentListResponse$Import } from "./models/agents/agent-list-response.js"; -import type { AgentTool as AgentTool$Import } from "./models/agents/agent-tool.js"; -import type { Agent as Agent$Import } from "./models/agents/agent.js"; -import type { AgentOption as AgentOption$Import } from "./models/interactions/agent-option.js"; -import type { AllowedTools as AllowedTools$Import } from "./models/interactions/allowed-tools.js"; -import type { AllowlistEntry as AllowlistEntry$Import } from "./models/interactions/allowlist-entry.js"; -import type { Annotation as Annotation$Import } from "./models/interactions/annotation.js"; -import type { ArgumentsDelta as ArgumentsDelta$Import } from "./models/interactions/arguments-delta.js"; -import type { AudioContent as AudioContent$Import } from "./models/interactions/audio-content.js"; -import type { AudioDelta as AudioDelta$Import } from "./models/interactions/audio-delta.js"; -import type { AudioResponseFormat as AudioResponseFormat$Import } from "./models/interactions/audio-response-format.js"; -import type { CodeExecutionCallArguments as CodeExecutionCallArguments$Import } from "./models/interactions/code-execution-call-arguments.js"; -import type { CodeExecutionCallDelta as CodeExecutionCallDelta$Import } from "./models/interactions/code-execution-call-delta.js"; -import type { CodeExecutionCallStep as CodeExecutionCallStep$Import } from "./models/interactions/code-execution-call-step.js"; -import type { CodeExecutionResultDelta as CodeExecutionResultDelta$Import } from "./models/interactions/code-execution-result-delta.js"; -import type { CodeExecutionResultStep as CodeExecutionResultStep$Import } from "./models/interactions/code-execution-result-step.js"; -import type { CodeExecution as CodeExecution$Import } from "./models/interactions/code-execution.js"; -import type { ComputerUse as ComputerUse$Import } from "./models/interactions/computer-use.js"; -import type { Content as Content$Import } from "./models/interactions/content.js"; -import type { CreateAgentInteraction as CreateAgentInteraction$Import } from "./models/interactions/create-agent-interaction.js"; -import type { CreateModelInteraction as CreateModelInteraction$Import } from "./models/interactions/create-model-interaction.js"; -import type { DeepResearchAgentConfig as DeepResearchAgentConfig$Import } from "./models/interactions/deep-research-agent-config.js"; -import type { DocumentContent as DocumentContent$Import } from "./models/interactions/document-content.js"; -import type { DocumentDelta as DocumentDelta$Import } from "./models/interactions/document-delta.js"; -import type { DynamicAgentConfig as DynamicAgentConfig$Import } from "./models/interactions/dynamic-agent-config.js"; -import type { Empty as Empty$Import } from "./models/interactions/empty.js"; -import type { EnvironmentNetworkEgressAllowlistUnion as EnvironmentNetworkEgressAllowlistUnion$Import } from "./models/interactions/environment-network-egress-allowlist-union.js"; -import type { Environment as Environment$Import } from "./models/interactions/environment.js"; -import type { - ErrorEvent as ErrorEvent$Import, - ErrorEventMetadata as ErrorEventMetadata$Import, -} from "./models/interactions/error-event.js"; -import type { ErrorT as ErrorT$Import } from "./models/interactions/error.js"; -import type { FileCitation as FileCitation$Import } from "./models/interactions/file-citation.js"; -import type { FileSearchCallDelta as FileSearchCallDelta$Import } from "./models/interactions/file-search-call-delta.js"; -import type { FileSearchCallStep as FileSearchCallStep$Import } from "./models/interactions/file-search-call-step.js"; -import type { FileSearchResultDelta as FileSearchResultDelta$Import } from "./models/interactions/file-search-result-delta.js"; -import type { FileSearchResultStep as FileSearchResultStep$Import } from "./models/interactions/file-search-result-step.js"; -import type { FileSearchResult as FileSearchResult$Import } from "./models/interactions/file-search-result.js"; -import type { FileSearch as FileSearch$Import } from "./models/interactions/file-search.js"; -import type { FunctionCallStep as FunctionCallStep$Import } from "./models/interactions/function-call-step.js"; -import type { FunctionResultDelta as FunctionResultDelta$Import } from "./models/interactions/function-result-delta.js"; -import type { FunctionResultStep as FunctionResultStep$Import } from "./models/interactions/function-result-step.js"; -import type { FunctionT as FunctionT$Import } from "./models/interactions/function.js"; -import type { GenerationConfig as GenerationConfig$Import } from "./models/interactions/generation-config.js"; -import type { GoogleMapsCallArguments as GoogleMapsCallArguments$Import } from "./models/interactions/google-maps-call-arguments.js"; -import type { GoogleMapsCallDelta as GoogleMapsCallDelta$Import } from "./models/interactions/google-maps-call-delta.js"; -import type { GoogleMapsCallStep as GoogleMapsCallStep$Import } from "./models/interactions/google-maps-call-step.js"; -import type { GoogleMapsResultDelta as GoogleMapsResultDelta$Import } from "./models/interactions/google-maps-result-delta.js"; -import type { GoogleMapsResultPlaces as GoogleMapsResultPlaces$Import } from "./models/interactions/google-maps-result-places.js"; -import type { GoogleMapsResultStep as GoogleMapsResultStep$Import } from "./models/interactions/google-maps-result-step.js"; -import type { GoogleMapsResult as GoogleMapsResult$Import } from "./models/interactions/google-maps-result.js"; -import type { GoogleMaps as GoogleMaps$Import } from "./models/interactions/google-maps.js"; -import type { GoogleSearchCallArguments as GoogleSearchCallArguments$Import } from "./models/interactions/google-search-call-arguments.js"; -import type { GoogleSearchCallDelta as GoogleSearchCallDelta$Import } from "./models/interactions/google-search-call-delta.js"; -import type { GoogleSearchCallStep as GoogleSearchCallStep$Import } from "./models/interactions/google-search-call-step.js"; -import type { GoogleSearchResultDelta as GoogleSearchResultDelta$Import } from "./models/interactions/google-search-result-delta.js"; -import type { GoogleSearchResultStep as GoogleSearchResultStep$Import } from "./models/interactions/google-search-result-step.js"; -import type { GoogleSearchResult as GoogleSearchResult$Import } from "./models/interactions/google-search-result.js"; -import type { GoogleSearch as GoogleSearch$Import } from "./models/interactions/google-search.js"; -import type { GroundingToolCount as GroundingToolCount$Import } from "./models/interactions/grounding-tool-count.js"; -import type { ImageConfig as ImageConfig$Import } from "./models/interactions/image-config.js"; -import type { ImageContent as ImageContent$Import } from "./models/interactions/image-content.js"; -import type { ImageDelta as ImageDelta$Import } from "./models/interactions/image-delta.js"; -import type { ImageResponseFormat as ImageResponseFormat$Import } from "./models/interactions/image-response-format.js"; -import type { InteractionCompletedEvent as InteractionCompletedEvent$Import } from "./models/interactions/interaction-completed-event.js"; -import type { InteractionCreatedEvent as InteractionCreatedEvent$Import } from "./models/interactions/interaction-created-event.js"; -import type { InteractionSseEventInteraction as InteractionSseEventInteraction$Import } from "./models/interactions/interaction-sse-event-interaction.js"; -import type { InteractionSSEEvent as InteractionSSEEvent$Import } from "./models/interactions/interaction-sse-event.js"; -import type { InteractionSSEStreamEvent as InteractionSSEStreamEvent$Import } from "./models/interactions/interaction-sse-stream-event.js"; -import type { - InteractionStatusUpdate as InteractionStatusUpdate$Import, - InteractionStatusUpdateMetadata as InteractionStatusUpdateMetadata$Import, -} from "./models/interactions/interaction-status-update.js"; -import type { Interaction as Interaction$Import } from "./models/interactions/interaction.js"; -import type { InteractionsInput as InteractionsInput$Import } from "./models/interactions/interactions-input.js"; -import type { MCPServerToolCallDelta as MCPServerToolCallDelta$Import } from "./models/interactions/mcp-server-tool-call-delta.js"; -import type { MCPServerToolCallStep as MCPServerToolCallStep$Import } from "./models/interactions/mcp-server-tool-call-step.js"; -import type { MCPServerToolResultDelta as MCPServerToolResultDelta$Import } from "./models/interactions/mcp-server-tool-result-delta.js"; -import type { MCPServerToolResultStep as MCPServerToolResultStep$Import } from "./models/interactions/mcp-server-tool-result-step.js"; -import type { MCPServer as MCPServer$Import } from "./models/interactions/mcp-server.js"; -import type { MediaResolution as MediaResolution$Import } from "./models/interactions/media-resolution.js"; -import type { ModalityTokens as ModalityTokens$Import } from "./models/interactions/modality-tokens.js"; -import type { ModelOutputStep as ModelOutputStep$Import } from "./models/interactions/model-output-step.js"; -import type { Model as Model$Import } from "./models/interactions/model.js"; -import type { PlaceCitation as PlaceCitation$Import } from "./models/interactions/place-citation.js"; -import type { ResponseFormat as ResponseFormat$Import } from "./models/interactions/response-format.js"; -import type { ResponseModality as ResponseModality$Import } from "./models/interactions/response-modality.js"; -import type { Retrieval as Retrieval$Import } from "./models/interactions/retrieval.js"; -import type { ReviewSnippet as ReviewSnippet$Import } from "./models/interactions/review-snippet.js"; -import type { ServiceTier as ServiceTier$Import } from "./models/interactions/service-tier.js"; -import type { Source as Source$Import } from "./models/interactions/source.js"; -import type { SpeechConfig as SpeechConfig$Import } from "./models/interactions/speech-config.js"; -import type { StepDeltaData as StepDeltaData$Import } from "./models/interactions/step-delta-data.js"; -import type { StepDeltaMetadata as StepDeltaMetadata$Import } from "./models/interactions/step-delta-metadata.js"; -import type { StepDelta as StepDelta$Import } from "./models/interactions/step-delta.js"; -import type { - StepStart as StepStart$Import, - StepStartMetadata as StepStartMetadata$Import, -} from "./models/interactions/step-start.js"; -import type { - StepStop as StepStop$Import, - StepStopMetadata as StepStopMetadata$Import, -} from "./models/interactions/step-stop.js"; -import type { Step as Step$Import } from "./models/interactions/step.js"; -import type { TextAnnotationDelta as TextAnnotationDelta$Import } from "./models/interactions/text-annotation-delta.js"; -import type { TextContent as TextContent$Import } from "./models/interactions/text-content.js"; -import type { TextDelta as TextDelta$Import } from "./models/interactions/text-delta.js"; -import type { TextResponseFormat as TextResponseFormat$Import } from "./models/interactions/text-response-format.js"; -import type { ThinkingLevel as ThinkingLevel$Import } from "./models/interactions/thinking-level.js"; -import type { ThinkingSummaries as ThinkingSummaries$Import } from "./models/interactions/thinking-summaries.js"; -import type { ThoughtSignatureDelta as ThoughtSignatureDelta$Import } from "./models/interactions/thought-signature-delta.js"; -import type { ThoughtStep as ThoughtStep$Import } from "./models/interactions/thought-step.js"; -import type { ThoughtSummaryContent as ThoughtSummaryContent$Import } from "./models/interactions/thought-summary-content.js"; -import type { ThoughtSummaryDelta as ThoughtSummaryDelta$Import } from "./models/interactions/thought-summary-delta.js"; -import type { ToolChoiceConfig as ToolChoiceConfig$Import } from "./models/interactions/tool-choice-config.js"; -import type { ToolChoiceType as ToolChoiceType$Import } from "./models/interactions/tool-choice-type.js"; -import type { Tool as Tool$Import } from "./models/interactions/tool.js"; -import type { URLCitation as URLCitation$Import } from "./models/interactions/url-citation.js"; -import type { URLContextCallArguments as URLContextCallArguments$Import } from "./models/interactions/url-context-call-arguments.js"; -import type { URLContextCallDelta as URLContextCallDelta$Import } from "./models/interactions/url-context-call-delta.js"; -import type { - Arguments as Arguments$Import, - URLContextCallStep as URLContextCallStep$Import, -} from "./models/interactions/url-context-call-step.js"; -import type { URLContextResultDelta as URLContextResultDelta$Import } from "./models/interactions/url-context-result-delta.js"; -import type { URLContextResultStep as URLContextResultStep$Import } from "./models/interactions/url-context-result-step.js"; -import type { URLContextResult as URLContextResult$Import } from "./models/interactions/url-context-result.js"; -import type { URLContext as URLContext$Import } from "./models/interactions/url-context.js"; -import type { Usage as Usage$Import } from "./models/interactions/usage.js"; -import type { UserInputStep as UserInputStep$Import } from "./models/interactions/user-input-step.js"; -import type { VertexAISearchConfig as VertexAISearchConfig$Import } from "./models/interactions/vertex-ai-search-config.js"; -import type { VideoContent as VideoContent$Import } from "./models/interactions/video-content.js"; -import type { VideoDelta as VideoDelta$Import } from "./models/interactions/video-delta.js"; -import type { WebhookConfig as WebhookConfig$Import } from "./models/interactions/webhook-config.js"; -import type { - CreateAgentParams as CreateAgentParams$Import, - CreateInteractionParams as CreateInteractionParams$Import, - CreateInteractionParamsNonStreaming - as CreateInteractionParamsNonStreaming$Import, - CreateInteractionParamsStreaming as CreateInteractionParamsStreaming$Import, - CreateWebhookParams as CreateWebhookParams$Import, - DeleteAgentParams as DeleteAgentParams$Import, - DeleteInteractionParams as DeleteInteractionParams$Import, - DeleteWebhookParams as DeleteWebhookParams$Import, - GetAgentParams as GetAgentParams$Import, - GetInteractionByIdParams as GetInteractionByIdParams$Import, - GetInteractionByIdParamsNonStreaming - as GetInteractionByIdParamsNonStreaming$Import, - GetInteractionByIdParamsStreaming as GetInteractionByIdParamsStreaming$Import, - GetWebhookParams as GetWebhookParams$Import, - ListAgentsParams as ListAgentsParams$Import, - ListWebhooksParams as ListWebhooksParams$Import, - UpdateWebhookParams as UpdateWebhookParams$Import, -} from "./models/operations/method-params.js"; -import type { PingWebhookRequest as PingWebhookRequest$Import2 } from "./models/operations/ping-webhook.js"; -import type { RotateSigningSecretRequest as RotateSigningSecretRequest$Import2 } from "./models/operations/rotate-signing-secret.js"; -import type { PingWebhookRequest as PingWebhookRequest$Import } from "./models/webhooks/ping-webhook-request.js"; -import type { RotateSigningSecretRequest as RotateSigningSecretRequest$Import } from "./models/webhooks/rotate-signing-secret-request.js"; -import type { SigningSecret as SigningSecret$Import } from "./models/webhooks/signing-secret.js"; -import type { WebhookListResponse as WebhookListResponse$Import } from "./models/webhooks/webhook-list-response.js"; -import type { WebhookPingResponse as WebhookPingResponse$Import } from "./models/webhooks/webhook-ping-response.js"; -import type { WebhookRotateSigningSecretResponse as WebhookRotateSigningSecretResponse$Import } from "./models/webhooks/webhook-rotate-signing-secret-response.js"; -import type { WebhookUpdate as WebhookUpdate$Import } from "./models/webhooks/webhook-update.js"; -import type { - Webhook as Webhook$Import, - WebhookInput as WebhookInput$Import, -} from "./models/webhooks/webhook.js"; -type Agent$ = Agent$Import; -type AgentCreateParams$ = CreateAgentParams$Import; -type AgentDeleteParams$ = DeleteAgentParams$Import; -type AgentDeleteResponse$ = Empty$Import; -type AgentGetParams$ = GetAgentParams$Import; -type AgentListParams$ = ListAgentsParams$Import; -type AgentListResponse$ = AgentListResponse$Import; -type AgentTool$ = AgentTool$Import; -type AgentDeleteResponse$2 = Empty$Import; -type AgentListParams$2 = ListAgentsParams$Import; -type AgentOption$ = AgentOption$Import; -type AllowedTools$ = AllowedTools$Import; -type AllowlistEntry$ = AllowlistEntry$Import; -type Annotation$ = Annotation$Import; -type ArgumentsDelta$ = ArgumentsDelta$Import; -type AudioContent$ = AudioContent$Import; -type AudioDelta$ = AudioDelta$Import; -type AudioResponseFormat$ = AudioResponseFormat$Import; -type CodeExecution$ = CodeExecution$Import; -type CodeExecutionCallArguments$ = CodeExecutionCallArguments$Import; -type CodeExecutionCallDelta$ = CodeExecutionCallDelta$Import; -type CodeExecutionCallStep$ = CodeExecutionCallStep$Import; -type CodeExecutionResultDelta$ = CodeExecutionResultDelta$Import; -type CodeExecutionResultStep$ = CodeExecutionResultStep$Import; -type ComputerUse$ = ComputerUse$Import; -type Content$ = Content$Import; -type CreateAgentInteraction$ = CreateAgentInteraction$Import; -type CreateModelInteraction$ = CreateModelInteraction$Import; -type DeepResearchAgentConfig$ = DeepResearchAgentConfig$Import; -type DocumentContent$ = DocumentContent$Import; -type DocumentDelta$ = DocumentDelta$Import; -type DynamicAgentConfig$ = DynamicAgentConfig$Import; -type Empty$ = Empty$Import; -type EnvironmentNetworkEgressAllowlistUnion$ = - EnvironmentNetworkEgressAllowlistUnion$Import; -type ErrorT$ = ErrorT$Import; -type ErrorEvent$ = ErrorEvent$Import; -type ErrorEventMetadata$ = ErrorEventMetadata$Import; -type FileCitation$ = FileCitation$Import; -type FileSearch$ = FileSearch$Import; -type FileSearchCallDelta$ = FileSearchCallDelta$Import; -type FileSearchCallStep$ = FileSearchCallStep$Import; -type FileSearchResult$ = FileSearchResult$Import; -type FileSearchResultDelta$ = FileSearchResultDelta$Import; -type FileSearchResultStep$ = FileSearchResultStep$Import; -type FunctionT$ = FunctionT$Import; -type FunctionCallStep$ = FunctionCallStep$Import; -type FunctionResultDelta$ = FunctionResultDelta$Import; -type FunctionResultStep$ = FunctionResultStep$Import; -type GenerationConfig$ = GenerationConfig$Import; -type GoogleMaps$ = GoogleMaps$Import; -type GoogleMapsCallArguments$ = GoogleMapsCallArguments$Import; -type GoogleMapsCallDelta$ = GoogleMapsCallDelta$Import; -type GoogleMapsCallStep$ = GoogleMapsCallStep$Import; -type GoogleMapsResult$ = GoogleMapsResult$Import; -type GoogleMapsResultDelta$ = GoogleMapsResultDelta$Import; -type GoogleMapsResultPlaces$ = GoogleMapsResultPlaces$Import; -type GoogleMapsResultStep$ = GoogleMapsResultStep$Import; -type GoogleSearch$ = GoogleSearch$Import; -type GoogleSearchCallArguments$ = GoogleSearchCallArguments$Import; -type GoogleSearchCallDelta$ = GoogleSearchCallDelta$Import; -type GoogleSearchCallStep$ = GoogleSearchCallStep$Import; -type GoogleSearchResult$ = GoogleSearchResult$Import; -type GoogleSearchResultDelta$ = GoogleSearchResultDelta$Import; -type GoogleSearchResultStep$ = GoogleSearchResultStep$Import; -type GroundingToolCount$ = GroundingToolCount$Import; -type ImageConfig$ = ImageConfig$Import; -type ImageContent$ = ImageContent$Import; -type ImageDelta$ = ImageDelta$Import; -type ImageResponseFormat$ = ImageResponseFormat$Import; -type Interaction$ = Interaction$Import; -type InteractionCompletedEvent$ = InteractionCompletedEvent$Import; -type InteractionCreateParams$ = CreateInteractionParams$Import; -type InteractionCreateParamsNonStreaming$ = - CreateInteractionParamsNonStreaming$Import; -type InteractionCreateParamsStreaming$ = - CreateInteractionParamsStreaming$Import; -type InteractionCreatedEvent$ = InteractionCreatedEvent$Import; -type InteractionDeleteParams$ = DeleteInteractionParams$Import; -type InteractionGetParams$ = GetInteractionByIdParams$Import; -type InteractionGetParamsNonStreaming$ = - GetInteractionByIdParamsNonStreaming$Import; -type InteractionGetParamsStreaming$ = GetInteractionByIdParamsStreaming$Import; -type InteractionSSEEvent$ = InteractionSSEEvent$Import; -type InteractionSSEStreamEvent$ = InteractionSSEStreamEvent$Import; -type InteractionSseEventInteraction$ = InteractionSseEventInteraction$Import; -type InteractionStatusUpdate$ = InteractionStatusUpdate$Import; -type InteractionStatusUpdateMetadata$ = InteractionStatusUpdateMetadata$Import; -type InteractionsInput$ = InteractionsInput$Import; -type MCPServer$ = MCPServer$Import; -type MCPServerToolCallDelta$ = MCPServerToolCallDelta$Import; -type MCPServerToolCallStep$ = MCPServerToolCallStep$Import; -type MCPServerToolResultDelta$ = MCPServerToolResultDelta$Import; -type MCPServerToolResultStep$ = MCPServerToolResultStep$Import; -type MediaResolution$ = MediaResolution$Import; -type ModalityTokens$ = ModalityTokens$Import; -type ModelOutputStep$ = ModelOutputStep$Import; -type PlaceCitation$ = PlaceCitation$Import; -type ResponseFormat$ = ResponseFormat$Import; -type ResponseModality$ = ResponseModality$Import; -type Retrieval$ = Retrieval$Import; -type ReviewSnippet$ = ReviewSnippet$Import; -type ServiceTier$ = ServiceTier$Import; -type Source$ = Source$Import; -type SpeechConfig$ = SpeechConfig$Import; -type Step$ = Step$Import; -type StepDelta$ = StepDelta$Import; -type StepDeltaData$ = StepDeltaData$Import; -type StepDeltaMetadata$ = StepDeltaMetadata$Import; -type StepStart$ = StepStart$Import; -type StepStartMetadata$ = StepStartMetadata$Import; -type StepStop$ = StepStop$Import; -type StepStopMetadata$ = StepStopMetadata$Import; -type TextAnnotationDelta$ = TextAnnotationDelta$Import; -type TextContent$ = TextContent$Import; -type TextDelta$ = TextDelta$Import; -type TextResponseFormat$ = TextResponseFormat$Import; -type ThinkingLevel$ = ThinkingLevel$Import; -type ThinkingSummaries$ = ThinkingSummaries$Import; -type ThoughtSignatureDelta$ = ThoughtSignatureDelta$Import; -type ThoughtStep$ = ThoughtStep$Import; -type ThoughtSummaryContent$ = ThoughtSummaryContent$Import; -type ThoughtSummaryDelta$ = ThoughtSummaryDelta$Import; -type Tool$ = Tool$Import; -type ToolChoiceConfig$ = ToolChoiceConfig$Import; -type ToolChoiceType$ = ToolChoiceType$Import; -type URLCitation$ = URLCitation$Import; -type URLContext$ = URLContext$Import; -type URLContextCallArguments$ = URLContextCallArguments$Import; -type URLContextCallDelta$ = URLContextCallDelta$Import; -type URLContextCallStep$ = URLContextCallStep$Import; -type URLContextResult$ = URLContextResult$Import; -type URLContextResultDelta$ = URLContextResultDelta$Import; -type URLContextResultStep$ = URLContextResultStep$Import; -type Usage$ = Usage$Import; -type UserInputStep$ = UserInputStep$Import; -type VertexAISearchConfig$ = VertexAISearchConfig$Import; -type VideoContent$ = VideoContent$Import; -type VideoDelta$ = VideoDelta$Import; -type WebhookConfig$ = WebhookConfig$Import; -type WebhookDeleteResponse$ = Empty$Import; -type WebhookListParams$ = ListWebhooksParams$Import; -type Agent$2 = Agent$Import; -type AgentCreateParams$2 = Agent$Import; -type AgentListResponse$2 = AgentListResponse$Import; -type Arguments$ = Arguments$Import; -type AudioContentParam$ = AudioContent$Import; -type Environment$ = Environment$Import; -type Model$ = Model$Import; -type ModelParam$ = Model$Import; -type SigningSecret$ = SigningSecret$Import; -type VideoContentParam$ = VideoContent$Import; -type Webhook$ = Webhook$Import; -type WebhookCreateParams$ = WebhookInput$Import; -type WebhookListResponse$ = WebhookListResponse$Import; -type WebhookPingParams$ = PingWebhookRequest$Import; -type WebhookPingResponse$ = WebhookPingResponse$Import; -type WebhookRotateSigningSecretParams$ = RotateSigningSecretRequest$Import; -type WebhookRotateSigningSecretResponse$ = - WebhookRotateSigningSecretResponse$Import; -type WebhookUpdateParams$ = WebhookUpdate$Import; -type PingWebhookRequest$ = PingWebhookRequest$Import; -type RotateSigningSecretRequest$ = RotateSigningSecretRequest$Import; -type SigningSecret$2 = SigningSecret$Import; -type Webhook$2 = Webhook$Import; -type WebhookCreateParams$2 = CreateWebhookParams$Import; -type WebhookDeleteParams$ = DeleteWebhookParams$Import; -type WebhookDeleteResponse$2 = Empty$Import; -type WebhookGetParams$ = GetWebhookParams$Import; -type WebhookListParams$2 = ListWebhooksParams$Import; -type WebhookListResponse$2 = WebhookListResponse$Import; -type WebhookPingParams$2 = PingWebhookRequest$Import2; -type WebhookPingResponse$2 = WebhookPingResponse$Import; -type WebhookRotateSigningSecretParams$2 = RotateSigningSecretRequest$Import2; -type WebhookRotateSigningSecretResponse$2 = - WebhookRotateSigningSecretResponse$Import; -type WebhookUpdate$ = WebhookUpdate$Import; -type WebhookUpdateParams$2 = UpdateWebhookParams$Import; -type WebhookInput$ = WebhookInput$Import; -export type Agent = Agent$; -export type AgentCreateParams = AgentCreateParams$; -export type AgentDeleteParams = AgentDeleteParams$; -export type AgentDeleteResponse = AgentDeleteResponse$; -export type AgentGetParams = AgentGetParams$; -export type AgentListParams = AgentListParams$; -export type AgentListResponse = AgentListResponse$; -export type AgentTool = AgentTool$; -export type AgentOption = AgentOption$; -export type AllowedTools = AllowedTools$; -export type AllowlistEntry = AllowlistEntry$; -export type Annotation = Annotation$; -export type ArgumentsDelta = ArgumentsDelta$; -export type AudioContent = AudioContent$; -export type AudioDelta = AudioDelta$; -export type AudioResponseFormat = AudioResponseFormat$; -export type CodeExecution = CodeExecution$; -export type CodeExecutionCallArguments = CodeExecutionCallArguments$; -export type CodeExecutionCallDelta = CodeExecutionCallDelta$; -export type CodeExecutionCallStep = CodeExecutionCallStep$; -export type CodeExecutionResultDelta = CodeExecutionResultDelta$; -export type CodeExecutionResultStep = CodeExecutionResultStep$; -export type ComputerUse = ComputerUse$; -export type Content = Content$; -export type CreateAgentInteraction = CreateAgentInteraction$; -export type CreateModelInteraction = CreateModelInteraction$; -export type DeepResearchAgentConfig = DeepResearchAgentConfig$; -export type DocumentContent = DocumentContent$; -export type DocumentDelta = DocumentDelta$; -export type DynamicAgentConfig = DynamicAgentConfig$; -export type Empty = Empty$; -export type EnvironmentNetworkEgressAllowlistUnion = - EnvironmentNetworkEgressAllowlistUnion$; -export type ErrorT = ErrorT$; -export type ErrorEvent = ErrorEvent$; -export type ErrorEventMetadata = ErrorEventMetadata$; -export type FileCitation = FileCitation$; -export type FileSearch = FileSearch$; -export type FileSearchCallDelta = FileSearchCallDelta$; -export type FileSearchCallStep = FileSearchCallStep$; -export type FileSearchResult = FileSearchResult$; -export type FileSearchResultDelta = FileSearchResultDelta$; -export type FileSearchResultStep = FileSearchResultStep$; -export type FunctionT = FunctionT$; -export type FunctionCallStep = FunctionCallStep$; -export type FunctionResultDelta = FunctionResultDelta$; -export type FunctionResultStep = FunctionResultStep$; -export type GenerationConfig = GenerationConfig$; -export type GoogleMaps = GoogleMaps$; -export type GoogleMapsCallArguments = GoogleMapsCallArguments$; -export type GoogleMapsCallDelta = GoogleMapsCallDelta$; -export type GoogleMapsCallStep = GoogleMapsCallStep$; -export type GoogleMapsResult = GoogleMapsResult$; -export type GoogleMapsResultDelta = GoogleMapsResultDelta$; -export type GoogleMapsResultPlaces = GoogleMapsResultPlaces$; -export type GoogleMapsResultStep = GoogleMapsResultStep$; -export type GoogleSearch = GoogleSearch$; -export type GoogleSearchCallArguments = GoogleSearchCallArguments$; -export type GoogleSearchCallDelta = GoogleSearchCallDelta$; -export type GoogleSearchCallStep = GoogleSearchCallStep$; -export type GoogleSearchResult = GoogleSearchResult$; -export type GoogleSearchResultDelta = GoogleSearchResultDelta$; -export type GoogleSearchResultStep = GoogleSearchResultStep$; -export type GroundingToolCount = GroundingToolCount$; -export type ImageConfig = ImageConfig$; -export type ImageContent = ImageContent$; -export type ImageDelta = ImageDelta$; -export type ImageResponseFormat = ImageResponseFormat$; -export type Interaction = Interaction$; -export type InteractionCompletedEvent = InteractionCompletedEvent$; -export type InteractionCreateParams = InteractionCreateParams$; -export type InteractionCreateParamsNonStreaming = - InteractionCreateParamsNonStreaming$; -export type InteractionCreateParamsStreaming = - InteractionCreateParamsStreaming$; -export type InteractionCreatedEvent = InteractionCreatedEvent$; -export type InteractionDeleteParams = InteractionDeleteParams$; -export type InteractionGetParams = InteractionGetParams$; -export type InteractionGetParamsNonStreaming = - InteractionGetParamsNonStreaming$; -export type InteractionGetParamsStreaming = InteractionGetParamsStreaming$; -export type InteractionSSEEvent = InteractionSSEEvent$; -export type InteractionSSEStreamEvent = InteractionSSEStreamEvent$; -export type InteractionSseEventInteraction = InteractionSseEventInteraction$; -export type InteractionStatusUpdate = InteractionStatusUpdate$; -export type InteractionStatusUpdateMetadata = InteractionStatusUpdateMetadata$; -export type InteractionsInput = InteractionsInput$; -export type MCPServer = MCPServer$; -export type MCPServerToolCallDelta = MCPServerToolCallDelta$; -export type MCPServerToolCallStep = MCPServerToolCallStep$; -export type MCPServerToolResultDelta = MCPServerToolResultDelta$; -export type MCPServerToolResultStep = MCPServerToolResultStep$; -export type MediaResolution = MediaResolution$; -export type ModalityTokens = ModalityTokens$; -export type ModelOutputStep = ModelOutputStep$; -export type PlaceCitation = PlaceCitation$; -export type ResponseFormat = ResponseFormat$; -export type ResponseModality = ResponseModality$; -export type Retrieval = Retrieval$; -export type ReviewSnippet = ReviewSnippet$; -export type ServiceTier = ServiceTier$; -export type Source = Source$; -export type SpeechConfig = SpeechConfig$; -export type Step = Step$; -export type StepDelta = StepDelta$; -export type StepDeltaData = StepDeltaData$; -export type StepDeltaMetadata = StepDeltaMetadata$; -export type StepStart = StepStart$; -export type StepStartMetadata = StepStartMetadata$; -export type StepStop = StepStop$; -export type StepStopMetadata = StepStopMetadata$; -export type TextAnnotationDelta = TextAnnotationDelta$; -export type TextContent = TextContent$; -export type TextDelta = TextDelta$; -export type TextResponseFormat = TextResponseFormat$; -export type ThinkingLevel = ThinkingLevel$; -export type ThinkingSummaries = ThinkingSummaries$; -export type ThoughtSignatureDelta = ThoughtSignatureDelta$; -export type ThoughtStep = ThoughtStep$; -export type ThoughtSummaryContent = ThoughtSummaryContent$; -export type ThoughtSummaryDelta = ThoughtSummaryDelta$; -export type Tool = Tool$; -export type ToolChoiceConfig = ToolChoiceConfig$; -export type ToolChoiceType = ToolChoiceType$; -export type URLCitation = URLCitation$; -export type URLContext = URLContext$; -export type URLContextCallArguments = URLContextCallArguments$; -export type URLContextCallDelta = URLContextCallDelta$; -export type URLContextCallStep = URLContextCallStep$; -export type URLContextResult = URLContextResult$; -export type URLContextResultDelta = URLContextResultDelta$; -export type URLContextResultStep = URLContextResultStep$; -export type Usage = Usage$; -export type UserInputStep = UserInputStep$; -export type VertexAISearchConfig = VertexAISearchConfig$; -export type VideoContent = VideoContent$; -export type VideoDelta = VideoDelta$; -export type WebhookConfig = WebhookConfig$; -export type WebhookDeleteResponse = WebhookDeleteResponse$; -export type WebhookListParams = WebhookListParams$; -export type Arguments = Arguments$; -export type AudioContentParam = AudioContentParam$; -export type Environment = Environment$; -export type Model = Model$; -export type ModelParam = ModelParam$; -export type SigningSecret = SigningSecret$; -export type VideoContentParam = VideoContentParam$; -export type Webhook = Webhook$; -export type WebhookCreateParams = WebhookCreateParams$; -export type WebhookListResponse = WebhookListResponse$; -export type WebhookPingParams = WebhookPingParams$; -export type WebhookPingResponse = WebhookPingResponse$; -export type WebhookRotateSigningSecretParams = - WebhookRotateSigningSecretParams$; -export type WebhookRotateSigningSecretResponse = - WebhookRotateSigningSecretResponse$; -export type WebhookUpdateParams = WebhookUpdateParams$; -export type PingWebhookRequest = PingWebhookRequest$; -export type RotateSigningSecretRequest = RotateSigningSecretRequest$; -export type WebhookDeleteParams = WebhookDeleteParams$; -export type WebhookGetParams = WebhookGetParams$; -export type WebhookUpdate = WebhookUpdate$; -export type WebhookInput = WebhookInput$; - -export declare namespace Agents { - export type Agent = Agent$; - export type AgentCreateParams = AgentCreateParams$; - export type AgentDeleteParams = AgentDeleteParams$; - export type AgentDeleteResponse = AgentDeleteResponse$; - export type AgentGetParams = AgentGetParams$; - export type AgentListParams = AgentListParams$; - export type AgentListResponse = AgentListResponse$; - export type AgentTool = AgentTool$; -} - -export declare namespace Interactions { - export type AgentDeleteResponse = AgentDeleteResponse$2; - export type AgentListParams = AgentListParams$2; - export type AgentOption = AgentOption$; - export type AllowedTools = AllowedTools$; - export type AllowlistEntry = AllowlistEntry$; - export type Annotation = Annotation$; - export type ArgumentsDelta = ArgumentsDelta$; - export type AudioContent = AudioContent$; - export type AudioDelta = AudioDelta$; - export type AudioResponseFormat = AudioResponseFormat$; - export type CodeExecution = CodeExecution$; - export type CodeExecutionCallArguments = CodeExecutionCallArguments$; - export type CodeExecutionCallDelta = CodeExecutionCallDelta$; - export type CodeExecutionCallStep = CodeExecutionCallStep$; - export type CodeExecutionResultDelta = CodeExecutionResultDelta$; - export type CodeExecutionResultStep = CodeExecutionResultStep$; - export type ComputerUse = ComputerUse$; - export type Content = Content$; - export type CreateAgentInteraction = CreateAgentInteraction$; - export type CreateModelInteraction = CreateModelInteraction$; - export type DeepResearchAgentConfig = DeepResearchAgentConfig$; - export type DocumentContent = DocumentContent$; - export type DocumentDelta = DocumentDelta$; - export type DynamicAgentConfig = DynamicAgentConfig$; - export type Empty = Empty$; - export type EnvironmentNetworkEgressAllowlistUnion = - EnvironmentNetworkEgressAllowlistUnion$; - export type ErrorT = ErrorT$; - export type ErrorEvent = ErrorEvent$; - export type ErrorEventMetadata = ErrorEventMetadata$; - export type FileCitation = FileCitation$; - export type FileSearch = FileSearch$; - export type FileSearchCallDelta = FileSearchCallDelta$; - export type FileSearchCallStep = FileSearchCallStep$; - export type FileSearchResult = FileSearchResult$; - export type FileSearchResultDelta = FileSearchResultDelta$; - export type FileSearchResultStep = FileSearchResultStep$; - export type FunctionT = FunctionT$; - export type FunctionCallStep = FunctionCallStep$; - export type FunctionResultDelta = FunctionResultDelta$; - export type FunctionResultStep = FunctionResultStep$; - export type GenerationConfig = GenerationConfig$; - export type GoogleMaps = GoogleMaps$; - export type GoogleMapsCallArguments = GoogleMapsCallArguments$; - export type GoogleMapsCallDelta = GoogleMapsCallDelta$; - export type GoogleMapsCallStep = GoogleMapsCallStep$; - export type GoogleMapsResult = GoogleMapsResult$; - export type GoogleMapsResultDelta = GoogleMapsResultDelta$; - export type GoogleMapsResultPlaces = GoogleMapsResultPlaces$; - export type GoogleMapsResultStep = GoogleMapsResultStep$; - export type GoogleSearch = GoogleSearch$; - export type GoogleSearchCallArguments = GoogleSearchCallArguments$; - export type GoogleSearchCallDelta = GoogleSearchCallDelta$; - export type GoogleSearchCallStep = GoogleSearchCallStep$; - export type GoogleSearchResult = GoogleSearchResult$; - export type GoogleSearchResultDelta = GoogleSearchResultDelta$; - export type GoogleSearchResultStep = GoogleSearchResultStep$; - export type GroundingToolCount = GroundingToolCount$; - export type ImageConfig = ImageConfig$; - export type ImageContent = ImageContent$; - export type ImageDelta = ImageDelta$; - export type ImageResponseFormat = ImageResponseFormat$; - export type Interaction = Interaction$; - export type InteractionCompletedEvent = InteractionCompletedEvent$; - export type InteractionCreateParams = InteractionCreateParams$; - export type InteractionCreateParamsNonStreaming = - InteractionCreateParamsNonStreaming$; - export type InteractionCreateParamsStreaming = - InteractionCreateParamsStreaming$; - export type InteractionCreatedEvent = InteractionCreatedEvent$; - export type InteractionDeleteParams = InteractionDeleteParams$; - export type InteractionGetParams = InteractionGetParams$; - export type InteractionGetParamsNonStreaming = - InteractionGetParamsNonStreaming$; - export type InteractionGetParamsStreaming = InteractionGetParamsStreaming$; - export type InteractionSSEEvent = InteractionSSEEvent$; - export type InteractionSSEStreamEvent = InteractionSSEStreamEvent$; - export type InteractionSseEventInteraction = InteractionSseEventInteraction$; - export type InteractionStatusUpdate = InteractionStatusUpdate$; - export type InteractionStatusUpdateMetadata = - InteractionStatusUpdateMetadata$; - export type InteractionsInput = InteractionsInput$; - export type MCPServer = MCPServer$; - export type MCPServerToolCallDelta = MCPServerToolCallDelta$; - export type MCPServerToolCallStep = MCPServerToolCallStep$; - export type MCPServerToolResultDelta = MCPServerToolResultDelta$; - export type MCPServerToolResultStep = MCPServerToolResultStep$; - export type MediaResolution = MediaResolution$; - export type ModalityTokens = ModalityTokens$; - export type ModelOutputStep = ModelOutputStep$; - export type PlaceCitation = PlaceCitation$; - export type ResponseFormat = ResponseFormat$; - export type ResponseModality = ResponseModality$; - export type Retrieval = Retrieval$; - export type ReviewSnippet = ReviewSnippet$; - export type ServiceTier = ServiceTier$; - export type Source = Source$; - export type SpeechConfig = SpeechConfig$; - export type Step = Step$; - export type StepDelta = StepDelta$; - export type StepDeltaData = StepDeltaData$; - export type StepDeltaMetadata = StepDeltaMetadata$; - export type StepStart = StepStart$; - export type StepStartMetadata = StepStartMetadata$; - export type StepStop = StepStop$; - export type StepStopMetadata = StepStopMetadata$; - export type TextAnnotationDelta = TextAnnotationDelta$; - export type TextContent = TextContent$; - export type TextDelta = TextDelta$; - export type TextResponseFormat = TextResponseFormat$; - export type ThinkingLevel = ThinkingLevel$; - export type ThinkingSummaries = ThinkingSummaries$; - export type ThoughtSignatureDelta = ThoughtSignatureDelta$; - export type ThoughtStep = ThoughtStep$; - export type ThoughtSummaryContent = ThoughtSummaryContent$; - export type ThoughtSummaryDelta = ThoughtSummaryDelta$; - export type Tool = Tool$; - export type ToolChoiceConfig = ToolChoiceConfig$; - export type ToolChoiceType = ToolChoiceType$; - export type URLCitation = URLCitation$; - export type URLContext = URLContext$; - export type URLContextCallArguments = URLContextCallArguments$; - export type URLContextCallDelta = URLContextCallDelta$; - export type URLContextCallStep = URLContextCallStep$; - export type URLContextResult = URLContextResult$; - export type URLContextResultDelta = URLContextResultDelta$; - export type URLContextResultStep = URLContextResultStep$; - export type Usage = Usage$; - export type UserInputStep = UserInputStep$; - export type VertexAISearchConfig = VertexAISearchConfig$; - export type VideoContent = VideoContent$; - export type VideoDelta = VideoDelta$; - export type WebhookConfig = WebhookConfig$; - export type WebhookDeleteResponse = WebhookDeleteResponse$; - export type WebhookListParams = WebhookListParams$; - export type Agent = Agent$2; - export type AgentCreateParams = AgentCreateParams$2; - export type AgentListResponse = AgentListResponse$2; - export type Arguments = Arguments$; - export type AudioContentParam = AudioContentParam$; - export type Environment = Environment$; - export type Model = Model$; - export type ModelParam = ModelParam$; - export type SigningSecret = SigningSecret$; - export type VideoContentParam = VideoContentParam$; - export type Webhook = Webhook$; - export type WebhookCreateParams = WebhookCreateParams$; - export type WebhookListResponse = WebhookListResponse$; - export type WebhookPingParams = WebhookPingParams$; - export type WebhookPingResponse = WebhookPingResponse$; - export type WebhookRotateSigningSecretParams = - WebhookRotateSigningSecretParams$; - export type WebhookRotateSigningSecretResponse = - WebhookRotateSigningSecretResponse$; - export type WebhookUpdateParams = WebhookUpdateParams$; -} - -export declare namespace Webhooks { - export type PingWebhookRequest = PingWebhookRequest$; - export type RotateSigningSecretRequest = RotateSigningSecretRequest$; - export type SigningSecret = SigningSecret$2; - export type Webhook = Webhook$2; - export type WebhookCreateParams = WebhookCreateParams$2; - export type WebhookDeleteParams = WebhookDeleteParams$; - export type WebhookDeleteResponse = WebhookDeleteResponse$2; - export type WebhookGetParams = WebhookGetParams$; - export type WebhookListParams = WebhookListParams$2; - export type WebhookListResponse = WebhookListResponse$2; - export type WebhookPingParams = WebhookPingParams$2; - export type WebhookPingResponse = WebhookPingResponse$2; - export type WebhookRotateSigningSecretParams = - WebhookRotateSigningSecretParams$2; - export type WebhookRotateSigningSecretResponse = - WebhookRotateSigningSecretResponse$2; - export type WebhookUpdate = WebhookUpdate$; - export type WebhookUpdateParams = WebhookUpdateParams$2; - export type WebhookInput = WebhookInput$; -} diff --git a/src/gaos/sdk/agents.ts b/src/gaos/sdk/agents.ts deleted file mode 100644 index 0971fc84e4..0000000000 --- a/src/gaos/sdk/agents.ts +++ /dev/null @@ -1,93 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { agentsCreate } from "../funcs/agents-create.js"; -import { agentsDelete } from "../funcs/agents-delete.js"; -import { agentsGet } from "../funcs/agents-get.js"; -import { agentsList } from "../funcs/agents-list.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as agents from "../models/agents/index.js"; -import * as interactions from "../models/interactions/index.js"; -import { - CreateAgentParams, - DeleteAgentParams, - GetAgentParams, - ListAgentsParams, -} from "../models/operations/method-params.js"; -import { APIPromise, unwrapAsAPIPromise } from "../types/async.js"; - -export class Agents extends ClientSDK { - /** - * Creates a new Agent (Typed version for SDK). - */ - create( - params: CreateAgentParams, - options?: RequestOptions, - ): APIPromise { - const { api_version, ...body } = params; - return unwrapAsAPIPromise(agentsCreate( - this, - body, - api_version, - options, - )); - } - - /** - * Lists all Agents. - */ - list( - params?: ListAgentsParams, - options?: Omit, - ): APIPromise { - return unwrapAsAPIPromise(agentsList( - this, - params?.api_version, - params?.parent, - params?.pageSize, - params?.pageToken, - options, - )); - } - - /** - * Gets a specific Agent. - */ - get( - id: string, - params?: GetAgentParams, - options?: Omit, - ): APIPromise { - return unwrapAsAPIPromise(agentsGet( - this, - id, - params?.api_version, - options, - )); - } - - /** - * Deletes an Agent. - */ - delete( - id: string, - params?: DeleteAgentParams, - options?: Omit, - ): APIPromise { - return unwrapAsAPIPromise(agentsDelete( - this, - id, - params?.api_version, - options, - )); - } -} diff --git a/src/gaos/sdk/index.ts b/src/gaos/sdk/index.ts deleted file mode 100644 index 9b6fc66386..0000000000 --- a/src/gaos/sdk/index.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export * from "./sdk.js"; diff --git a/src/gaos/sdk/interactions.ts b/src/gaos/sdk/interactions.ts deleted file mode 100644 index 4627b36449..0000000000 --- a/src/gaos/sdk/interactions.ts +++ /dev/null @@ -1,148 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { interactionsCancel } from "../funcs/interactions-cancel.js"; -import { interactionsCreate } from "../funcs/interactions-create.js"; -import { interactionsDelete } from "../funcs/interactions-delete.js"; -import { interactionsGet } from "../funcs/interactions-get.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as interactions from "../models/interactions/index.js"; -import * as operations from "../models/operations/index.js"; -import { - CancelInteractionByIdParams, - CreateAgentInteractionParamsNonStreaming, - CreateAgentInteractionParamsStreaming, - CreateInteractionParams, - CreateModelInteractionParamsNonStreaming, - CreateModelInteractionParamsStreaming, - DeleteInteractionParams, - GetInteractionByIdParams, - GetInteractionByIdParamsNonStreaming, - GetInteractionByIdParamsStreaming, -} from "../models/operations/method-params.js"; -import { APIPromise, unwrapAsAPIPromise } from "../types/async.js"; - -export class Interactions extends ClientSDK { - /** - * Creating an interaction - * - * @remarks - * Creates a new interaction. - */ - create( - params: CreateModelInteractionParamsNonStreaming, - options?: RequestOptions, - ): APIPromise; - create( - params: CreateAgentInteractionParamsNonStreaming, - options?: RequestOptions, - ): APIPromise; - create( - params: CreateModelInteractionParamsStreaming, - options?: RequestOptions, - ): APIPromise; - create( - params: CreateAgentInteractionParamsStreaming, - options?: RequestOptions, - ): APIPromise; - create( - params: CreateInteractionParams, - options?: RequestOptions, - ): APIPromise; - create( - params: CreateInteractionParams, - options?: RequestOptions, - ): APIPromise { - const { api_version, ...body } = params; - return unwrapAsAPIPromise(interactionsCreate( - this, - body, - api_version, - options, - )); - } - - /** - * Retrieving an interaction - * - * @remarks - * Retrieves the full details of a single interaction based on its `Interaction.id`. - */ - get( - id: string, - params?: GetInteractionByIdParamsNonStreaming, - options?: Omit, - ): APIPromise; - get( - id: string, - params: GetInteractionByIdParamsStreaming, - options?: Omit, - ): APIPromise; - get( - id: string, - params?: GetInteractionByIdParams, - options?: Omit, - ): APIPromise; - get( - id: string, - params?: GetInteractionByIdParams, - options?: Omit, - ): APIPromise { - return unwrapAsAPIPromise(interactionsGet( - this, - id, - params?.stream, - params?.last_event_id, - params?.include_input, - params?.api_version, - options, - )); - } - - /** - * Deleting an interaction - * - * @remarks - * Deletes the interaction by id. - */ - delete( - id: string, - params?: DeleteInteractionParams, - options?: Omit, - ): APIPromise { - return unwrapAsAPIPromise(interactionsDelete( - this, - id, - params?.api_version, - options, - )); - } - - /** - * Canceling an interaction - * - * @remarks - * Cancels an interaction by id. This only applies to background interactions that are still running. - */ - cancel( - id: string, - params?: CancelInteractionByIdParams, - options?: Omit, - ): APIPromise { - return unwrapAsAPIPromise(interactionsCancel( - this, - id, - params?.api_version, - options, - )); - } -} diff --git a/src/gaos/sdk/sdk.ts b/src/gaos/sdk/sdk.ts deleted file mode 100644 index 9605ae4d47..0000000000 --- a/src/gaos/sdk/sdk.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ClientSDK } from "../lib/sdks.js"; -import { Agents } from "./agents.js"; -import { Interactions } from "./interactions.js"; -import { Webhooks } from "./webhooks.js"; - -export class GoogleGenAI extends ClientSDK { - private _interactions?: Interactions; - get interactions(): Interactions { - return (this._interactions ??= new Interactions(this._options)); - } - - private _webhooks?: Webhooks; - get webhooks(): Webhooks { - return (this._webhooks ??= new Webhooks(this._options)); - } - - private _agents?: Agents; - get agents(): Agents { - return (this._agents ??= new Agents(this._options)); - } -} diff --git a/src/gaos/sdk/webhooks.ts b/src/gaos/sdk/webhooks.ts deleted file mode 100644 index 351ac5145f..0000000000 --- a/src/gaos/sdk/webhooks.ts +++ /dev/null @@ -1,154 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { webhooksCreate } from "../funcs/webhooks-create.js"; -import { webhooksDelete } from "../funcs/webhooks-delete.js"; -import { webhooksGet } from "../funcs/webhooks-get.js"; -import { webhooksList } from "../funcs/webhooks-list.js"; -import { webhooksPing } from "../funcs/webhooks-ping.js"; -import { webhooksRotateSigningSecret } from "../funcs/webhooks-rotate-signing-secret.js"; -import { webhooksUpdate } from "../funcs/webhooks-update.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as interactions from "../models/interactions/index.js"; -import { - CreateWebhookParams, - DeleteWebhookParams, - GetWebhookParams, - ListWebhooksParams, - UpdateWebhookParams, -} from "../models/operations/method-params.js"; -import * as webhooks from "../models/webhooks/index.js"; -import { APIPromise, unwrapAsAPIPromise } from "../types/async.js"; - -export class Webhooks extends ClientSDK { - /** - * Creates a new Webhook. - */ - create( - params: CreateWebhookParams, - options?: RequestOptions, - ): APIPromise { - const { api_version, ...body } = params; - return unwrapAsAPIPromise(webhooksCreate( - this, - body, - api_version, - options, - )); - } - - /** - * Lists all Webhooks. - */ - list( - params?: ListWebhooksParams, - options?: Omit, - ): APIPromise { - return unwrapAsAPIPromise(webhooksList( - this, - params?.api_version, - params?.page_size, - params?.page_token, - options, - )); - } - - /** - * Gets a specific Webhook. - */ - get( - id: string, - params?: GetWebhookParams, - options?: Omit, - ): APIPromise { - return unwrapAsAPIPromise(webhooksGet( - this, - id, - params?.api_version, - options, - )); - } - - /** - * Updates an existing Webhook. - */ - update( - id: string, - params?: UpdateWebhookParams, - options?: RequestOptions, - ): APIPromise { - const { api_version, update_mask, ...body$body } = params ?? {}; - const body = params === undefined || Object.keys(body$body).length === 0 - ? undefined - : body$body; - return unwrapAsAPIPromise(webhooksUpdate( - this, - id, - api_version, - update_mask, - body, - options, - )); - } - - /** - * Deletes a Webhook. - */ - delete( - id: string, - params?: DeleteWebhookParams, - options?: Omit, - ): APIPromise { - return unwrapAsAPIPromise(webhooksDelete( - this, - id, - params?.api_version, - options, - )); - } - - /** - * Generates a new signing secret for a Webhook. - */ - rotateSigningSecret( - id: string, - api_version?: string | undefined, - body?: webhooks.RotateSigningSecretRequest | undefined, - options?: RequestOptions, - ): APIPromise { - return unwrapAsAPIPromise(webhooksRotateSigningSecret( - this, - id, - api_version, - body, - options, - )); - } - - /** - * Sends a ping event to a Webhook. - */ - ping( - id: string, - api_version?: string | undefined, - body?: webhooks.PingWebhookRequest | undefined, - options?: RequestOptions, - ): APIPromise { - return unwrapAsAPIPromise(webhooksPing( - this, - id, - api_version, - body, - options, - )); - } -} diff --git a/src/gaos/types/async.ts b/src/gaos/types/async.ts deleted file mode 100644 index 5a9d27991a..0000000000 --- a/src/gaos/types/async.ts +++ /dev/null @@ -1,132 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { type Result } from "./fp.js"; -export type APICall = - | { - status: "complete"; - request: Request; - response: Response; - } - | { - status: "request-error"; - request: Request; - response?: undefined; - } - | { - status: "invalid"; - request?: undefined; - response?: undefined; - }; - -export class APIPromise implements Promise { - readonly _promise: Promise<[T, APICall]>; - _unwrapped: Promise | null; - _callSource: Promise | null; - - readonly [Symbol.toStringTag] = "APIPromise"; - - constructor( - p: [T, APICall] | Promise<[T, APICall]>, - callSource?: Promise, - ) { - this._promise = p instanceof Promise ? p : Promise.resolve(p); - this._unwrapped = p instanceof Promise ? null : Promise.resolve(p[0]); - this._callSource = callSource ?? null; - } - - _getUnwrapped(): Promise { - return (this._unwrapped ??= this._promise.then(([value]) => value)); - } - - then( - onfulfilled?: - | ((value: T) => TResult1 | PromiseLike) - | null - | undefined, - onrejected?: - | ((reason: any) => TResult2 | PromiseLike) - | null - | undefined, - ): Promise { - return this._promise.then( - onfulfilled ? ([value]) => onfulfilled(value) : void 0, - onrejected, - ); - } - - catch( - onrejected?: - | ((reason: any) => TResult | PromiseLike) - | null - | undefined, - ): Promise { - return this._getUnwrapped().catch(onrejected); - } - - finally(onfinally?: (() => void) | null | undefined): Promise { - return this._getUnwrapped().finally(onfinally); - } - - $inspect(): Promise<[T, APICall]> { - return this._promise; - } - - asResponse(): Promise { - const src = (this._callSource ??= this._promise.then( - ([, call]) => call, - )); - return src.then((call) => { - if (!call.response) { - throw new Error("APIPromise.asResponse: response unavailable"); - } - return call.response; - }); - } - - async withResponse(): Promise<{ data: T; response: Response }> { - const [[data], response] = await Promise.all([ - this._promise, - this.asResponse(), - ]); - return { data, response }; - } - - _thenUnwrap(transform: (value: T) => U): APIPromise { - const data = this._promise.then( - ([value, call]): [U, APICall] => [transform(value), call], - ); - data.catch(() => {}); - return new APIPromise(data, this._callSource ?? undefined); - } -} - -export function unwrapAsAPIPromise( - p: APIPromise>, -): APIPromise { - const inner = p.$inspect(); - const data: Promise<[T, APICall]> = inner.then(([r, call]) => { - if (!r.ok) { - throw r.error; - } - return [r.value, call]; - }); - const callSource: Promise = inner.then(([r, call]) => { - if (!r.ok && !call.response?.ok) { - throw r.error; - } - return call; - }); - data.catch(() => {}); - callSource.catch(() => {}); - return new APIPromise(data, callSource); -} diff --git a/src/gaos/types/blobs.ts b/src/gaos/types/blobs.ts deleted file mode 100644 index 470cf2c16a..0000000000 --- a/src/gaos/types/blobs.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export function isBlobLike(val: unknown): val is Blob { - if (val instanceof Blob) { - return true; - } - - if (typeof val !== "object" || val == null || !(Symbol.toStringTag in val)) { - return false; - } - - const name = val[Symbol.toStringTag]; - if (typeof name !== "string") { - return false; - } - if (name !== "Blob" && name !== "File") { - return false; - } - - return "stream" in val && typeof val.stream === "function"; -} diff --git a/src/gaos/types/fp.ts b/src/gaos/types/fp.ts deleted file mode 100644 index 24a91b8a88..0000000000 --- a/src/gaos/types/fp.ts +++ /dev/null @@ -1,58 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -/** - * A monad that captures the result of a function call or an error if it was not - * successful. Railway programming, enabled by this type, can be a nicer - * alternative to traditional exception throwing because it allows functions to - * declare all _known_ errors with static types and then check for them - * exhaustively in application code. Thrown exception have a type of `unknown` - * and break out of regular control flow of programs making them harder to - * inspect and more verbose work with due to try-catch blocks. - */ -export type Result = - | { ok: true; value: T; error?: never } - | { ok: false; value?: never; error: E }; - -export function OK(value: V): Result { - return { ok: true, value }; -} - -export function ERR(error: E): Result { - return { ok: false, error }; -} - -/** - * unwrap is a convenience function for extracting a value from a result or - * throwing if there was an error. - */ -export function unwrap(r: Result): T { - if (!r.ok) { - throw r.error; - } - return r.value; -} - -/** - * unwrapAsync is a convenience function for resolving a value from a Promise - * of a result or rejecting if an error occurred. - */ -export async function unwrapAsync( - pr: Promise>, -): Promise { - const r = await pr; - if (!r.ok) { - throw r.error; - } - - return r.value; -} diff --git a/src/gaos/types/index.ts b/src/gaos/types/index.ts deleted file mode 100644 index 6ab0241c8f..0000000000 --- a/src/gaos/types/index.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export { isBlobLike } from "./blobs.js"; -export type { Result } from "./fp.js"; -export type { PageIterator, Paginator } from "./operations.js"; -export { createPageIterator } from "./operations.js"; diff --git a/src/gaos/types/operations.ts b/src/gaos/types/operations.ts deleted file mode 100644 index 0403cee2de..0000000000 --- a/src/gaos/types/operations.ts +++ /dev/null @@ -1,113 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { Result } from "./fp.js"; - -export type Paginator = () => Promise }> | null; - -export type PageIterator = V & { - next: Paginator; - [Symbol.asyncIterator]: () => AsyncIterableIterator; - "~next"?: PageState | undefined; -}; - -export function createPageIterator( - page: V & { next: Paginator }, - halt: (v: V) => boolean, -): { - [Symbol.asyncIterator]: () => AsyncIterableIterator; -} { - return { - [Symbol.asyncIterator]: async function* paginator() { - yield page; - if (halt(page)) { - return; - } - - let p: typeof page | null = page; - for (p = await p.next(); p != null; p = await p.next()) { - yield p; - if (halt(p)) { - return; - } - } - }, - }; -} - -/** - * This utility create a special iterator that yields a single value and - * terminates. It is useful in paginated SDK functions that have early return - * paths when things go wrong. - */ -export function haltIterator( - v: V, -): PageIterator { - return { - ...v, - next: () => null, - [Symbol.asyncIterator]: async function* paginator() { - yield v; - }, - }; -} - -/** - * Converts an async iterator of `Result` into an async iterator of `V`. - * When error results occur, the underlying error value is thrown. - */ -export async function unwrapResultIterator( - iteratorPromise: Promise, PageState>>, -): Promise> { - const resultIter = await iteratorPromise; - - if (!resultIter.ok) { - throw resultIter.error; - } - - return { - ...resultIter.value, - next: unwrapPaginator(resultIter.next), - "~next": resultIter["~next"], - [Symbol.asyncIterator]: async function* paginator() { - for await (const page of resultIter) { - if (!page.ok) { - throw page.error; - } - yield page.value; - } - }, - }; -} - -function unwrapPaginator( - paginator: Paginator>, -): Paginator { - return () => { - const nextResult = paginator(); - if (nextResult == null) { - return null; - } - return nextResult.then((res) => { - if (!res.ok) { - throw res.error; - } - const out = { - ...res.value, - next: unwrapPaginator(res.next), - }; - return out; - }); - }; -} - -export const URL_OVERRIDE = Symbol("URL_OVERRIDE"); diff --git a/src/gaos/types/rfcdate.ts b/src/gaos/types/rfcdate.ts deleted file mode 100644 index 6dcf828808..0000000000 --- a/src/gaos/types/rfcdate.ts +++ /dev/null @@ -1,62 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -const dateRE = /^\d{4}-\d{2}-\d{2}$/; - -export class RFCDate { - private serialized: string; - - /** - * Creates a new RFCDate instance using today's date. - */ - static today(): RFCDate { - return new RFCDate(new Date()); - } - - /** - * Creates a new RFCDate instance using the provided input. - * If a string is used then in must be in the format YYYY-MM-DD. - * - * @param date A Date object or a date string in YYYY-MM-DD format - * @example - * new RFCDate("2022-01-01") - * @example - * new RFCDate(new Date()) - */ - constructor(date: Date | string) { - if (typeof date === "string" && !dateRE.test(date)) { - throw new RangeError( - "RFCDate: date strings must be in the format YYYY-MM-DD: " + date, - ); - } - - const value = new Date(date); - if (isNaN(+value)) { - throw new RangeError("RFCDate: invalid date provided: " + date); - } - - this.serialized = value.toISOString().slice(0, "YYYY-MM-DD".length); - if (!dateRE.test(this.serialized)) { - throw new TypeError( - `RFCDate: failed to build valid date with given value: ${date} serialized to ${this.serialized}`, - ); - } - } - - toJSON(): string { - return this.toString(); - } - - toString(): string { - return this.serialized; - } -} diff --git a/src/gaos/types/streams.ts b/src/gaos/types/streams.ts deleted file mode 100644 index c0bd4ce9ef..0000000000 --- a/src/gaos/types/streams.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * @license - * Copyright 2026 Google LLC - * SPDX-License-Identifier: Apache-2.0 - * - * g3-prettier-ignore-file - */ - -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export function isReadableStream( - val: unknown, -): val is ReadableStream { - if (typeof val !== "object" || val === null) { - return false; - } - - // Check for the presence of methods specific to ReadableStream - const stream = val as ReadableStream; - - // ReadableStream has methods like getReader, cancel, and tee - return ( - typeof stream.getReader === "function" && - typeof stream.cancel === "function" && - typeof stream.tee === "function" - ); -}