mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-22 21:44:18 +02:00
PR feedback
This commit is contained in:
parent
f6de7ad880
commit
376ac22cd7
1 changed files with 2 additions and 3 deletions
|
|
@ -54,6 +54,7 @@ from .transports import (
|
|||
PythonStdioTransport,
|
||||
SessionKwargs,
|
||||
SSETransport,
|
||||
StdioTransport,
|
||||
StreamableHttpTransport,
|
||||
infer_transport,
|
||||
)
|
||||
|
|
@ -337,15 +338,13 @@ class Client(Generic[ClientTransportT]):
|
|||
await fresh_client.call_tool("some_tool", {})
|
||||
```
|
||||
"""
|
||||
from .transports import StdioTransport
|
||||
|
||||
new_client = copy.copy(self)
|
||||
|
||||
if not isinstance(self.transport, StdioTransport):
|
||||
# Reset session state to fresh state
|
||||
new_client._session_state = ClientSessionState()
|
||||
|
||||
new_client.name += f":{secrets.token_hex(nbytes=2)}"
|
||||
new_client.name += f":{secrets.token_hex(2)}"
|
||||
|
||||
return new_client
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue