reorx / ai.py Goto Github PK
View Code? Open in Web Editor NEWA single-file Python script that interacts with ChatGPT API in the command-line.
License: MIT License
A single-file Python script that interacts with ChatGPT API in the command-line.
License: MIT License
Issue:
Mär 27 14:59:06 eve python3[120317]: detected unhandled Python exception in '/usr/local/sbin/ai.py'
Mär 27 14:59:06 eve abrt-server[120321]: Executable '/usr/local/sbin/ai.py' doesn't belong to any package and ProcessUnpackaged is set to 'no'
Mär 27 14:59:06 eve abrt-server[120321]: 'post-create' on '/var/spool/abrt/Python3-2023-03-27-14:59:06-120317' exited with 1
Mär 27 14:59:06 eve.resellerdesktop.de abrt-server[120321]: Deleting problem directory '/var/spool/abrt/Python3-2023-03-27-14:59:06-120317'
as soon as i deleted the history file, it worked again.
I suggest to limit it to the last 10 entries.
大佬,请问我用py ai.py -v可以看到verbose模式,可是如果用ai -v或ai.py -v的话就会直接进入REPL循环,而没有详细信息,换其他参数也一样,似乎参数传递不进去,请问这是为什么呀
Issue:
Mär 27 14:59:06 eve python3[120317]: detected unhandled Python exception in '/usr/local/sbin/ai.py'
Mär 27 14:59:06 eve abrt-server[120321]: Executable '/usr/local/sbin/ai.py' doesn't belong to any package and ProcessUnpackaged is set to 'no'
Mär 27 14:59:06 eve abrt-server[120321]: 'post-create' on '/var/spool/abrt/Python3-2023-03-27-14:59:06-120317' exited with 1
Mär 27 14:59:06 eve.resellerdesktop.de abrt-server[120321]: Deleting problem directory '/var/spool/abrt/Python3-2023-03-27-14:59:06-120317'
as soon as i deleted the history file, it worked again.
I suggest to limit it to the last 10 entries.
having the homedir full of hidden directories and files, everyone should place theire files to the correct directories according to the FreeDesktop doctrine (!=Windows ofcourse) .
In this case, it would be $HOME/.config/
OR accept an ENV variable with the API key and do not require a single-line-configfile ;)
"none-interactive conversation mode" I guess you can imagine what i mean, for everyone else reading it:
"-c" enabled conversation mode, where all previous communication is send as history, so chat.ai can understand the context of a rephrased sentence. This only works in interactive mode inside ai.py.
here is the request:
if a "Prompt" and option "-c" are given together, accept a "history"-file ( in the 90s we called it a brainfile ) as a third argument and send it with the prompt to the API. For better parsing I suggest an ordered JSON String-Array [ sortorder: oldest first ].
This would allow external code to get better results via ai.py .
Pls Add a license or grant an explicit usage right, so your script can get included into AND distributed by this:
https://github.com/Cyborgscode/Personal-Voice-Assistent
BTW: it's working, but the overall usecase is limited due to jibbrish inspired, imagined textrecognition from the STS system ;) But it's FUN all night long :)
STS + an AI Bot is the best use-case of mocking about defective technology in progress .. like in the Big Bang Theory ;)
Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.