Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ SEARCH_TOOL="tavily" # tavily/duckduckgo
TAVILY_API_KEY="<YOUR_TAVILY_API_KEY_HERE>"

# LLM Provider (openai/ollama/watsonx)
LLM_BACKEND="watsonx" # Fallback backend for both agents. If both agent‑specific variables below are set, this fallback is optional.
LLM_BACKEND_SUPERVISOR="openai" # Backend for the supervisor agent
LLM_BACKEND_OPERATOR="ollama" # Backend for the operator agent
LLM_BACKEND="openai" # Fallback backend for both agents. If both agent‑specific variables below are set, this fallback is optional.
# LLM_BACKEND_SUPERVISOR="openai" # Backend for the supervisor agent
# LLM_BACKEND_OPERATOR="ollama" # Backend for the operator agent

## OpenAI
OPENAI_API_KEY="<YOUR_OPEN_AI_API_KEY_HERE>"
OPENAI_MODEL_SUPERVISOR="gpt-4o"
OPENAI_MODEL_OPERATOR="gpt-4o"
OPENAI_MODEL_SUPERVISOR="gpt-4o-mini"
OPENAI_MODEL_OPERATOR="gpt-4o-mini"

## Ollama
OLLAMA_BASE_URL="http://0.0.0.0:11434/api"
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
"uuid": "^11.1.0",
"vite-tsconfig-paths": "^5.1.4",
"vitest": "^3.0.5",
"yaml": "^2.8.0",
"zod": "^3.23.8"
},
"devDependencies": {
Expand Down
61 changes: 32 additions & 29 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 17 additions & 1 deletion src/agents/operator.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,29 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import { ArXivTool } from "beeai-framework/tools/arxiv";
import { DuckDuckGoSearchTool } from "beeai-framework/tools/search/duckDuckGoSearch";
import { BaseToolsFactory, ToolFactoryMethod } from "@/base/tools-factory.js";
import { getEnv } from "beeai-framework/internals/env";
import { TavilySearchTool } from "@/tools/tavily/tavily-search.js";
import { TavilyExtractTool } from "@/tools/tavily/tavily-extract.js";
import { ListSeasonsTool } from "@/tools/openf1/list-seasons.js";
import { GetSeasonDetailTool } from "@/tools/openf1/get-season-detail.js";
import { GetDriverTool } from "@/tools/openf1/get-driver.js";
import { GetCurrentSeasonDetailTool } from "@/tools/openf1/get-current-season-detail.js";
import { ListGrandPrixPositionsTool } from "@/tools/openf1/list-grandprix-positions.js";
import { GetGrandPrixDetailTool } from "@/tools/openf1/get-grand-prix-detail.js";

export class ToolsFactory extends BaseToolsFactory {
async getFactoriesMethods(): Promise<ToolFactoryMethod[]> {
return [...getWebSearchTools(), () => new ArXivTool()];
return [
// ...getWebSearchTools(),
// () => new ArXivTool(),
() => new ListSeasonsTool(),
() => new ListGrandPrixPositionsTool(),
() => new GetCurrentSeasonDetailTool(),
() => new GetSeasonDetailTool(),
() => new GetDriverTool(),
() => new GetGrandPrixDetailTool(),
];
}
}
type WebSearchToolName = "tavily" | "duckduckgo";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { AgentConfigTiny } from "@/agents/supervisor-workflow/workflow-composer/task-initializer/agent-config-initializer/dto.js";

import toolsFixtures from "./tools.js";
import { FixtureName, createFixtures } from "../../base/fixtures.js";
import { addAgentConfigMissingAttrs } from "../../helpers/add-missing-config-attrs.js";
type ToolName = FixtureName<typeof toolsFixtures>;

const ENTRIES = [
{
agentType: `TBD`,
description: `TBD`,
instructions: `TBD`,
tools: [] as const satisfies ToolName[],
},
{
agentType: `TBD`,
description: `TBD`,
instructions: `TBD`,
tools: [] as const satisfies ToolName[],
},
{
agentType: `TBD`,
description: `TBD`,
instructions: `TBD`,
tools: [] as const satisfies ToolName[],
},
] as const satisfies AgentConfigTiny[];

export default createFixtures(
addAgentConfigMissingAttrs(ENTRIES),
({ agentType }) => agentType,
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
import agentsFixtures from "./agent-config.js";
import tasksFixtures from "./task-config.js";
import taskStepsFixtures from "./task-step.js";
import taskRunsFixtures from "./task-run.js";
import toolsFixtures from "./tools.js";
import {
ChoiceExplanations,
WorkflowComposeFixture,
} from "../../base/workflow-compose-fixtures.js";

const title = `List Last 2 Grands Prix of Last F1 Season`;

const prompt = `Can you list last 2 grands prix of last F1 season?`;

const choiceExplanations = {
requestHandler: `TBD`,
problemDecomposer: `TBD`,
steps: [
{
no: 1,
agentConfig: `TBD`,
taskConfig: `TBD`,
taskRun: `TBD`,
},
{
no: 2,
agentConfig: `TBD`,
taskConfig: `TBD`,
taskRun: `TBD`,
},
{
no: 3,
agentConfig: `TBD`,
taskConfig: `TBD`,
taskRun: `TBD`,
},
{
no: 4,
agentConfig: `TBD`,
taskConfig: `TBD`,
taskRun: `TBD`,
},
{
no: 5,
agentConfig: `TBD`,
taskConfig: `TBD`,
taskRun: `TBD`,
},
{
no: 6,
agentConfig: `TBD`,
taskConfig: `TBD`,
taskRun: `TBD`,
},
],
} satisfies ChoiceExplanations;

export const requestHandlerOutput = `{
"requestType": "sports_info",
"primaryGoal": "List the last 2 Grands Prix of the last F1 season",
"userParameters": {
"sport": "F1",
"season": "Last",
"events": "last 2 Grands Prix"
},
"requiredComponents": [
"identify the last F1 season",
"retrieve the schedule of the last F1 season",
"extract the last 2 Grands Prix"
],
"expectedDeliverables": "Names and dates of the last 2 Grands Prix of the last F1 season"
}`;

const fixtures = new WorkflowComposeFixture(
title,
prompt,
choiceExplanations,
requestHandlerOutput,
taskStepsFixtures,
toolsFixtures,
agentsFixtures,
tasksFixtures,
taskRunsFixtures,
);

export default fixtures;
Loading