Which of the following best describes the primary purpose of building custom tools in an agentic AI system?
Think about why an AI would need to connect to outside services or perform actions beyond just generating text.
Custom tools allow agentic AI to extend its capabilities by interacting with external APIs or systems, enabling it to perform tasks like fetching data, controlling devices, or executing commands.
Given the following Python code snippet for a custom tool in an agentic AI framework, what will be the output when the tool is called with input '5'?
def multiply_by_two(input_value): return f"Result: {int(input_value) * 2}" output = multiply_by_two('5') print(output)
Check how the input string is converted and multiplied.
The input '5' is converted to integer 5, then multiplied by 2, resulting in 10. The function returns the string 'Result: 10'.
When building a custom tool that calls an external API within an agentic AI system, which timeout setting is most appropriate to balance responsiveness and reliability?
Consider user experience and network variability.
A 5-second timeout balances waiting long enough for typical API responses while preventing the AI from hanging too long, maintaining responsiveness.
Which metric is most suitable to evaluate the success of a custom tool integrated into an agentic AI that performs data retrieval tasks?
Think about how well the tool returns relevant information.
Precision and recall measure how accurately and completely the tool retrieves relevant data, which is key for data retrieval tasks.
Consider this Python code snippet for a custom tool in an agentic AI system that queries a weather API. The tool always returns 'None' instead of the expected temperature string. What is the most likely cause?
import requests
def get_temperature(city):
response = requests.get(f"https://api.weather.com/temp?city={city}")
if response.status_code == 200:
data = response.json()
return data['temperature']
print(get_temperature('London'))Check if the API URL and parameters match the expected API specification.
If the API URL or parameters are wrong, the API may return a non-200 status or empty data, causing the function to return None.