Exclude Nones
This commit is contained in:
parent
7b55252c87
commit
4040945cdf
2 changed files with 15 additions and 15 deletions
|
|
@ -104,7 +104,7 @@ async def sse_client(url: str, headers: dict[str, Any] | None = None, timeout: f
|
|||
logger.debug(f"Sending client message: {message}")
|
||||
response = await client.post(
|
||||
endpoint_url,
|
||||
json=message.model_dump(by_alias=True, mode="json"),
|
||||
json=message.model_dump(by_alias=True, mode="json", exclude_none=True),
|
||||
)
|
||||
response.raise_for_status()
|
||||
logger.debug(
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ async def stdio_client(server: StdioServerParameters):
|
|||
try:
|
||||
async with write_stream_reader:
|
||||
async for message in write_stream_reader:
|
||||
json = message.model_dump_json(by_alias=True)
|
||||
json = message.model_dump_json(by_alias=True, exclude_none=True)
|
||||
await process.stdin.send((json + "\n").encode())
|
||||
except anyio.ClosedResourceError:
|
||||
await anyio.lowlevel.checkpoint()
|
||||
|
|
|
|||
Loading…
Reference in a new issue