When interacting with AI models like gemini-pro there are times when you need to add additional context to to support specific prompts based on data of which the model is not aware. This often includes coping and pasting content into the AI chatbot terminal (e.g. bard). This terminal app allows for easier interaction with external data using prompts that add either local files (e.g. FILE:path
) or external resources (e.g. URL:url
).
The above content prompts must in upper case and at the be at the at beginning of user input.
You can install aictl
CLI using one of the following ways:
See the release section for
aictl
checksums and SBOMs.
You can also download the latest release version of aictl
for your operating system/architecture from here. Put the binary somewhere in your $PATH, and make sure it has that executable bit.
The official
aictl
releases include SBOMs
If you have Go 1.17 or newer, you can install latest aictl
using:
go install github.com/mchmarny/aictl@latest
Create API key: https://makersuite.google.com/app/apikey
Either export the API_KEY
environment variable, or pass the key as a flag (see below).
export API_KEY="your-key-goes-here"
To start the AI chat using default values:
aictl
If you haven't defined the API_KEY
environment variable, you will have to pass it as a flag:
aictl --api-key your-key-goes-here
Additional parameters that can be passed as flags. More details available here:
temperature
(float0.0
to1.0
, default:0.9
) the lower the number the more predictable the answers, higher numbers result in more creative responses.tokens
(int1
to2048
, default:100
) the maximum number of output tokens that will be returned from each prompt.top-p
(float0.0
to1.0
, default:0.9
) combined withtemperature
changes how the model selects tokens for output. Lower value results in less random responses.top-k
(int, default:40
) combined withtemperature
changes how the model selects tokens for output. Lower value results in less random responses.
You can add your own context into the chat by inserting file content using FILE:
or remote content using URL:
references. For example, at the chat prompt:
FILE:content/monthly-gas-price.csv
The chat will ask you first for description of the file to understand its content:
chat: Describe content of content/annual-us-gdp.csv:
you: Annual US Gross Domestic Productivity
So then in chat you can combine that data with the content chat already knows:
chat: How can I help?
you: What was the average gas price in US between 2010 and 2015?
chat: The average gas price in the US between 2010 and 2015 was $3.618 per gallon.
This is my personal project and it does not represent my employer. While I do my best to ensure that everything works, I take no responsibility for issues caused by this code.