Skip to content

Commit

Permalink
Upgrade version to 1.4.90 and adjust AI models in chatGPT
Browse files Browse the repository at this point in the history
  • Loading branch information
zackees committed Jul 22, 2024
1 parent 45fb852 commit e561465
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ Running tox will install hooks into the .tox directory. Keep this in my if you a
TODO: Add a cleanup function to undo this.

# Release Notes
* 1.4.90: `askai` is upgraded to the latest models. ChatGPT3.5 has been replaced with GPT4o-mini. --advanced is now gpt-4o
* 1.4.89: Fixes `vidinfo --full` not being able to parse json with trailing commas.
* 1.4.88: `aicode` now has minimal version 1.1.0
* 1.4.87: `aicode` has been externalized into package `advanced-aicode`, but can still be invoked using `aicode`.
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ static-ffmpeg>=2.5
zcmds_win32>=1.2.12; platform_system=='Windows'
static-sox
json5
tiktoken>=0.6.0
tiktoken>=0.7.0
# Needed by tiktoken
regex>=2023.12.25
pipx
Expand Down
6 changes: 1 addition & 5 deletions src/zcmds/util/chatgpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@
sys.exit(1)


MAX_TOKENS = 4096
HIDDEN_PROMPT_TOKEN_COUNT = (
100 # this hack corrects for the unnaccounted for tokens in the prompt
)
ADVANCED_MODEL = "gpt-4-turbo"
ADVANCED_MODEL = "gpt-4o"
FAST_MODEL = "gpt-4o-mini"
AI_ASSISTANT_AS_PROGRAMMER = (
"You are a helpful assistant to a senior programmer. "
Expand Down Expand Up @@ -66,9 +65,6 @@ def get_client_instance(openai_key: str) -> OpenAI:


def count_tokens(model: str, text: str):
# Ensure you have the right model, for example, "gpt-3.5-turbo"
if "gpt-4" in model:
model = "gpt-3.5-turbo" # Hack to make this works
enc = tiktoken.encoding_for_model(model)
return len(enc.encode(text))

Expand Down
2 changes: 1 addition & 1 deletion src/zcmds/version.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Just holds the version for the app"""

# Also change version in pyproject.toml
VERSION = "1.4.89" # pylint: disable=R0801
VERSION = "1.4.90" # pylint: disable=R0801
__version__ = VERSION

0 comments on commit e561465

Please sign in to comment.