Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/AI/chat.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ We use different vendors for different models and try to use the best vendor ava
<script src="https://js.puter.com/v2/"></script>
<script>
(async () => {
const resp = await puter.ai.chat('Tell me in detail what Rick and Morty is all about.', {model: 'claude', stream: true });
const resp = await puter.ai.chat('Tell me in detail what Rick and Morty is all about.', {model: 'gemini-2.5-flash-lite', stream: true });
for await ( const part of resp ) document.write(part?.text.replaceAll('\n', '<br>'));
})();
</script>
Expand Down
2 changes: 1 addition & 1 deletion src/AI/txt2img.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ A `Promise` that resolves to an `HTMLImageElement`. The element’s `src` points
<script>
// Generate an image of a cat playing piano using a specific model and quality set to low
puter.ai.txt2img("a cat playing the piano", {
model: "gpt-image-1",
model: "gpt-image-1.5",
quality: "low"
}).then((image)=>{
document.body.appendChild(image);
Expand Down
2 changes: 1 addition & 1 deletion src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ Puter.js is powered by [Puter](https://github.com/HeyPuter/puter), the open-sour
<script src="https://js.puter.com/v2/"></script>
<script>
(async () => {
const resp = await puter.ai.chat('Tell me in detail what Rick and Morty is all about.', {model: 'claude', stream: true });
const resp = await puter.ai.chat('Tell me in detail what Rick and Morty is all about.', {model: 'gemini-2.5-flash-lite', stream: true });
for await ( const part of resp ) puter.print(part?.text?.replaceAll('\n', '<br>'));
})();
</script>
Expand Down
4 changes: 2 additions & 2 deletions src/playground/examples/ai-chat-claude.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<script src="https://js.puter.com/v2/"></script>
<script>
(async () => {
const chat_resp = await puter.ai.chat('Tell me something I might not know about chemistry.', {model: 'claude-sonnet-4', stream: true });
puter.print('<h1>Claude Sonnet 4:</h1>');
const chat_resp = await puter.ai.chat('Tell me something I might not know about chemistry.', {model: 'claude-sonnet-4.5', stream: true });
puter.print('<h1>Claude Sonnet 4.5:</h1>');
for await ( const part of chat_resp ) puter.print(part?.text?.replaceAll('\n', '<br>'));
})();
</script>
Expand Down
20 changes: 11 additions & 9 deletions src/playground/examples/ai-chat-gemini.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,17 @@
<script src="https://js.puter.com/v2/"></script>
<script>
(async () => {
// Gemini 2.0 Flash
const chat_resp = await puter.ai.chat('Tell me something I might not know about chemistry.', {model: 'gemini-2.0-flash', stream: true });
puter.print('<h1>Gemini 2.0 Flash:</h1>');
for await ( const part of chat_resp ) puter.print(part?.text?.replaceAll('\n', '<br>'));

// Gemini 1.5 Flash
const reasoner_resp = await puter.ai.chat('Tell me something I might not know about chemistry.', {model: 'gemini-1.5-flash', stream: true });
puter.print('<h1>Gemini 1.5 Flash:</h1>');
for await ( const part of reasoner_resp ) puter.print(part?.text?.replaceAll('\n', '<br>'));
// Gemini 2.5 Flash
const flash_resp = await puter.ai.chat(
'Tell me something interesting about quantum mechanics.',
{model: 'gemini-2.5-flash', stream: true}
);
puter.print('<h2>Gemini 2.5 Flash Response:</h2>');
for await (const part of flash_resp) {
if (part?.text) {
puter.print(part.text.replaceAll('\n', '<br>'));
}
}
})();
</script>
</body>
Expand Down
2 changes: 1 addition & 1 deletion src/playground/examples/ai-chat-stream.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<script src="https://js.puter.com/v2/"></script>
<script>
(async () => {
const resp = await puter.ai.chat('Tell me in detail what Rick and Morty is all about.', {model: 'claude', stream: true });
const resp = await puter.ai.chat('Tell me in detail what Rick and Morty is all about.', {model: 'gemini-2.5-flash-lite', stream: true });
for await ( const part of resp ) puter.print(part?.text?.replaceAll('\n', '<br>'));
})();
</script>
Expand Down
2 changes: 1 addition & 1 deletion src/playground/examples/ai-txt2img-options.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<script>
// Generate an image of a cat playing the piano using a specific model and quality set to low
puter.ai.txt2img("a cat playing the piano", {
model: "gpt-image-1",
model: "gpt-image-1.5",
quality: "low"
}).then((image)=>{
document.body.appendChild(image);
Expand Down
2 changes: 1 addition & 1 deletion src/playground/examples/ai-xai.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<script src="https://js.puter.com/v2/"></script>
<script>
(async () => {
const resp = await puter.ai.chat('Tell me something I might not know about chemistry.', {model: 'grok-beta', stream: true });
const resp = await puter.ai.chat('Tell me something I might not know about chemistry.', {model: 'grok-4-fast', stream: true });
for await ( const part of resp ) puter.print(part?.text?.replaceAll('\n', '<br>'));
})();
</script>
Expand Down
Loading