gityo 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +5 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -167614,7 +167614,7 @@ const SUPPORTED_PROVIDERS = {
|
|
|
167614
167614
|
"zhipu-ai-provider": createZhipu
|
|
167615
167615
|
};
|
|
167616
167616
|
const modelSchema = object$4({
|
|
167617
|
-
npm: _enum$4(Object.keys(SUPPORTED_PROVIDERS)).
|
|
167617
|
+
npm: _enum$4(Object.keys(SUPPORTED_PROVIDERS)).optional(),
|
|
167618
167618
|
apiKeyEnv: union$4([string$6().min(1), array$4(string$6().min(1))]),
|
|
167619
167619
|
model: string$6().min(1),
|
|
167620
167620
|
apiUrl: url$3().optional(),
|
|
@@ -172830,9 +172830,10 @@ function resolveLanguageModel(modelConfig) {
|
|
|
172830
172830
|
}
|
|
172831
172831
|
}
|
|
172832
172832
|
if (apiKey === null) throw new Error(`No API key found. Set 'apiKeyEnv' in your config to the environment variable holding the key for '${modelConfig.model}'.`);
|
|
172833
|
-
|
|
172834
|
-
|
|
172835
|
-
|
|
172833
|
+
const npm = modelConfig.npm ?? "@ai-sdk/openai-compatible";
|
|
172834
|
+
if (npm === "@ai-sdk/openai-compatible" && !modelConfig.apiUrl) throw new Error("apiUrl is required for openai-compatible provider");
|
|
172835
|
+
return SUPPORTED_PROVIDERS[npm]({
|
|
172836
|
+
name: npm,
|
|
172836
172837
|
apiKey,
|
|
172837
172838
|
baseURL: modelConfig.apiUrl,
|
|
172838
172839
|
...modelConfig.options
|