mirror of
https://github.com/HeyPuter/puter.git
synced 2026-10-13 23:29:50 +00:00
docs(ai): trim listModels return value and AI overview per review
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
64db150a90
commit
f0b55e7605
2 files changed
+7
-13
No files matched your search
@@ -7,8 +7,6 @@ The Puter.js AI feature allows you to integrate artificial intelligence capabili
|
||||
|
||||
You can use AI models from various providers to perform tasks such as chat, text-to-image, image-to-text, text-to-video, and text-to-speech conversion. And with the [User-Pays Model](/user-pays-model/), you don't have to set up your own API keys and top up credits, because users cover their own AI costs.
|
||||
|
||||
Chat supports cancellation through an `AbortSignal`; see [chat()](/AI/chat/#stopping-a-stream). [listModels()](/AI/listModels/) caches successful catalogues for 60 seconds and rejects failed requests.
|
||||
|
||||
## Features
|
||||
|
||||
<div style="overflow:hidden; margin-bottom: 30px;">
|
||||
|
||||
@@ -20,17 +20,6 @@ A string containing the provider you want to list the models for.
|
||||
|
||||
## Return value
|
||||
|
||||
Successful results are cached for 60 seconds per SDK instance, provider, API origin
|
||||
and authentication token. Concurrent identical calls share one request. Each call
|
||||
receives an independent copy of the result. Provider filtering happens on the server;
|
||||
older servers are filtered locally. The SDK falls back to the legacy driver only
|
||||
when the endpoint is unavailable (404 or 501).
|
||||
|
||||
Network and server failures reject the promise; they do not resolve to an empty
|
||||
catalogue. Network failures use `{ message, code: "network_error" }`, invalid
|
||||
catalogue responses use `invalid_response`, idle timeouts use `request_timeout`,
|
||||
and server errors pass through unchanged.
|
||||
|
||||
Resolves to an array of model objects. Each object always contains `id` and `provider`, and may include fields such as `name`, `aliases`, `context`, `max_tokens`, and a `cost` object (`currency`, `tokens`, `input` and `output` costs in cents). Additional provider-specific capability fields may also be present.
|
||||
|
||||
Example model entry:
|
||||
@@ -54,6 +43,13 @@ Example model entry:
|
||||
]
|
||||
```
|
||||
|
||||
Network and server failures reject the promise; they do not resolve to an empty
|
||||
catalogue. Network failures use `{ message, code: "network_error" }`, invalid
|
||||
catalogue responses use `invalid_response`, idle timeouts use `request_timeout`,
|
||||
and server errors pass through unchanged.
|
||||
|
||||
<div class="info">Successful results are cached for 60 seconds per provider.</div>
|
||||
|
||||
## Model variants
|
||||
|
||||
Some models have variants. A variant is the same model with a different price, rate limit, or speed. The variant is a suffix on the model ID, separated by a colon.
|
||||
|
||||
Reference in new issue
Block a user