Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to pass LLM with structured output to createReactAgent or createSupervisor #995

Open
ali-habibzadeh opened this issue Mar 14, 2025 · 0 comments

Comments

@ali-habibzadeh
Copy link

ali-habibzadeh commented Mar 14, 2025

Currently your docs shows LLM is created like this to be used for agents:

const llm = new ChatAnthropic({ apiKey: config.CLAUDE_API_KEY, model: "claude-3-7-sonnet-20250219" });

const userTasksAgent = createReactAgent({
  llm,
  tools: [userTasksTool],
  name: "user-tasks-expert",
  prompt: `blablabla`,
});

But this is not ideal when this is the final task or a supervisor. Ideally I should be able to do something like this, but its not compatible:

const llm = new ChatAnthropic({ apiKey: config.CLAUDE_API_KEY, model: "claude-3-7-sonnet-20250219" });

const userTasksAgent = createReactAgent({
  llm: llm.withStructuredOutput({ output: z.string(),..... }),
  tools: [userTasksTool],
  name: "user-tasks-expert",
  prompt: `blablabla`,
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant