Posts

Showing posts from November, 2026

Beyond Successful API Calls: Managing Timeouts, Retries, and Service Failures

Image
External APIs are an essential part of modern application development. Whether it's processing payments, authenticating users, or retrieving data from third-party services, applications depend on these integrations to function properly. But what happens when an API suddenly stops responding? A request might take several seconds longer than expected, return an HTTP 500 error, or fail because of a temporary network interruption. If the application continues waiting or repeatedly sends requests, the problem can affect other services and consume valuable resources. Developers use several resilience patterns to prevent these situations from affecting the entire application. Timeouts: Controlling How Long Requests Wait Every external API request should have a defined timeout. Without one, slow responses can keep connections occupied and eventually affect application performance. For example, Python's requests library allows developers to configure connection and read timeouts: respo...

Tool Calling vs Function Calling: Examining the API Contract Differences

Image
Modern AI applications are evolving beyond simple prompt-and-response interactions. Language models can now retrieve information, query databases, invoke external APIs, and execute application operations. These interactions rely on structured communication between the model and the application. Two commonly used approaches behind this capability are function calling and tool calling . While they may appear similar, the difference becomes more relevant when designing complex AI agents and production-ready systems. Function Calling: A Direct Interface to Application Code Function calling allows an LLM to select a predefined function and generate the arguments required to invoke it. For example, an application might expose a weather function through a JSON schema: {    "name" : "get_weather" ,    "parameters" : {      "type" : "object" ,      "properties" : {        "city" : {     ...