Skip to content

Commit

Permalink
Update ts example; use camelCase in python
Browse files Browse the repository at this point in the history
  • Loading branch information
neilmehta24 committed Feb 27, 2025
1 parent 9ac2ee8 commit 54c7485
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions 1_python/1_llm-prediction/completion.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Once you have a loaded model, you can generate completions by passing a string t
language: python
code: |
# The `chat` object is created in the previous step.
prediction_stream = model.complete_stream("My name is", config={"max_tokens": 100})
prediction_stream = model.complete_stream("My name is", config={"maxTokens": 100})
for fragment in prediction_stream:
print(fragment.content, end="", flush=True)
Expand All @@ -53,7 +53,7 @@ Once you have a loaded model, you can generate completions by passing a string t
language: python
code: |
# The `chat` object is created in the previous step.
result = model.complete("My name is", config={"max_tokens": 100})
result = model.complete("My name is", config={"maxTokens": 100})
print(result)
```
Expand Down
8 changes: 6 additions & 2 deletions 2_typescript/2_llm-prediction/completion.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ Once you have a loaded model, you can generate completions by passing a string t
Streaming:
language: typescript
code: |
const completion = model.complete("My name is");
const completion = model.complete("My name is", {
maxTokens: 100,
});
for await (const { content } of completion) {
process.stdout.write(content);
Expand All @@ -43,7 +45,9 @@ Once you have a loaded model, you can generate completions by passing a string t
"Non-streaming":
language: typescript
code: |
const completion = await model.complete("My name is");
const completion = await model.complete("My name is", {
maxTokens: 100,
});
console.info(completion.content);
```
Expand Down

0 comments on commit 54c7485

Please sign in to comment.