Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update providers documentation and enhance support for Blackbox HAR auth #2886

Merged
merged 4 commits into from
Apr 6, 2025

Conversation

kqlio67
Copy link
Contributor

@kqlio67 kqlio67 commented Apr 4, 2025

docs: update providers documentation and enhance support for Blackbox HAR auth

  • Added "No auth / HAR file" authentication type in providers-and-models.md
  • Added "Video generation" column to provider tables for future capability
  • Updated model counts and provider capabilities throughout documentation
  • Fixed ARTA provider with improved error handling and response validation
  • Enhanced AllenAI provider with vision model support and proper image handling
  • Significantly improved Blackbox provider:
    • Added HAR file authentication support
    • Added subscription status checking
    • Added premium/demo model differentiation
    • Improved session handling and error recovery
  • Enhanced DDG provider with better error handling for challenges
  • Improved PollinationsAI and PollinationsImage providers' model handling
  • Added VideoModel class in g4f/models.py
  • Added audio/video generation indicators in GUI components
  • Added new Ai2 models: olmo-1-7b, olmo-2-32b, olmo-4-synthetic
  • Added new commit message generation tool in etc/tool/commit.py

feat: enhance commit tool with advanced options and error handling

  • Added command-line argument parsing with options for model selection, editing, and no-commit mode
  • Implemented fallback mechanism with multiple AI models if the primary model fails
  • Added spinner display to indicate progress during API calls
  • Created functions to filter sensitive data from diffs before sending to API
  • Added diff truncation capabilities for handling large changesets
  • Implemented commit message editing in user's configured editor
  • Added model listing functionality to show available AI options
  • Enhanced error handling with retries and better error reporting
  • Added keyboard interrupt handling for graceful termination
  • Improved type annotations throughout the codebase
  • Added constants for configuration parameters like retry delay and max diff size

chore: add backup files to .gitignore

  • Added *.bak and *.backup file patterns to .gitignore file
  • Placed new patterns at the end of the file after a blank line

… HAR auth

- Added "No auth / HAR file" authentication type in providers-and-models.md
- Added "Video generation" column to provider tables for future capability
- Updated model counts and provider capabilities throughout documentation
- Fixed ARTA provider with improved error handling and response validation
- Enhanced AllenAI provider with vision model support and proper image handling
- Significantly improved Blackbox provider:
  - Added HAR file authentication support
  - Added subscription status checking
  - Added premium/demo model differentiation
  - Improved session handling and error recovery
- Enhanced DDG provider with better error handling for challenges
- Improved PollinationsAI and PollinationsImage providers' model handling
- Added VideoModel class in g4f/models.py
- Added audio/video generation indicators in GUI components
- Added new Ai2 models: olmo-1-7b, olmo-2-32b, olmo-4-synthetic
- Added new commit message generation tool in etc/tool/commit.py
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Review

Title: Update providers documentation and enhance support for Blackbox HAR auth

Summary

Thank you for your contribution! This pull request includes significant updates to the providers documentation and enhances the support for Blackbox HAR authentication. The changes improve clarity and add useful features.

Changes Made

  • Added a new authentication type for "No auth / HAR file" in the providers-and-models.md documentation.
  • Expanded the provider tables by including a "Video generation" column.
  • Updated model counts and capabilities across the documentation for accuracy.
  • Improved error handling and response validation for the ARTA provider.
  • Enhanced the AllenAI provider to support new vision models and improve image handling.
  • Major improvements to the Blackbox provider including:
    • Support for HAR file authentication.
    • Subscription status checks.
    • Differentiation between premium and demo models.
    • Improved session management and error recovery.
  • Made enhancements to the DDG provider regarding error handling.
  • Improved model handling for PollinationsAI and PollinationsImage providers.
  • Added a new VideoModel class in g4f/models.py.
  • Included audio/video generation indicators in the GUI components.
  • Introduced new Ai2 models: olmo-1-7b, olmo-2-32b, and olmo-4-synthetic.
  • Created a new commit message generation tool in etc/tool/commit.py.

Documentation

The documentation updates ensure that users can easily understand the new functionality and features available, especially regarding the authentication methods and model capabilities.

Code Quality

The code improvements, especially around error handling, are essential for a robust user experience. It's also great to see the addition of clear and informative comments.

Suggestions

  • Consider adding some examples or usage scenarios within the documentation to further assist users.

Overall, this pull request brings substantial value to the project, improving both documentation and functionality. Great work!

Thank you again for your contributions to the project!

Best Regards,
g4f Copilot

@@ -26,6 +26,7 @@ This document provides an overview of various AI providers and models, including
- **Optional API key** - Works without authentication, but you can provide an API key for better rate limits or additional features. The service is usable without an API key.
- **API key / Cookies** - Supports both authentication methods. You can use either an API key or browser cookies for authentication.
- **No auth required** - No authentication needed. The service is publicly available without any credentials.
- **No auth / HAR file** - Supports both authentication methods. The service works without authentication, but you can also use HAR file authentication for potentially enhanced features or capabilities.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The description "the service works without authentication, but you can also use HAR file authentication for potentially enhanced features or capabilities." is somewhat vague. It would be better to specify what enhanced features or capabilities HAR file authentication entails.

|[you.com](https://you.com)|[Manual cookies](https://you.com)|`g4f.Provider.You`|✔|✔|❌|✔|![](https://img.shields.io/badge/Active-brightgreen)|
|[websim.ai](https://websim.ai)|No auth required|`g4f.Provider.Websim`|`gemini-1.5-pro, gemini-1.5-flash`|`flux`|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
|[chat9.yqcloud.top](https://chat9.yqcloud.top)|No auth required|`g4f.Provider.Yqcloud`|`gpt-4`|✔|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
| Website | API Credentials | Provider | Text generation | Image generation | Audio generation | Video generation | Vision (Image Upload) | Status |
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have added a new "Video generation" column, but it seems some entries in this column are marked with even when corresponding providers support video generation. You may need to check and ensure that the data reflects the current capabilities accurately.

|[hailuo.ai/chat](https://www.hailuo.ai/chat)|[Get API key](https://intl.minimaxi.com/user-center/basic-information/interface-key)|`g4f.Provider.MiniMax`|`MiniMax` _**(1+)**_|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
| Website | API Credentials | Provider | Text generation | Image generation | Audio generation | Video generation | Vision (Image Upload) | Status |
|----------|-------------|--------------|---------------|--------|--------|------|------|------|
|[hailuo.ai/chat](https://www.hailuo.ai/chat)|[Get API key](https://intl.minimaxi.com/user-center/basic-information/interface-key)|`g4f.Provider.MiniMax`|`MiniMax` _**(1+)**_|❌|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The entry for the g4f.Provider.MiniMax provider lists "Video generation | ❌" despite a newly added "Video generation" support. Ensure the entry reflects the latest capabilities after recent updates.

|[platform.deepseek.com](https://platform.deepseek.com)|[Get API key](https://platform.deepseek.com/api_keys)|`g4f.Provider.DeepSeek`|✔ _**(1+)**_|❌|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
|[gemini.google.com](https://gemini.google.com)|[Manual cookies](https://gemini.google.com)|`g4f.Provider.Gemini`|`gemini-2.0`|`gemini-2.0`|❌|❌|`gemini-2.0`|![](https://img.shields.io/badge/Active-brightgreen)|
|[ai.google.dev](https://ai.google.dev)|[Get API key](https://aistudio.google.com/u/0/apikey)|`g4f.Provider.GeminiPro`|`gemini-1.5-flash, gemini-1.5-pro, gemini-2.0-flash`|❌|❌|❌|`gemini-1.5-pro`|![](https://img.shields.io/badge/Active-brightgreen)|
|[developers.sber.ru/gigachat](https://developers.sber.ru/gigachat)|[Manual cookies](https://developers.sber.ru/gigachat)|`g4f.Provider.GigaChat`|✔ _**(3+)**_|❌|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For g4f.Provider.GigaChat, the entry lists multiple capabilities that may need updating as per new data, considering you have refined various provider capabilities in this pull request. Ensure consistency throughout.

|[replicate.com](https://replicate.com)|[Get API key](https://replicate.com/account/api-tokens)|`g4f.Provider.Replicate`|✔ _**(1+)**_|❌|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
|[beta.theb.ai](https://beta.theb.ai)|[Get API key](https://beta.theb.ai)|`g4f.Provider.ThebApi`|✔ _**(21+)**_|❌|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
|[whiterabbitneo.com](https://www.whiterabbitneo.com)|[Manual cookies](https://www.whiterabbitneo.com)|`g4f.Provider.WhiteRabbitNeo`|✔|❌|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|
|[console.x.ai](https://console.x.ai)|[Get API key](https://console.x.ai)|`g4f.Provider.xAI`|✔|❌|❌|❌|❌|![](https://img.shields.io/badge/Active-brightgreen)|

---
## Models
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider organizing the documentation to ensure easy navigation, particularly given the new elements introduced. It could help users access required information without excessive scrolling.

@@ -52,6 +54,8 @@ def get_provider_models(provider: str, api_key: str = None, api_base: str = None
"model": model,
"default": model == provider.default_model,
"vision": getattr(provider, "default_vision_model", None) == model or model in getattr(provider, "vision_models", []),
"audio": getattr(provider, "default_audio_model", None) == model or model in getattr(provider, "audio_models", []),
"video": getattr(provider, "default_video_model", None) == model or model in getattr(provider, "video_models", []),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly, the check for the video model here could be simplified or adjusted to ensure consistency with the checks for other model types.

- Added command-line argument parsing with options for model selection, editing, and no-commit mode
- Implemented fallback mechanism with multiple AI models if the primary model fails
- Added spinner display to indicate progress during API calls
- Created functions to filter sensitive data from diffs before sending to API
- Added diff truncation capabilities for handling large changesets
- Implemented commit message editing in user's configured editor
- Added model listing functionality to show available AI options
- Enhanced error handling with retries and better error reporting
- Added keyboard interrupt handling for graceful termination
- Improved type annotations throughout the codebase
- Added constants for configuration parameters like retry delay and max diff size
Copy link

github-actions bot commented Apr 4, 2025

Review for Pull Request: Update providers documentation and enhance support for Blackbox HAR auth

Summary

Thank you for your contribution to the project! This pull request introduces several enhancements and updates to the providers documentation, as well as significant improvements to the Blackbox provider.

Changes

  • Added a new authentication type: No auth / HAR file in providers-and-models.md.
  • Introduced a Video generation column to provider tables for future capabilities.
  • Updated model counts and provider capabilities throughout the documentation.
  • Improved error handling and response validation for the ARTA provider.
  • Enhanced the AllenAI provider with vision model support and proper image handling.
  • Major improvements to the Blackbox provider, including:
    • HAR file authentication support.
    • Subscription status checking.
    • Differentiation between premium and demo models.
    • Enhanced session handling and error recovery.
  • Improved error handling for challenges in the DDG provider.
  • Enhanced model handling for PollinationsAI and PollinationsImage providers.
  • Added a new VideoModel class in g4f/models.py.
  • Introduced audio/video generation indicators in GUI components.
  • Added new Ai2 models: olmo-1-7b, olmo-2-32b, olmo-4-synthetic.
  • Created a new commit message generation tool in etc/tool/commit.py.

Documentation Updates

The documentation has been updated to reflect these changes, ensuring that users have the most current information regarding the capabilities and requirements of each provider.

Recommendations

  • Ensure that all new features are thoroughly tested to confirm their functionality.
  • Consider adding examples in the documentation for the new authentication methods and model capabilities to assist users in understanding how to implement them.

Overall, this is a well-structured and comprehensive update. Great job on enhancing the functionality and documentation of the project!


Thank you once again for your valuable contribution!

- Added *.bak and *.backup file patterns to .gitignore file
- Placed new patterns at the end of the file after a blank line
Copy link

github-actions bot commented Apr 4, 2025

Review for Pull Request: Update providers documentation and enhance support for Blackbox HAR auth

Thank you for contributing to the project with this detailed and comprehensive pull request! The changes you made are beneficial and will enhance the documentation and functionality significantly.

Changes Overview

  • Documentation Updates:
    • Addition of the "No auth / HAR file" authentication type in providers-and-models.md.
    • Introduction of a new "Video generation" column to provider tables, which will aid in future capabilities.
    • Updated model counts and provider capabilities across the board.
  • Provider Enhancements:
    • Improvements to various providers, including better error handling, support for vision models in the AllenAI provider, and significant additions in the Blackbox provider, such as HAR file authentication support.

Specific Changes Noted

  1. Documentation: The clarity and structure of the documentation have improved, making it easier for users to understand the capabilities of different providers and models.

  2. Operator Support: The inclusion of audio/video generation indicators in GUI components is a forward-thinking enhancement that will be well-received by users.

  3. Commit Message Tool: The new commit message generation tool (etc/tool/commit.py) you introduced is an excellent addition, particularly for streamlining the development process and ensuring consistency in commit messages.

  4. Error Handling: The enhancements to error handling in the ARTA and Blackbox providers, along with the introduction of clearer response validations, indicate a strong commitment to improving user experience and reliability.

  5. Code Structure: Improved type annotations and the organization of constants contribute to code readability and maintainability.

Suggestions for Improvement

While the pull request is mostly solid, I suggest:

  • Possibly including more examples in the documentation for each authentication type, especially for new entries like "No auth / HAR file" to aid user understanding further.
  • Consider modularizing the commit tool further in terms of responsibilities or functionalities if it grows in size.

Conclusion

Your efforts to enhance both the documentation and the functionality of various providers are commendable. The Pull Request is looking great, and I believe it will positively impact our users.

Thank you once again for your contributions! I look forward to seeing this merged and the implementation of these features in our project.

Copy link

github-actions bot commented Apr 6, 2025

Review for Pull Request: Update providers documentation and enhance support for Blackbox HAR auth

Thank you for your contributions to the project! This update makes substantial improvements and clarifications that will certainly enhance our documentation and provider capabilities.

Summary of Changes

  1. Documentation Updates:

    • Added "No auth / HAR file" authentication type in providers-and-models.md
    • Included a "Video generation" column in provider tables for future expansions.
    • Updated model counts and provider capabilities throughout the documentation to reflect recent enhancements.
  2. Provider Enhancements:

    • Improved error handling and response validation for the ARTA provider.
    • Enhanced functionality for the AllenAI provider, adding vision model support and image handling.
    • Major updates to the Blackbox provider including:
      • HAR file authentication support.
      • Subscription status checking.
      • Differentiation between premium and demo models.
      • Enhanced session management and error recovery mechanisms.
    • Improvements to the DDG provider for better error handling with challenges.
    • Updates to PollinationsAI and PollinationsImage providers’ model handling.
  3. New Features:

    • Introduced a new VideoModel class in g4f/models.py.
    • Added audio/video generation indicators in the GUI components.
    • Introduced new AI models including olmo-1-7b, olmo-2-32b, and olmo-4-synthetic.
    • Implemented a commit message generation tool in etc/tool/commit.py with various new options.

Feedback

Positive Aspects

  • The thorough documentation updates are incredibly helpful for developers to understand the capabilities and limitations of each provider.
  • The added error handling measures significantly improve the reliability of the providers during operation, which is vital for user experience.

Suggestions for Improvement

  • Consider adding examples for the new "No auth / HAR file" authentication type to provide clarity on how to implement it.
  • A small note or section addressing potential edge cases during subscription status checks for users might be beneficial as well.

Conclusion

Overall, this pull request is well-structured with clear improvements to both documentation and provider functionality. I'm looking forward to seeing how these changes enhance user interaction with the providers!

Thanks again for your hard work!

"deepseek-r1": "deepseek-reasoning-large",
"deepseek-r1": "deepseek-reasoning",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can set one alias for a value

@hlohaus hlohaus merged commit 3effec4 into xtekky:main Apr 6, 2025
1 check passed
@hlohaus
Copy link
Collaborator

hlohaus commented Apr 6, 2025

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants