mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-01 19:12:42 +00:00
community[patch]: fix deprecation warnings on openai subclasses (#15621)
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
import datetime
|
||||
from typing import Any, Dict, List, Optional
|
||||
|
||||
from langchain_core._api.deprecation import suppress_langchain_deprecation_warning
|
||||
from langchain_core.callbacks import (
|
||||
AsyncCallbackManagerForLLMRun,
|
||||
CallbackManagerForLLMRun,
|
||||
@@ -39,6 +40,11 @@ class PromptLayerChatOpenAI(ChatOpenAI):
|
||||
pl_tags: Optional[List[str]]
|
||||
return_pl_id: Optional[bool] = False
|
||||
|
||||
def __init__(self, *kwargs: Any) -> None:
|
||||
# bypass deprecation warning for ChatOpenAI
|
||||
with suppress_langchain_deprecation_warning():
|
||||
super().__init__(*kwargs)
|
||||
|
||||
@classmethod
|
||||
def is_lc_serializable(cls) -> bool:
|
||||
return False
|
||||
|
Reference in New Issue
Block a user