Skip to content

Commit bb6acba

Browse files
committed
Add typescript langgraph to dojo agents
1 parent 98ac9d0 commit bb6acba

File tree

5 files changed

+271
-13
lines changed

5 files changed

+271
-13
lines changed

typescript-sdk/apps/dojo/scripts/generate-content-json.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,15 @@ const agentFilesMapper: Record<string, (agentKeys: string[]) => Record<string, s
177177
]
178178
}), {})
179179
},
180+
'langgraph-typescript': (agentKeys: string[]) => {
181+
return agentKeys.reduce((acc, agentId) => ({
182+
...acc,
183+
[agentId]: [
184+
path.join(__dirname, integrationsFolderPath, `/langgraph/examples/python/agents/${agentId}/agent.py`),
185+
path.join(__dirname, integrationsFolderPath, `/langgraph/examples/typescript/src/agents/${agentId}/agent.ts`)
186+
]
187+
}), {})
188+
},
180189
'langgraph-fastapi': (agentKeys: string[]) => {
181190
return agentKeys.reduce((acc, agentId) => ({
182191
...acc,

typescript-sdk/apps/dojo/scripts/run-dojo-everything.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,8 @@ const dojo = {
119119
AGNO_URL: 'http://localhost:8002',
120120
CREW_AI_URL: 'http://localhost:8003',
121121
LANGGRAPH_FAST_API_URL: 'http://localhost:8004',
122-
// TODO: Move this to run 2 platforms for testing.
123-
LANGGRAPH_URL: 'http://localhost:8005',
124-
// LANGGRAPH_PLATFORM_PYTHON_URL: 'http://localhost:8005',
125-
// LANGGRAPH_PLATFORM_TYPESCRIPT_URL: 'http://localhost:8006',
122+
LANGGRAPH_PYTHON_URL: 'http://localhost:8005',
123+
LANGGRAPH_TYPESCRIPT_URL: 'http://localhost:8006',
126124
LLAMA_INDEX_URL: 'http://localhost:8007',
127125
MASTRA_URL: 'http://localhost:8008',
128126
PYDANTIC_AI_URL: 'http://localhost:8009',
@@ -137,7 +135,6 @@ const procs = [
137135
crewai,
138136
langgraphFastapi,
139137
langgraphPlatformPython,
140-
// TODO: Also run the typescript version of langgraph.
141138
langgraphPlatformTypescript,
142139
llamaIndex,
143140
mastra,

typescript-sdk/apps/dojo/src/agents.ts

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,27 +115,27 @@ export const agentsIntegrations: AgentIntegrationConfig[] = [
115115
agents: async () => {
116116
return {
117117
agentic_chat: new LangGraphAgent({
118-
deploymentUrl: envVars.langgraphUrl,
118+
deploymentUrl: envVars.langgraphPythonUrl,
119119
graphId: "agentic_chat",
120120
}),
121121
agentic_generative_ui: new LangGraphAgent({
122-
deploymentUrl: envVars.langgraphUrl,
122+
deploymentUrl: envVars.langgraphPythonUrl,
123123
graphId: "agentic_generative_ui",
124124
}),
125125
human_in_the_loop: new LangGraphAgent({
126-
deploymentUrl: envVars.langgraphUrl,
126+
deploymentUrl: envVars.langgraphPythonUrl,
127127
graphId: "human_in_the_loop",
128128
}),
129129
predictive_state_updates: new LangGraphAgent({
130-
deploymentUrl: envVars.langgraphUrl,
130+
deploymentUrl: envVars.langgraphPythonUrl,
131131
graphId: "predictive_state_updates",
132132
}),
133133
shared_state: new LangGraphAgent({
134-
deploymentUrl: envVars.langgraphUrl,
134+
deploymentUrl: envVars.langgraphPythonUrl,
135135
graphId: "shared_state",
136136
}),
137137
tool_based_generative_ui: new LangGraphAgent({
138-
deploymentUrl: envVars.langgraphUrl,
138+
deploymentUrl: envVars.langgraphPythonUrl,
139139
graphId: "tool_based_generative_ui",
140140
}),
141141
};
@@ -169,6 +169,37 @@ export const agentsIntegrations: AgentIntegrationConfig[] = [
169169
};
170170
},
171171
},
172+
{
173+
id: "langgraph-typescript",
174+
agents: async () => {
175+
return {
176+
agentic_chat: new LangGraphAgent({
177+
deploymentUrl: envVars.langgraphTypescriptUrl,
178+
graphId: "agentic_chat",
179+
}),
180+
agentic_generative_ui: new LangGraphAgent({
181+
deploymentUrl: envVars.langgraphTypescriptUrl,
182+
graphId: "agentic_generative_ui",
183+
}),
184+
human_in_the_loop: new LangGraphAgent({
185+
deploymentUrl: envVars.langgraphTypescriptUrl,
186+
graphId: "human_in_the_loop",
187+
}),
188+
predictive_state_updates: new LangGraphAgent({
189+
deploymentUrl: envVars.langgraphTypescriptUrl,
190+
graphId: "predictive_state_updates",
191+
}),
192+
shared_state: new LangGraphAgent({
193+
deploymentUrl: envVars.langgraphTypescriptUrl,
194+
graphId: "shared_state",
195+
}),
196+
tool_based_generative_ui: new LangGraphAgent({
197+
deploymentUrl: envVars.langgraphTypescriptUrl,
198+
graphId: "tool_based_generative_ui",
199+
})
200+
};
201+
},
202+
},
172203
{
173204
id: "agno",
174205
agents: async () => {

typescript-sdk/apps/dojo/src/env.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ type envVars = {
22
serverStarterUrl: string;
33
serverStarterAllFeaturesUrl: string;
44
mastraUrl: string;
5-
langgraphUrl: string;
5+
langgraphPythonUrl: string;
66
langgraphFastApiUrl: string;
7+
langgraphTypescriptUrl: string;
78
agnoUrl: string;
89
llamaIndexUrl: string;
910
crewAiUrl: string;
@@ -24,8 +25,9 @@ export default function getEnvVars(): envVars {
2425
serverStarterUrl: process.env.SERVER_STARTER_URL || 'http://localhost:8000',
2526
serverStarterAllFeaturesUrl: process.env.SERVER_STARTER_ALL_FEATURES_URL || 'http://localhost:8000',
2627
mastraUrl: process.env.MASTRA_URL || 'http://localhost:4111',
27-
langgraphUrl: process.env.LANGGRAPH_URL || 'http://localhost:2024',
28+
langgraphPythonUrl: process.env.LANGGRAPH_URL || 'http://localhost:2024',
2829
langgraphFastApiUrl: process.env.LANGGRAPH_FAST_API_URL || 'http://localhost:8000',
30+
langgraphTypescriptUrl: process.env.LANGGRAPH_TYPESCRIPT_URL || 'http://localhost:8000',
2931
agnoUrl: process.env.AGNO_URL || 'http://localhost:9001',
3032
llamaIndexUrl: process.env.LLAMA_INDEX_URL || 'http://localhost:9000',
3133
crewAiUrl: process.env.CREW_AI_URL || 'http://localhost:9002',

0 commit comments

Comments
 (0)