From 9404e7af9d8768a7e884dae3e9fafb712eaf4e99 Mon Sep 17 00:00:00 2001 From: Bagatur <22008038+baskaryan@users.noreply.github.com> Date: Sun, 29 Sep 2024 11:16:27 -0700 Subject: [PATCH] openai[patch]: exclude http client (#26891) httpx clients aren't serializable --- libs/partners/openai/langchain_openai/chat_models/base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/partners/openai/langchain_openai/chat_models/base.py b/libs/partners/openai/langchain_openai/chat_models/base.py index 8bf598a530852..21754937d180f 100644 --- a/libs/partners/openai/langchain_openai/chat_models/base.py +++ b/libs/partners/openai/langchain_openai/chat_models/base.py @@ -440,11 +440,11 @@ class BaseChatOpenAI(BaseChatModel): default_query: Union[Mapping[str, object], None] = None # Configure a custom httpx client. See the # [httpx documentation](https://www.python-httpx.org/api/#client) for more details. - http_client: Union[Any, None] = None + http_client: Union[Any, None] = Field(default=None, exclude=True) """Optional httpx.Client. Only used for sync invocations. Must specify http_async_client as well if you'd like a custom client for async invocations. """ - http_async_client: Union[Any, None] = None + http_async_client: Union[Any, None] = Field(default=None, exclude=True) """Optional httpx.AsyncClient. Only used for async invocations. Must specify http_client as well if you'd like a custom client for sync invocations.""" stop: Optional[Union[List[str], str]] = Field(default=None, alias="stop_sequences")