feat: add bullish and bearish researcher agents

This commit is contained in:
2026-05-14 07:59:44 +02:00
parent eb66485e76
commit e913b32f34
2 changed files with 117 additions and 0 deletions
+37
View File
@@ -0,0 +1,37 @@
import { describe, it, expect, vi } from "vitest";
import { BullishResearcher, BearishResearcher } from "../researchers";
import type { AnalystReport } from "../../types/agents";
describe("Researchers", () => {
const mockClient = {
createChatCompletion: vi.fn().mockResolvedValue({
choices: [{ message: { content: "Bullish thesis content" } }],
}),
};
const mockReports: AnalystReport[] = [
{
analyst: "fundamentals",
report: "Strong earnings growth",
signal: {
agent: "fundamentals",
signal: "bullish",
confidence: 0.8,
reasoning: "Revenue up 20%",
timestamp: "2024-01-01",
},
},
];
it("should create bullish researcher", async () => {
const researcher = new BullishResearcher(mockClient as any);
const result = await researcher.research("AAPL", mockReports);
expect(result.researcher).toBe("bullish");
});
it("should create bearish researcher", async () => {
const researcher = new BearishResearcher(mockClient as any);
const result = await researcher.research("AAPL", mockReports);
expect(result.researcher).toBe("bearish");
});
});