Mobile-Agent / MobileAgent /api_service.py
阳渠
Mobile-Agent-v2
1e96bca
raw
history blame
570 Bytes
import requests
import json
def get_action(query_data, url, token):
headers = {
'Authorization': token,
'Content-Type': 'application/json'
}
data = {
"model": "pre-Mobile_Agent_Server_ADB_V2-2204",
"input": {"json_data": query_data}
}
while True:
try:
response = requests.post(url, headers=headers, data=json.dumps(data))
response.json()["output"]
except:
print("Network Error:", response.json())
else:
break
return response