Skip to content

Commit

Permalink
remove remote
Browse files Browse the repository at this point in the history
  • Loading branch information
zzhangpurdue committed Nov 4, 2024
1 parent cefcd7e commit b1db8d9
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions modelscope_agent/tools/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -679,27 +679,27 @@ def call(self, params: str, **kwargs):
url = url.replace(f'{{{name}}}', f'{value}')
try:
# visit tool node to call tool
if self.is_remote:
response = requests.post(
f'{self.openapi_service_manager_url}/execute_openapi',
json={
'url': url,
'params': query_params,
'headers': header,
'method': method,
'cookies': cookies,
'data': data
},
headers=headers)
logger.query_info(
message=f'calling tool message {response.json()}')

response.raise_for_status()
else:
credentials = kwargs.get('credentials', {})
header = self._parse_credentials(credentials, header)
response = execute_api_call(url, method, header, query_params,
data, cookies)
# if self.is_remote:
# response = requests.post(
# f'{self.openapi_service_manager_url}/execute_openapi',
# json={
# 'url': url,
# 'params': query_params,
# 'headers': header,
# 'method': method,
# 'cookies': cookies,
# 'data': data
# },
# headers=headers)
# logger.query_info(
# message=f'calling tool message {response.json()}')
#
# response.raise_for_status()
# else:
credentials = kwargs.get('credentials', {})
header = self._parse_credentials(credentials, header)
response = execute_api_call(url, method, header, query_params,
data, cookies)
return OpenapiServiceProxy.parse_service_response(response)
except Exception as e:
raise RuntimeError(
Expand Down

0 comments on commit b1db8d9

Please sign in to comment.