@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 {
|
|
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:
|
|
21
|
-
|
|
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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowdefy/connection-ai-gateway",
|
|
3
|
-
"version": "
|
|
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": "
|
|
40
|
+
"@lowdefy/ai-utils": "6.0.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@jest/globals": "28.1.3",
|
|
44
|
-
"@lowdefy/ajv": "
|
|
45
|
-
"@swc/cli": "0.8.
|
|
46
|
-
"@swc/core": "1.15.
|
|
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
|
},
|