mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-11 11:56:53 +08:00
chore: apply ruff's pyflakes linter rules (#2420)
This commit is contained in:
@@ -39,13 +39,13 @@ class ToolModelManager:
|
||||
)
|
||||
|
||||
if not model_instance:
|
||||
raise InvokeModelError(f'Model not found')
|
||||
raise InvokeModelError('Model not found')
|
||||
|
||||
llm_model = cast(LargeLanguageModel, model_instance.model_type_instance)
|
||||
schema = llm_model.get_model_schema(model_instance.model, model_instance.credentials)
|
||||
|
||||
if not schema:
|
||||
raise InvokeModelError(f'No model schema found')
|
||||
raise InvokeModelError('No model schema found')
|
||||
|
||||
max_tokens = schema.model_properties.get(ModelPropertyKey.CONTEXT_SIZE, None)
|
||||
if max_tokens is None:
|
||||
@@ -69,7 +69,7 @@ class ToolModelManager:
|
||||
)
|
||||
|
||||
if not model_instance:
|
||||
raise InvokeModelError(f'Model not found')
|
||||
raise InvokeModelError('Model not found')
|
||||
|
||||
llm_model = cast(LargeLanguageModel, model_instance.model_type_instance)
|
||||
|
||||
@@ -156,7 +156,7 @@ class ToolModelManager:
|
||||
except InvokeConnectionError as e:
|
||||
raise InvokeModelError(f'Invoke connection error: {e}')
|
||||
except InvokeAuthorizationError as e:
|
||||
raise InvokeModelError(f'Invoke authorization error')
|
||||
raise InvokeModelError('Invoke authorization error')
|
||||
except InvokeServerUnavailableError as e:
|
||||
raise InvokeModelError(f'Invoke server unavailable error: {e}')
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user