feat: add bullish and bearish researcher agents
This commit is contained in:
@@ -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");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user