@lowdefy/connection-ai-gateway 5.5.1 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,20 +12,26 @@
12
12
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
- */ import { createGateway } from '@ai-sdk/gateway';
15
+ */ import { createGenerateObject, createGenerateText } from '@lowdefy/ai-utils';
16
+ import createProvider from './createProvider.js';
16
17
  import schema from './schema.js';
17
18
  function create({ connection }) {
18
- const { apiKey, baseURL, headers } = connection ?? {};
19
19
  return {
20
- provider: createGateway({
21
- apiKey,
22
- baseURL,
23
- headers
20
+ provider: createProvider({
21
+ connection
24
22
  })
25
23
  };
26
24
  }
27
25
  const AIGateway = {
28
26
  schema,
29
- create
27
+ create,
28
+ requests: {
29
+ GenerateObject: createGenerateObject({
30
+ createProvider
31
+ }),
32
+ GenerateText: createGenerateText({
33
+ createProvider
34
+ })
35
+ }
30
36
  };
31
37
  export default AIGateway;
@@ -0,0 +1,27 @@
1
+ /*
2
+ Copyright 2020-2026 Lowdefy, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */ import { createGateway } from '@ai-sdk/gateway';
16
+ // Shared by the connection's create and the request resolvers, which receive
17
+ // evaluated connection properties (not a provider instance) from the request
18
+ // interface layer and must construct the provider themselves.
19
+ function createProvider({ connection }) {
20
+ const { apiKey, baseURL, headers } = connection ?? {};
21
+ return createGateway({
22
+ apiKey,
23
+ baseURL,
24
+ headers
25
+ });
26
+ }
27
+ export default createProvider;
package/dist/types.js CHANGED
@@ -18,5 +18,9 @@
18
18
  ],
19
19
  agents: [
20
20
  'AIGatewayAgent'
21
+ ],
22
+ requests: [
23
+ 'GenerateObject',
24
+ 'GenerateText'
21
25
  ]
22
26
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lowdefy/connection-ai-gateway",
3
- "version": "5.5.1",
3
+ "version": "6.0.0",
4
4
  "license": "Apache-2.0",
5
5
  "description": "",
6
6
  "homepage": "https://lowdefy.com",
@@ -37,13 +37,13 @@
37
37
  ],
38
38
  "dependencies": {
39
39
  "@ai-sdk/gateway": "3.0.111",
40
- "@lowdefy/ai-utils": "5.5.1"
40
+ "@lowdefy/ai-utils": "6.0.0"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@jest/globals": "28.1.3",
44
- "@lowdefy/ajv": "5.5.1",
45
- "@swc/cli": "0.8.0",
46
- "@swc/core": "1.15.18",
44
+ "@lowdefy/ajv": "6.0.0",
45
+ "@swc/cli": "0.8.1",
46
+ "@swc/core": "1.15.32",
47
47
  "@swc/jest": "0.2.39",
48
48
  "jest": "28.1.3"
49
49
  },