@ai-sdk/provider 2.0.0-canary.2 → 2.0.0-canary.4

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,17 @@
1
1
  # @ai-sdk/provider
2
2
 
3
+ ## 2.0.0-canary.4
4
+
5
+ ### Major Changes
6
+
7
+ - 6f6bb89: chore (provider): cleanup request and rawRequest (language model v2)
8
+
9
+ ## 2.0.0-canary.3
10
+
11
+ ### Major Changes
12
+
13
+ - d1a1aa1: chore (provider): merge rawRequest into request (language model v2)
14
+
3
15
  ## 2.0.0-canary.2
4
16
 
5
17
  ### Major Changes
package/dist/index.d.mts CHANGED
@@ -1847,42 +1847,13 @@ An optional signature for verifying that the reasoning originated from the model
1847
1847
  completionTokens: number;
1848
1848
  };
1849
1849
  /**
1850
- Raw prompt and setting information for observability provider integration.
1851
- */
1852
- rawCall: {
1853
- /**
1854
- Raw prompt after expansion and conversion to the format that the
1855
- provider uses to send the information to their API.
1856
- */
1857
- rawPrompt: unknown;
1858
- /**
1859
- Raw settings that are used for the API call. Includes provider-specific
1860
- settings.
1861
- */
1862
- rawSettings: Record<string, unknown>;
1863
- };
1864
- /**
1865
- Optional response information for telemetry and debugging purposes.
1866
- */
1867
- rawResponse?: {
1868
- /**
1869
- Response headers.
1870
- */
1871
- headers?: Record<string, string>;
1872
- /**
1873
- Response body.
1874
- */
1875
- body?: unknown;
1876
- };
1877
- /**
1878
1850
  Optional request information for telemetry and debugging purposes.
1879
1851
  */
1880
1852
  request?: {
1881
1853
  /**
1882
- Raw request HTTP body that was sent to the provider API as a string (JSON should be stringified).
1883
- Non-HTTP(s) providers should not set this.
1854
+ Request HTTP body that was sent to the provider API.
1884
1855
  */
1885
- body?: string;
1856
+ body?: unknown;
1886
1857
  };
1887
1858
  /**
1888
1859
  Optional response information for telemetry and debugging purposes.
@@ -1900,6 +1871,14 @@ An optional signature for verifying that the reasoning originated from the model
1900
1871
  The ID of the response model that was used to generate the response, if the provider sends one.
1901
1872
  */
1902
1873
  modelId?: string;
1874
+ /**
1875
+ Response headers.
1876
+ */
1877
+ headers?: Record<string, string>;
1878
+ /**
1879
+ Response HTTP body.
1880
+ */
1881
+ body?: unknown;
1903
1882
  };
1904
1883
  warnings?: LanguageModelV2CallWarning[];
1905
1884
  /**
@@ -1931,40 +1910,24 @@ An optional signature for verifying that the reasoning originated from the model
1931
1910
  doStream(options: LanguageModelV2CallOptions): PromiseLike<{
1932
1911
  stream: ReadableStream<LanguageModelV2StreamPart>;
1933
1912
  /**
1934
- Raw prompt and setting information for observability provider integration.
1913
+ Optional request information for telemetry and debugging purposes.
1935
1914
  */
1936
- rawCall: {
1937
- /**
1938
- Raw prompt after expansion and conversion to the format that the
1939
- provider uses to send the information to their API.
1940
- */
1941
- rawPrompt: unknown;
1915
+ request?: {
1942
1916
  /**
1943
- Raw settings that are used for the API call. Includes provider-specific
1944
- settings.
1945
- */
1946
- rawSettings: Record<string, unknown>;
1917
+ Request HTTP body that was sent to the provider API.
1918
+ */
1919
+ body?: unknown;
1947
1920
  };
1948
1921
  /**
1949
1922
  Optional raw response data.
1950
1923
  */
1951
- rawResponse?: {
1924
+ response?: {
1952
1925
  /**
1953
1926
  Response headers.
1954
1927
  */
1955
1928
  headers?: Record<string, string>;
1956
1929
  };
1957
1930
  /**
1958
- Optional request information for telemetry and debugging purposes.
1959
- */
1960
- request?: {
1961
- /**
1962
- Raw request HTTP body that was sent to the provider API as a string (JSON should be stringified).
1963
- Non-HTTP(s) providers should not set this.
1964
- */
1965
- body?: string;
1966
- };
1967
- /**
1968
1931
  Warnings for the call, e.g. unsupported settings.
1969
1932
  */
1970
1933
  warnings?: Array<LanguageModelV2CallWarning>;
package/dist/index.d.ts CHANGED
@@ -1847,42 +1847,13 @@ An optional signature for verifying that the reasoning originated from the model
1847
1847
  completionTokens: number;
1848
1848
  };
1849
1849
  /**
1850
- Raw prompt and setting information for observability provider integration.
1851
- */
1852
- rawCall: {
1853
- /**
1854
- Raw prompt after expansion and conversion to the format that the
1855
- provider uses to send the information to their API.
1856
- */
1857
- rawPrompt: unknown;
1858
- /**
1859
- Raw settings that are used for the API call. Includes provider-specific
1860
- settings.
1861
- */
1862
- rawSettings: Record<string, unknown>;
1863
- };
1864
- /**
1865
- Optional response information for telemetry and debugging purposes.
1866
- */
1867
- rawResponse?: {
1868
- /**
1869
- Response headers.
1870
- */
1871
- headers?: Record<string, string>;
1872
- /**
1873
- Response body.
1874
- */
1875
- body?: unknown;
1876
- };
1877
- /**
1878
1850
  Optional request information for telemetry and debugging purposes.
1879
1851
  */
1880
1852
  request?: {
1881
1853
  /**
1882
- Raw request HTTP body that was sent to the provider API as a string (JSON should be stringified).
1883
- Non-HTTP(s) providers should not set this.
1854
+ Request HTTP body that was sent to the provider API.
1884
1855
  */
1885
- body?: string;
1856
+ body?: unknown;
1886
1857
  };
1887
1858
  /**
1888
1859
  Optional response information for telemetry and debugging purposes.
@@ -1900,6 +1871,14 @@ An optional signature for verifying that the reasoning originated from the model
1900
1871
  The ID of the response model that was used to generate the response, if the provider sends one.
1901
1872
  */
1902
1873
  modelId?: string;
1874
+ /**
1875
+ Response headers.
1876
+ */
1877
+ headers?: Record<string, string>;
1878
+ /**
1879
+ Response HTTP body.
1880
+ */
1881
+ body?: unknown;
1903
1882
  };
1904
1883
  warnings?: LanguageModelV2CallWarning[];
1905
1884
  /**
@@ -1931,40 +1910,24 @@ An optional signature for verifying that the reasoning originated from the model
1931
1910
  doStream(options: LanguageModelV2CallOptions): PromiseLike<{
1932
1911
  stream: ReadableStream<LanguageModelV2StreamPart>;
1933
1912
  /**
1934
- Raw prompt and setting information for observability provider integration.
1913
+ Optional request information for telemetry and debugging purposes.
1935
1914
  */
1936
- rawCall: {
1937
- /**
1938
- Raw prompt after expansion and conversion to the format that the
1939
- provider uses to send the information to their API.
1940
- */
1941
- rawPrompt: unknown;
1915
+ request?: {
1942
1916
  /**
1943
- Raw settings that are used for the API call. Includes provider-specific
1944
- settings.
1945
- */
1946
- rawSettings: Record<string, unknown>;
1917
+ Request HTTP body that was sent to the provider API.
1918
+ */
1919
+ body?: unknown;
1947
1920
  };
1948
1921
  /**
1949
1922
  Optional raw response data.
1950
1923
  */
1951
- rawResponse?: {
1924
+ response?: {
1952
1925
  /**
1953
1926
  Response headers.
1954
1927
  */
1955
1928
  headers?: Record<string, string>;
1956
1929
  };
1957
1930
  /**
1958
- Optional request information for telemetry and debugging purposes.
1959
- */
1960
- request?: {
1961
- /**
1962
- Raw request HTTP body that was sent to the provider API as a string (JSON should be stringified).
1963
- Non-HTTP(s) providers should not set this.
1964
- */
1965
- body?: string;
1966
- };
1967
- /**
1968
1931
  Warnings for the call, e.g. unsupported settings.
1969
1932
  */
1970
1933
  warnings?: Array<LanguageModelV2CallWarning>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/provider",
3
- "version": "2.0.0-canary.2",
3
+ "version": "2.0.0-canary.4",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
@@ -46,11 +46,11 @@
46
46
  "ai"
47
47
  ],
48
48
  "scripts": {
49
- "build": "tsup",
50
- "build:watch": "tsup --watch",
51
- "clean": "rm -rf dist",
49
+ "build": "pnpm clean && tsup --tsconfig tsconfig.build.json",
50
+ "build:watch": "pnpm clean && tsup --watch",
51
+ "clean": "rm -rf dist *.tsbuildinfo",
52
52
  "lint": "eslint \"./**/*.ts*\"",
53
- "type-check": "tsc --noEmit",
53
+ "type-check": "tsc --build",
54
54
  "prettier-check": "prettier --check \"./**/*.ts*\""
55
55
  }
56
56
  }