From faa0da49771b0e7b1e5d4c08b0a3e57d7bacce79 Mon Sep 17 00:00:00 2001 From: zach Date: Fri, 3 Jan 2025 16:57:08 -0800 Subject: [PATCH] fix: default client initialization --- mcpx/chat.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mcpx/chat.py b/mcpx/chat.py index 6328ce7..a21ae7d 100644 --- a/mcpx/chat.py +++ b/mcpx/chat.py @@ -34,7 +34,7 @@ class ChatConfig: Stores configuration and session for chats """ - client: Client = Client() + client: Client | None = None """ mcp.run client """ @@ -166,6 +166,8 @@ def __init__(self, config: ChatConfig | None = None): self.messages = [] self.tools = [] self.config = config or ChatConfig() + if self.config.client is None: + self.config.client = Client() if self.config.model is None: self.config.model = self._default_model() if self.config.provider_client is not None: