Skip to content

armgit / dspy

Public Imported from GitHub
0

DSPy: The framework for programming—not prompting—language models

Python

(feature) Adding support for Mistral AI's API

Franck Stephane Ndzomga226077436fa3
diff --git a/dsp/modules/__init__.py b/dsp/modules/__init__.py
index eceabc3c4..737c7c795 100644
--- a/dsp/modules/__init__.py
+++ b/dsp/modules/__init__.py
@@ -9,8 +9,8 @@ from .google import *
from .gpt3 import *
from .hf import HFModel
from .hf_client import Anyscale, HFClientTGI, Together
+from .mistral import *
from .ollama import *
from .pyserini import *
from .sbert import *
from .sentence_vectorizer import *
-from .mistral import *
diff --git a/dsp/modules/lm.py b/dsp/modules/lm.py
index b2500d290..e382d4c50 100644
--- a/dsp/modules/lm.py
+++ b/dsp/modules/lm.py
@@ -53,20 +53,13 @@ class LM(ABC):
x['response'],
),
)
- elif provider == "mistral":
+ elif provider == "mistral" or provider == "mistral":
printed.append(
(
prompt,
x['response'].choices,
),
)
- elif provider == "mistral":
- printed.append(
- (
- prompt,
- x['response'].choices
- )
- )
else:
printed.append(
(