Gen-AI Developer Classroom notes 24/Sep/2026

Memory

  • Consecutive model calls does not memorize any thing, its our problem to solve

Parsing Response Structure of Claude and OpenAI

Tools

  • To create a tool call we need to create a tool description in the format undestood by modle

  • Method

def get_weather(city: str) -> dict:
    fake_weather_db = {
        'hyderabad': {
            'temp': '25',
            'forecast': 'Flash flood risk',
            'other_details': 'mostly cloudy'

        },
        'bangalore': {
            'temp': '33',
            'forecast': 'sunny',
            'other_details': 'clear sky'
        }
    }
    return fake_weather_db.get(city)
  • Claude expects the structure to be
{
  "name": "get_weather",
  "description": "Retrieves the current temperature, weather forecast, and climate details for a specified city.",
  "input_schema": {
    "type": "object",
    "properties": {
      "city": {
        "type": "string",
        "description": "The name of the city to look up the weather for, e.g., 'hyderabad' or 'bangalore'."
      }
    },
    "required": ["city"]
  }
}

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