Commit Graph

2719 Commits

Author SHA1 Message Date
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
H Lohaus
6c48dd608b
Merge pull request #2449 from hlohaus/reset
Use pydantic construct instead of new model_construct
2024-12-05 01:01:59 +01:00
TrueSaiyan
e7e9d7df85
Create requests.md (#2429)
* Create requests.md

* Update requests.md

* Update README.md
2024-12-02 10:04:34 +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
3f93d34cbf
Add more contributers, add link to Swagger UI (#2443)
* Add more contributers, add link to Swagger UI
* Update Dockerfile-slim
* Update retry_provider.py
* Add html preview to gui, fix urls in website manifest
* Missing chunks in OpenaiChat
2024-11-30 22:11:18 +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
kqlio67
8d5d522c4e
feat(g4f): Major provider updates and new model support (#2437)
* 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

* Update (g4f/Provider/Airforce.py)

---------

Co-authored-by: kqlio67 <kqlio67@users.noreply.github.com>
2024-11-28 17:50:24 +01:00
H Lohaus
2cf2f86ce8
Merge pull request #2439 from hlohaus/retry
Fix api with default providers, add unittests for RetryProvider
2024-11-28 17:48:59 +01:00
Heiner Lohaus
c31f5435c4 Fix api with default providers, add unittests for RetryProvider 2024-11-28 17:46:46 +01:00
H Lohaus
971a01eb5c
Update OpenaiChat.py 2024-11-28 10:59:49 +01:00
H Lohaus
a292ca317b
Update OpenaiChat.py 2024-11-28 10:58:33 +01:00
H Lohaus
fe0ab0427e
Fix api requests with retry provider 2024-11-28 10:42:14 +01:00
foxfire52
0cf0c1f4e2
Fix docker armv7 cryptography module build (#2436)
* Update Dockerfile-armv7
2024-11-27 21:57:19 +01:00
H Lohaus
9df8e07739
Merge pull request #2435 from hlohaus/discord
Add some arguments to chat completion api, update discord links
2024-11-27 14:50:02 +01:00
Heiner Lohaus
651df0cf82 Add some arguments to chat completion api, update discord links 2024-11-27 14:44:24 +01:00
H Lohaus
abd94c1174
Update README.md 2024-11-27 14:16:43 +01:00
H Lohaus
fdb46662d5
Merge pull request #2432 from hlohaus/model
Add duckduckgo-search to slim requirements,
2024-11-27 00:03:03 +01:00
Heiner Lohaus
16a11f991f Fix unit tests 2024-11-26 23:38:48 +01:00
H Lohaus
1b6f6f5443
Merge pull request #2434 from foxfire52/pillow
Fix docker armv7 cffi pillow
2024-11-26 21:26:22 +01:00
foxfire52
79e34181ff
Update Dockerfile-armv7 2024-11-26 20:34:26 +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
H Lohaus
b99717df39
Merge pull request #2430 from hlohaus/model
Add armv7 docker image, Remove Bing provider, add update banner
2024-11-26 11:54:17 +01:00
Heiner Lohaus
6b48af1757 Add armv7 docker image, Remove Bing provider, add update banner 2024-11-25 20:34:50 +01:00
H Lohaus
f0308abe71
Merge pull request #2426 from hlohaus/model
Fix start api without port argument
2024-11-25 16:45:02 +01:00
Heiner Lohaus
0eb1d3ed50 Fix start api without port argument 2024-11-25 16:35:58 +01:00
H Lohaus
f01f679965
Merge pull request #2424 from ufoptg/patch-1
FIX: Bug fix for flux-pro aka flux-schnell
2024-11-25 15:48:44 +01:00
H Lohaus
f4ff7f8da5
Merge pull request #2425 from hlohaus/model
Fix provider selection in images generate
2024-11-25 15:47:10 +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
TrueSaiyan
30b9707657
FIX: Bug fix for flux-pro aka flux-schnell
https://api.airforce/imagine2?model=flux-4o

https://api.airforce/imagine2?model=flux-schnell 
and
https://api.airforce/imagine2?model=flux-1.1-pro

all generate same images but "Flux-1.1-Pro" doesnt work
2024-11-25 21:28:50 +08:00
H Lohaus
a73b3fc382
Merge pull request #2423 from hlohaus/model
Add .har file support for Copilot
2024-11-25 14:20:17 +01:00
Heiner Lohaus
fb831bcc26 Add image upload to api 2024-11-25 13:53:05 +01:00
Heiner Lohaus
46038c6a20 Add .har file support for Copilot
Update provider in Vision documentation
Hide
2024-11-25 13:27:56 +01:00
H Lohaus
a722abb8c2
Merge pull request #2421 from hlohaus/model
Fix optional fields in api
2024-11-25 10:42:23 +01:00
Heiner Lohaus
0043e0494c Fix AsyncClient / loop is already running 2024-11-25 09:15:27 +01:00
Heiner Lohaus
6e99f70191 Fix optional fields in api 2024-11-25 08:53:57 +01:00
H Lohaus
f2849fce1b
Merge pull request #2419 from hlohaus/arm3
Fix import Annotated typing
2024-11-25 01:28:10 +01:00
Heiner Lohaus
8153668ab8 Fix import Annotated typing 2024-11-25 01:24:03 +01:00
H Lohaus
73997bc4e7
Merge pull request #2418 from hlohaus/arm3
Fix typing issue
2024-11-25 00:42:18 +01:00
Heiner Lohaus
1b7f89f69a Fix typing issue 2024-11-25 00:36:38 +01:00
H Lohaus
2fb0163715
Merge pull request #2417 from hlohaus/arm3
Improve error handling in api, Update openapi.json workflow
2024-11-24 23:36:54 +01:00
Heiner Lohaus
c57321e287 Improve error handling in api, Update openapi.json workflow 2024-11-24 23:34:59 +01:00
H Lohaus
1982a7863e
Merge pull request #2416 from hlohaus/arm3
Improve slim docker build, Add openapi.json to release
2024-11-24 22:22:03 +01:00
Heiner Lohaus
2114520ed2 Improve slim docker build, Add openapi.json to release 2024-11-24 22:20:08 +01:00
H Lohaus
aaedd5b3ff
Update Dockerfile-slim 2024-11-24 19:27:24 +01:00
H Lohaus
7d9a64013b
Arm2 (#2415)
* Fix arm v7 build / improve api

* Update stubs.py

* Fix unit tests

* Fix arm build
2024-11-24 18:42:00 +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
4744d0b77d
Merge pull request #2412 from xtekky/arm
Fix build arm v7
2024-11-24 15:23:46 +01:00
Heiner Lohaus
7f5e20bd1c Fix build arm v7 2024-11-24 15:23:03 +01:00
H Lohaus
f36e6a2e3b
Fix provider api response (#2408)
* Update __init__.py

* Update __init__.py

* Update Gemini.py

* Update Gemini.py

* Update Gemini.py

* Update Gemini.py

* Update internet.py
2024-11-24 13:30:10 +01:00