Skip to content

Commit

Permalink
fix bugs in new openapi
Browse files Browse the repository at this point in the history
  • Loading branch information
zzhangpurdue committed Nov 11, 2024
1 parent c2607e8 commit d03efe3
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion modelscope_agent/tools/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ def call(self, params: str, **kwargs):
)


class OpenapiServiceProxy:
class OpenapiServiceProxy(BaseTool):

def __init__(self,
openapi: Union[str, Dict],
Expand Down Expand Up @@ -598,6 +598,22 @@ def _verify_args(self, params: str, api_info) -> Union[str, dict]:
return params_json

def _parse_credentials(self, credentials: dict, headers=None):
"""
Args:
credentials: includes auth_type, api_key_header, api_key_value, api_key_header_prefix
usage:
{
"auth_type": "api_key",
"api_key_header": "Authorization",
"api_key_value": "xxx",
"api_key_header_prefix": "Bearer"
}
headers:
Returns:
"""
if not headers:
headers = {}

Expand Down

0 comments on commit d03efe3

Please sign in to comment.