When i run simple_agent.ipynb, roleplay function not working. it is error from openai api. but i can using DSAssistant. How i can fix this ?
Initial Checks
- [X] I have searched GitHub for a duplicate issue and I'm sure this is something new
- [X] I have read and followed the docs & demos and still think this is a bug
- [X] I am confident that the issue is with modelscope-agent (not my code, or another library in the ecosystem)
What happened + What you expected to happen
File ~/backup/ai/modelscope-agent/examples/agents/../../modelscope_agent/agent.py:32, in enable_stream_callback(name, rsp, callbacks) 31 def enable_stream_callback(name, rsp, callbacks): ---> 32 for s in rsp: 33 yield s 34 callbacks.on_run_end(name, rsp)
File ~/backup/ai/modelscope-agent/examples/agents/../../modelscope_agent/agents/role_play.py:251, in RolePlay._run(self, user_request, history, ref_doc, image_url, lang, **kwargs) 249 llm_result = '' 250 logger.info(f'call llm {call_llm_count} times output: {output}') --> 251 for s in output: 252 if isinstance(s, dict): 253 llm_result = s
File ~/backup/ai/modelscope-agent/examples/agents/../../modelscope_agent/llm/base.py:45, in enable_stream_callback(model, rsp, callbacks) 44 def enable_stream_callback(model, rsp, callbacks): ---> 45 for s in rsp: ... 272 msg = f"Missing required argument: {quote(missing[0])}" 273 raise TypeError(msg) --> 274 return func(*args, **kwargs)
TypeError: Completions.create() got an unexpected keyword argument 'remote'
Versions / Dependencies
addict-2.4.0 aliyun-python-sdk-core-2.15.1 aliyun-python-sdk-kms-2.16.3 backoff-2.2.1 charset-normalizer-3.3.2 crcmod-1.7 dashscope-1.20.3 dataclasses-json-0.6.7 datasets-2.20.0 deepdiff-7.0.1 deprecated-1.2.14 dirtyjson-1.0.8 einops-0.8.0 emoji-2.12.1 faiss-cpu-1.8.0.post1 filetype-1.2.0 fqdn-1.5.1 grpcio-1.65.4 h11-0.14.0 httpcore-1.0.5 httpx-0.27.0 huggingface-hub-0.24.5 isoduration-20.11.0 jieba-0.42.1 jiter-0.5.0 jmespath-0.10.0 jsonpath-python-1.0.6 langchain-0.2.12 langchain-community-0.2.11 langchain-core-0.2.28 langchain-experimental-0.0.64 langchain-text-splitters-0.2.2 langdetect-1.0.9 langsmith-0.1.98 llama-cloud-0.0.12 llama-index-0.10.62 llama-index-agent-openai-0.2.9 llama-index-cli-0.1.13 llama-index-core-0.10.62 llama-index-embeddings-openai-0.1.11 llama-index-indices-managed-llama-cloud-0.2.7 llama-index-legacy-0.9.48 llama-index-llms-openai-0.1.28 llama-index-multi-modal-llms-openai-0.1.8 llama-index-program-openai-0.1.7 llama-index-question-gen-openai-0.1.3 llama-index-readers-file-0.1.32 llama-index-readers-json-0.1.5 llama-index-readers-llama-parse-0.1.6 llama-index-retrievers-bm25-0.1.5 llama-parse-0.4.9 marshmallow-3.21.3 modelscope-1.17.0 multiprocess-0.70.16 openai-1.40.0 opencv-python-4.10.0.84 ordered-set-4.1.0 orjson-3.10.6 oss2-2.18.6 pdfminer.six-20240706 pyarrow-17.0.0 pyarrow-hotfix-0.6 pycryptodome-3.20.0 pydantic-2.8.2 pydantic-core-2.20.1 pypdf-4.3.1 pytest-mock-3.14.0 python-iso639-2024.4.27 python-magic-0.4.27 rank-bm25-0.2.2 rapidfuzz-3.9.6 requests-2.32.3 safetensors-0.4.4 sentencepiece-0.2.0 simplejson-3.19.2 striprtf-0.0.26 tiktoken-0.7.0 tokenizers-0.19.1 transformers-4.44.0 typing-inspect-0.9.0 unstructured-0.15.1 unstructured-client-0.25.4 uri-template-1.3.0 webcolors-24.6.0 xxhash-3.4.1
Reproduction script
from modelscope_agent.agents import RolePlay
role_template = '你一个人类助手,可以利用工具帮助人类做许多事情'
llm_config = { 'model': 'Qwen/Qwen2-72B-Instruct', 'model_server': 'openai', # base_url, also known as api_base 'api_key': 'xxxxxx', 'api_base': 'https://api.together.xyz/v1' } function_list = ['text-address'] bot = RolePlay(function_list=function_list,llm=llm_config, instruction=role_template) response = bot.run("it is london", remote=False, print_info=True) text = '' for chunk in response: text += chunk print(text)
Issue Severity
None
please remove the remote=False and try again