Memory
- Consecutive model calls does not memorize any thing, its our problem to solve
Parsing Response Structure of Claude and OpenAI
- Refer Here for the changes done
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"]
}
}
- Refer Here for the code changes done
