fix: update provider status, models, error handling, and imports

- Set `working = False` in Free2GPT, Startnest, and Reka providers
- Changed `default_model` in LambdaChat from `deepseek-v3-0324` to `deepseek-r1`
- Removed `deepseek-v3` alias from LambdaChat's `model_aliases`
- In Kimi provider:
  - Replaced manual status check with `await raise_for_status(response)`
  - Set `model` field to `"k2"` in chat completion request
  - Removed unused `pass` statement
- In WeWordle provider:
  - Removed `**kwargs` from `data_payload` construction
- In Reka provider:
  - Set default value for `stream` to `True`
  - Modified `get_cookies` call to use `cache_result=False`
- In `cli/client.py`:
  - Added conditional import for `MarkItDown` with `has_markitdown` flag
  - Raised `MissingRequirementsError` if `MarkItDown` is not installed
- In `gui/server/backend_api.py`:
  - Imported `MissingAuthError`
  - Wrapped `get_provider_models` call in try-except block to return 401 if `MissingAuthError` is raised
This commit is contained in:
hlohaus
2025-07-27 18:03:54 +02:00
parent 8892b00ac1
commit f83c92446e
8 changed files with 27 additions and 24 deletions

View File

@@ -40,7 +40,7 @@ from ...providers.response import FinishReason, AudioResponse, MediaResponse, Re
from ...client.helper import filter_markdown
from ...tools.files import supports_filename, get_streaming, get_bucket_dir, get_tempfile
from ...tools.run_tools import iter_run_tools
from ...errors import ProviderNotFoundError
from ...errors import ProviderNotFoundError, MissingAuthError
from ...image import is_allowed_extension, process_image, MEDIA_TYPE_MAP
from ...cookies import get_cookies_dir
from ...image.copy_images import secure_filename, get_source_url, get_media_dir, copy_media
@@ -120,7 +120,10 @@ class Backend_Api(Api):
@app.route('/backend-api/v2/models/<provider>', methods=['GET'])
def jsonify_provider_models(**kwargs):
response = self.get_provider_models(**kwargs)
try:
response = self.get_provider_models(**kwargs)
except MissingAuthError as e:
return jsonify({"error": {"message": str(e)}}), 401
return jsonify(response)
@app.route('/backend-api/v2/providers', methods=['GET'])