This content originally appeared on DEV Community and was authored by fadingNA
I have an opportunity to contribute to a classmate’s project. He has developed a chat completion program that provides two services. The first service is GROQ, and the second is Gemini from Google.
To explain, both have significant differences. Google only provides Gemini and its models. On the other hand, GROQ offers various models to choose from, such as Llama3, Gemma, and others.
My task for this week is to add a new feature to my classmate’s project, which involves capturing the .toml file in the user’s home directory during program initialization. At a glance, his project has a well-structured approach to using a config file. By running gr-ai -c, it creates a config file in the user’s home directory, but it is a generic config file and not a .toml file. Therefore, we need to adapt some logic to use a TOML parser to recognize the TOML syntax, extract the environment variables, and use them in the chat completion feature.
Pull Request & Issue
Issue 31 TOML Configuration #34
succeed capture TOML config from user root directory
adding normalize the case of config
fadingNA committed 24 minutes ago
@peterdanwan review these change and I will proceed to run application without providing argument if .toml configuration exist.
New Feature: Support using a TOML "dotfile" config file in the user's homedir #33
- Users want to be able to specify all of their options to your tool in a TOML formatted configuration file
Then, when the user runs your tool, it will search for a config file in the home dir and use those values. Or, if the user specifies values via args, those will override the default ones in the config.
Certainly! Based on your writing style, here’s a conclusion:
In conclusion, my task this week involves enhancing my classmate's chat completion project by incorporating TOML configuration file parsing. Unlike the existing generic config file setup, this addition will allow the program to read .toml
files from the user's home directory, making configuration more flexible and streamlined. By leveraging a TOML parser, we can extract environment variables more effectively and integrate them directly into the chat completion functionality, supporting the use of both GROQ and Google's Gemini models.
This content originally appeared on DEV Community and was authored by fadingNA
fadingNA | Sciencx (2024-10-03T23:25:45+00:00) New Feature PR. Retrieved from https://www.scien.cx/2024/10/03/new-feature-pr/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.