@lowdefy/connection-google 6.1.0 → 7.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,32 @@
|
|
|
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 { createGenerateObject, createGenerateText } from '@lowdefy/ai-utils';
|
|
15
|
+
*/ import { createDecide, createGenerateObject, createGenerateText } from '@lowdefy/ai-utils';
|
|
16
16
|
import createProvider from './createProvider.js';
|
|
17
17
|
import schema from './schema.js';
|
|
18
|
+
// maxOutputTokens and timeout are defaults for the agents on this connection; the
|
|
19
|
+
// request resolvers read them from the connection properties.
|
|
18
20
|
function create({ connection }) {
|
|
21
|
+
const { maxOutputTokens, timeout } = connection ?? {};
|
|
19
22
|
return {
|
|
20
23
|
provider: createProvider({
|
|
21
24
|
connection
|
|
22
|
-
})
|
|
25
|
+
}),
|
|
26
|
+
maxOutputTokens,
|
|
27
|
+
timeout
|
|
23
28
|
};
|
|
24
29
|
}
|
|
25
30
|
const Google = {
|
|
26
31
|
schema,
|
|
32
|
+
// An outside service, not app data: a journey on a data set keeps its real target.
|
|
33
|
+
meta: {
|
|
34
|
+
dataSet: 'external'
|
|
35
|
+
},
|
|
27
36
|
create,
|
|
28
37
|
requests: {
|
|
38
|
+
Decide: createDecide({
|
|
39
|
+
createProvider
|
|
40
|
+
}),
|
|
29
41
|
GenerateObject: createGenerateObject({
|
|
30
42
|
createProvider
|
|
31
43
|
}),
|
|
@@ -12,13 +12,13 @@
|
|
|
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 { createGoogle } from '@ai-sdk/google';
|
|
16
16
|
// Shared by the connection's create and the request resolvers, which receive
|
|
17
17
|
// evaluated connection properties (not a provider instance) from the request
|
|
18
18
|
// interface layer and must construct the provider themselves.
|
|
19
19
|
function createProvider({ connection }) {
|
|
20
20
|
const { apiKey, baseURL } = connection ?? {};
|
|
21
|
-
return
|
|
21
|
+
return createGoogle({
|
|
22
22
|
apiKey,
|
|
23
23
|
baseURL
|
|
24
24
|
});
|
|
@@ -33,6 +33,24 @@
|
|
|
33
33
|
errorMessage: {
|
|
34
34
|
type: 'Google connection property "baseURL" should be a string.'
|
|
35
35
|
}
|
|
36
|
+
},
|
|
37
|
+
maxOutputTokens: {
|
|
38
|
+
type: 'integer',
|
|
39
|
+
minimum: 1,
|
|
40
|
+
description: 'Default maximum number of tokens a model call generates, for the requests and agents on this connection that do not set their own.',
|
|
41
|
+
errorMessage: {
|
|
42
|
+
type: 'Google connection property "maxOutputTokens" should be an integer.',
|
|
43
|
+
minimum: 'Google connection property "maxOutputTokens" should be at least 1.'
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
timeout: {
|
|
47
|
+
type: 'integer',
|
|
48
|
+
minimum: 1,
|
|
49
|
+
description: 'Default milliseconds a model call may take, retries included, before it is cancelled, for the requests and agents on this connection that do not set their own.',
|
|
50
|
+
errorMessage: {
|
|
51
|
+
type: 'Google connection property "timeout" should be an integer.',
|
|
52
|
+
minimum: 'Google connection property "timeout" should be at least 1.'
|
|
53
|
+
}
|
|
36
54
|
}
|
|
37
55
|
},
|
|
38
56
|
errorMessage: {
|
package/dist/types.js
CHANGED
|
@@ -16,10 +16,18 @@
|
|
|
16
16
|
connections: [
|
|
17
17
|
'Google'
|
|
18
18
|
],
|
|
19
|
+
// Non-scopable: the tenant wall does not cover this type, so its
|
|
20
|
+
// connections are never scoped and accept no tenant: declaration.
|
|
21
|
+
connectionMetas: {
|
|
22
|
+
Google: {
|
|
23
|
+
tenant: false
|
|
24
|
+
}
|
|
25
|
+
},
|
|
19
26
|
agents: [
|
|
20
27
|
'GeminiAgent'
|
|
21
28
|
],
|
|
22
29
|
requests: [
|
|
30
|
+
'Decide',
|
|
23
31
|
'GenerateObject',
|
|
24
32
|
'GenerateText'
|
|
25
33
|
]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowdefy/connection-google",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
@@ -27,6 +27,9 @@
|
|
|
27
27
|
"url": "https://github.com/lowdefy/lowdefy.git"
|
|
28
28
|
},
|
|
29
29
|
"type": "module",
|
|
30
|
+
"sideEffects": [
|
|
31
|
+
"**/*.css"
|
|
32
|
+
],
|
|
30
33
|
"exports": {
|
|
31
34
|
"./connections": "./dist/connections.js",
|
|
32
35
|
"./agents": "./dist/agents.js",
|
|
@@ -36,12 +39,12 @@
|
|
|
36
39
|
"dist/*"
|
|
37
40
|
],
|
|
38
41
|
"dependencies": {
|
|
39
|
-
"@ai-sdk/google": "
|
|
40
|
-
"@lowdefy/ai-utils": "
|
|
42
|
+
"@ai-sdk/google": "4.0.82",
|
|
43
|
+
"@lowdefy/ai-utils": "7.0.0"
|
|
41
44
|
},
|
|
42
45
|
"devDependencies": {
|
|
43
46
|
"@jest/globals": "28.1.3",
|
|
44
|
-
"@lowdefy/ajv": "
|
|
47
|
+
"@lowdefy/ajv": "7.0.0",
|
|
45
48
|
"@swc/cli": "0.8.1",
|
|
46
49
|
"@swc/core": "1.15.32",
|
|
47
50
|
"@swc/jest": "0.2.39",
|