[Question]: How do I use the cli with a pattern and a custom user prompt on a given input?
What is your question?
How do I use the cli with an inline user prompt, on a given input and pattern? example in ollama: pbpaste | ollama run llama3 "what is this data indicating?" .
Something like pbpaste | fabric -sp ai "what is this data indicating?"
Very interesting question that I was about to ask! I tried a bit with echo and -t but unsuccessfully.
Once you copy your custom pattern to the patterns directory, you should just be able to call it. Your example looks iike you are pasting the contents of your clipboard using pbpaste and also putting in another prompt in the quotes, and starting Ollama at the same time. If you already have Ollama running locally you don't need to run that command.
I use pbpaste | fabric -sp my-custom-command
I think his question and mine is about giving a user prompt to a model through a pattern, after feeding it with a text.
Copied text -> question about the text -> pattern -> model
But maybe that's just not something Fabric is designed for.
That's right. Of the 3 parts in a prompt: context, system prompt and user prompt, fabric seems to cover context and system prompt, but not user prompt. Still really love using it
An example of what I'd like to do:
echo "Write a plausible conversation between Socrates and Omar Khayam" | fabric --agents | echo "translate the input to French" -sp ai
Instead, I made a custom pattern for translation and tried this:
echo "Write a plausible conversation between Socrates and Omar Khayam" | fabric --agents | fabric -p translate_fr
It worked. But for anything like single use, it would be nice to have user input.
As a workaround you can use a session to ask further questions like:
pbpaste | ai --session tmp; echo "what is this data indicating" | ai --session tmp; fabric --clearsession tmp