| import requests |
| import json |
| from utils.common import ACCOUNT_ID, BASE_URL, HEADER |
|
|
| account_information_tool = { |
| "type": "function", |
| "function": { |
| "name": "AccountInformation", |
| "description": "Fetches account details for the hardcoded account ID.", |
| "parameters": { |
| "type": "object", |
| "properties": { |
| "account_id": { |
| "type": "string", |
| "description": "ID of the account to fetch information.", |
| "default": ACCOUNT_ID |
| }, |
| }, |
| "required": ["account_id"] |
| } |
| } |
| } |
|
|
|
|
| def AccountInformation(account_id=ACCOUNT_ID): |
| """Fetch and print account details.""" |
|
|
| |
| url = f"{BASE_URL}account/{account_id}" |
|
|
| try: |
| response = requests.get(url, headers=HEADER) |
| response.raise_for_status() |
| response_data = response.json() |
| formatted_response = json.dumps(response_data, indent=2) |
| return formatted_response |
| except requests.RequestException as e: |
| return f"Error making API request: {e}" |
|
|