Comments (4)
Seems to be a bug with getting environment variables from the calling bash shell in poetry.
A quick work around that works is to just pass the api key in chromegpt/agent/zeroshot.py
:
43 class ZeroShotAgent(ChromeGPTAgent):
44 def __init__(self, model: str = "gpt-3.5-turbo", verbose: bool = False) -> None:
45 """Initialize the ZeroShotAgent."""
46 self.model = model
47 self.agent = get_zeroshot_agent(
48 llm=ChatOpenAI(model_name=model, temperature=0, openai_api_key='{YOUR_API_KEY_HERE}'), # type: ignore
49 verbose=verbose,
50 )
Replace YOUR_API_KEY_HERE with your key.
from chrome-gpt.
Seems to be a bug with getting environment variables from the calling bash shell in poetry.
A quick work around that works is to just pass the api key in
chromegpt/agent/zeroshot.py
:43 class ZeroShotAgent(ChromeGPTAgent): 44 def __init__(self, model: str = "gpt-3.5-turbo", verbose: bool = False) -> None: 45 """Initialize the ZeroShotAgent.""" 46 self.model = model 47 self.agent = get_zeroshot_agent( 48 llm=ChatOpenAI(model_name=model, temperature=0, openai_api_key='{YOUR_API_KEY_HERE}'), # type: ignore 49 verbose=verbose, 50 )
Replace YOUR_API_KEY_HERE with your key.
Ahh okay, I'll try that tomorrow and give it another whirl
from chrome-gpt.
Side note
There's different functions that use the api key for each agent so make sure you read the error logs for the right line to change
For example:
{...}
File "/Users/nr/chromegpt/Chrome-GPT/chromegpt/agent/autogpt/autogpt.py", line 25, in __init__
llm=ChatOpenAI(model_name=model, temperature=0), # type: ignore
{...}
Would mean you should change that line to:
llm=ChatOpenAI(model_name=model, temperature=0, openai_api_key='{YOUR_API_KEY_HERE}'), # type: ignore
Just in case anyone else has this problem :)
from chrome-gpt.
This appears to be fixed in the latest version but ty for the quick response!
from chrome-gpt.
Related Issues (20)
- Windows errors HOT 1
- Selenium error on Chrome version HOT 1
- Did not find openai_api_key, please add an environment variable `OPENAI_API_KEY` which contains it, or pass `openai_api_key` as a named parameter. (type=value_error) HOT 8
- NameError: name 'v_args' is not defined. Did you mean: 'vars'?
- How extract data HOT 1
- Please update a detailed demo example. HOT 3
- Is it possible to load extensions? HOT 1
- 'SeleniumWrapper' object has no attribute 'driver' HOT 2
- I would like to perform special webdriver actions on shutdown
- FileNotFoundError: [Errno 2] No such file or directory: 'chromedriver' HOT 3
- Note. If you must access openai by VPN, you may encounter the following issues.
- -
- Where to enter API key? HOT 2
- Error: Got unexpected extra argument () HOT 2
- ModuleNotFoundError: No module named 'langchain.experimental' HOT 1
- raise MaxRetryError HOT 2
- metaclass conflict HOT 1
- Regression?: Unable to run inside or outside of Docker
- Can it use the debugger tools? Can it read and parse the source? Can it help me write e2e Cypress tests?
- Won't show Chrome GUI
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 chrome-gpt.