Skip to content

Commit 944f131

Browse files
authored
Use maxTemperature in session creation sample code
See also #53.
1 parent fa45f9d commit 944f131

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,14 @@ const customSession = await ai.languageModel.create({
185185

186186
const capabilities = await ai.languageModel.capabilities();
187187
const slightlyHighTemperatureSession = await ai.languageModel.create({
188-
temperature: Math.max(capabilities.defaultTemperature * 1.2, 1.0),
188+
temperature: Math.max(
189+
capabilities.defaultTemperature * 1.2,
190+
capabilities.maxTemperature
191+
),
192+
topK: 10
189193
});
190194

191-
// capabilities also contains maxTemperature, defaultTopK, and maxTopK.
195+
// capabilities also contains defaultTopK and maxTopK.
192196
```
193197

194198
### Session persistence and cloning

0 commit comments

Comments
 (0)