fix(provider.openai): Update dependency versions, clean test imports, and adjust default OpenAI model configurations

This commit is contained in:
Philipp Kunz 2025-05-13 18:39:57 +00:00
parent 2bc6f7ee5e
commit 09c27379cb
6 changed files with 1225 additions and 296 deletions

View File

@ -1,5 +1,12 @@
# Changelog # Changelog
## 2025-05-13 - 0.5.4 - fix(provider.openai)
Update dependency versions, clean test imports, and adjust default OpenAI model configurations
- Bump dependency versions in package.json (@git.zone/tsbuild, @push.rocks/tapbundle, openai, etc.)
- Change default chatModel from 'gpt-4o' to 'o4-mini' and visionModel from 'gpt-4o' to '04-mini' in provider.openai.ts
- Remove unused 'expectAsync' import from test file
## 2025-04-03 - 0.5.3 - fix(package.json) ## 2025-04-03 - 0.5.3 - fix(package.json)
Add explicit packageManager field to package.json Add explicit packageManager field to package.json

View File

@ -14,24 +14,24 @@
"buildDocs": "(tsdoc)" "buildDocs": "(tsdoc)"
}, },
"devDependencies": { "devDependencies": {
"@git.zone/tsbuild": "^2.2.1", "@git.zone/tsbuild": "^2.3.2",
"@git.zone/tsbundle": "^2.2.5", "@git.zone/tsbundle": "^2.2.5",
"@git.zone/tsrun": "^1.3.3", "@git.zone/tsrun": "^1.3.3",
"@git.zone/tstest": "^1.0.96", "@git.zone/tstest": "^1.0.96",
"@push.rocks/qenv": "^6.1.0", "@push.rocks/qenv": "^6.1.0",
"@push.rocks/tapbundle": "^5.5.6", "@push.rocks/tapbundle": "^6.0.3",
"@types/node": "^22.13.5" "@types/node": "^22.15.17"
}, },
"dependencies": { "dependencies": {
"@anthropic-ai/sdk": "^0.37.0", "@anthropic-ai/sdk": "^0.50.4",
"@push.rocks/smartarray": "^1.1.0", "@push.rocks/smartarray": "^1.1.0",
"@push.rocks/smartfile": "^11.2.0", "@push.rocks/smartfile": "^11.2.0",
"@push.rocks/smartpath": "^5.0.18", "@push.rocks/smartpath": "^5.0.18",
"@push.rocks/smartpdf": "^3.2.2", "@push.rocks/smartpdf": "^3.2.2",
"@push.rocks/smartpromise": "^4.2.3", "@push.rocks/smartpromise": "^4.2.3",
"@push.rocks/smartrequest": "^2.0.23", "@push.rocks/smartrequest": "^2.1.0",
"@push.rocks/webstream": "^1.0.10", "@push.rocks/webstream": "^1.0.10",
"openai": "^4.85.4" "openai": "^4.98.0"
}, },
"repository": { "repository": {
"type": "git", "type": "git",

1494
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
import { expect, expectAsync, tap } from '@push.rocks/tapbundle'; import { expect, tap } from '@push.rocks/tapbundle';
import * as qenv from '@push.rocks/qenv'; import * as qenv from '@push.rocks/qenv';
import * as smartrequest from '@push.rocks/smartrequest'; import * as smartrequest from '@push.rocks/smartrequest';
import * as smartfile from '@push.rocks/smartfile'; import * as smartfile from '@push.rocks/smartfile';

View File

@ -3,6 +3,6 @@
*/ */
export const commitinfo = { export const commitinfo = {
name: '@push.rocks/smartai', name: '@push.rocks/smartai',
version: '0.5.3', version: '0.5.4',
description: 'SmartAi is a versatile TypeScript library designed to facilitate integration and interaction with various AI models, offering functionalities for chat, audio generation, document processing, and vision tasks.' description: 'SmartAi is a versatile TypeScript library designed to facilitate integration and interaction with various AI models, offering functionalities for chat, audio generation, document processing, and vision tasks.'
} }

View File

@ -184,7 +184,7 @@ export class OpenAiProvider extends MultiModalModel {
}, },
})); }));
const chatModel = this.options.chatModel ?? 'gpt-4o'; const chatModel = this.options.chatModel ?? 'o4-mini';
const requestParams: any = { const requestParams: any = {
model: chatModel, model: chatModel,
messages: [ messages: [
@ -207,7 +207,7 @@ export class OpenAiProvider extends MultiModalModel {
} }
public async vision(optionsArg: { image: Buffer; prompt: string }): Promise<string> { public async vision(optionsArg: { image: Buffer; prompt: string }): Promise<string> {
const visionModel = this.options.visionModel ?? 'gpt-4o'; const visionModel = this.options.visionModel ?? '04-mini';
const requestParams: any = { const requestParams: any = {
model: visionModel, model: visionModel,
messages: [ messages: [