Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ollama
Commits
6cc823c9
Unverified
Commit
6cc823c9
authored
Dec 07, 2023
by
Matt Williams
Committed by
GitHub
Dec 07, 2023
Browse files
Update examples/typescript-simplechat/client.ts
Co-authored-by:
Bruce MacDonald
<
brucewmacdonald@gmail.com
>
parent
b84d34e6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
examples/typescript-simplechat/client.ts
examples/typescript-simplechat/client.ts
+2
-2
No files found.
examples/typescript-simplechat/client.ts
View file @
6cc823c9
...
...
@@ -30,7 +30,7 @@ async function chat(messages: Message[]): Promise<Message> {
if
(
!
reader
)
{
throw
new
Error
(
"
Failed to read response body
"
)
}
cons
t
content
:
string
[]
=
[]
le
t
content
=
""
while
(
true
)
{
const
{
done
,
value
}
=
await
reader
.
read
()
if
(
done
)
{
...
...
@@ -41,7 +41,7 @@ async function chat(messages: Message[]): Promise<Message> {
if
(
json
.
done
===
false
)
{
process
.
stdout
.
write
(
json
.
message
.
content
);
content
.
push
(
json
.
message
.
content
)
content
+=
json
.
message
.
content
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment