Create Client websocket.py#179
Create Client websocket.py#179jerome3o-anthropic merged 11 commits intomodelcontextprotocol:mainfrom smithery-ai:patch-1
Conversation
|
@calclavia thanks for pushing this draft, I'd love to see tests and happy to assist. |
|
any update on this? |
Hey, sorry I missed this thread. Will run some tests and update! |
Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
|
@Kludex I addressed your comments by fixing it. Also added a test and that new test passes. |
|
Btw, I'm not a maintainer here. I was just passing by. |
|
My bad - notifying @jalleyne |
jerome3o-anthropic
left a comment
There was a problem hiding this comment.
awesome - I've had a play with it locally and it works well. Once the requested changes are in I'm happy to merge
|
@jerome3o-anthropic Addressed comments! |
|
Looks like you have some linting / formating / locking issues, once solved we can merge |
| # Convert to a dict, then to JSON | ||
| msg_dict = message.model_dump( | ||
| by_alias=True, mode="json", exclude_none=True | ||
| ) | ||
| await ws.send(json.dumps(msg_dict)) |
There was a problem hiding this comment.
You don't need to use all this, you can just do message.model_dump_json().
1691b90
into
modelcontextprotocol:main
Adds a WebSocket client.
Motivation and Context
Currently, there's a WebSocket server but no client. Allows Python clients to connect to WS servers.
How Has This Been Tested?
This is a draft PR. If there's interest in this, then we can move on to adding a test.
Types of changes
Checklist