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

Fix for Tokens Limit/Context issue | GPT4FREE | Auto Install Windows | Folders collapse/expand Monaco Editor #539

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

Reiko69420
Copy link

@Reiko69420 Reiko69420 commented May 8, 2024

Description

[FEATURE] - Added "Blacklist Folder/File" in Settings, where you can specify folders and files that Devika shouldn't read for context.
In the Monaco Editor you can also easily block the context of files/folder automaticly with a button.
This prevents situations where it reads everything in the projects folder (Even dependencies) and ends up exceeding gigantic tokens usage in some case.

[FEATURE] - Added support for GPT4FREE, with a lot of models

[FEATURE] - Automatic Installer and launcher for Windows "start.cmd" that install bun, uv and python if not already installed, create the environnement, install requirements with uv and then start UI and server

[FEATURE] - A text will appear if config canot be loaded in UI

[FEATURE] - Added folders collapse and Expand in Monaco Editor for much better readability (With smooth animation!)

[BUG] - Fixed asyncio.set_event_loop_policy on some Windows machine
On some Windows machine, some API could make an infinite loop and freeze the server. Because the Event Loop Policy was set to the default, switch to "WindowsSelectorEventLoopPolicy()" when the inference is made fixed the issue

[BUG] - Fixed an issue with update_config where Python will glitch out and write random stuff in the config file because the code keeps opening, read, add value, write, close very fast... It's very random but in my use it was very frequent and because of that everytime the server just randomly broke
Now it just write the update in the self.config and THEN save_config

Resolve Issues git

#366

Test plan

Here we can see in the logs all the skipped files:
image

Before blacklist token exceed 438k+ example:
image
It was not even able to finish the task because of the tokens limit...

After blacklist, token is just fine, 2k:
image

Here's almost all the GPT4FREE models:
image

When Config can be loaded by UI:
image

When config CANNOT be loaded:
image

And Here's a video of the folders in Monaco Editor and GPT4FREE:
https://github.com/stitionai/devika/assets/34484331/32051947-ff86-43d8-a70e-5427a5bf20cb
(I have added smooooth looking animation on a new commit, so we don't see it on the video)

Reiko69420 and others added 9 commits May 6, 2024 00:51
Idk what the f*ck did i do, i somehow deleted every commit that i've done
On the Monaco Editor there is now folder that are collapsed and you can expand them!
And now you can click on the little eye in the monacoEditor to block the context of the file for the AI
Fixed an issue with update_config where Python will glitch out and write random stuff in the config file because the code keeps opening, read, add value, write, close very fast...
Now it just write the update in the self.config and THEN save_config

Made some optimization on the save func in MonacoEditor

Added some smooth animation in the folder collapse/expanding~
It seems that the line needed to be split on ":" instead of "`", because there will always be a colon when the line starts with "File: ".
@Prakashmaheshwaran
Copy link

Prakashmaheshwaran commented Jun 10, 2024

@Reiko69420 Dude such a awesome work you did here

Having some issue with free GPT-4 models
image
i belive if you extend time limit that would be enough to counter it

@Reiko69420
Copy link
Author

@Reiko69420 Dude such a awesome work you did here

Having some issue with free GPT-4 models image i belive if you extend time limit that would be enough to counter it

Thx!
You can change the Timeout settings! ^^

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.

3 participants