BREAKING CHANGE(vercel-ai-sdk): migrate to Vercel AI SDK v6 and introduce provider registry (getModel) returning LanguageModelV3

This commit is contained in:
2026-03-05 19:37:29 +00:00
parent 27cef60900
commit c24010c9bc
61 changed files with 4789 additions and 9083 deletions

31
test/test.research.ts Normal file
View File

@@ -0,0 +1,31 @@
import { tap, expect } from '@git.zone/tstest/tapbundle';
import * as qenv from '@push.rocks/qenv';
import { research } from '../ts_research/index.js';
const testQenv = new qenv.Qenv('./', './.nogit/');
tap.test('research should return answer and sources', async () => {
const apiKey = await testQenv.getEnvVarOnDemand('ANTHROPIC_TOKEN');
if (!apiKey) {
console.log('ANTHROPIC_TOKEN not set, skipping test');
return;
}
const result = await research({
apiKey,
query: 'What is the current version of Node.js?',
searchDepth: 'basic',
});
console.log('Research answer:', result.answer.substring(0, 200));
console.log('Research sources:', result.sources.length);
if (result.searchQueries) {
console.log('Search queries:', result.searchQueries);
}
expect(result.answer).toBeTruthy();
expect(result.answer.length).toBeGreaterThan(10);
expect(result.sources).toBeArray();
});
export default tap.start();