@orpc/ai-sdk 2.0.0-beta.25 → 2.0.0-beta.26
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/dist/index.mjs +3 -9
- package/package.json +7 -6
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getAsyncIteratorObjectSchemaDetails } from '@orpc/contract';
|
|
2
2
|
import { combineJsonSchemasWithComposition } from '@orpc/json-schema';
|
|
3
3
|
import { Procedure, call } from '@orpc/server';
|
|
4
|
-
import { resolveMaybeOptionalOptions, toArray,
|
|
4
|
+
import { resolveMaybeOptionalOptions, toArray, ORPC_NAME } from '@orpc/shared';
|
|
5
5
|
import { tool } from 'ai';
|
|
6
6
|
|
|
7
7
|
const aiSdkTool = (incoming) => ({
|
|
@@ -113,8 +113,7 @@ function createToolFactory(...rest) {
|
|
|
113
113
|
const toolOptions = resolveMaybeOptionalOptions(rest2);
|
|
114
114
|
const disabledValidation = new Procedure({
|
|
115
115
|
...procedure["~orpc"],
|
|
116
|
-
disableInputValidation: true
|
|
117
|
-
disableOutputValidation: true
|
|
116
|
+
disableInputValidation: true
|
|
118
117
|
});
|
|
119
118
|
const isIteratorOutput = getIteratorYieldSchemas(toArray(procedure["~orpc"].outputSchemas)) !== void 0;
|
|
120
119
|
return implementTool(procedure, {
|
|
@@ -125,12 +124,7 @@ function createToolFactory(...rest) {
|
|
|
125
124
|
* and the last event becomes the final result.
|
|
126
125
|
*/
|
|
127
126
|
execute: isIteratorOutput ? async function* (input, callingOptions) {
|
|
128
|
-
|
|
129
|
-
if (!isAsyncIteratorObject(output)) {
|
|
130
|
-
yield output;
|
|
131
|
-
return;
|
|
132
|
-
}
|
|
133
|
-
yield* output;
|
|
127
|
+
yield* await call(disabledValidation, input, { signal: callingOptions.abortSignal, ...options });
|
|
134
128
|
} : (input, callingOptions) => {
|
|
135
129
|
return call(disabledValidation, input, { signal: callingOptions.abortSignal, ...options });
|
|
136
130
|
}
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orpc/ai-sdk",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.0-beta.
|
|
4
|
+
"version": "2.0.0-beta.26",
|
|
5
5
|
"license": "MIT",
|
|
6
|
+
"funding": "https://github.com/sponsors/dinwwwh",
|
|
6
7
|
"homepage": "https://orpc.dev",
|
|
7
8
|
"repository": {
|
|
8
9
|
"type": "git",
|
|
@@ -29,11 +30,11 @@
|
|
|
29
30
|
"ai": ">=7.0.31"
|
|
30
31
|
},
|
|
31
32
|
"dependencies": {
|
|
32
|
-
"@orpc/
|
|
33
|
-
"@orpc/
|
|
34
|
-
"@orpc/
|
|
35
|
-
"@orpc/
|
|
36
|
-
"@orpc/
|
|
33
|
+
"@orpc/client": "2.0.0-beta.26",
|
|
34
|
+
"@orpc/contract": "2.0.0-beta.26",
|
|
35
|
+
"@orpc/server": "2.0.0-beta.26",
|
|
36
|
+
"@orpc/shared": "2.0.0-beta.26",
|
|
37
|
+
"@orpc/json-schema": "2.0.0-beta.26"
|
|
37
38
|
},
|
|
38
39
|
"devDependencies": {
|
|
39
40
|
"ai": "^7.0.48",
|