Skip to content

Commit 876384a

Browse files
committed
add end=""
makes it look nicer for streaming text from inference api
1 parent 8b96b0e commit 876384a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/tasks/src/snippets/python.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ stream = client.chat.completions.create(
4848
)
4949
5050
for chunk in stream:
51-
print(chunk.choices[0].delta.content)`,
51+
print(chunk.choices[0].delta.content, end="")`,
5252
},
5353
{
5454
client: "openai",
@@ -69,7 +69,7 @@ stream = client.chat.completions.create(
6969
)
7070
7171
for chunk in stream:
72-
print(chunk.choices[0].delta.content)`,
72+
print(chunk.choices[0].delta.content, end="")`,
7373
},
7474
];
7575
} else {

0 commit comments

Comments
 (0)