Comments (6)
Hi @AndreiClouds, it seems you haven't install the camel package. Did you run pip install -e .
?
from camel.
Yes everything is setup acordingly and now I'm getting this
(camel) C:\Users\user\Desktop\camel-master\camel-master\examples\ai_society>python role_playing.py
Traceback (most recent call last):
File "C:\Users\user.conda\envs\camel\lib\site-packages\tenacity_init_.py", line 382, in call
result = fn(*args, **kwargs)
File "C:\Users\user\Desktop\camel-master\camel-master\camel\agents\chat_agent.py", line 130, in step
response = openai.ChatCompletion.create(
File "C:\Users\user.conda\envs\camel\lib\site-packages\openai\api_resources\chat_completion.py", line 25, in create
return super().create(*args, **kwargs)
File "C:\Users\user.conda\envs\camel\lib\site-packages\openai\api_resources\abstract\engine_api_resource.py", line 149, in create
) = cls.__prepare_create_request(
File "C:\Users\user.conda\envs\camel\lib\site-packages\openai\api_resources\abstract\engine_api_resource.py", line 106, in __prepare_create_request
requestor = api_requestor.APIRequestor(
File "C:\Users\user.conda\envs\camel\lib\site-packages\openai\api_requestor.py", line 130, in init
self.api_key = key or util.default_api_key()
File "C:\Users\user.conda\envs\camel\lib\site-packages\openai\util.py", line 186, in default_api_key
raise openai.error.AuthenticationError(
openai.error.AuthenticationError: No API key provided. You can set your API key in code using 'openai.api_key = ', or you can set the environment variable OPENAI_API_KEY=). If your API key is stored in a file, you can point the openai module at it with 'openai.api_key_path = '. You can generate API keys in the OpenAI web interface. See https://onboard.openai.com for details, or email [email protected] if you have any questions.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\user\Desktop\camel-master\camel-master\examples\ai_society\role_playing.py", line 56, in
main()
File "C:\Users\user\Desktop\camel-master\camel-master\examples\ai_society\role_playing.py", line 9, in main
role_play_session = RolePlaying(
File "C:\Users\user\Desktop\camel-master\camel-master\camel\agents\role_playing.py", line 71, in init
self.specified_task_prompt = task_specify_agent.step(
File "C:\Users\user\Desktop\camel-master\camel-master\camel\agents\task_agent.py", line 85, in step
specified_task_msgs, terminated, _ = super().step(task_msg)
File "C:\Users\user.conda\envs\camel\lib\site-packages\tenacity_init_.py", line 289, in wrapped_f
return self(f, *args, **kw)
File "C:\Users\user.conda\envs\camel\lib\site-packages\tenacity_init_.py", line 379, in call
do = self.iter(retry_state=retry_state)
File "C:\Users\user.conda\envs\camel\lib\site-packages\tenacity_init_.py", line 326, in iter
raise retry_exc from fut.exception()
tenacity.RetryError: RetryError[<Future at 0x160e9d3ffd0 state=finished raised AuthenticationError>]
from camel.
As the error message shown, you need to set up the OpenAI api key:
No API key provided. You can set your API key in code using 'openai.api_key = ', or you can set the environment variable OPENAI_API_KEY=). If your API key is stored in a file, you can point the openai module at it with 'openai.api_key_path = '. You can generate API keys in the OpenAI web interface. See https://onboard.openai.com for details, or email [email protected] if you have any questions.
from camel.
so how od i add the api key?
from camel.
There are multiple ways to do that:
- Export as variable using your terminal (on Linux that would be)
export OPENAI_API_KEY=<insert your OpenAI API key>
- Add to the Python code,
openai.api_key = os.environ["OPENAI_API_KEY"]
There are multiple other ways, check this for reference.
from camel.
I closed this issue. Please feel free to reopen if it is not fixed.
from camel.
Related Issues (20)
- [BUG] test `tests_search_wiki_with_ambiguity` fails from time to time HOT 1
- [Feature Request] Optimize github actions
- [BUG] HuggingFace Tool Connection Problem HOT 3
- [Feature Request] Structure Output of LLM HOT 4
- [Feature Request] Support `CodeLlama` and `Llama-2-chat`
- Data I/O HOT 3
- [Feature Request] Fix documents
- [Feature Request] Optimize Issue and PR templates HOT 1
- [Feature Request] Improve function calling implementation
- [Feature Request] Add support to Anthropic LLM HOT 6
- Prepare release 0.2 HOT 2
- Improve code coverage of OpenSourceModel HOT 3
- More coverage for python interpreter HOT 2
- improved with structured output
- π€Agile Documentation & Updates HOT 6
- [Feature Request] Test Agile
- [Feature Request] Text to Audio generation with `ElevenLabs` HOT 1
- [BUG] chat_agent update message HOT 4
- [Feature Request] Web UI for muti-agent HOT 2
- [Feature Request] `schemas` subpackage to support different structured output schemas HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from camel.