Skip to content

Commit 9524d85

Browse files
CopilotOhYee
andcommitted
fix: use kwargs.get("stream_options") to avoid KeyError
Co-authored-by: OhYee <[email protected]>
1 parent c35f472 commit 9524d85

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

agentrun/model/api/data.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def completions(
5454
**self.headers,
5555
**kwargs.get("headers", {}),
5656
}
57-
if kwargs["stream_options"] is None:
57+
if kwargs.get("stream_options") is None:
5858
kwargs["stream_options"] = {}
5959
kwargs["stream_options"]["include_usage"] = True
6060

@@ -86,7 +86,7 @@ def responses(
8686
**self.headers,
8787
**kwargs.get("headers", {}),
8888
}
89-
if kwargs["stream_options"] is None:
89+
if kwargs.get("stream_options") is None:
9090
kwargs["stream_options"] = {}
9191
kwargs["stream_options"]["include_usage"] = True
9292
from litellm import responses

0 commit comments

Comments
 (0)