-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improved Jordao's napari reader pluginin file open tool,
and OpenAI and Anthropic model list code. Also made web search tests more robust to rate limits.
- Loading branch information
Showing
10 changed files
with
239 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import traceback | ||
|
||
from arbol import asection, aprint | ||
|
||
from napari_chatgpt.utils.api_keys.api_key import set_api_key | ||
|
||
|
||
|
||
|
||
def get_anthropic_model_list() -> list: | ||
""" | ||
Get the list of all Anthropic models. | ||
Parameters | ||
---------- | ||
filter : str | ||
Filter to apply to the list of models. | ||
Returns | ||
------- | ||
list | ||
List of models. | ||
""" | ||
|
||
with asection(f"Enumerating all Anthropic models:"): | ||
model_list = [] | ||
|
||
model_list.append('claude-3-opus-20240229') | ||
model_list.append('claude-3-sonnet-20240229') | ||
model_list.append('claude-3-haiku-20240307') | ||
model_list.append('claude-3-5-sonnet-20240620') | ||
|
||
return model_list | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,20 @@ | ||
from arbol import aprint | ||
from duckduckgo_search.exceptions import RatelimitException | ||
|
||
from napari_chatgpt.utils.web.google import search_overview | ||
|
||
|
||
def test_google_search_overview(): | ||
term = 'wiki Mickey Mouse' | ||
text = search_overview(term) | ||
|
||
aprint(text) | ||
try: | ||
term = 'wiki Mickey Mouse' | ||
text = search_overview(term) | ||
|
||
aprint(text) | ||
|
||
except RatelimitException as e: | ||
aprint(f"RatelimitException: {e}") | ||
aprint(f"RatelimitException: {e.response}") | ||
aprint(f"RatelimitException: {e.response.text}") | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.