mirror of
https://github.com/langbot-app/LangBot.git
synced 2025-11-25 11:29:39 +08:00
refactor: improve model_config implementation based on code review
- Simplify _get_model_config method logic - Add more descriptive comment about model_config usage - Clarify when model_config is used (assistant type apps) Co-authored-by: RockChinQ <45992437+RockChinQ@users.noreply.github.com>
This commit is contained in:
@@ -53,6 +53,8 @@ class AsyncDifyServiceClient:
|
||||
}
|
||||
|
||||
# Add model_config if provided
|
||||
# model_config allows overriding model settings (temperature, max_tokens, etc.)
|
||||
# for assistant type apps in Dify's open-source version
|
||||
if model_config is not None:
|
||||
payload['model_config'] = model_config
|
||||
|
||||
|
||||
@@ -41,12 +41,11 @@ class DifyServiceAPIRunner(runner.RequestRunner):
|
||||
"""获取模型配置参数
|
||||
|
||||
Returns:
|
||||
模型配置字典,如果未配置则返回None
|
||||
模型配置字典,如果未配置或为空则返回None
|
||||
"""
|
||||
model_config = self.pipeline_config['ai']['dify-service-api'].get('model-config')
|
||||
if model_config:
|
||||
return model_config
|
||||
return None
|
||||
# Return None if model_config is None or empty dict to avoid sending unnecessary parameters
|
||||
return model_config if model_config else None
|
||||
|
||||
def _process_thinking_content(
|
||||
self,
|
||||
|
||||
Reference in New Issue
Block a user