Commit graph

214 commits

Author SHA1 Message Date
hlohaus
5276e2d6d0 Remove MCP usage guide and README files; update logging in API to use print for most wanted IPs; enhance WebSearchTool to support region parameter for search queries. 2025-11-01 20:34:47 +01:00
hlohaus
35e3fa95f3 Enhance Perplexity provider to yield additional response types including sources, media items, and suggested follow-ups; update response formatting in response classes for improved data handling. 2025-10-31 15:48:26 +01:00
hlohaus
23218c4aa3 Refactor Copilot and PollinationsAI classes for improved error handling and timeout adjustments; add rate limiting in API class based on user IP. 2025-10-31 14:17:41 +01:00
hlohaus
3b4ad875cc Enhance G4F API key decryption by logging decrypted data and adding referrer validation 2025-10-31 10:53:28 +01:00
hlohaus
046e009e39 Enhance user validation in Api class by adjusting username criteria and ensuring proper formatting with country prefix 2025-10-31 06:24:20 +01:00
hlohaus
7ee118e20c Refactor OpenaiTemplate and Api classes for improved error handling and user identification 2025-10-31 06:01:58 +01:00
hlohaus
da6c00e2a2 Refactor Cloudflare and LMArena providers to enhance authentication handling and improve WebSocket communication 2025-10-30 21:34:45 +01:00
H Lohaus
63315df501
Update __init__.py 2025-10-30 16:48:22 +01:00
H Lohaus
52781f3c4c
Update __init__.py 2025-10-30 16:47:29 +01:00
H Lohaus
7c8cf45631
Update __init__.py 2025-10-30 16:46:36 +01:00
hlohaus
d309e0df1d Add cf_ipcountry header to Api class and enhance output_tokens handling in Usage class 2025-10-04 22:17:07 +02:00
hlohaus
391e1f463e Enhance Azure provider error handling and update environment variables 2025-09-22 22:21:03 +02:00
hlohaus
4c1da4e610 Fix handling of stream_timeout 2025-09-08 05:21:44 +02:00
hlohaus
c7bb1538ea Add BrowserConfig initialization in cookies.py and ensure directory creation in SharedTokenManager 2025-09-06 21:20:34 +02:00
hlohaus
76a1bb754c Ensure BrowserConfig port is converted to integer when retrieved from environment variable 2025-09-06 20:36:15 +02:00
hlohaus
a4d0a10a4f Update BrowserConfig port retrieval to handle non-integer values from environment variable 2025-09-06 20:32:23 +02:00
hlohaus
bca45481ea Refactor SharedTokenManager to remove async from reloadCredentialsFromFile and update its invocation. Set default host in BrowserConfig to 127.0.0.1. 2025-09-06 20:22:15 +02:00
hlohaus
933fff985b Enhance PuterJS provider to track live model instances and update BrowserConfig for automation tool settings 2025-09-06 16:28:17 +02:00
hlohaus
17b2526f69 Refactor G4F API key decryption to improve error handling and user validation 2025-09-05 04:03:21 +02:00
hlohaus
2832a98454 Refactor error handling in Api class to ensure consistent response for invalid providers 2025-09-05 03:12:13 +02:00
hlohaus
1ddf666da4 Fix owned_by retrieval in Api class to use provider directly 2025-09-05 02:50:19 +02:00
hlohaus
1d4c708726 Add models_needs_auth attribute to FenayAI class and fix owned_by retrieval in Api class 2025-09-05 02:46:09 +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
e2f8437cc6 Refactor API key validation to improve error handling and user retrieval logic 2025-09-04 12:35:59 +02:00
hlohaus
f269ea1b4c Fix user retrieval logic to raise an error if user is not set in API key validation 2025-09-04 12:13:03 +02:00
hlohaus
d6e0cfaae6 Fix user retrieval logic in API key validation to ensure user is set correctly 2025-09-04 12:12:26 +02:00
hlohaus
2dfa807cfb Refactor provider type determination to use 'chat' for non-image models and update download URL configuration 2025-09-04 12:07:42 +02:00
hlohaus
01e7af68c0 Enhance error logging for invalid G4F API keys by capturing exception details 2025-09-04 11:15:03 +02:00
hlohaus
5ebe7763de Improve logging for invalid G4F API keys 2025-09-04 07:18:39 +02:00
hlohaus
b400ceee3b Log invalid requests 2025-09-04 06:38:27 +02:00
hlohaus
3fc69e0a99 Log invalid requests 2025-09-04 06:32:03 +02:00
hlohaus
aab5c045a2 Update api module 2025-08-22 00:09:45 +02:00
H Lohaus
df3c34cd69
Merge pull request #3131 from xtekky/copilot/fix-3128
Fix WebUI authentication bypass for /chat/ endpoint
2025-08-21 08:52:11 +02:00
hlohaus
526292c4c3 Improce check key 2025-08-19 23:54:22 +02:00
copilot-swe-agent[bot]
d0ce56689c Fix WebUI authentication bypass for /chat/ endpoint
Co-authored-by: hlohaus <983577+hlohaus@users.noreply.github.com>
2025-08-19 14:08:38 +00:00
hlohaus
571af32062 Fix track usage 2025-08-11 22:44:49 +02:00
hlohaus
ea08a7a57d Add model tags to /api 2025-08-09 10:40:47 +02:00
hlohaus
17d36d5106 Add check fingerprint 2025-08-09 09:52:26 +02:00
hlohaus
ba1f9bb3c3 Log requests 2025-08-08 11:44:58 +02:00
hlohaus
b4c3c30766 Fix auth with api_key 2025-08-07 04:39:10 +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
a62a1b6e71 Update models list 2025-08-06 20:54:32 +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
0b6d8e62a1 Fix python combility 2025-07-19 16:13:44 +02:00
hlohaus
36266ae5b3 Filter audio parameter 2025-07-16 10:42:53 +02:00
hlohaus
9868a88199 Fix audio response in API 2025-07-16 10:27:12 +02:00
hlohaus
c718011cb8 Add YouTube provider 2025-07-14 08:49:12 +02:00
hlohaus
89a45f38b6 Fix cors 2025-07-14 04:55:25 +02:00
hlohaus
0c7006f61e Fix cors 2025-07-14 04:35:19 +02:00