I’m working with two functions that sometimes run into issues. One function fetches coin prices from a third-party API, and the other performs Google searches. I’m looking for ways to make these function calls more robust. Here are the details of the two functions:
Coin Price Retrieval Function
This function retrieves historical data for a specific cryptocurrency.
get_coin_historical_data_by_id_desc = {
"name": "get_coin_historical_data_by_id",
"description": "Get historical data of a specific date related to cryptocurrency page based on a particular coin ID",
"parameters": {
"type": "object",
"properties": {
"coin_id": {
"type": "string",
"description": "Unique ID for the coin"
},
"date": {
"type": "string",
"description": "Date in Format: dd-mm-yyyy"
}
},
"required": ["coin_id", "date"]
}
}
Google Search Function
This function gets the most recent and relevant data from the web like when was the most recent bitcoin halving but is not used for price information.
search_online_desc = {
"name": "search_online",
"description": "Get the most recent and latest data from the web; do not use this tool to get price information",
"parameters": {
"type": "object",
"properties": {
"question": {
"type": "string",
"description": "Question asked by the user"
}
},
"required": ["question"]
}
}
type or paste code here
Does anyone have suggestions or best practices for making these API calls more reliable? Any advice on error handling, retries, or any other techniques would be greatly appreciated. Thanks in advance!