Skip to content

Commit

Permalink
Merge pull request #2736 from langchain-ai/nc/12dec/sdk-command-keys
Browse files Browse the repository at this point in the history
sdk-py: Strip out unused keys in command parameter
  • Loading branch information
nfcampos authored Dec 12, 2024
2 parents 2d8246e + e5ea4f5 commit cbb7348
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions libs/sdk-py/langgraph_sdk/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1318,7 +1318,9 @@ def stream(
""" # noqa: E501
payload = {
"input": input,
"command": command,
"command": {k: v for k, v in command.items() if v is not None}
if command
else None,
"config": config,
"metadata": metadata,
"stream_mode": stream_mode,
Expand Down Expand Up @@ -1503,7 +1505,9 @@ async def create(
""" # noqa: E501
payload = {
"input": input,
"command": command,
"command": {k: v for k, v in command.items() if v is not None}
if command
else None,
"stream_mode": stream_mode,
"stream_subgraphs": stream_subgraphs,
"config": config,
Expand Down Expand Up @@ -1672,7 +1676,9 @@ async def wait(
""" # noqa: E501
payload = {
"input": input,
"command": command,
"command": {k: v for k, v in command.items() if v is not None}
if command
else None,
"config": config,
"metadata": metadata,
"assistant_id": assistant_id,
Expand Down Expand Up @@ -3477,7 +3483,9 @@ def stream(
""" # noqa: E501
payload = {
"input": input,
"command": command,
"command": {k: v for k, v in command.items() if v is not None}
if command
else None,
"config": config,
"metadata": metadata,
"stream_mode": stream_mode,
Expand Down Expand Up @@ -3662,7 +3670,9 @@ def create(
""" # noqa: E501
payload = {
"input": input,
"command": command,
"command": {k: v for k, v in command.items() if v is not None}
if command
else None,
"stream_mode": stream_mode,
"stream_subgraphs": stream_subgraphs,
"config": config,
Expand Down Expand Up @@ -3828,7 +3838,9 @@ def wait(
""" # noqa: E501
payload = {
"input": input,
"command": command,
"command": {k: v for k, v in command.items() if v is not None}
if command
else None,
"config": config,
"metadata": metadata,
"assistant_id": assistant_id,
Expand Down

0 comments on commit cbb7348

Please sign in to comment.