realpython / realpython/materials

langchain-rag-app/ Client.__init__() got an unexpected keyword argument 'proxies'

Aperta
#624 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
Jupyter Notebook
Stelle
5.2k
Fork
5.3k
Merge medio
4g 10h
PR unite (30g)
10

Descrizione

ℹ️ Please note that the best way to get support for Real Python courses & articles is to join one of our weekly Office Hours calls or in the RP Community Slack.

You can report issues and problems here, but we typically won't be able to provide 1:1 support outside the channels listed above.

Describe the bug
A clear and concise description of what the bug is.
In langchain-rag-app directory, according to README.md, I excecute 'docker-compose up --build'. There is an error related to chatbot_api.

source_code_final-chatbot_api-1 | from chains.hospital_cypher_chain import hospital_cypher_chain
source_code_final-chatbot_api-1 | File "/app/chains/hospital_cypher_chain.py", line 149, in
source_code_final-chatbot_api-1 | cypher_llm=ChatOpenAI(model=HOSPITAL_CYPHER_MODEL, temperature=0),
source_code_final-chatbot_api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
source_code_final-chatbot_api-1 | File "/usr/local/lib/python3.11/site-packages/langchain_core/load/serializable.py", line 107, in init
source_code_final-chatbot_api-1 | super().init(**kwargs)
source_code_final-chatbot_api-1 | File "/usr/local/lib/python3.11/site-packages/pydantic/v1/main.py", line 341, in init
source_code_final-chatbot_api-1 | raise validation_error
source_code_final-chatbot_api-1 | pydantic.v1.error_wrappers.ValidationError: 1 validation error for ChatOpenAI
source_code_final-chatbot_api-1 | root
source_code_final-chatbot_api-1 | Client.init() got an unexpected keyword argument 'proxies' (type=type_error)
source_code_final-chatbot_api-1 | Failed to write data to connection ResolvedIPv4Address(('34.126.114.186', 7687)) (ResolvedIPv4Address(('34.126.114.186', 7687)))
source_code_final-chatbot_api-1 | Failed to write data to connection IPv4Address(('7cf48f19.databases.neo4j.io', 7687)) (ResolvedIPv4Address(('34.126.114.186', 7687)))

To Reproduce
Steps to reproduce the behavior:

  1. Go to langchain-rag-app/source_code_final directory.
  2. In console terminal, docker-compose up --build
  3. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Ubuntu22.04

Additional context
Add any other context about the problem here.

I searched similar problems and fixed problem manually. https://community.openai.com/t/error-with-openai-1-56-0-client-init-got-an-unexpected-keyword-argument-proxies/1040332/24
The problem is version of openai and httpx.

  • I update openai version in chatbot_api/pyproject.toml.

  • "openai==1.7.2" --> "openai==1.55.3"

  • I update httpx in requirements.txt

  • httpx==0.26.0 --> httpx==0.27.2

Then, it works fine!!

I think it would be good to update this later.
Thank you.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia in langchain-rag-app/source_code_final e ispeziona chatbot_api/pyproject.toml e requirements.txt per verificare le versioni delle dipendenze OpenAI e httpx. Ricostruisci con docker-compose up --build e conferma che chatbot_api si avvii senza l’errore Client.init() segnalato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
docker-compose, python
Ambito
backend, devops
Tipo di issue
Bug
Difficoltà
2/5
Tempo stimato
1-3 ore
Stato di attività
Ferma
Chiarezza
Specificata chiaramente
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.