Skip to content

Commit 1a21f73

Browse files
committed
bugfix: 解决 httpx.AsyncClient 不支持pickle
1 parent 2dde1e8 commit 1a21f73

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

trpc_agent_sdk/models/_openai_model.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,14 +235,15 @@ def _create_async_client(self) -> openai.AsyncOpenAI:
235235

236236
logging.getLogger("httpx").setLevel(logging.WARNING)
237237

238-
self.client_args['http_client'] = self._http_client_factory()
238+
client_args = self.client_args.copy()
239+
client_args['http_client'] = self._http_client_factory()
239240

240241
return openai.AsyncOpenAI(
241242
api_key=self._api_key,
242243
max_retries=0, # disable retries
243244
organization=self.organization,
244245
base_url=self._base_url,
245-
**self.client_args,
246+
**client_args,
246247
)
247248

248249
def _create_tool_prompt(self) -> ToolPrompt:

0 commit comments

Comments
 (0)