Skip to content

Commit e7bb0d4

Browse files
committed
chore: fix examples
1 parent d68334b commit e7bb0d4

File tree

2 files changed

+27
-29
lines changed

2 files changed

+27
-29
lines changed

apps/dojo/src/agents.ts

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { HttpAgent } from "@ag-ui/client";
2121
import { A2AMiddlewareAgent } from "@ag-ui/a2a-middleware";
2222
import { A2AAgent } from "@ag-ui/a2a";
2323
import { A2AClient } from "@a2a-js/sdk/client";
24-
import { langChainAgents } from "@ag-ui/langchain/src/examples";
24+
import { LangChainAgent } from "@ag-ui/langchain";
2525

2626
const envVars = getEnvVars();
2727
export const agentsIntegrations: AgentIntegrationConfig[] = [
@@ -263,7 +263,32 @@ export const agentsIntegrations: AgentIntegrationConfig[] = [
263263
},
264264
{
265265
id: "langchain",
266-
agents: async () => langChainAgents,
266+
agents: async () => {
267+
return {
268+
agentic_chat: new LangChainAgent({
269+
chainFn: async ({ messages, tools, threadId }) => {
270+
// @ts-ignore
271+
const { ChatOpenAI } = await import("@langchain/openai");
272+
const chatOpenAI = new ChatOpenAI({ model: "gpt-4o" });
273+
const model = chatOpenAI.bindTools(tools, {
274+
strict: true,
275+
});
276+
return model.stream(messages, { tools, metadata: { conversation_id: threadId } });
277+
},
278+
}),
279+
tool_based_generative_ui: new LangChainAgent({
280+
chainFn: async ({ messages, tools, threadId }) => {
281+
// @ts-ignore
282+
const { ChatOpenAI } = await import("@langchain/openai");
283+
const chatOpenAI = new ChatOpenAI({ model: "gpt-4o" });
284+
const model = chatOpenAI.bindTools(tools, {
285+
strict: true,
286+
});
287+
return model.stream(messages, { tools, metadata: { conversation_id: threadId } });
288+
},
289+
}),
290+
}
291+
},
267292
},
268293
{
269294
id: "agno",

integrations/langchain/typescript/src/examples.ts

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)