Commit Graph

81 Commits

Author SHA1 Message Date
H Lohaus
bbb858249b
Improve gradient in gui, show only models with enabled providers (#2492)
- **Cloudflare Provider**: Added error handling for missing requirements when fetching arguments.
- **Copilot Provider**: Updated the prompt formatting to use a maximum length function, improving message handling.
- **PollinationsAI Provider**: Adjusted the prompt length to a maximum of 5000 characters.
- **GitHub Copilot Provider**: Updated to use `ClientSession` for better session management.
- **CSS Updates**: Enhanced the gradient styling in the GUI for a more visually appealing interface.
- **JavaScript Updates**: Added functionality to toggle search options in the chat interface.
2024-12-17 21:17:40 +01:00
Heiner Lohaus
ff66df1486 Improved ignored providers support,
Add get_models to OpenaiAPI, HuggingFace and Groq
Add xAI provider
2024-12-15 23:22:36 +01:00
Heiner Lohaus
3b7b79f5ba Fix show html in gui 2024-12-15 12:23:04 +01:00
H Lohaus
335c971f6a
Add multiple images support (#2478)
* Add multiple images support

* Add multiple images support in gui

* Support multiple images in legacy client and in the api
Fix some model names in provider model list

* Fix unittests

* Add vision and providers docs
2024-12-13 22:20:58 +01:00
Heiner Lohaus
20ad08021a Fix deprecated construct method, fix unittests 2024-12-07 20:07:11 +01:00
Heiner Lohaus
78c20c08a0 Improve image generation in OpenaiChat and Gemini 2024-12-06 21:54:13 +01:00
kqlio67
b198d900aa
update providers and documentation with image handling improvements (#2451)
* refactor(g4f/Provider/Airforce.py): Enhance Airforce provider with dynamic model fetching

* refactor(g4f/Provider/Blackbox.py): Enhance Blackbox AI provider configuration and streamline code

* feat(g4f/Provider/RobocodersAPI.py): Add RobocodersAPI new async chat provider

* refactor(g4f/client/__init__.py): Improve provider handling in async_generate method

* refactor(g4f/models.py): Update provider configurations for multiple models

* refactor(g4f/Provider/Blackbox.py): Streamline model configuration and improve response handling

* feat(g4f/Provider/DDG.py): Enhance model support and improve conversation handling

* refactor(g4f/Provider/Copilot.py): Enhance Copilot provider with model support

* refactor(g4f/Provider/AmigoChat.py): update models and improve code structure

* chore(g4f/Provider/not_working/AIUncensored.): move AIUncensored to not_working directory

* chore(g4f/Provider/not_working/Allyfy.py): remove Allyfy provider

* Update (g4f/Provider/not_working/AIUncensored.py g4f/Provider/not_working/__init__.py)

* refactor(g4f/Provider/ChatGptEs.py): Implement format_prompt for message handling

* refactor(g4f/Provider/Blackbox.py): Update message formatting and improve code structure

* refactor(g4f/Provider/LLMPlayground.py): Enhance text generation and error handling

* refactor(g4f/Provider/needs_auth/PollinationsAI.py): move PollinationsAI to needs_auth directory

* refactor(g4f/Provider/Liaobots.py): Update Liaobots provider models and aliases

* feat(g4f/Provider/DeepInfraChat.py): Add new DeepInfra models and aliases

* Update (g4f/Provider/__init__.py)

* Update (g4f/models.py)

* g4f/models.py

* Update g4f/models.py

* Update g4f/Provider/LLMPlayground.py

* Update (g4f/models.py g4f/Provider/Airforce.py
g4f/Provider/__init__.py g4f/Provider/LLMPlayground.py)

* Update g4f/Provider/__init__.py

* refactor(g4f/Provider/Airforce.py): Enhance text generation with retry and timeout

* Update g4f/Provider/AmigoChat.py g4f/Provider/__init__.py

* refactor(g4f/Provider/Blackbox.py): update model prefixes and image handling

Fixes #2445

- Update model prefixes for gpt-4o, gemini-pro, and claude-sonnet-3.5
- Add 'gpt-3.5-turbo' alias for 'blackboxai' model
- Modify image handling in create_async_generator method
- Add 'imageGenerationMode' and 'webSearchModePrompt' flags to API request
- Remove redundant 'imageBase64' field from image data structure

* New provider (g4f/Provider/Blackbox2.py)

Support for model llama-3.1-70b text generation

* docs(docs/async_client.md): update AsyncClient API guide with minor improvements

- Improve formatting and readability of code examples
- Add line breaks for better visual separation of sections
- Fix minor typos and inconsistencies in text
- Enhance clarity of explanations in various sections
- Remove unnecessary whitespace

* feat(docs/client.md): add response_format parameter

- Add 'response_format' parameter to image generation examples
- Specify 'url' format for standard image generation
- Include 'b64_json' format for base64 encoded image response
- Update documentation to reflect new parameter usage
- Improve code examples for clarity and consistency

* docs(README.md): update usage examples and add image generation

- Update text generation example to use new Client API
- Add image generation example with Client API
- Update configuration section with new cookie setting instructions
- Add response_format parameter to image generation example
- Remove outdated information and reorganize sections
- Update contributors list

* refactor(g4f/client/__init__.py): optimize image processing and response handling

- Modify _process_image_response to handle 'url' format without local saving
- Update ImagesResponse construction to include 'created' timestamp
- Simplify image processing logic for different response formats
- Improve error handling and logging for image generation
- Enhance type hints and docstrings for better code clarity

* feat(g4f/models.py): update model providers and add new models

- Add Blackbox2 to Provider imports
- Update gpt-3.5-turbo best provider to Blackbox
- Add Blackbox2 to llama-3.1-70b best providers
- Rename dalle_3 to dall_e_3 and update its best providers
- Add new models: solar_mini, openhermes_2_5, lfm_40b, zephyr_7b, neural_7b, mythomax_13b
- Update ModelUtils.convert with new models and changes
- Remove duplicate 'dalle-3' entry in ModelUtils.convert

* refactor(Airforce): improve API handling and add authentication

- Implement API key authentication with check_api_key method
- Refactor image generation to use new imagine2 endpoint
- Improve text generation with better error handling and streaming
- Update model aliases and add new image models
- Enhance content filtering for various model outputs
- Replace StreamSession with aiohttp's ClientSession for async operations
- Simplify model fetching logic and remove redundant code
- Add is_image_model method for better model type checking
- Update class attributes for better organization and clarity

* feat(g4f/Provider/HuggingChat.py): update HuggingChat model list and aliases

Request by @TheFirstNoob
- Add 'Qwen/Qwen2.5-72B-Instruct' as the first model in the list
- Update model aliases to include 'qwen-2.5-72b'
- Reorder existing models in the list for consistency
- Remove duplicate entry for 'Qwen/Qwen2.5-72B-Instruct' in models list

* refactor(g4f/Provider/ReplicateHome.py): remove unused text models

Request by @TheFirstNoob
- Removed the 'meta/meta-llama-3-70b-instruct' and 'mistralai/mixtral-8x7b-instruct-v0.1' text models from the  list
- Updated the  list to only include the remaining text and image models
- This change simplifies the model configuration and reduces the number of available models, focusing on the core text and image models provided by Replicate

* refactor(g4f/Provider/HuggingChat.py): Move HuggingChat to needs_auth directory

Request by @TheFirstNoob

* Update (g4f/Provider/needs_auth/HuggingChat.py)

* Update g4f/models.py

* Update g4f/Provider/Airforce.py

* Update g4f/models.py g4f/Provider/needs_auth/HuggingChat.py

* Added 'Airforce' provider to the 'o1-mini' model (g4f/models.py)

* Update (g4f/Provider/Airforce.py g4f/Provider/AmigoChat.py)

* Update g4f/models.py g4f/Provider/DeepInfraChat.py g4f/Provider/Airforce.py

* Update g4f/Provider/DeepInfraChat.py

* Update (g4f/Provider/DeepInfraChat.py)

* Update g4f/Provider/Blackbox.py

* Update (docs/client.md docs/async_client.md g4f/client/__init__.py)

* Update (docs/async_client.md docs/client.md)

* Update (g4f/client/__init__.py)

---------

Co-authored-by: kqlio67 <kqlio67@users.noreply.github.com>
Co-authored-by: kqlio67 <>
Co-authored-by: H Lohaus <hlohaus@users.noreply.github.com>
2024-12-05 01:07:59 +01:00
Heiner Lohaus
d6b18c0f15 Use pydantic construct and dict instead of model_construct and model_dump 2024-12-01 17:31:05 +01:00
H Lohaus
79c407b939
IterListProvider support for generating images (#2441)
* IterListProvider support for generating images
* Add missing get_har_files import in Copilot
* Fix typo in dall-e-3 model name
* Add image client unittests
* Add MicrosoftDesigner provider
* Import MicrosoftDesigner and add it to the model list
2024-11-29 13:56:11 +01:00
Heiner Lohaus
c31f5435c4 Fix api with default providers, add unittests for RetryProvider 2024-11-28 17:46:46 +01:00
Heiner Lohaus
651df0cf82 Add some arguments to chat completion api, update discord links 2024-11-27 14:44:24 +01:00
Heiner Lohaus
16a11f991f Fix unit tests 2024-11-26 23:38:48 +01:00
Heiner Lohaus
4ae3d98df8 Sort .har files by date, filter None from result 2024-11-26 19:28:41 +01:00
Heiner Lohaus
cab71ca8b6 Add duckduckgo-search to slim requirements,
Add pass provider as model in the client,
Fix missing @property in version utils
2024-11-26 16:36:45 +01:00
Heiner Lohaus
442185eac2 Fix provider selection in images generate
Improve image generation in Airforce provider
2024-11-25 15:44:17 +01:00
Heiner Lohaus
0043e0494c Fix AsyncClient / loop is already running 2024-11-25 09:15:27 +01:00
Heiner Lohaus
1b7f89f69a Fix typing issue 2024-11-25 00:36:38 +01:00
H Lohaus
804a80bc7c
Arm2 (#2414)
* Fix arm v7 build / improve api

* Update stubs.py

* Fix unit tests
2024-11-24 17:43:45 +01:00
H Lohaus
e4bfd9db5c
Improve slim docker image example, clean up OpenaiChat provider (#2397)
* Improve slim docker image example, clean up OpenaiChat provider

* Enhance event loop management for asynchronous generators

* Fix attribute " shutdown_default_executor" not found in old python versions

* asyncio file added with all async helpers
2024-11-21 14:05:50 +01:00
H Lohaus
eae317a166
Support synthesize in Openai generator (#2394)
* Improve download of generated images, serve images in the api

* Add support for conversation handling in the api

* Add orginal prompt to image response

* Add download images option in gui, fix loading model list in Airforce

* Support speech synthesize in Openai generator
2024-11-21 05:00:08 +01:00
H Lohaus
ffb4b0d162
Improve download of generated images, serve images in the api (#2391)
* Improve download of generated images, serve images in the api
Add support for conversation handling in the api

* Add orginal prompt to image response

* Add download images option in gui, fix loading model list in Airforce

* Add download images option in gui, fix loading model list in Airforce
2024-11-20 19:58:16 +01:00
Heiner Lohaus
5e9e56ed53 Fix missing provider_handler in client 2024-11-20 02:35:35 +01:00
Heiner Lohaus
8f3fbee0d8 Add show log option to gui 2024-11-19 15:26:03 +01:00
H Lohaus
6cccd6d9ac
Merge pull request #2367 from hlohaus/data-uri
Add full nodriver support to OpenaiChat
2024-11-18 05:13:15 +01:00
Heiner Lohaus
2a7770ea51 Add full nodriver support to OpenaiChat
Move small docker images before old images
2024-11-18 02:53:50 +01:00
kqlio67
8e2723938a Refactor Image Processing and Error Handling in g4f Client Module 2024-11-17 15:33:18 +02:00
H Lohaus
6ce493d4df
Fix api streaming, fix AsyncClient (#2357)
* Fix api streaming, fix AsyncClient, Improve Client class, Some providers fixes, Update models list, Fix some tests, Update model list in Airforce provid
er, Add OpenAi image generation url to api, Fix reload and debug in api arguments, Fix websearch in gui

* Fix Cloadflare and Pi and AmigoChat provider

* Fix conversation support in DDG provider, Add cloudflare bypass with nodriver

* Fix unittests without curl_cffi
2024-11-16 13:19:51 +01:00
kqlio67
17057742ac refactor(g4f/client/client.py): Simplify AsyncClient methods 2024-11-13 14:30:44 +02:00
kqlio67
21a26f6882 Update (docs/ README.md g4f/client/client.py) 2024-11-12 08:44:48 +02:00
kqlio67
b5c432f73e Update (g4f/client/) 2024-11-08 12:03:33 +02:00
kqlio67
e6627d8d30 The prefix function has been removed 2024-10-30 16:25:55 +02:00
kqlio67
b11cf3ab4b feat(g4f/client/client.py): integrate ModelUtils for model retrieval 2024-10-30 14:09:16 +02:00
kqlio67
8adaf33202 feat(g4f/client/async_client.py): refactor for async client implementation 2024-10-30 12:35:55 +02:00
Tekky
1c8061af55
Merge pull request #2304 from kqlio67/main
Add new provider, enhance functionality, and update docs
2024-10-30 09:54:54 +01:00
Tekky
b1d5af85ae re-includeAsyncClient for backwards compatibility, with deprecationwarning. Use Client instead 2024-10-30 09:47:48 +01:00
kqlio67
e79c8b01f5 Update (docs/async_client.md docs/client.md docs/interference-api.md g4f/client/client.py) 2024-10-29 22:03:05 +02:00
kqlio67
f55f867a01 feat(g4f/client/client.py): add system prompt support 2024-10-25 19:43:55 +03:00
kqlio67
0d868f64aa feat(g4f/client/async_client.py, g4f/client/async_client.py): enhance async and sync handling in client 2024-10-15 12:22:52 +03:00
kqlio67
29f4fcb4b0 feat(g4f/client/async_client.py): improve async generator handling and logging 2024-10-03 00:22:43 +03:00
kqlio67
9a16296416 feat(g4f/client/async_client.py): enhance image generation and logging 2024-09-26 21:38:04 +03:00
kqlio67
85c95be22d Restored old version(g4f/client/async_client.py) 2024-09-25 21:31:27 +03:00
kqlio67
b3ddad4a08 feat(g4f/client/async_client.py): enhance image and chat response handling 2024-09-25 20:44:55 +03:00
kqlio67
24d4ea055a refactor(image-models): replace providers with ModelUtils 2024-09-06 01:34:12 +03:00
kqlio67
44ba42f58b feat(images): add async support and logging, enhance image handling 2024-09-06 01:33:45 +03:00
Heiner Lohaus
b7624b75a3 Add streaming and conversation support to gemini 2024-05-21 20:39:31 +02:00
H Lohaus
5115cf0e23
Merge pull request #1984 from hlohaus/leech
Add some options to messages in gui, saves generated images local
2024-05-20 01:50:03 +02:00
Heiner Lohaus
80b2e9b807 Add some options to messages in gui, saves generated images local 2024-05-20 01:28:08 +02:00
H Lohaus
fea056dd49
Update client.py 2024-05-19 17:49:06 +02:00
H Lohaus
370ac53943
Update async_client.py 2024-05-19 17:45:57 +02:00
Heiner Lohaus
b1dafc0ef7 Improve Liabots provider, Add image api support 2024-05-18 07:37:37 +02:00