feat(dependencies): update @ai-sdk/openai and @ai-sdk/provider-utils versions

- Upgraded `@ai-sdk/openai` to version 2.0.19 in `yarn.lock` and `package.json` for improved functionality and compatibility.
- Updated `@ai-sdk/provider-utils` to version 3.0.5, enhancing dependency management.
- Added `TypedToolError` type export in `index.ts` for better error handling.
- Removed unnecessary console logs in `webSearchPlugin` for cleaner code.
- Refactored type handling in `createProvider` to ensure proper type assertions.
- Enforced `topicId` as a required field in the `ModernAiProvider` configuration for stricter validation.
This commit is contained in:
MyPrototypeWhat
2025-08-25 16:04:47 +08:00
parent 65c15c6d87
commit 417f90df3b
9 changed files with 71 additions and 31 deletions
@@ -23,7 +23,6 @@ export const webSearchPlugin = (config: WebSearchPluginConfig = DEFAULT_WEB_SEAR
transformParams: async (params: any, context: AiRequestContext) => {
const { providerId } = context
console.log('providerId', providerId)
switch (providerId) {
case 'openai': {
if (config.openai) {
@@ -40,7 +40,7 @@ export async function createProvider(config: ProviderConfig, options: any): Prom
// 方式二:动态导入 + 函数名
if (config.import && config.creatorFunctionName) {
const module = await config.import()
const module = (await config.import()) as Record<string, unknown>
const creatorFunction = module[config.creatorFunctionName]
if (typeof creatorFunction !== 'function') {
+1
View File
@@ -98,6 +98,7 @@ export type {
ToolResultPart,
ToolSet,
TypedToolCall,
TypedToolError,
TypedToolResult,
UserModelMessage
} from 'ai'