Ai_Agent / api_json_to_doc.py
HighRoller's picture
Upload 14 files
02b5c87 verified
raw
history blame contribute delete
946 Bytes
from all_apis import API_LIST
# Function to convert JSON to documentation format
def convert_json_to_doc(API_LIST):
documentation = ""
for idx, api in enumerate(API_LIST):
documentation += f"#### {idx+1}. {api['name']}\n"
documentation += f"- *API Description:* {api['description']}\n"
if api["arguments"]:
documentation += "- **Arguments:**\n"
for arg in api["arguments"]:
try:
documentation += f" - {arg['argument_name']}:\n"
except:
pass
try:
documentation += f" - Argument Description: {arg['argument_description']}\n"
except:
pass
try:
documentation += f" - Argument Type: {arg['argument_type']}\n"
except:
pass
return documentation