stanfordnlp / dspy

DSPy: The framework for programming—not prompting—foundation models
https://dspy.ai
MIT License
18.67k stars 1.43k forks source link

dspy.Mistral Fails to Recognize Installed mistralai Package #1393

Closed softshipper closed 2 months ago

softshipper commented 2 months ago

Hi all

I am trying to use the LM Mistral in the dspy library with the following code:

llm = dspy.Mistral(
    model="mistral-large-latest",
    api_key="secret",
)

However, I encounter the following error:

Not loading Mistral AI because it is not installed. Install it with pip install mistralai. Steps Taken:

I have installed the mistralai package, and confirmed the installation with the following command:

❯ pip show mistralai
Name: mistralai
Version: 1.0.1
Summary: Python Client SDK for the Mistral AI API.
Location: /Users/developer/ai/playdspy/.venv/lib/python3.12/site-packages
Issue:

Despite the package being installed, dspy does not recognize it and throws an error indicating that mistralai is not installed.

Question:

Is there something I am missing or doing incorrectly? How can I resolve this issue?

Best regards

arnavsinghvi11 commented 2 months ago

Hi @softshipper , is this resolved with the latest merged PR?

softshipper commented 2 months ago

@arnavsinghvi11 Perfect. Thanks a lot.