@lowdefy/connection-google 5.6.0 → 6.1.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,19 +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 { createGoogleGenerativeAI } from '@ai-sdk/google';
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 } = connection ?? {};
19
19
  return {
20
- provider: createGoogleGenerativeAI({
21
- apiKey,
22
- baseURL
20
+ provider: createProvider({
21
+ connection
23
22
  })
24
23
  };
25
24
  }
26
25
  const Google = {
27
26
  schema,
28
- create
27
+ create,
28
+ requests: {
29
+ GenerateObject: createGenerateObject({
30
+ createProvider
31
+ }),
32
+ GenerateText: createGenerateText({
33
+ createProvider
34
+ })
35
+ }
29
36
  };
30
37
  export default Google;
@@ -0,0 +1,26 @@
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 { createGoogleGenerativeAI } from '@ai-sdk/google';
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 } = connection ?? {};
21
+ return createGoogleGenerativeAI({
22
+ apiKey,
23
+ baseURL
24
+ });
25
+ }
26
+ export default createProvider;
package/dist/types.js CHANGED
@@ -18,5 +18,9 @@
18
18
  ],
19
19
  agents: [
20
20
  'GeminiAgent'
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-google",
3
- "version": "5.6.0",
3
+ "version": "6.1.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/google": "3.0.70",
40
- "@lowdefy/ai-utils": "5.6.0"
40
+ "@lowdefy/ai-utils": "6.1.0"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@jest/globals": "28.1.3",
44
- "@lowdefy/ajv": "5.6.0",
45
- "@swc/cli": "0.8.0",
46
- "@swc/core": "1.15.18",
44
+ "@lowdefy/ajv": "6.1.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
  },