Closed ManveerBhullar closed 1 year ago
How about using -p flag? Put the prompt in a file and just do
gish -i 10LinePoem.txt -p summarize.txt
Seems like an unneccesary step to first save a prompt to a file then feed it in, especially when that prompt is changing often. Its also created files on the filesystem for something that should be ephemeral. For added context, a typical use case could be like the following.
gish -i 10LinesOfPoem.txt "Rewrite this in the style of shakespeare"
gish -i 10LinesOfPoem.txt "Rewrite this in the style of Lord Byron"
I use this currently as a work around https://gist.github.com/ManveerBhullar/4abc087fc361ee5c0b7375174a9132fb , but i havent bothered trying to make it so it works with more flags, so its not a complete solution.
Try this
gish -p 10LinesOfPoem.txt "Rewrite this in the style of shakespeare"
I realize it's a bit confusing, prompt <--> instructions, but it works :-).
Having said that, I do think I need to go back and look at the way different flags interact with each other. It might make sense to have multiple -i or combine -i with a text prompt. Though, personally, for complex cases, I just have a "input" file, and in there I can just "#import" as many files as I want and change the text in the file and then just run
gish -i input
gish -p 10LinesOfPoem.txt "Rewrite this in the style of shakespeare"
This is great. Thanks, I can remove that ugly function from my .bashrc now :)
Have you thought about combining -i
and -p
, and support arbitrary number of file or string inputs?
ie
gish -p file1 file2 file3 "tell me about these files" "in a rhyming poem"
It does seem like -i and -p should coexist as well as just args on the command line like ...
gish -p file1 -i files tell me about these files
Having said that I asked gish and it provided this simple solution :-).
{ echo "tell me about these files" "in a rhyming poem"; cat package.json; } | gish
and it responded
In this file there's lots to see,
From "main" to "license" and "type" to "exports" you see.
The "scripts" section includes "start" and "test",
And "dev" and "prd" are among the rest.
There's "devDependencies" and "dependencies" too,
With "esbuild" and "playwright" joining the crew.
And "pkg" stands out with its targets and options,
Making sure the file runs on different versions.
The "bin" section makes "gish" the star,
With "dist/index.js" as its shining arm.
...
I'd better stop now. It's too much fun.
gish "Return the first 5 lines only, nothing else' -i 10LinePoem.txt
orgish -i 10LinePoem.txt "Return the first 5 lines only , nothing else"
It would be dope if a functionality like this could be implemented. Would be helpful to string with -s to summarize notes, manipulate documents, etc.