Share My Creation B4XCopilot - A.I. Assistant

Introducing B4X Copilot: Harness the Power of AI in Your B4X IDE

logo.png


B4X Copilot is an inofficial external tool completely written in B4J, designed to integrate the most common AI (GPT, Claude, Gemini) advanced language model capabilities into your B4X programming environment. Whether you're coding in B4A, B4J, or B4i, B4X Copilot offers smart, AI-driven features to enhance your coding efficiency and quality.



Key Features of B4X Copilot:
  • Code Refactoring: Enhance your existing code with our intelligent refactoring tools. B4X Copilot reviews your code, suggesting optimizations to improve both performance and readability.
  • Code Completion: Leveraging comments within your code, B4X Copilot predicts and completes your code snippets automatically. Simply begin a comment and B4X Copilot will seamlessly convert your thoughts into precise, functional code.
  • Automated Commenting: Maintain clarity within your codebase with auto-generated comments. B4X Copilot provides insightful explanations for complex code sections, simplifying project navigation and maintenance.
  • Custom Prompt: Directly instruct the AI by describing exactly what you need. Just tell B4X Copilot what to do, and it will execute your commands intelligently.
  • Code Explanation: Revisit your code with confidence. B4X Copilot offers clear, understandable explanations for any part of your code, aiding both you and your team in managing your projects effectively.
  • Fix Code: B4X Copilot not only identifies issues within your code but also corrects them. After making changes, it provides a detailed explanation of what was modified and why, ensuring you understand the adjustments and can learn from them.


Requirements:

Used Models:

Installation Guide:

1. Download B4XCopilot.zip and unzip it and start it with the B4xCopilot.exe.
3. Right-click the tray icon to access settings. Here, you can configure your preferred language, IDE, A.I. Provider, API Key and shortcut.

To change the shortcut use the KeyCodes and seperate them with a &. for example "29&61" for Ctrl+F2. The settings screen will show you the current keycode of the pressed key.
Standard Value is 29&43 for `Ctrl+circumflex (Ctrl+^)`.


Usage:
1. Highlight the code section you need assistance with and press the key combination: `Ctrl+circumflex (Ctrl+^)`.
2. A context menu will appear with all available functions. Select the desired function and wait for the operation to complete.

1720089497164.png



Important Note: While B4X Copilot is designed to enhance your coding experience, it's important to note that due to the relatively lower popularity of the B4X language, it may not be as comprehensively supported in the AI's model. This could lead to occasional inaccuracies in code suggestions and comments. Always review the AI's contributions to ensure they meet your project's requirements.

@Erel may be able to integrate this natively into the IDEs. I am at your disposal for help ;-)

Changelog 1.1
- Adds "Fix" Method (experimental)
- Adds option to change the shortcut

Changelog 1.2
- Nicer contextmenu
- Adds Anthropic Claude and Google Gemini as possible A.I.

Download v1.2
If you want to support my work, please consider a small donation here
 
Last edited:

enrfortin

Member
Licensed User
I tried to test it but my keyboard does not have the ^ key without being able to use the function key, it would be great if the keyboard shortcut could be configured from the options, thank you very much for the contribution.
 

Blueforcer

Well-Known Member
Licensed User
Longtime User
I tried to test it but my keyboard does not have the ^ key without being able to use the function key, it would be great if the keyboard shortcut could be configured from the options, thank you very much for the contribution.

B4XCopilot V1.1 Released:
- Adds the "Fix" method (experimental) where B4XCopilot finds and fixes your code error.
- Adds option to change the shortcut (See first post for tutorial)
 
Last edited:

Blueforcer

Well-Known Member
Licensed User
Longtime User
I have tried it and it works well. On some occasion it closed automatically.
I also selected a code snippet that I had in visual studio code and ran the command; it worked very well
Can you reproduce the crash? Otherwise run it with run_debug.bat and wait for the crash and post the output.
 

fernando1987

Active Member
Licensed User
Thank you, you have inspired me to carry out a similar project using Gemini. Very good work, congratulations
 

cklester

Well-Known Member
Licensed User
@Blueforcer , are you going to be adding interfaces for more APIs (or is it easy to add myself)?

I'm just curious, as I'm finding other LLMs like CoPilot that are reported to be pretty good as coding helpers.

Thanks!
 

cheveguerra

Member
Licensed User
Longtime User
I installed v 1.1 and pretty good so far, a couple of functions that don't exists in B4A, but so far GREAT, and those are problems with THE AI, not with the app.

Will test version 1.2 soon

Best regards
 

Blueforcer

Well-Known Member
Licensed User
Longtime User
@Blueforcer , are you going to be adding interfaces for more APIs (or is it easy to add myself)?

I'm just curious, as I'm finding other LLMs like CoPilot that are reported to be pretty good as coding helpers.

Thanks!

Thats not that easy, because each AI API uses different requests and responses.
But if you want another API, i can implement it. But so far these 3 A.I´s are the most popular and best for B4X
 

Blueforcer

Well-Known Member
Licensed User
Longtime User

cklester

Well-Known Member
Licensed User
Thats not that easy, because each AI API uses different requests and responses.
But if you want another API, i can implement it. But so far these 3 A.I´s are the most popular and best for B4X

The only other one I know to ask for at this point is Github's Copilot. It's supposed to be one of the best for coding purposes, drawing from its codebase.

But if you don't want to, I will be happy to play with the current options.

Thank you!
 

Blueforcer

Well-Known Member
Licensed User
Longtime User
The only other one I know to ask for at this point is Github's Copilot. It's supposed to be one of the best for coding purposes, drawing from its codebase.

But if you don't want to, I will be happy to play with the current options.

Thank you!
Seems like Github Copilot doesnt provide a public API. Only for metrics and business/user management. If you find something else, let me know.
 

Theera

Well-Known Member
Licensed User
Longtime User
Top