Inspiration
My passion for command-line interfaces and the allure of interacting with a Large Language Model (LLM) via the Linux CLI ignited the inspiration for this project. I envisioned a tool that would empower users to harness the transformative capabilities of AI from the comfort of their terminal.
What it Does
This code project materializes that vision, providing a comprehensive toolkit for AI functionality. Its core component, the Google AI LLM API wrapper, enables seamless interaction with Gemini, Bison, and Vision, Google's suite of AI models. Safety measures are meticulously configured, ensuring that harmful content is effectively filtered.
Complementing the wrapper is a user-friendly command-line interface (CLI) that simplifies the AI interaction process. Key features include:
- Single-prompt querying
- Chat-mode conversations
- Contextual enhancement through web search integration
- AI-powered web search result summarization
- Conversation storage in various formats, including plain text, Joplin notes, and a database
How We Built It
Nushell, with its robust scripting capabilities, served as the foundation for this project. By leveraging the Gemini REST API and Nushell's HTTP commands, I meticulously crafted the post request format to facilitate seamless communication with the AI models.
Challenges We Ran Into
The development journey was not without its obstacles. Formulating the correct post request format required careful adaptation of curl examples to Nushell's HTTP capabilities. Integrating web search presented another challenge, demanding a strategic approach to enhance prompts while mitigating token limits.
Accomplishments We're Proud Of
Overcoming these challenges and implementing the project's diverse functionality were significant milestones. The ability to store conversations in various formats, harness pre-defined system messages and pre-prompts, and integrate web search for prompt enrichment were particularly rewarding achievements.
What We Learned
This project enriched my knowledge of REST API interaction through both the command line and Nushell's scripting language. I gained valuable insights into formulating effective post requests and navigating the complexities of AI integration.
What's Next
The future holds exciting possibilities for this project. I envision expanding its capabilities by developing more specialized tools that leverage the Gemini API. The potential applications are vast, ranging from automated content creation to AI-assisted research and analysis.
Built With
- nushell-scripting
- rest-api