Skip to content

Commit

Permalink
Fixed problem with new 4o model and ddg search. Candidate for v2024.5.13
Browse files Browse the repository at this point in the history
  • Loading branch information
royerloic committed May 13, 2024
1 parent 5a33c96 commit 41aaf2f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
8 changes: 4 additions & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = napari-chatgpt
version = v2024.5.9
version = v2024.5.13
description = A napari plugin to process and analyse images with chatGPT.
long_description = file: README.md
long_description_content_type = text/markdown
Expand Down Expand Up @@ -37,9 +37,9 @@ install_requires =
qtpy
QtAwesome
langchain==0.1.11
langchain-openai==0.0.8
langchain-openai==0.1.6
langchain-anthropic==0.1.4
openai==1.13.3
openai==1.29.0
anthropic
fastapi
uvicorn
Expand All @@ -53,7 +53,7 @@ install_requires =
xarray
arbol
playwright
duckduckgo_search>=5.3.1b1
duckduckgo_search>=5.3.0b4
ome-zarr
transformers
cryptography
Expand Down
4 changes: 4 additions & 0 deletions src/napari_chatgpt/utils/openai/default_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ def model_key(model):
parts = model.split('-')
# Get the main version (e.g., '3.5' or '4' from 'gpt-3.5' or 'gpt-4')
main_version = parts[1]

if 'o' in main_version:
main_version = main_version.replace('o', '.25')

# Use the length of the model name as a secondary sorting criterion
length = len(model)
# Sort by main version (descending), then by length (ascending)
Expand Down
5 changes: 4 additions & 1 deletion src/napari_chatgpt/utils/python/test/add_comments_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,8 @@ def test_add_comments():
assert len(commented_code) >= len(___generated_python_code)

# Count the number of comments:
assert commented_code.count('#') >= 4
assert commented_code.count('#') >= 2

# Count the number of docstrings:
assert commented_code.count('"""') >= 4

0 comments on commit 41aaf2f

Please sign in to comment.