@charmland/pi-hyper-provider 0.2.0 → 0.2.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/package.json +1 -1
- package/src/models.ts +4 -6
package/package.json
CHANGED
package/src/models.ts
CHANGED
|
@@ -78,10 +78,8 @@ function toProviderModel(model: ProviderModel): Model<"openai-completions"> {
|
|
|
78
78
|
cost: {
|
|
79
79
|
input: model.cost_per_1m_in,
|
|
80
80
|
output: model.cost_per_1m_out,
|
|
81
|
-
cacheRead: model.
|
|
82
|
-
|
|
83
|
-
// input reads and cache writes. Hyper does not expose a cache-write price.
|
|
84
|
-
cacheWrite: 0,
|
|
81
|
+
cacheRead: model.cost_per_1m_out_cached ?? 0,
|
|
82
|
+
cacheWrite: model.cost_per_1m_in_cached,
|
|
85
83
|
},
|
|
86
84
|
contextWindow: model.context_window,
|
|
87
85
|
maxTokens: model.default_max_tokens,
|
|
@@ -107,10 +105,10 @@ function buildThinkingLevelMap(levels: string[]): ThinkingLevelMap | undefined {
|
|
|
107
105
|
}
|
|
108
106
|
|
|
109
107
|
export async function fetchHyperModels(signal?: AbortSignal): Promise<Model<"openai-completions">[]> {
|
|
110
|
-
const payload = await fetchJson(`${HYPER_API_BASE_URL}/
|
|
108
|
+
const payload = await fetchJson(`${HYPER_API_BASE_URL}/models`, {
|
|
111
109
|
signal,
|
|
112
110
|
timeoutMs: MODEL_FETCH_TIMEOUT_MS,
|
|
113
111
|
});
|
|
114
|
-
const provider = parseSchema(ProviderPayloadSchema, payload, "Hyper /
|
|
112
|
+
const provider = parseSchema(ProviderPayloadSchema, payload, "Hyper /models response");
|
|
115
113
|
return provider.models.map(toProviderModel);
|
|
116
114
|
}
|