pi-requesty-discover 1.0.4 → 1.0.5
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/README.adoc +2 -1
- package/README.md +2 -1
- package/package.json +1 -1
- package/src/index.ts +2 -2
- package/src/models-json.ts +3 -1
package/README.adoc
CHANGED
|
@@ -67,7 +67,7 @@ Example:
|
|
|
67
67
|
"requesty-export": {
|
|
68
68
|
"name": "Requesty",
|
|
69
69
|
"baseUrl": "https://router.requesty.ai/v1",
|
|
70
|
-
"apiKey": "
|
|
70
|
+
"apiKey": "$REQUESTY_API_KEY",
|
|
71
71
|
"api": "openai-completions",
|
|
72
72
|
"models": []
|
|
73
73
|
}
|
|
@@ -78,6 +78,7 @@ Example:
|
|
|
78
78
|
IMPORTANT: The `apiKey` from `models.json` is not used by this extension.
|
|
79
79
|
It may contain Pi-specific environment-variable substitution that the extension cannot reliably resolve.
|
|
80
80
|
Set `REQUESTY_API_KEY` instead. This variable is required.
|
|
81
|
+
You can configure the real `apiKey` as you like, but it would be recommended to use the same variable as for the model discovery.
|
|
81
82
|
|
|
82
83
|
IMPORTANT: Health checks are designed to use only a few tokens, but they still make real Requesty API calls and may consume credits.
|
|
83
84
|
|
package/README.md
CHANGED
|
@@ -55,7 +55,7 @@ Example:
|
|
|
55
55
|
"requesty-export": {
|
|
56
56
|
"name": "Requesty",
|
|
57
57
|
"baseUrl": "https://router.requesty.ai/v1",
|
|
58
|
-
"apiKey": "
|
|
58
|
+
"apiKey": "$REQUESTY_API_KEY",
|
|
59
59
|
"api": "openai-completions",
|
|
60
60
|
"models": []
|
|
61
61
|
}
|
|
@@ -67,6 +67,7 @@ Example:
|
|
|
67
67
|
The `apiKey` from `models.json` is not used by this extension.
|
|
68
68
|
It may contain Pi-specific environment-variable substitution that the extension cannot reliably resolve.
|
|
69
69
|
Set `REQUESTY_API_KEY` instead. This variable is required.
|
|
70
|
+
You can configure the real `apiKey` as you like, but it would be recommended to use the same variable as for the model discovery.
|
|
70
71
|
|
|
71
72
|
**❗ IMPORTANT**\
|
|
72
73
|
Health checks are designed to use only a few tokens, but they still make real Requesty API calls and may consume credits.
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -17,7 +17,7 @@ interface AutocompleteItem {
|
|
|
17
17
|
export type NotificationLevel = 'info' | 'warning' | 'error'
|
|
18
18
|
|
|
19
19
|
export type Notifier = {
|
|
20
|
-
notify(message: string, level
|
|
20
|
+
notify(message: string, level: NotificationLevel): void
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
export type StatusReporter = {
|
|
@@ -62,7 +62,7 @@ export async function runCommand(args: string, status: StatusReporter, notifier:
|
|
|
62
62
|
const parts = args.split(' ')
|
|
63
63
|
const dryRun = parts.includes(DRY_RUN_ARG)
|
|
64
64
|
if (dryRun) {
|
|
65
|
-
notifier.notify('running in dry mode, no changes will be done',
|
|
65
|
+
notifier.notify('running in dry mode, no changes will be done', 'info')
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
try {
|
package/src/models-json.ts
CHANGED
|
@@ -56,8 +56,10 @@ export function getRequestyConfig(envConfig: Env = getEnv()): RequestyConfig {
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
export function updateModelsJson(data: ModelsJson, models: ProviderModelConfig[], envConfig: Env = getEnv()): void {
|
|
59
|
+
const provider = data.providers[envConfig.provider_id]
|
|
59
60
|
data.providers[envConfig.provider_id] = {
|
|
60
|
-
...
|
|
61
|
+
...provider,
|
|
62
|
+
apiKey: nonEmptyString(provider.apiKey) ?? '$REQUESTY_API_KEY',
|
|
61
63
|
models: models.map(model => ({
|
|
62
64
|
id: model.id,
|
|
63
65
|
name: model.name,
|