chore(vendor): import pi 1.3.0

Imported as a linear vendor commit so forge rebases do not replay the upstream root tree.

git-subtree-dir: third_party/pi

git-subtree-split: 71023aec1546d6d677a65669c5665c0927ce0dd0
This commit is contained in:
alexion committed 2026-10-15 17:58:48 -04:00
1 parent 719370c8f7
commit 6081e3e325
1743 files changed
+205459 -131704

No files matched your search

+9 -4
View File
@@ -1,9 +1,9 @@
import "./providers/images/register-builtins.ts";
import { getImagesApiProvider } from "./images-api-registry.ts";
import type { AssistantImages, ImagesApi, ImagesContext, ImagesModel, ProviderImagesOptions } from "./types.ts";
import type { AssistantImages, ImageApi, ImageModel, ImagesContext, ProviderImagesOptions } from "./types.ts";
function resolveImagesApiProvider(api: ImagesApi) {
function resolveImagesApiProvider(api: ImageApi) {
const provider = getImagesApiProvider(api);
if (!provider) {
throw new Error(`No API provider registered for api: ${api}`);
@@ -11,8 +11,13 @@ function resolveImagesApiProvider(api: ImagesApi) {
return provider;
}
export async function generateImages<TApi extends ImagesApi>(
model: ImagesModel<TApi>,
/**
* Global image generation dispatched on `model.api` through the images api
* registry. Auth must be passed explicitly via `options.apiKey`; prefer
* `Models.generateImages()`, which resolves provider auth.
*/
export async function generateImages(
model: ImageModel<ImageApi>,
context: ImagesContext,
options?: ProviderImagesOptions,
): Promise<AssistantImages> {