Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/llama_stack_client/resources/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,8 @@ def chat_completion(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> InferenceChatCompletionResponse | Stream[InferenceChatCompletionResponse]:
extra_headers = {"Accept": "text/event-stream", **(extra_headers or {})}
if stream is True:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be if stream, but the higher level issue is that this is generated code. We need to make sure we auto-apply this patch always after generation (see stainless_sync.sh) or find another way

extra_headers = {"Accept": "text/event-stream", **(extra_headers or {})}
extra_headers = {
**strip_not_given(
{
Expand Down Expand Up @@ -364,7 +365,8 @@ def completion(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> InferenceCompletionResponse | Stream[InferenceCompletionResponse]:
extra_headers = {"Accept": "text/event-stream", **(extra_headers or {})}
if stream is True:
extra_headers = {"Accept": "text/event-stream", **(extra_headers or {})}
extra_headers = {
**strip_not_given(
{
Expand Down Expand Up @@ -623,7 +625,8 @@ async def chat_completion(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> InferenceChatCompletionResponse | AsyncStream[InferenceChatCompletionResponse]:
extra_headers = {"Accept": "text/event-stream", **(extra_headers or {})}
if stream is True:
extra_headers = {"Accept": "text/event-stream", **(extra_headers or {})}
extra_headers = {
**strip_not_given(
{
Expand Down Expand Up @@ -774,7 +777,8 @@ async def completion(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> InferenceCompletionResponse | AsyncStream[InferenceCompletionResponse]:
extra_headers = {"Accept": "text/event-stream", **(extra_headers or {})}
if stream is True:
extra_headers = {"Accept": "text/event-stream", **(extra_headers or {})}
extra_headers = {
**strip_not_given(
{
Expand Down
Loading