@godscene/shared
Advanced tools
@@ -21,3 +21,3 @@ import { decideModelConfigFromIntentConfig } from "./parse-model-config.mjs"; | ||
| const defaultConfig = decideModelConfigFromIntentConfig('default', configMap); | ||
| if (!defaultConfig) throw new Error('Model configuration is incomplete: model name (MIDSCENE_MODEL_NAME) is required. See https://midscenejs.com/model-strategy.html'); | ||
| if (!defaultConfig) throw new Error('请配置模型名称'); | ||
| const insightConfig = decideModelConfigFromIntentConfig('insight', configMap); | ||
@@ -67,3 +67,3 @@ const planningConfig = decideModelConfigFromIntentConfig('planning', configMap); | ||
| const modelConfig = this.getModelConfig('default'); | ||
| if (!modelConfig.modelFamily) throw new Error('MIDSCENE_MODEL_FAMILY is not set to a visual language model (VL model), the element localization can not be achieved. Check your model configuration. See https://midscenejs.com/model-strategy.html'); | ||
| if (!modelConfig.modelFamily) throw new Error('请设置模型系列'); | ||
| } | ||
@@ -70,0 +70,0 @@ constructor(modelConfig, createOpenAIClientFn){ |
@@ -8,3 +8,3 @@ import { DEFAULT_MODEL_CONFIG_KEYS, INSIGHT_MODEL_CONFIG_KEYS, PLANNING_MODEL_CONFIG_KEYS } from "./constants.mjs"; | ||
| const MODEL_CONFIG_DOC_URL = 'https://midscenejs.com/model-common-config.html'; | ||
| const getCurrentVersion = ()=>"1.7.20"; | ||
| const getCurrentVersion = ()=>"1.7.21"; | ||
| const getInvalidModelFamilyMessage = (modelFamily)=>`Invalid MIDSCENE_MODEL_FAMILY value: ${modelFamily}. Current version v${getCurrentVersion()} accepts the following model families: ${MODEL_FAMILY_VALUES.join(', ')}. You can also visit ${MODEL_CONFIG_DOC_URL} for the latest configuration information.`; | ||
@@ -162,3 +162,3 @@ const KEYS_MAP = { | ||
| })); | ||
| assert(finalResult.openaiBaseURL, `failed to get base URL of model (intent=${intent}). See https://midscenejs.com/model-strategy`); | ||
| assert(finalResult.openaiBaseURL, "请配置大模型API地址"); | ||
| if (!finalResult.modelName) console.warn(`modelName is not set for intent ${intent}, this may cause unexpected behavior. See https://midscenejs.com/model-strategy`); | ||
@@ -165,0 +165,0 @@ return finalResult; |
@@ -49,3 +49,3 @@ "use strict"; | ||
| const defaultConfig = (0, external_parse_model_config_js_namespaceObject.decideModelConfigFromIntentConfig)('default', configMap); | ||
| if (!defaultConfig) throw new Error('Model configuration is incomplete: model name (MIDSCENE_MODEL_NAME) is required. See https://midscenejs.com/model-strategy.html'); | ||
| if (!defaultConfig) throw new Error('请配置模型名称'); | ||
| const insightConfig = (0, external_parse_model_config_js_namespaceObject.decideModelConfigFromIntentConfig)('insight', configMap); | ||
@@ -95,3 +95,3 @@ const planningConfig = (0, external_parse_model_config_js_namespaceObject.decideModelConfigFromIntentConfig)('planning', configMap); | ||
| const modelConfig = this.getModelConfig('default'); | ||
| if (!modelConfig.modelFamily) throw new Error('MIDSCENE_MODEL_FAMILY is not set to a visual language model (VL model), the element localization can not be achieved. Check your model configuration. See https://midscenejs.com/model-strategy.html'); | ||
| if (!modelConfig.modelFamily) throw new Error('请设置模型系列'); | ||
| } | ||
@@ -98,0 +98,0 @@ constructor(modelConfig, createOpenAIClientFn){ |
@@ -40,3 +40,3 @@ "use strict"; | ||
| const MODEL_CONFIG_DOC_URL = 'https://midscenejs.com/model-common-config.html'; | ||
| const getCurrentVersion = ()=>"1.7.20"; | ||
| const getCurrentVersion = ()=>"1.7.21"; | ||
| const getInvalidModelFamilyMessage = (modelFamily)=>`Invalid MIDSCENE_MODEL_FAMILY value: ${modelFamily}. Current version v${getCurrentVersion()} accepts the following model families: ${external_types_js_namespaceObject.MODEL_FAMILY_VALUES.join(', ')}. You can also visit ${MODEL_CONFIG_DOC_URL} for the latest configuration information.`; | ||
@@ -194,3 +194,3 @@ const KEYS_MAP = { | ||
| })); | ||
| (0, external_utils_js_namespaceObject.assert)(finalResult.openaiBaseURL, `failed to get base URL of model (intent=${intent}). See https://midscenejs.com/model-strategy`); | ||
| (0, external_utils_js_namespaceObject.assert)(finalResult.openaiBaseURL, "请配置大模型API地址"); | ||
| if (!finalResult.modelName) console.warn(`modelName is not set for intent ${intent}, this may cause unexpected behavior. See https://midscenejs.com/model-strategy`); | ||
@@ -197,0 +197,0 @@ return finalResult; |
+1
-1
| { | ||
| "name": "@godscene/shared", | ||
| "version": "1.7.21", | ||
| "version": "1.7.22", | ||
| "repository": "https://github.com/web-infra-dev/midscene", | ||
@@ -5,0 +5,0 @@ "homepage": "https://midscenejs.com/", |
@@ -52,3 +52,3 @@ import type { GlobalConfigManager } from './global-config-manager'; | ||
| throw new Error( | ||
| 'Model configuration is incomplete: model name (MIDSCENE_MODEL_NAME) is required. See https://midscenejs.com/model-strategy.html', | ||
| '请配置模型名称', | ||
| ); | ||
@@ -146,3 +146,3 @@ } | ||
| throw new Error( | ||
| 'MIDSCENE_MODEL_FAMILY is not set to a visual language model (VL model), the element localization can not be achieved. Check your model configuration. See https://midscenejs.com/model-strategy.html', | ||
| '请设置模型系列', | ||
| ); | ||
@@ -149,0 +149,0 @@ } |
@@ -218,3 +218,3 @@ import { | ||
| // 友互通 | ||
| // 友互通 | ||
| const yht_domain: string | undefined = provider[keys.yht_domain]; | ||
@@ -348,3 +348,3 @@ const yht_access_token: string | undefined = provider[keys.yht_access_token]; | ||
| finalResult.openaiBaseURL, | ||
| `failed to get base URL of model (intent=${intent}). See https://midscenejs.com/model-strategy`, | ||
| `请配置大模型API地址`, | ||
| ); | ||
@@ -351,0 +351,0 @@ |
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
1362410
-0.08%