-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.ts
More file actions
48 lines (44 loc) · 1.75 KB
/
Copy pathindex.ts
File metadata and controls
48 lines (44 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import {Forum} from "./src/forum";
import {orModel} from "./src/providers";
import {BEGINNER_DEVELOPER} from "./prompts/extractors/beginner-developer";
import {SPACED_REPETITION_EXPERT} from "./prompts/experts/spaced-repetition-expert";
import {LEARNING_INSIGHTS} from "./prompts/summarizers/learning-insights";
// Interview between two models, served through OpenRouter:
// - a beginner programmer (interviewer) who leads with questions, and
// - a domain expert (interviewee) on learning with spaced repetition.
//
// The ping-pong strategy alternates turns starting with agent[0]. Putting the
// beginner first means every round is a clean question -> answer exchange, so
// `rounds: 3` yields exactly 3 questions, each answered by the expert.
async function main() {
const forum = new Forum({
threadName: "spaced-repetition-interview",
rounds: 3,
maxTokens: 30000,
initialPrompt:
"Rozpoczynasz wywiad z ekspertem od nauki ze spaced repetition. " +
"Przedstaw się w jednym zdaniu i zadaj swoje pierwsze, najważniejsze pytanie.",
agents: [
{
// Interviewer — asks first, drives the conversation.
agentId: "beginner-developer",
model: orModel("openai/gpt-4o-mini"),
personality: BEGINNER_DEVELOPER(),
},
{
// Interviewee — answers the beginner's questions.
agentId: "spaced-repetition-expert",
model: orModel("anthropic/claude-sonnet-4.5"),
personality: SPACED_REPETITION_EXPERT(),
},
],
summarizer: {
// Distills the interview into a structured domain brief.
agentId: "learning-insights",
model: orModel("openai/gpt-4o"),
personality: LEARNING_INSIGHTS,
},
});
await forum.runForum();
}
main().catch(console.error);