Skip to content

Commit ebc9abc

Browse files
committed
Fix mistralai partially imported errors
1 parent 627eb97 commit ebc9abc

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

aikido_zen/sinks/mistralai.py

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,21 @@ def _chat_completions_response(func, instance, args, kwargs, return_value):
1616
)
1717

1818

19-
@on_import("mistralai", "mistralai", "1.0.0")
20-
def patch(m):
21-
"""patching module mistralai"""
22-
patch_function(m, "agents.Agents.complete", _chat_completions_response)
23-
patch_function(m, "chat.Chat.complete", _chat_completions_response)
24-
patch_function(m, "embeddings.Embeddings.create", _chat_completions_response)
25-
patch_function(m, "fim.Fim.complete", _chat_completions_response)
19+
@on_import("mistralai.agents", "mistralai", "1.0.0")
20+
def patch_agents(m):
21+
patch_function(m, "Agents.complete", _chat_completions_response)
22+
23+
24+
@on_import("mistralai.chat", "mistralai", "1.0.0")
25+
def patch_chat(m):
26+
patch_function(m, "Chat.complete", _chat_completions_response)
27+
28+
29+
@on_import("mistralai.embeddings", "mistralai", "1.0.0")
30+
def patch_embeddings(m):
31+
patch_function(m, "Embeddings.create", _chat_completions_response)
32+
33+
34+
@on_import("mistralai.fim", "mistralai", "1.0.0")
35+
def patch_fim(m):
36+
patch_function(m, "Fim.complete", _chat_completions_response)

0 commit comments

Comments
 (0)