Replies: 2 comments
-
|
@kalenkevich any advice would be very appreciated 🙏 |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Hello, Running the agent via To be able to debug your agent file you might need to do pretty much the same but manually:
const myTool = new FunctionTool({
name: 'my_tool',
description: 'Tool desc',
execute: () => {},
});
const rootAgent = new LlmAgent({
name: 'root_agent',
model: 'gemini-2.5-flash',
instruction: '...instructions',
tools: [myTool],
});
import {FunctionTool, InMemoryRunner, LlmAgent} from '@google/adk';
const myTool = new FunctionTool({
name: 'my_tool',
description: 'Tool desc',
execute: () => {},
});
const rootAgent = new LlmAgent({
name: 'root_agent',
model: 'gemini-2.5-flash',
instruction: '...instructions',
tools: [myTool],
});
async function main() {
const userId = 'test_user';
const appName = rootAgent.name;
const runner = new InMemoryRunner({agent: rootAgent, appName});
const session = await runner.sessionService.createSession({
appName,
userId,
});
for await (const e of runner.runAsync({
userId,
sessionId: session.id,
newMessage: createUserContent('My message'),
})) {
if (e.content?.parts?.[0]?.text) {
console.log(`${e.author}: ${JSON.stringify(e.content, null, 2)}`);
}
}
}
main().catch(console.error);
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have tried running these commands in the debug mode:
npx @google/adk-devtools webnpx @google/adk-devtools run agent.tsBut it doesn't stop on breakpoints in
FunctionToolof ADK, which makes it very hard to debug.My IDE is Webstorm.
The debug view in the Web-Mode is not enough to get the full context.
How to make it stop on breakpoints?
Beta Was this translation helpful? Give feedback.
All reactions