Fix loading when installed from git: import openAIResponsesApi from pi-ai/compat
Some checks failed
CI / test (22) (push) Failing after 25s
CI / test (24) (push) Failing after 37s

pi resolves only a fixed set of its own module paths for installed
extensions; pi-ai/api/* is not among them. Add a test that keeps
runtime imports within that set.
This commit is contained in:
Benjamin Hackl 2026-11-03 21:18:44 +01:00
commit 4a957f2796

View file

@ -3,7 +3,9 @@ import {
type Model,
type Provider,
} from "@earendil-works/pi-ai";
import { openAIResponsesApi } from "@earendil-works/pi-ai/api/openai-responses.lazy";
// pi resolves only a fixed set of its own module paths for extensions; anything
// else (e.g. pi-ai/api/*) fails in a git/npm install. See test/imports.test.ts.
import { openAIResponsesApi } from "@earendil-works/pi-ai/compat";
import { getBuiltinModels } from "@earendil-works/pi-ai/providers/all";
export const PROVIDER_ID = "unigpt";