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:
@@ -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') {
|
||||
|
||||
@@ -98,6 +98,7 @@ export type {
|
||||
ToolResultPart,
|
||||
ToolSet,
|
||||
TypedToolCall,
|
||||
TypedToolError,
|
||||
TypedToolResult,
|
||||
UserModelMessage
|
||||
} from 'ai'
|
||||
|
||||
Reference in New Issue
Block a user