Skip to content

Commit

Permalink
code-refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
shubhamaidetic committed Mar 29, 2024
1 parent 0555759 commit 6ed4ca4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions spacy_llm/models/rest/mistral/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
from typing import Iterable, Optional, Any, Dict
from ..base import REST

from mistralai.client import MistralClient
from mistralai.models.chat_completion import ChatMessage


class AzureMistral(REST):
def __init__(
Expand All @@ -29,13 +32,10 @@ def __init__(

def __call__(self, prompts: Iterable[Iterable[str]]) -> Iterable[Iterable[str]]:
all_resps = []
api_key = self._credentials.get("api-key")
for prompts_doc in prompts:
doc_resps = []
for prompt in prompts_doc:
from mistralai.client import MistralClient
from mistralai.models.chat_completion import ChatMessage

api_key = self._credentials.get("api-key")
client = MistralClient(endpoint=self._endpoint, api_key=api_key)

chat_response = client.chat(
Expand Down

0 comments on commit 6ed4ca4

Please sign in to comment.