MervinPraison / PraisonAI

PraisonAI application combines AutoGen and CrewAI or similar frameworks into a low-code solution for building and managing multi-agent LLM systems, focusing on simplicity, customisation, and efficient human-agent collaboration.
https://docs.praison.ai
MIT License
1.24k stars 188 forks source link

Feature: Piped command #17

Open AndresRojoInteracso opened 3 months ago

AndresRojoInteracso commented 3 months ago

I found useful to use this with praisonAI to pipe inputs the same way as the fabric project even been compatibles

I call this file pAI

#/bin/zsh
export OPENAI_MODEL_NAME="mixtral-8x7b-32768"
export OPENAI_API_KEY="gsk_****"
export OPENAI_API_BASE="https://api.groq.com/openai/v1" #OR the endpoint you want to use

concatenated_lines=$(cat)
praisonAI_exec=$(which praisonai)

# Check if concatenated_lines is not empty
if [[ -n "$concatenated_lines" ]]; then
    $praisonAI_exec "$@" "$concatenated_lines"
else
    $praisonAI_exec "$@"
fi

Examples:

cat file_with_messy_notes.txt | pAI -auto 'Write a well-crafted essay with the input notes and review the essay to ensure coherence and fact-checking. INPUT: '