Skip to content

Commit

Permalink
path: Added deprecation for mistralai/mixtral-8x7b-instruct-v01 mod…
Browse files Browse the repository at this point in the history
…el (#27)

* path: added deprecation warning for mistralai/mixtral-8x7b-instruct-v01 model
  • Loading branch information
MateuszOssGit authored Oct 7, 2024
1 parent ee09601 commit 466bb9a
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 79 deletions.
9 changes: 9 additions & 0 deletions libs/ibm/langchain_ibm/chat_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import json
import logging
import warnings
from datetime import datetime
from operator import itemgetter
from typing import (
Expand All @@ -23,6 +24,7 @@

from ibm_watsonx_ai import APIClient, Credentials # type: ignore
from ibm_watsonx_ai.foundation_models import ModelInference # type: ignore
from langchain_core._api import LangChainDeprecationWarning
from langchain_core.callbacks import CallbackManagerForLLMRun
from langchain_core.language_models import LanguageModelInput
from langchain_core.language_models.chat_models import (
Expand Down Expand Up @@ -862,6 +864,13 @@ def bind_tools(
f"bind_tools() method for ChatWatsonx support only "
f"following models: {bind_tools_supported_models}"
)
else:
warnings.warn(
"The `mistralai/mixtral-8x7b-instruct-v01` model, which "
"supports the `bind_tools()` method, is deprecated and will be "
"removed in version 0.3.x of `langchain_ibm`.",
LangChainDeprecationWarning,
)

formatted_tools = [convert_to_openai_tool(tool) for tool in tools]

Expand Down
Loading

0 comments on commit 466bb9a

Please sign in to comment.