google adk with tool calling using gwen3.8-2b-distill

 When we are using the model to perform tool calling it is important to prompt correctly. Let''s see the difference if we were to do it this way 

Prompt #1 

When we using the prompt below and notice the output 


banking_agent = Agent(
    name="account_assistant",
    model=model,
    instruction="You are a helpful customer support agent. Answer questions concisely.",
    tools=[get_user_account_balance],
    before_model_callback=inspect_llm_input
)


Output from prompt1


If i specifiy or prompt the model to specifically "use the tool", the model would call the function.

Prompt #2 

When we change our prompt slight to ask it to use the tool. 

# -------------------------------------------------------------
# 2. CREATE THE ADK AGENT
# -------------------------------------------------------------
banking_agent = Agent(
    name="account_assistant",
    model=model,
    instruction="You are a helpful customer support agent. Answer questions concisely. Use the search tool to find relevant information before answering.",
    tools=[get_user_account_balance],
    before_model_callback=inspect_llm_input
)


Output from prompt 2 



And after reloading my model, even with the same prompt, the result is different. So prompt is more important that you can imagine. 








Comments

Popular posts from this blog

NodeJS: Error: spawn EINVAL in window for node version 20.20 and 18.20

llama cpp running it in google colab