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

Function request: Adding config files for API keys & model selected by users #75

Closed
h114mx001 opened this issue Jan 21, 2025 · 5 comments · Fixed by #78
Closed

Function request: Adding config files for API keys & model selected by users #75

h114mx001 opened this issue Jan 21, 2025 · 5 comments · Fixed by #78

Comments

@h114mx001
Copy link
Contributor

Hi, I am using DAILA and having good time with it. But there is a small thing I don't like is that I have to setup manually the APIs & GPT model manually (which requires a few clicks but I am lazy 🤦)

Is there plan to put config files within:

  • Either global for every new sessions,
  • Or, by project/idb/bndb/angr db/etc. files?

I suggest that we can have a JSON/YAML file that stores model, API key, and prompt style by my choice (via current dialog is fine). This will be loaded in new sessions. Storing the config file in the same folder with the database file is fine and easier to implement, as sometimes the installation folder of tools requires privilege to write.

Please give me have some suggestions on this and I am open to create this new feature 👍

@mahaloz
Copy link
Owner

mahaloz commented Jan 21, 2025

@h114mx001 I'd love that as well, it is annoying! I don't know why I never did it, since it should be fast.

You can make a new DAILAConfig class by subclassing this libbs class:
https://github.com/binsync/libbs/blob/5da003d7b98d7ee113259e3211563b130d337d7c/libbs/configuration.py#L93

In the DAILA implementation, simply add the two attributes:

  • model
  • api_keys (a dict of keys with the key to the dict being the model name)

On init, store the results of loading the config in a global variable:

  • CONFIG_MODEL
  • CONFIG_API_KEYS

Finally, on init of the LiteLLMAIAPI, if it is None for the model or key, use the config data:

@mahaloz
Copy link
Owner

mahaloz commented Jan 21, 2025

Lmk if you want to do it. I likely can't for about a week.

@h114mx001
Copy link
Contributor Author

Gotcha. I think I can implement this within this weekend. Will notify you if I have any questions.

@h114mx001
Copy link
Contributor Author

By the way, as we are planning to have a config file for DAILA, do you think combine several options in LLM/Settings/ into a one single dialog is better now? This could be an extendable thing as DAILA project continues to have other things go to config.

Image

@h114mx001
Copy link
Contributor Author

h114mx001 commented Jan 22, 2025

Created pull request on these changes: #76

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