Skip to content

Commit

Permalink
resolve problems
Browse files Browse the repository at this point in the history
  • Loading branch information
garyzhang99 committed May 11, 2024
1 parent 29c2a0a commit ece9e7f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
7 changes: 1 addition & 6 deletions src/agentscope/models/litellm_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,14 @@ def __init__(
super().__init__(config_name=config_name)

if litellm is None:
logger.error(
raise ImportError(
"Cannot import litellm package in current python environment."
"You should try:"
"1. Install litellm by `pip install litellm`"
"2. If you still have import error, you should try to "
"update the openai to higher version, e.g. "
"by runing `pip install openai==1.25.1",
)
raise ImportError(
"Cannot import litellm package in current python environment."
"You should try to install litellm by `pip install litellm`"
"and update openai package by `pip install openai==1.25.1",
)

self.model_name = model_name
self.generate_args = generate_args or {}
Expand Down
6 changes: 2 additions & 4 deletions src/agentscope/service/service_toolkit.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,8 +492,7 @@ def bing_search(query: str, api_key: str, num_results: int=10):
)

# The arguments that requires the agent to specify
# to support class method, the self args are deprecated
args_agent = set(argsspec.args) - set(kwargs.keys()) - {"self"}
args_agent = set(argsspec.args) - set(kwargs.keys())

# Check if the arguments from agent have descriptions in docstring
args_description = {
Expand Down Expand Up @@ -650,8 +649,7 @@ def bing_search(query: str, api_key: str, num_results: int=10):
)

# The arguments that requires the agent to specify
# we remove the self argument, for class methods
args_agent = set(argsspec.args) - set(kwargs.keys()) - set({"self"})
args_agent = set(argsspec.args) - set(kwargs.keys())

# Check if the arguments from agent have descriptions in docstring
args_description = {
Expand Down

0 comments on commit ece9e7f

Please sign in to comment.