Commit graph

524 commits

Author SHA1 Message Date
hlohaus
01d194ff4b Enhance MCP server and tools: add CORS support, initialize tool_calls, and update WebSearchTool to use CachedSearch 2025-11-01 11:55:42 +01:00
hlohaus
9b3e7a69d2 Refactor Dockerfile and backend API for improved image processing and dependency management 2025-10-31 03:52:10 +01:00
hlohaus
b2efb16b86 Enhance Yupp provider with model tags management and improve response handling 2025-10-06 13:19:07 +02:00
hlohaus
1fb8b7e4c9 Refactor PollinationsAI model alias handling for improved string conversion; add audio_tokens field to CompletionTokenDetails; update data structure in Backend_Api for user data handling. 2025-10-04 00:48:46 +02:00
hlohaus
6b210f44f9 Refactor search and response handling; introduce CachedSearch and DDGS classes for improved web search functionality and response management. Add PlainTextResponse for handling plain text responses. Update requirements and setup for new dependencies. 2025-10-03 11:38:24 +02:00
Copilot
81f5f32ae8
Add /private/ route to GUI server (#3195)
* Initial plan

* Add /private/ route to GUI server

Co-authored-by: hlohaus <983577+hlohaus@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: hlohaus <983577+hlohaus@users.noreply.github.com>
2025-10-02 21:03:45 +02:00
hlohaus
9931e874ee Add Perplexity provider and enhance response handling in existing providers 2025-10-01 23:41:38 +02:00
hlohaus
91ea2d7a27 Add streaming endpoint for file management and enhance manage_files function 2025-09-12 00:30:12 +02:00
hlohaus
0804d6836a Comment out JSDELIVR_URL replacement in render function to prevent URL rewriting 2025-09-11 22:59:04 +02:00
hlohaus
d7375d4c6c Add Claude provider with authentication handling and update Nvidia provider 2025-09-11 20:55:31 +02:00
hlohaus
4f8456623d Fix error logging format in provider model retrieval and improve message handling in raise_for_status 2025-09-10 09:09:53 +02:00
hlohaus
0f8853d9f3 Fix latest_version handling in render function to correctly append query string 2025-09-07 02:54:09 +02:00
hlohaus
99e647a016 Update render function to use GITHUB_URL for download URL handling 2025-09-07 02:44:05 +02:00
hlohaus
3852fda31d Refactor render function to simplify download URL handling by removing version query parameter 2025-09-07 02:42:06 +02:00
hlohaus
130a429500 Update download URL in website.py to use GITHUB_URL for improved version handling 2025-09-07 02:27:29 +02:00
hlohaus
9b4727b2f1 Update render function to use latest_version for download URL and cache handling 2025-09-07 01:57:38 +02:00
hlohaus
bc77a9226e Update render function to include version in download URL and improve cache handling 2025-09-07 01:39:12 +02:00
hlohaus
ffae27b3cf Refactor render function in website.py to improve HTML handling and caching logic 2025-09-07 01:02:35 +02:00
hlohaus
d0ae94def3 Refactor Copilot provider to improve authentication handling and streamline media uploads; add error handling for user retrieval. Enhance QwenCode provider to manage token validation and refresh logic. Update backend API to include new error handling for model and provider not found scenarios. Add start-browser script for automated Chrome launch. 2025-09-06 20:11:24 +02:00
hlohaus
1cbf9dfb6a Track live provider instances and update count on success or failure in various providers 2025-09-06 11:28:09 +02:00
hlohaus
be52b6aff0 Add user information to encryption response in handle_synthesize method 2025-09-05 05:05:17 +02:00
hlohaus
2030bdd62a Fix JSDELIVR_URL replacement in render function to ensure correct path formatting 2025-09-05 04:08:46 +02:00
hlohaus
b8845f4afe Fix header key formatting in get_provider_models method 2025-09-05 01:52:46 +02:00
hlohaus
25b35ddf99 Refactor build scripts and API to enhance model handling and improve timeout functionality 2025-09-04 22:21:42 +02: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
hlohaus
d6e2bf2c9e Fix secret validation logic to allow non-negative time differences 2025-09-04 08:01:05 +02:00
hlohaus
9dd90991b6 Update backend_api.py 2025-09-04 06:03:54 +02:00
hlohaus
7c5ec5325a Update EasyChat and OpenRouter classes, modify backend API timing, and enhance website rendering 2025-09-04 02:42:04 +02:00
hlohaus
196946b75c Add gel all models 2025-08-20 00:06:10 +02:00
hlohaus
ddab0ffa07 Remove fingerprint 2025-08-09 10:20:56 +02:00
hlohaus
17d36d5106 Add check fingerprint 2025-08-09 09:52:26 +02:00
H Lohaus
23d4c6eb38
Update backend_api.py 2025-08-09 05:00:41 +02:00
hlohaus
71adc96bce Update model list 2025-08-09 04:44:58 +02:00
hlohaus
6fad9c5d58 refactor: update cookie browsers var and LMArenaBeta availability logic
- In `g4f/Provider/needs_auth/LMArenaBeta.py`, import `has_nodriver` from `...requests` in the same line as other imports
- Change `working` attribute to be set based on `has_nodriver` instead of `True`
- Add new class attribute `active_by_default = True` to `LMArenaBeta`
- In `g4f/cli/__init__.py`, change `--cookie-browsers` argument choices to use `g4f.cookies.BROWSERS` instead of `g4f.cookies.browsers`
- In `g4f/cli/__init__.py`, update `run_api_args` to assign to `g4f.cookies.BROWSERS` instead of `g4f.cookies.browsers`
- In `g4f/gui/gui_parser.py`, change import from `browsers` to `BROWSERS`
- In `g4f/gui/gui_parser.py`, update `--cookie-browsers` argument choices to use `BROWSERS` instead of `browsers`
- In `g4f/gui/run.py`, update `run_gui_args` to assign to `g4f.cookies.BROWSERS` instead of `g4f.cookies.browsers
2025-08-09 03:30:37 +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
e7a1bcdf54 fix: improve message formatting and set default activation for providers
- In PerplexityLabs.py, added logic to filter consecutive assistant messages and update message array accordingly
- Modified PerplexityLabs.py to change "messages" field to use the new formatted message list
- Adjusted error handling in PerplexityLabs.py to include a newline in error messages
- Import os in BlackForestLabs_Flux1KontextDev.py and replace media filename assignment with basename if media is None
- In Groq.py, set "active_by_default" to True for the provider
- In OpenRouter.py, added "active_by_default" as True
- In Together.py, set "active_by_default" to True
- In HuggingFaceInference.py, set "working" to False
- In models.py, changed default_model to "openai/gpt-oss-120b" instead of previous value
- In backend_api.py, added a null check in jsonify_provider_models to return 404 if response is None, and simplified get_provider_models call
2025-08-06 04:46:28 +02:00
hlohaus
d4b46f34de fix: correct typo in API section title and update links, and adjust provider aliases
- Changed "Inference API" to "Interference API" and updated corresponding documentation links in README.md
- Removed "o1" and "dall-e-3" entries from Copilot.py model_aliases
- Added "stream" and "extra_body" parameters with default values in Azure.py's create_async_generator method
- In CopilotAccount.py, included model_aliases with "gpt-4", "gpt-4o", "o1", and "dall-e-3"
- Updated conditional for provider comparison from "==" to "in" list in any_provider.py
- Modified g4f/api/__init__.py to set g4f_api_key from environment variable
- In backend_api.py, added "user" field to cached data with default "unknown"
- Changed logic in OpenaiTemplate.py read_response to check if "choice" exists before processing, and cleaned up indentation and conditionals in response parsing
- Removed unnecessary "stop" and "prompt" parameters from comments or unused code in OpenaiTemplate.py
- Tightened the check for "provider" comparison in any_provider.py to handle multiple providers properly
2025-08-01 00:18:29 +02:00
hlohaus
f246e7cfa8 fix: improve error messaging and handling in get_provider_models
- Updated error message formatting in `get_provider_models` call within `Backend_Api` class
- Changed `MissingAuthError` handling to include exception type name in response
- Added generic `Exception` catch to handle unexpected errors with HTTP 500 response
- Modified `backend_api.py` file in `g4f/gui/server` directory
- Ensured all returned error messages use consistent structure with exception type and message
2025-07-29 20:35:21 +02:00
hlohaus
f83c92446e 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
2025-07-27 18:03:54 +02:00
hlohaus
3161f70c29 Add flags 2025-07-18 02:58:06 +02:00
hlohaus
6f8c5ea62b active_by_default 2025-07-15 13:49:29 +02:00
hlohaus
b597d84a50 Update YouTube provider 2025-07-15 08:46:08 +02:00
hlohaus
6c52234d83 Fix cors 2025-07-14 03:51:46 +02:00
hlohaus
113e788914 Log user name 2025-07-13 22:31:21 +02:00
hlohaus
53657646af Update headers 2025-07-13 22:08:12 +02:00
hlohaus
6106ca95c9 Improve logging 2025-07-13 20:07:39 +02:00
hlohaus
a31cb50d6a Add public gen api 2025-07-13 15:31:09 +02:00
hlohaus
c4b18df769 Support audio model in Azure provider 2025-07-12 19:41:23 +02:00
hlohaus
dc98d0cb37 Fix unittests 2025-07-12 08:34:42 +02:00
hlohaus
d6ba724bcc Fix unittests 2025-07-12 08:33:42 +02:00