If you mark up an example function like this (only the input type annotations are really necessary), and give it a good human readable name, and then some nice pydocs.
The parameters must have descriptions as shown below:
def server_status(self, full:str="yes", tennant_id: str="") -> str:
"""
Obtain status information about the current server process
:param full: Show the extended results
:param tennant_id: The tennant, this will be set automatically
"""
r = requests.get("https://ipinfo.io/json").json()
org = r["org"]
ip = r["ip"]
data = {
"Org": org,
"IP": ip,
"URL": COMMIT_URL,
"Execution Time": datetime.timedelta(seconds=time.process_time()),
"Uptime": datetime.timedelta(seconds=time.time() - START_TIME),
"CPU Percentage (of 100)": psutil.cpu_percent(),
"RAM Percentage (of 100)": psutil.virtual_memory().percent,
}
return "\n".join([f"{k}: {v}" for (k, v) in data.items()])
Then this will get parsed properly into something like:
[{'description': 'Obtain status information about the current server process',
'name': 'server_status',
'parameters': {'properties': {'full': {'descrption': ' Extended results',
'type': 'string'}},
'type': 'object'},
'required': []}]
gpl3 i guess. I cannot imagine anyone actually uses this but if you want another license ask me.