AnswerDotAI / claudette

Claudette is Claude's friend
https://claudette.answer.ai/
Apache License 2.0
175 stars 27 forks source link

Running 'import claudette' cause issues #4

Closed hedonistrh closed 3 months ago

hedonistrh commented 3 months ago

Hey, thanks for great library. I tried to use it but getting some errors when I tried to run as following.

In [1]: import claudette
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In[1], line 1
----> 1 import claudette

File ~/Desktop/claros_superlig/claros_superlig_env/lib/python3.11/site-packages/claudette/__init__.py:2
      1 __version__ = "0.0.1"
----> 2 from .core import *

File ~/Desktop/claros_superlig/claros_superlig_env/lib/python3.11/site-packages/claudette/core.py:15
     13 from anthropic import Anthropic
     14 from anthropic.types import Usage, TextBlock, Message
---> 15 from anthropic.types.beta.tools import ToolsBetaMessage, tool_use_block
     17 from fastcore.docments import docments
     18 from fastcore.utils import *

ModuleNotFoundError: No module named 'anthropic.types.beta'

I am using following libraries with their versions attached.

anthropic                 0.29.0
claudette                 0.0.1

Version of my python is

Python 3.11.8 (main, Feb  6 2024, 21:21:21) [Clang 15.0.0 (clang-1500.1.0.2.5)]
g1y5x3 commented 3 months ago

I think this error is gone once I install from source which is claudette 0.0.2

petergchang commented 3 months ago

It seems a2b94d8 resolves this but the update hasn't yet been pushed to PyPI. In the meantime, you can do pip install git+https://github.com/AnswerDotAI/claudette.git

voxmenthe commented 3 months ago

I had the exact same issue but @petergchang 's recommended fix resolves that, but now we get the "No module named 'toolslm'" error:

ModuleNotFoundError Traceback (most recent call last) from claudette import *

----> 2 from .core import 3 from .toolloop import

File ~/.pyenv/versions/3.12.2/lib/python3.12/site-packages/claudette/core.py:17 14 from anthropic.types import Usage, TextBlock, Message, ToolUseBlock 15 from anthropic.resources import messages ---> 17 import toolslm 18 from toolslm.funccall import * 20 from fastcore import imghdr

ModuleNotFoundError: No module named 'toolslm'

This is easily resolved by pip install -U toolslm

jph00 commented 3 months ago

both fixed in main - thanks!