-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question]: How do I chain/combine outputs before passing them on to the next step? #1226
Comments
Hi Michael! I played around with your idea and was able to do the following (multi-step in the terminal): Step 1: Define the initial prompt: initial_prompt="Extract the whole knowledge of the video. Especially the seven deadly sins and how to avoid them. I want to keep that knowledge easily understandable and retrievable in my Obsidian vault. For each Sin, come up with an example. Properly format the output." Step 2: Pipe the initial prompt to the 'improve_prompt' pattern and save the output: improved_prompt=$(echo "$initial_prompt" | improve_prompt) Step 3: Extract the YouTube transcript and save it into a variable: video_transcript=$(yt "https://www.youtube.com/watch?v=q1qKv5TBaOA&ab_channel=Coderized") Step 4: Concatenate the improved prompt with the video transcript: combined_text="$improved_prompt Step 5: Pipe the combined text into the summarization pattern: echo "$combined_text" | summarize "How principled coders outperform the competition" It is not a long piped instruction but 5 separate instructions that work quite well! |
I'm not sure if this is what you're trying to do but here's how I would try this: ❯ echo "Extract the whole knowldege of the video. Especially the seven deadly sins and how to avoid them. I want to keep that knowledge easily understandable and retrievable in my Obisidian vault. For each Sin, come up with an example. Properly format the output." | improve_prompt -o improved_prompt.txt && echo "$(cat improved_prompt.txt && yt https://www.youtube.com/watch\?v\=q1qKv5TBaOA\&ab_channel\=Coderized)" | summarize >> ~/path/to/vault/"How principled coders outperform the competition.md" I hope this helps |
Thank you two for your answers and your inspirations, in the end I came up with this solution, and it should be useable for all kinds of similar problems: Translated to my problem: |
What is your question?
First, thank you for this great project. I wanted to try it out for a long time and finally could do so, and I love it.
However, I hit a small roadblock. I wanted to adapt the output of one of the patterns a bit before passing it on to my Obsidian vault. Concretly, this is what I want to do:
Currently, my attempts look like this:
echo "Extract the whole knowldege of the video. Especially the seven deadly sins and how to avoid them. I want to keep that knowledge easily understandable and retrievable in my Obisidian vault. For each Sin, come up with an example. Properly format the output." | improve_prompt | yt https://www.youtube.com/watch\?v\=q1qKv5TBaOA\&ab_channel\=Coderized | summarize | save " How principled coders outperform the competition"
If I understood the tool correctly, I lose my initial and improved prompt between
improve_prompt | yt https://www.youtube.com/watch\?v\=q1qKv5TBaOA\&ab_channel\=Coderized
because I then pass on the transcript without my improved prompt.In essence: How can I adjust the patterns using custom instructions on the fly without having to add custom prompts?
Thank you very much for your time and help with this.
The text was updated successfully, but these errors were encountered: