mirror of
https://github.com/TheR1D/shell_gpt.git
synced 2026-07-03 14:10:18 +02:00
Minor bug fixes, documentation, release 1.4.4 (#607)
This commit is contained in:
@@ -453,21 +453,16 @@ Possible options for `CODE_THEME`: https://pygments.org/styles/
|
||||
```
|
||||
|
||||
## Docker
|
||||
Run the container using the `OPENAI_API_KEY` environment variable, and a docker volume to store cache:
|
||||
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.
|
||||
```shell
|
||||
docker run --rm \
|
||||
--env OPENAI_API_KEY="your OPENAI API key" \
|
||||
--env OPENAI_API_KEY=api_key \
|
||||
--env OS_NAME=$(uname -s) \
|
||||
--env SHELL_NAME=$(echo $SHELL) \
|
||||
--volume gpt-cache:/tmp/shell_gpt \
|
||||
ghcr.io/ther1d/shell_gpt --chat rainbow "what are the colors of a rainbow"
|
||||
ghcr.io/ther1d/shell_gpt -s "update my system"
|
||||
```
|
||||
|
||||
When using a container, please note:
|
||||
* The \[E\]xecute option for --shell with interaction will not work, since it would try this Execute in the docker container.
|
||||
=> setting the `SHELL_INTERACTION` environment variable to false , makes sense.
|
||||
* Since, most likely the os and shell of your container are not identical to the environment you want help with:
|
||||
set the environment variables `OS_NAME` and `SHELL_NAME` according to your setup.
|
||||
|
||||
|
||||
Example of a conversation, using an alias and the `OPENAI_API_KEY` environment variable:
|
||||
```shell
|
||||
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"
|
||||
sgpt --chat rainbow "inverse the list of your last answer"
|
||||
sgpt --chat rainbow "translate your last answer in french"
|
||||
```
|
||||
Note:
|
||||
Consider filling in a more specific OS_NAME instead of using $(uname -s)
|
||||
|
||||
You also can use the provided `Dockerfile` to build your own image:
|
||||
```shell
|
||||
@@ -498,7 +491,7 @@ ENV USE_LITELLM=true
|
||||
ENV OPENAI_API_KEY=bad_key
|
||||
ENV SHELL_INTERACTION=false
|
||||
ENV PRETTIFY_MARKDOWN=false
|
||||
ENV OS_NAME="Red Hat Enterprise Linux 8.6 (Ootpa)"
|
||||
ENV OS_NAME="Arch Linux"
|
||||
ENV SHELL_NAME=auto
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
__version__ = "1.4.3"
|
||||
__version__ = "1.4.4"
|
||||
|
||||
+2
-2
@@ -34,9 +34,9 @@ DEFAULT_CONFIG = {
|
||||
"API_BASE_URL": os.getenv("API_BASE_URL", "default"),
|
||||
"PRETTIFY_MARKDOWN": os.getenv("PRETTIFY_MARKDOWN", "true"),
|
||||
"USE_LITELLM": os.getenv("USE_LITELLM", "false"),
|
||||
"SHELL_INTERACTION ": os.getenv("SHELL_INTERACTION ", "true"),
|
||||
"SHELL_INTERACTION": os.getenv("SHELL_INTERACTION ", "true"),
|
||||
"OS_NAME": os.getenv("OS_NAME", "auto"),
|
||||
"SHELL_NAME ": os.getenv("SHELL_NAME", "auto"),
|
||||
"SHELL_NAME": os.getenv("SHELL_NAME", "auto"),
|
||||
# New features might add their own config variables here.
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ import importlib.util
|
||||
import sys
|
||||
from abc import ABCMeta
|
||||
from pathlib import Path
|
||||
from typing import Any, Callable, Dict, List, Union
|
||||
from typing import Any, Callable, Dict, List
|
||||
|
||||
from .config import cfg
|
||||
|
||||
|
||||
@@ -90,7 +90,6 @@ class Handler:
|
||||
messages: List[Dict[str, Any]],
|
||||
functions: Optional[List[Dict[str, str]]],
|
||||
) -> Generator[str, None, None]:
|
||||
|
||||
name = arguments = ""
|
||||
is_shell_role = self.role.name == DefaultRoles.SHELL.value
|
||||
is_code_role = self.role.name == DefaultRoles.CODE.value
|
||||
|
||||
Reference in New Issue
Block a user