mirror of
https://github.com/jina-ai/node-DeepResearch.git
synced 2025-12-25 22:16:49 +08:00
* feat: add OpenAI provider with structured output support Co-Authored-By: Han Xiao <han.xiao@jina.ai> * fix: add @ai-sdk/openai dependency and fix modelConfigs access Co-Authored-By: Han Xiao <han.xiao@jina.ai> * fix: correct indentation in agent.ts Co-Authored-By: Han Xiao <han.xiao@jina.ai> * refactor: centralize model initialization in config.ts Co-Authored-By: Han Xiao <han.xiao@jina.ai> * refactor: improve model config access patterns Co-Authored-By: Han Xiao <han.xiao@jina.ai> * fix: remove unused imports Co-Authored-By: Han Xiao <han.xiao@jina.ai> * refactor: clean up --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: Han Xiao <han.xiao@jina.ai>
32 lines
878 B
TypeScript
32 lines
878 B
TypeScript
import { analyzeSteps } from '../error-analyzer';
|
|
import { LLMProvider } from '../../config';
|
|
|
|
describe('analyzeSteps', () => {
|
|
const providers: Array<LLMProvider> = ['openai', 'gemini'];
|
|
const originalEnv = process.env;
|
|
|
|
beforeEach(() => {
|
|
jest.resetModules();
|
|
process.env = { ...originalEnv };
|
|
});
|
|
|
|
afterEach(() => {
|
|
process.env = originalEnv;
|
|
});
|
|
|
|
providers.forEach(provider => {
|
|
describe(`with ${provider} provider`, () => {
|
|
beforeEach(() => {
|
|
process.env.LLM_PROVIDER = provider;
|
|
});
|
|
|
|
it('should analyze error steps', async () => {
|
|
const { response } = await analyzeSteps(['Step 1: Search failed', 'Step 2: Invalid query']);
|
|
expect(response).toHaveProperty('recap');
|
|
expect(response).toHaveProperty('blame');
|
|
expect(response).toHaveProperty('improvement');
|
|
});
|
|
});
|
|
});
|
|
});
|