deedy5 / duckduckgo_search

Search for words, documents, images, videos, news, maps and text translation using the DuckDuckGo.com search engine. Downloading files and images to a local hard drive.
MIT License
927 stars 117 forks source link

Chat interface updates - new flags for multi-line input, model choice selection, updated paragraph wrapping for output and option flag to disable, and minor bugfixes #230

Closed PeteHemery closed 1 week ago

PeteHemery commented 2 weeks ago

Following on the inspiration to share back to the community from PR 227, I offer these improvements. The commit messages should have most of the info there. I did modify/comment out this line text = resp_answer #click.wrap_text(resp_answer, width=78, preserve_paragraphs=True) since the formatted text returned does look right when it prints mardown code.

Let me know what you think.

PeteHemery commented 2 weeks ago

Ah, also added a mini timeout feature, for when requests occasionally go bad. Probably should change the commit message to reflect that. Will wait for feedback

PeteHemery commented 2 weeks ago

split commits up into manageable chunks. hope some are good for cherry picking

PeteHemery commented 2 weeks ago

always with the "just one more thing" with git ;) played with this a lot today.

FYI, my usage style with these changes is:

$ ddgs chat -m1 -M -w <<< "replace these three words with emojis
python
coding
updates"
DuckDuckGo AI chat.
Using model: gpt-3.5
You typed:
replace these three words with emojis
python
coding
updates
Waiting for response
AI:
Sure! Here are the emojis for the words you provided:
🐍
💻
🔄

I've also been making some improvements to the save chat functionality too. being able to name saved chats as you start them, and allowing branches with reworking from a certain point. need to save the chat_vdqs along the way. open for a discussion, if it'd be of any interest?

deedy5 commented 1 week ago

The code is overcomplicated.