@umituz/react-native-ai-pruna-provider 1.0.2 → 1.0.4

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umituz/react-native-ai-pruna-provider",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "Pruna AI provider for React Native - implements IAIProvider interface for unified AI generation",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -12,9 +12,11 @@ import { prunaProvider } from '../infrastructure/services';
12
12
  */
13
13
  export function initializePrunaProvider(config: {
14
14
  apiKey: string | undefined;
15
+ /** When true (default), sets this provider as the active/default provider */
16
+ setAsActive?: boolean;
15
17
  }): boolean {
16
18
  try {
17
- const { apiKey } = config;
19
+ const { apiKey, setAsActive = true } = config;
18
20
 
19
21
  if (!apiKey) {
20
22
  return false;
@@ -25,7 +27,9 @@ export function initializePrunaProvider(config: {
25
27
  if (!providerRegistry.hasProvider(prunaProvider.providerId)) {
26
28
  providerRegistry.register(prunaProvider);
27
29
  }
28
- providerRegistry.setActiveProvider(prunaProvider.providerId);
30
+ if (setAsActive) {
31
+ providerRegistry.setActiveProvider(prunaProvider.providerId);
32
+ }
29
33
 
30
34
  return true;
31
35
  } catch (error) {