Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

re-pin versions o that a proxy issue no longer occurs #28

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

claythearc
Copy link

Somewhere up the chain a proxy error was introduced in either openAI or anthropic SDK (or both?) this fixes that

clay@clay:~/vulnhuntr$ poetry run vulnhuntr -r /home/clay/django-geostore/ -l claude
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/clay/vulnhuntr/vulnhuntr/__main__.py", line 348, in run
    llm = initialize_llm(args.llm)
  File "/home/clay/vulnhuntr/vulnhuntr/__main__.py", line 289, in initialize_llm
    llm = Claude(anth_model, anth_base_url, system_prompt)
  File "/home/clay/vulnhuntr/vulnhuntr/LLMs.py", line 81, in __init__
    self.client = anthropic.Anthropic(max_retries=3, base_url=base_url)
  File "/home/clay/.cache/pypoetry/virtualenvs/vulnhuntr-MspkhdD9-py3.10/lib/python3.10/site-packages/anthropic/_client.py", line 121, in __init__
    super().__init__(
  File "/home/clay/.cache/pypoetry/virtualenvs/vulnhuntr-MspkhdD9-py3.10/lib/python3.10/site-packages/anthropic/_base_client.py", line 835, in __init__
    self._client = http_client or SyncHttpxClientWrapper(
  File "/home/clay/.cache/pypoetry/virtualenvs/vulnhuntr-MspkhdD9-py3.10/lib/python3.10/site-packages/anthropic/_base_client.py", line 733, in __init__
    super().__init__(**kwargs)
TypeError: Client.__init__() got an unexpected keyword argument 'proxies'

@lociko
Copy link

lociko commented Dec 30, 2024

Please approve this PR, I have the same issue)

@DaveLak
Copy link

DaveLak commented Dec 31, 2024

After I ran into this same 'proxy' issue this addresses I attempted to test the changes proposed in this PR to see if I could get things working with the docker image, but there was a new error: ModuleNotFoundError: No module named 'requests'

Steps I Attempted

I built the image from the PR author's branch and tagged it with the branch name:

docker build -t vulnhuntr:poetry_fix https://github.com/claythearc/vulnhuntr.git#poetry_fix

Then ran the docker command as outlined in README:

docker run --rm -e ANTHROPIC_API_KEY=$ANTHROPIC_API_KEY -e ANTHROPIC_BASE_URL=$ANTHROPIC_BASE_URL -v $(pwd)/path/to/local/repo:/repo -r /repo -a /repo/path/to/file.py

Which resulted in this failure case:

Traceback (most recent call last):
  File "/usr/local/bin/vulnhuntr", line 5, in <module>
    from vulnhuntr.__main__ import run
  File "/usr/local/lib/python3.10/site-packages/vulnhuntr/__main__.py", line 6, in <module>
    from vulnhuntr.LLMs import Claude, ChatGPT, Ollama
  File "/usr/local/lib/python3.10/site-packages/vulnhuntr/LLMs.py", line 8, in <module>
    import requests
ModuleNotFoundError: No module named 'requests'

Could the issue be that requests was not listed in the pyproject.toml by mistake, but happened to be a transitive dependency that for some reason isn't installed again after deleting the lock file in this PR?

It is listed in requirements.tx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants