Skip to content

Commit b087d73

Browse files
authored
Minor bug fixes, documentation, release 1.4.4 (#607)
1 parent f0d000a commit b087d73

File tree

5 files changed

+10
-18
lines changed

5 files changed

+10
-18
lines changed

README.md

+6-13
Original file line numberDiff line numberDiff line change
@@ -453,21 +453,16 @@ Possible options for `CODE_THEME`: https://pygments.org/styles/
453453
```
454454

455455
## Docker
456-
Run the container using the `OPENAI_API_KEY` environment variable, and a docker volume to store cache:
456+
Run the container using the `OPENAI_API_KEY` environment variable, and a docker volume to store cache. Consider to set the environment variables `OS_NAME` and `SHELL_NAME` according to your preferences.
457457
```shell
458458
docker run --rm \
459-
--env OPENAI_API_KEY="your OPENAI API key" \
459+
--env OPENAI_API_KEY=api_key \
460+
--env OS_NAME=$(uname -s) \
461+
--env SHELL_NAME=$(echo $SHELL) \
460462
--volume gpt-cache:/tmp/shell_gpt \
461-
ghcr.io/ther1d/shell_gpt --chat rainbow "what are the colors of a rainbow"
463+
ghcr.io/ther1d/shell_gpt -s "update my system"
462464
```
463465

464-
When using a container, please note:
465-
* The \[E\]xecute option for --shell with interaction will not work, since it would try this Execute in the docker container.
466-
=> setting the `SHELL_INTERACTION` environment variable to false , makes sense.
467-
* Since, most likely the os and shell of your container are not identical to the environment you want help with:
468-
set the environment variables `OS_NAME` and `SHELL_NAME` according to your setup.
469-
470-
471466
Example of a conversation, using an alias and the `OPENAI_API_KEY` environment variable:
472467
```shell
473468
alias sgpt="docker run --rm --volume gpt-cache:/tmp/shell_gpt --env OPENAI_API_KEY --env OS_NAME=$(uname -s) --env SHELL_NAME=$(echo $SHELL) ghcr.io/ther1d/shell_gpt"
@@ -476,8 +471,6 @@ sgpt --chat rainbow "what are the colors of a rainbow"
476471
sgpt --chat rainbow "inverse the list of your last answer"
477472
sgpt --chat rainbow "translate your last answer in french"
478473
```
479-
Note:
480-
Consider filling in a more specific OS_NAME instead of using $(uname -s)
481474

482475
You also can use the provided `Dockerfile` to build your own image:
483476
```shell
@@ -498,7 +491,7 @@ ENV USE_LITELLM=true
498491
ENV OPENAI_API_KEY=bad_key
499492
ENV SHELL_INTERACTION=false
500493
ENV PRETTIFY_MARKDOWN=false
501-
ENV OS_NAME="Red Hat Enterprise Linux 8.6 (Ootpa)"
494+
ENV OS_NAME="Arch Linux"
502495
ENV SHELL_NAME=auto
503496
504497
WORKDIR /app

sgpt/__version__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.4.3"
1+
__version__ = "1.4.4"

sgpt/config.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@
3434
"API_BASE_URL": os.getenv("API_BASE_URL", "default"),
3535
"PRETTIFY_MARKDOWN": os.getenv("PRETTIFY_MARKDOWN", "true"),
3636
"USE_LITELLM": os.getenv("USE_LITELLM", "false"),
37-
"SHELL_INTERACTION ": os.getenv("SHELL_INTERACTION ", "true"),
37+
"SHELL_INTERACTION": os.getenv("SHELL_INTERACTION ", "true"),
3838
"OS_NAME": os.getenv("OS_NAME", "auto"),
39-
"SHELL_NAME ": os.getenv("SHELL_NAME", "auto"),
39+
"SHELL_NAME": os.getenv("SHELL_NAME", "auto"),
4040
# New features might add their own config variables here.
4141
}
4242

sgpt/function.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import sys
33
from abc import ABCMeta
44
from pathlib import Path
5-
from typing import Any, Callable, Dict, List, Union
5+
from typing import Any, Callable, Dict, List
66

77
from .config import cfg
88

sgpt/handlers/handler.py

-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ def get_completion(
9090
messages: List[Dict[str, Any]],
9191
functions: Optional[List[Dict[str, str]]],
9292
) -> Generator[str, None, None]:
93-
9493
name = arguments = ""
9594
is_shell_role = self.role.name == DefaultRoles.SHELL.value
9695
is_code_role = self.role.name == DefaultRoles.CODE.value

0 commit comments

Comments
 (0)