@ai-sdk/gateway 4.0.92 → 4.0.94

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @ai-sdk/gateway
2
2
 
3
+ ## 4.0.94
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [af9597b]
8
+ - Updated dependencies [bc49f78]
9
+ - @ai-sdk/provider-utils@5.0.49
10
+
11
+ ## 4.0.93
12
+
13
+ ### Patch Changes
14
+
15
+ - 80b9100: feat (provider/gateway): add Browserbase Search and Fetch tool support
16
+ - d3cc6ae: feat(provider/gateway): accept structured-output in the has provider option
17
+ - Updated dependencies [be877ff]
18
+ - @ai-sdk/provider-utils@5.0.48
19
+
3
20
  ## 4.0.92
4
21
 
5
22
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -868,10 +868,130 @@ interface ExaSearchInput {
868
868
  type ExaSearchOutput = ExaSearchResponse | ExaSearchError;
869
869
  declare const exaSearchToolFactory: _ai_sdk_provider_utils.ProviderExecutedToolFactory<ExaSearchInput, ExaSearchOutput, ExaSearchConfig, {}>;
870
870
 
871
+ interface BrowserbaseSearchConfig {
872
+ /**
873
+ * Default maximum number of results to return (1-25, default: 10).
874
+ */
875
+ numResults?: number;
876
+ }
877
+ interface BrowserbaseSearchInput {
878
+ /**
879
+ * Web search query (1-200 characters).
880
+ */
881
+ query: string;
882
+ /**
883
+ * Maximum number of results to return (1-25, default: 10).
884
+ */
885
+ num_results?: number;
886
+ }
887
+ interface BrowserbaseSearchResult {
888
+ /** Unique identifier for the result. */
889
+ id: string;
890
+ /** Title of the search result. */
891
+ title: string;
892
+ /** URL of the search result. */
893
+ url: string;
894
+ /** Author of the content, when available. */
895
+ author?: string;
896
+ /** Favicon URL, when available. */
897
+ favicon?: string;
898
+ /** Image URL, when available. */
899
+ image?: string;
900
+ /** Publication date in ISO 8601 format, when available. */
901
+ publishedDate?: string;
902
+ }
903
+ interface BrowserbaseSearchResponse {
904
+ /** The search query that was executed. */
905
+ query: string;
906
+ /** Unique identifier for the request. */
907
+ requestId: string;
908
+ /** Search results. */
909
+ results: BrowserbaseSearchResult[];
910
+ }
911
+ interface BrowserbaseSearchError {
912
+ error: 'api_error' | 'configuration_error' | 'execution_error' | 'invalid_input' | 'rate_limit' | 'timeout' | 'unknown';
913
+ statusCode?: number;
914
+ message: string;
915
+ }
916
+ type BrowserbaseSearchOutput = BrowserbaseSearchError | BrowserbaseSearchResponse;
917
+ declare const browserbaseSearchToolFactory: _ai_sdk_provider_utils.ProviderExecutedToolFactory<BrowserbaseSearchInput, BrowserbaseSearchOutput, BrowserbaseSearchConfig, {}>;
918
+
919
+ type BrowserbaseFetchFormat = 'raw' | 'json' | 'markdown';
920
+ interface BrowserbaseFetchConfig {
921
+ /** Whether to follow HTTP redirects (default: false). */
922
+ allowRedirects?: boolean;
923
+ /** Whether to bypass TLS certificate verification (default: false). */
924
+ allowInsecureSsl?: boolean;
925
+ /** Whether to route the request through Browserbase proxies (default: false). */
926
+ proxies?: boolean;
927
+ /** Output format for the response content (default: raw). */
928
+ format?: BrowserbaseFetchFormat;
929
+ /**
930
+ * JSON Schema describing the desired response content. Only used when format
931
+ * is json.
932
+ */
933
+ schema?: Record<string, unknown>;
934
+ }
935
+ interface BrowserbaseFetchInput {
936
+ /** URL of the page to fetch. */
937
+ url: string;
938
+ /** Whether to follow HTTP redirects. */
939
+ allow_redirects?: boolean;
940
+ /** Whether to bypass TLS certificate verification. */
941
+ allow_insecure_ssl?: boolean;
942
+ /** Whether to route the request through Browserbase proxies. */
943
+ proxies?: boolean;
944
+ /** Output format for the response content. */
945
+ format?: BrowserbaseFetchFormat;
946
+ /**
947
+ * JSON Schema describing the desired response content. Only used when format
948
+ * is json.
949
+ */
950
+ schema?: Record<string, unknown>;
951
+ }
952
+ interface BrowserbaseFetchResponse {
953
+ /** Unique identifier for the fetch request. */
954
+ id: string;
955
+ /**
956
+ * Response body. Raw and markdown responses return strings; JSON extraction
957
+ * returns an object matching the requested schema.
958
+ */
959
+ content: string | Record<string, unknown>;
960
+ /** MIME type of the response. */
961
+ contentType: string;
962
+ /** Character encoding of the response. */
963
+ encoding: string;
964
+ /** Response headers from the fetched page. */
965
+ headers: Record<string, string>;
966
+ /** HTTP status code returned by the fetched page. */
967
+ statusCode: number;
968
+ }
969
+ interface BrowserbaseFetchError {
970
+ error: 'api_error' | 'configuration_error' | 'execution_error' | 'invalid_input' | 'rate_limit' | 'timeout' | 'unknown';
971
+ statusCode?: number;
972
+ message: string;
973
+ }
974
+ type BrowserbaseFetchOutput = BrowserbaseFetchError | BrowserbaseFetchResponse;
975
+ declare const browserbaseFetchToolFactory: _ai_sdk_provider_utils.ProviderExecutedToolFactory<BrowserbaseFetchInput, BrowserbaseFetchOutput, BrowserbaseFetchConfig, {}>;
976
+
871
977
  /**
872
978
  * Gateway-specific provider-defined tools.
873
979
  */
874
980
  declare const gatewayTools: {
981
+ /**
982
+ * Fetch page content using Browserbase's lightweight Fetch API.
983
+ *
984
+ * Supports raw, Markdown, and schema-driven JSON output as well as redirects,
985
+ * proxy routing, and TLS controls.
986
+ */
987
+ browserbaseFetch: (config?: BrowserbaseFetchConfig) => ReturnType<typeof browserbaseFetchToolFactory>;
988
+ /**
989
+ * Search the web using Browserbase's Search API for fast, structured results.
990
+ *
991
+ * Returns titles, URLs, and available publication metadata without requiring
992
+ * a browser session.
993
+ */
994
+ browserbaseSearch: (config?: BrowserbaseSearchConfig) => ReturnType<typeof browserbaseSearchToolFactory>;
875
995
  /**
876
996
  * Search the web using Exa for current information and token-efficient
877
997
  * excerpts optimized for agent workflows.
@@ -1123,14 +1243,15 @@ type GatewayProviderOptions = {
1123
1243
  * Restrict routing to provider models that satisfy every given entry.
1124
1244
  *
1125
1245
  * Entries are capability tags (`'implicit-caching'`, `'reasoning'`,
1126
- * `'tool-use'`, `'vision'`) or weight-format conditions: `'quantization:fp8'`
1127
- * requires the serving provider to report that weight format,
1128
- * `'!quantization:fp8'` excludes it (providers with no recorded format still
1129
- * pass an exclusion). Format values are an open space but must match
1130
- * `[a-zA-Z0-9._-]{1,32}` and compare case-insensitively; unknown capability
1131
- * names are rejected by the Gateway with a 400.
1132
- */
1133
- has?: Array<'implicit-caching' | 'reasoning' | 'tool-use' | 'vision' | `quantization:${string}` | `!quantization:${string}`>;
1246
+ * `'tool-use'`, `'vision'` (image input), `'structured-output'`
1247
+ * (schema-constrained output)) or weight-format conditions:
1248
+ * `'quantization:fp8'` requires the serving provider to report that weight
1249
+ * format, `'!quantization:fp8'` excludes it (providers with no recorded
1250
+ * format still pass an exclusion). Format values are an open space but must
1251
+ * match `[a-zA-Z0-9._-]{1,32}` and compare case-insensitively. Unknown
1252
+ * capability names are rejected by the Gateway with a 400.
1253
+ */
1254
+ has?: Array<'implicit-caching' | 'reasoning' | 'structured-output' | 'tool-use' | 'vision' | `quantization:${string}` | `!quantization:${string}`>;
1134
1255
  /**
1135
1256
  * Idempotency key for `experimental_startBatch`: retries with the same
1136
1257
  * key replay the original batch instead of creating a duplicate.