Gen-AI Developer Classroom notes 26/Aug/2026

Build a Basic Agent

  • I Want to build a agent which calls tools
  • Agent:
    • Model + Prompt
    • Tool
    • Framework

Preview

Model (LLM)

  • Where will i get access to a models

    • Hosted by provider
      • Google AI Studio (Free access available)
    • Hosted by Cloud Providers (Enterpirse)
    • Self Hosted
  • In the class when we built the agent these were messages exchanged

# First Message  -> Our input/goal
response['messages'][0].content
'Send how are you email to test@gmail.com'

# model has decided that it should call a tool
AIMessage(content=[], additional_kwargs={'function_call': {'name': 'send_email', 'arguments': '{"destination": "test@gmail.com", "content": "How are you?"}'}, '__gemini_function_call_thought_signatures__': {'call_166863': 'EnEKbwERTTIPUKbDs4pdJWrEDJBXJA4KyDmFiWs8hyeLdXX8jHcNsKROzzLV076oh0Gh91jctlUJuB7B7H9lYYJBZNkxsT8Gu3rmtKhqMgZR3TypQP+63gt6lGveNtSpm7D/aqJyJm7ulHy+iUFG88+AKw=='}}, response_metadata={'finish_reason': 'STOP', 'model_name': 'gemini-3.1-flash-lite', 'safety_ratings': [], 'model_provider': 'google_genai'}, id='lc_run--01a03c0c-cbd5-7e13-ab86-c52d0341c947-0', tool_calls=[{'name': 'send_email', 'args': {'destination': 'test@gmail.com', 'content': 'How are you?'}, 'id': 'call_166863', 'type': 'tool_call'}], invalid_tool_calls=[], usage_metadata={'input_tokens': 87, 'output_tokens': 29, 'total_tokens': 116, 'input_token_details': {'cache_read': 0}})


# Framework called to tool and passed the response to model
ToolMessage(content='Email sent successfully to test@gmail.com', name='send_email', id='f365e670-b847-4893-be53-0382b8b5c38c', tool_call_id='call_166863')


# Model figured out email was sent
AIMessage(content=[{'type': 'text', 'text': "OK. I've sent the email to test@gmail.com.", 'extras': {'signature': 'EnEKbwERTTIPU+iGBPCz33hAH6r/u9b6aSMv+rTsITCUgWlr9aqvfwAtaQ2kGw9hJBEo74wspxERP7r8HYN1UlUqY95HkvuhH20ijP3n5Kv0bbsfIvP8BPqYwe0JbHJZfwJzrG3W8s4S4knH9qWIYseVKw=='}}], additional_kwargs={}, response_metadata={'finish_reason': 'STOP', 'model_name': 'gemini-3.1-flash-lite', 'safety_ratings': [], 'model_provider': 'google_genai'}, id='lc_run--01a03c0c-d250-7c93-a51f-aac68ee02180-0', tool_calls=[], invalid_tool_calls=[], usage_metadata={'input_tokens': 138, 'output_tokens': 15, 'total_tokens': 153, 'input_token_details': {'cache_read': 0}})

By continuous learner

enthusiastic technology learner

Leave a Reply

Discover more from Direct AI Powered By Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading