aandrew-me / tgpt

AI Chatbots in terminal without needing API keys
GNU General Public License v3.0
2.04k stars 171 forks source link

Command Fails with Piped Input and Arguments #300

Closed patrickkdev closed 1 month ago

patrickkdev commented 1 month ago

When piping input into the tgpt command and providing arguments (e.g., --provider duckduckgo and --model gpt-4o-mini), it returns "You need to write something." This issue only occurs when the input is piped. The command works without issues when no arguments are provided, or when input is not piped.

Steps to Reproduce:

Run cat file.txt | tgpt – this works as expected. Run cat file.txt | tgpt --provider duckduckgo --model 'gpt-4o-mini' – returns "You need to write something." Expected Behavior: The command should process the piped input along with the specified arguments.

Actual Behavior: The command returns "You need to write something" when piped input is used with arguments.

Screenshot: Screenshot From 2024-10-01 20-28-10

aandrew-me commented 1 month ago

It is intended behavior. Infact I will modify so that it requires arguments when no provider is provided

SinaiOnline commented 1 month ago

So I can't pipe input when using other providers?

aandrew-me commented 1 month ago

You can, you just have to add some text

cat foo.txt | tgpt —provider duckduckgo "Analyze the content"
patrickkdev commented 1 month ago

Makes sense. Thank you