8 Commits

Author SHA1 Message Date
hlohaus
74fcb27cbc Add OpenRouterFree API key to environment and adjust max_tokens 2025-09-22 22:32:49 +02:00
hlohaus
391e1f463e Enhance Azure provider error handling and update environment variables 2025-09-22 22:21:03 +02:00
TheFirstNoob
c388606c52 Fix missing comma 2025-09-05 03:35:43 +03:00
hlohaus
1edd0fff17 Refactor model handling and improve timeout functionality
- Removed empty string mapping from model_map in AnyModelProviderMixin.
- Updated clean_name function to exclude 'chat' from version patterns.
- Added stream_timeout parameter to AsyncGeneratorProvider for more flexible timeout handling.
- Enhanced chunk yielding in AsyncAuthedProvider to support stream_timeout, allowing for better control over asynchronous responses.
2025-09-04 18:11:05 +02:00
TheFirstNoob
f11f47f15c Fix typo in example.env
Wrong: HUUGINGFACE_API_KEY
Correct: HUGGINGFACE_API_KEY
2025-08-20 00:17:48 +03:00
hlohaus
05f0f55711 refactor: update providers list, env vars, and minor fixes
- **example.env**:
  - Added `G4F_API_KEY` and `G4F_PROXY` variables
  - Removed Azure-related API keys and routes block
  - Added `OLLAMA_API_KEY`, `NVIDIA_API_KEY`, and `PUTER_API_KEY`

- **g4f/Provider/EasyChat.py**:
  - Replaced `page.js_dumps` with `page.evaluate` for retrieving `guestId`

- **g4f/Provider/deprecated/LegacyLMArena.py**:
  - Changed `working = True` to `working = False`

- **g4f/Provider/deprecated/har/__init__.py**:
  - Changed `working = True` to `working = False`

- **g4f/providers/any_provider.py**:
  - Updated imports, adding `Custom`, `PollinationsImage`, `OpenaiAccount`, and reordering providers
  - Renamed `PROVIERS_LIST_2` → `PROVIDERS_LIST_2` and `PROVIERS_LIST_3` → `PROVIDERS_LIST_3`
  - Removed `PROVIERS_LIST_1` and replaced its usage with `Provider.__providers__`
  - Changed `cls.audio_models` initialization from `{}` to `[]`
  - Adjusted handling of model mapping with `clean_name` for consistency
  - GeminiPro check updated to `if provider == GeminiPro`
  - Changed final `cls.audio_models` assignment to `[ *cls.audio_models ]` instead of `list(cls.audio_models.keys())`
  - Adjusted provider fallback in `AnyProvider` to use `PROVIDERS_LIST_2 + PROVIDERS_LIST_3`

- **g4f/requests/__init__.py**:
  - Changed SSE parsing condition from `line.startswith(b"data: ")` to `line.startswith(b"data:")`
  - Updated slice from `line[6:]` to `line[5:]` when extracting `rest
2025-08-18 17:44:05 +02:00
hlohaus
9563f8df3a feat: Update environment variables and modify model mappings
- Added `OPENROUTER_API_KEY` and `AZURE_API_KEYS` to `example.env`.
- Updated `AZURE_DEFAULT_MODEL` to "model-router" in `example.env`.
- Added `AZURE_ROUTES` with multiple model URLs in `example.env`.
- Changed the mapping for `"phi-4-multimodal"` in `DeepInfraChat.py` to `"microsoft/Phi-4-multimodal-instruct"`.
- Added `media` parameter to `GptOss.create_completion` method and raised a `ValueError` if `media` is provided.
- Updated `model_aliases` in `any_model_map.py` to include new mappings for various models.
- Removed several model aliases from `PollinationsAI` in `any_model_map.py`.
- Added new models and updated existing models in `model_map` across various files, including `any_model_map.py` and `__init__.py`.
- Refactored `AnyModelProviderMixin` to include `model_aliases` and updated the logic for handling model aliases.
2025-08-07 01:21:22 +02:00
hlohaus
78f9e2b0b2 Add example.env 2025-07-11 12:55:15 +02:00