@firebase/ai 2.9.0-canary.78384d32c → 2.9.0-canary.792c61671

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.
@@ -4,7 +4,7 @@ import { FirebaseError, Deferred, getModularInstance } from '@firebase/util';
4
4
  import { Logger } from '@firebase/logger';
5
5
 
6
6
  var name = "@firebase/ai";
7
- var version = "2.9.0-canary.78384d32c";
7
+ var version = "2.9.0-canary.792c61671";
8
8
 
9
9
  /**
10
10
  * @license
@@ -4654,6 +4654,11 @@ function getAI(app = getApp(), options) {
4654
4654
  aiInstance.options = finalOptions;
4655
4655
  return aiInstance;
4656
4656
  }
4657
+ const hybridParamKeys = [
4658
+ 'mode',
4659
+ 'onDeviceParams',
4660
+ 'inCloudParams'
4661
+ ];
4657
4662
  /**
4658
4663
  * Returns a {@link GenerativeModel} class with methods for inference
4659
4664
  * and other functionality.
@@ -4665,6 +4670,16 @@ function getGenerativeModel(ai, modelParams, requestOptions) {
4665
4670
  const hybridParams = modelParams;
4666
4671
  let inCloudParams;
4667
4672
  if (hybridParams.mode) {
4673
+ for (const param of Object.keys(modelParams)) {
4674
+ if (!hybridParamKeys.includes(param)) {
4675
+ logger.warn(`When a hybrid inference mode is specified (mode is currently set` +
4676
+ ` to ${hybridParams.mode}), "${param}" cannot be ` +
4677
+ `configured at the top level. Configuration for in-cloud and ` +
4678
+ `on-device must be done separately in inCloudParams and onDeviceParams. ` +
4679
+ `Configuration values set outside of inCloudParams and onDeviceParams will` +
4680
+ ` be ignored.`);
4681
+ }
4682
+ }
4668
4683
  inCloudParams = hybridParams.inCloudParams || {
4669
4684
  model: DEFAULT_HYBRID_IN_CLOUD_MODEL
4670
4685
  };