Code Monkey home page Code Monkey logo

terminalgpt's People

Contributors

adamyodinsky avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

terminalgpt's Issues

Can't enter API key

Can't enter API key after terminalgpt install.

To Reproduce
Steps to reproduce the behavior:

  1. pip install terminalgpt -U
  2. terminalgpt install
  3. Get output
OpenAI API key is missing!
Please install the chatbot api key first with 'terminalgpt install' command.

Expected behavior
Asks for API key.

Unhandled exception on API errors

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
 

Follow XDG specification on Linux

To unclutter the home directory and help with backups, TerminalGPT should follow the XDG Specification on Linux machines.

BASE_PATH = f"~/.{APP_NAME}".replace("~", path.expanduser("~"))
CONVERSATIONS_PATH = f"{BASE_PATH}/conversations"

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.

No matching distribution found for terminalgpt

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.