[Python] ValidationError: Client.__init__() got an unexpected keyword argument 'proxies' with...

Discussão em 'Python' iniciado por Stack, Abril 21, 2025.

  1. Stack

    Stack Membro Participativo

    I’m building a Streamlit app using LangChain and langchain-groq to query a Groq model (llama3-70b-8192). The app deploys on Streamlit Cloud but crashes with a ValidationError when initializing ChatGroq:

    ValidationError: 1 validation error for ChatGroq
    __root__
    Client.__init__() got an unexpected keyword argument 'proxies'
    (type=type_error)


    Code Snippet In app.py:

    llm = ChatGroq(
    model="llama3-70b-8192",
    temperature=0,
    groq_api_key=os.getenv("GROQ_API_KEY")
    )


    What I’ve Tried Fixed a dependency conflict by removing version pins for LangChain packages in requirements.txt, so langchain-groq is now 0.3.2. The error suggests groq==0.9.0 passes an unsupported 'proxies' argument, so I downgraded to groq==0.8.0, but the error persists.

    Current requirements.txt

    langchain
    langchain-community
    langchain-huggingface
    langchain-chroma
    langsmith==0.1.99
    alpha-vantage==2.3.1
    sentence-transformers==3.0.1
    numpy==1.26.4
    requests==2.32.3
    python-dotenv==1.0.1
    chromadb==0.4.22
    groq==0.8.0
    huggingface_hub==0.24.5
    streamlit==1.37.0
    fastapi==0.111.0
    uvicorn==0.30.1
    onnx==1.16.1
    pysqlite3-binary
    langchain-groq


    Questions Why does ChatGroq still pass the 'proxies' argument with groq==0.8.0? Are there compatible versions of langchain-groq and groq for Streamlit Cloud? My project is on GitHub: https://github.com/gargumang411/stock-assistant.

    Any help would be great!

    Continue reading...

Compartilhe esta Página