pi-nvidia-nim 1.1.19 → 1.1.20
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/index.ts +8 -0
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -620,6 +620,14 @@ function nimStreamSimple(
|
|
|
620
620
|
context: Context,
|
|
621
621
|
options?: SimpleStreamOptions,
|
|
622
622
|
): AssistantMessageEventStream {
|
|
623
|
+
// pi-coding-agent registers streamSimple globally per `api` type (not per provider).
|
|
624
|
+
// This streamer is invoked for ALL openai-completions providers (e.g. openrouter, openai),
|
|
625
|
+
// not just nvidia-nim. Pass non-NIM calls through unchanged so we don't leak the
|
|
626
|
+
// NVIDIA_NIM_API_KEY into other providers' Authorization headers.
|
|
627
|
+
if (model.provider !== PROVIDER_NAME) {
|
|
628
|
+
return streamSimpleOpenAICompletions(model as Model<"openai-completions">, context, options);
|
|
629
|
+
}
|
|
630
|
+
|
|
623
631
|
const thinkingConfig = THINKING_CONFIGS[model.id];
|
|
624
632
|
const reasoning = options?.reasoning;
|
|
625
633
|
const isThinkingEnabled = !!reasoning;
|