Skip to content

Commit 32abdfe

Browse files
committed
[feat] Enhance AI SDK integration with new model factories and task adapters
- Added ModelInstanceFactory to manage language, embedding, and image model registrations. - Introduced V3TaskAdapters for executing tasks via V3 models, supporting text generation and embedding tasks. - Updated AiJob to utilize new task execution paths, enhancing compatibility with V3 models. - Registered AI SDK providers for worker execution, enabling streamlined model access and task processing. - Enhanced package dependencies to include new AI SDK packages for improved functionality.
1 parent 6b057b4 commit 32abdfe

28 files changed

Lines changed: 1325 additions & 69 deletions

bun.lock

Lines changed: 50 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/ai-provider/package.json

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@
3535
"@workglow/storage": "workspace:*",
3636
"@workglow/task-graph": "workspace:*",
3737
"@workglow/util": "workspace:*",
38+
"@ai-sdk/openai": "^3.0.28",
39+
"@ai-sdk/anthropic": "^3.0.43",
40+
"@ai-sdk/google": "^3.0.29",
41+
"ai-sdk-ollama": "^3.7.0",
3842
"@sroussey/transformers": "catalog:",
3943
"@mediapipe/tasks-text": "catalog:",
4044
"@mediapipe/tasks-vision": "catalog:",
@@ -56,6 +60,18 @@
5660
},
5761
"@workglow/util": {
5862
"optional": false
63+
},
64+
"@ai-sdk/openai": {
65+
"optional": true
66+
},
67+
"@ai-sdk/anthropic": {
68+
"optional": true
69+
},
70+
"@ai-sdk/google": {
71+
"optional": true
72+
},
73+
"ai-sdk-ollama": {
74+
"optional": true
5975
}
6076
},
6177
"devDependencies": {
@@ -64,10 +80,15 @@
6480
"@workglow/storage": "workspace:*",
6581
"@workglow/task-graph": "workspace:*",
6682
"@workglow/util": "workspace:*",
83+
"@ai-sdk/openai": "^3.0.28",
84+
"@ai-sdk/anthropic": "^3.0.43",
85+
"@ai-sdk/google": "^3.0.29",
86+
"ai-sdk-ollama": "^3.7.0",
6787
"@sroussey/transformers": "catalog:",
6888
"@mediapipe/tasks-text": "catalog:",
6989
"@mediapipe/tasks-vision": "catalog:",
7090
"@mediapipe/tasks-audio": "catalog:",
71-
"@mediapipe/tasks-genai": "catalog:"
91+
"@mediapipe/tasks-genai": "catalog:",
92+
"@ai-sdk/provider": "3.0.8"
7293
}
7394
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/**
2+
* @license
3+
* Copyright 2025 Steven Roussey <sroussey@gmail.com>
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
export const AI_SDK_PROVIDER_IDS = ["openai", "anthropic", "google", "ollama"] as const;
8+
export type AiSdkProviderId = (typeof AI_SDK_PROVIDER_IDS)[number];

0 commit comments

Comments
 (0)