Troubles on using an third-party API #1004
eccstartup
started this conversation in
General
Replies: 3 comments 1 reply
-
The issue will be resolved after the refactoring of the modeltype. |
Beta Was this translation helpful? Give feedback.
1 reply
-
A few more troubles:
/Users/eccstartup/miniforge3/envs/camelai/bin/python /Users/eccstartup/code/llm4dummies/camel_examples/workforce_example.py
Traceback (most recent call last):
File "/Users/eccstartup/code/llm4dummies/camel_examples/workforce_example.py", line 87, in <module>
task = workforce.process_task(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/eccstartup/miniforge3/envs/camelai/lib/python3.11/site-packages/camel/workforce/utils.py", line 63, in wrapper
return func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/eccstartup/miniforge3/envs/camelai/lib/python3.11/site-packages/camel/workforce/workforce.py", line 149, in process_task
subtasks = self._decompose_task(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/eccstartup/miniforge3/envs/camelai/lib/python3.11/site-packages/camel/workforce/workforce.py", line 124, in _decompose_task
subtasks = task.decompose(self.task_agent, decompose_prompt)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/eccstartup/miniforge3/envs/camelai/lib/python3.11/site-packages/camel/tasks/task.py", line 226, in decompose
response = agent.step(msg)
^^^^^^^^^^^^^^^
File "/Users/eccstartup/miniforge3/envs/camelai/lib/python3.11/site-packages/camel/agents/chat_agent.py", line 388, in step
) = self._step_model_response(openai_messages, num_tokens)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/eccstartup/miniforge3/envs/camelai/lib/python3.11/site-packages/camel/agents/chat_agent.py", line 676, in _step_model_response
response = self.model_backend.run(openai_messages)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/eccstartup/miniforge3/envs/camelai/lib/python3.11/site-packages/camel/models/openai_compatibility_model.py", line 77, in run
response = self._client.chat.completions.create(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/eccstartup/miniforge3/envs/camelai/lib/python3.11/site-packages/openai/_utils/_utils.py", line 274, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/Users/eccstartup/miniforge3/envs/camelai/lib/python3.11/site-packages/openai/resources/chat/completions.py", line 704, in create
return self._post(
^^^^^^^^^^^
File "/Users/eccstartup/miniforge3/envs/camelai/lib/python3.11/site-packages/openai/_base_client.py", line 1270, in post
return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/eccstartup/miniforge3/envs/camelai/lib/python3.11/site-packages/openai/_base_client.py", line 947, in request
return self._request(
^^^^^^^^^^^^^^
File "/Users/eccstartup/miniforge3/envs/camelai/lib/python3.11/site-packages/openai/_base_client.py", line 1051, in _request
raise self._make_status_error_from_response(err.response) from None
openai.BadRequestError: Error code: 400 - {'code': 20015, 'message': 'The parameter is invalid. Please check again.', 'data': None}
Process finished with exit code 1 |
Beta Was this translation helpful? Give feedback.
0 replies
-
It is difficult to guess how to use tools configuration. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I was trying to use third-party API for workforce and get stuck many times.
Firstly, I don't know that I have to write
model_platform=ModelPlatformType.OPENAI_COMPATIBILITY_MODEL
. I thought it wasmodel_platform=ModelPlatformType.OPENAI
.Secondly, in a workforce, I have to set
task_agent_kwargs
andcoordinator_agent_kwargs
because these parameters are OpenAI models by default.Thirdly, a newly fixed bug stops me again which has not be pushed to pypi.
Beta Was this translation helpful? Give feedback.
All reactions