adamyodinsky / terminalgpt Goto Github PK
View Code? Open in Web Editor NEWTerminalGPT - Terminal-based ChatGPT personal assistant app. Provides optimized, tailored answers for your machine's terminal.
License: MIT License
TerminalGPT - Terminal-based ChatGPT personal assistant app. Provides optimized, tailored answers for your machine's terminal.
License: MIT License
Can't enter API key after terminalgpt install
.
To Reproduce
Steps to reproduce the behavior:
pip install terminalgpt -U
terminalgpt install
OpenAI API key is missing!
Please install the chatbot api key first with 'terminalgpt install' command.
Expected behavior
Asks for API key.
Describe the bug
If openapi API is down - returns non 20x response the exception is thrown:
User: some prompt request
Traceback (most recent call last):
File "/Users/user/Library/Python/3.9/lib/python/site-packages/openai/api_requestor.py", line 672, in _interpret_response_line
data = json.loads(rbody)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/bin/terminalgpt", line 8, in <module>
sys.exit(cli())
File "/Users/user/Library/Python/3.9/lib/python/site-packages/click/core.py", line 1130, in __call__
return self.main(*args, **kwargs)
File "/Users/user/Library/Python/3.9/lib/python/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/Users/user/Library/Python/3.9/lib/python/site-packages/click/core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Users/user/Library/Python/3.9/lib/python/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/user/Library/Python/3.9/lib/python/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/Users/user/Library/Python/3.9/lib/python/site-packages/click/decorators.py", line 26, in new_func
return f(get_current_context(), *args, **kwargs)
File "/Users/user/Library/Python/3.9/lib/python/site-packages/terminalgpt/main.py", line 82, in new
chat_utils.chat_loop(
File "/Users/user/Library/Python/3.9/lib/python/site-packages/terminalgpt/chat_utils.py", line 49, in chat_loop
answer = get_user_answer(messages)
File "/Users/user/Library/Python/3.9/lib/python/site-packages/terminalgpt/chat_utils.py", line 101, in get_user_answer
answer = openai.ChatCompletion.create(
File "/Users/user/Library/Python/3.9/lib/python/site-packages/openai/api_resources/chat_completion.py", line 25, in create
return super().create(*args, **kwargs)
File "/Users/user/Library/Python/3.9/lib/python/site-packages/openai/api_resources/abstract/engine_api_resource.py", line 153, in create
response, _, api_key = requestor.request(
File "/Users/user/Library/Python/3.9/lib/python/site-packages/openai/api_requestor.py", line 226, in request
resp, got_stream = self._interpret_response(result, stream)
File "/Users/user/Library/Python/3.9/lib/python/site-packages/openai/api_requestor.py", line 619, in _interpret_response
self._interpret_response_line(
File "/Users/user/Library/Python/3.9/lib/python/site-packages/openai/api_requestor.py", line 674, in _interpret_response_line
raise error.APIError(
openai.error.APIError: HTTP code 502 from API (<html>
<head><title>502 Bad Gateway</title></head>
<body>
<center><h1>502 Bad Gateway</h1></center>
<hr><center>cloudflare</center>
</body>
</html>
)```
The bot quits.
**Expected behavior**
one of the following or their combination:
* an error message that a "backend is dead - try again"
* re-try mechanism
+ not quiting prompt
Please put guide how to setup. On. Windows machine?
https://i.ibb.co/vwjSGPc/WM-Screenshots-20240111054950.png
The response is broken,i think the color code is broken or something
To unclutter the home directory and help with backups, TerminalGPT should follow the XDG Specification on Linux machines.
TerminalGPT/terminalgpt/config.py
Lines 30 to 31 in 3c0eb5a
Configuration files should probably be in ${XDG_CONFIG_HOME}/terminalgpt/
when XDG_CONFIG_HOME
is set.
Conversations should probably be in ${XDG_STATE_HOME}/terminalgpt/conversations/
when XDG_STATE_HOME
is set:
The
$XDG_STATE_HOME
contains state data that should persist between (application) restarts, but that is not important or portable enough to the user that it should be stored in$XDG_DATA_HOME
. It may contain:actions history (logs, history, recently used files, …)
current state of the application that can be reused on a restart (view, layout, open files, undo history, …)
I believe it is an easy change. If there is already a ~/.terminalgpt/
, Terminal GPT can fallback to that in order to preserve existing user data.
i try setub on ubuntu . when i run pip install terminalgpt -U --user i got this error :
Could not find a version that satisfies the requirement terminalgpt (from versions: none)
ERROR: No matching distribution found for terminalgpt
please help
please help how to setup and run in windows machine
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.