對於想要透過終端存取 Open Assistant 的 API 或想要在自己的應用程式中使用 API 的終端愛好者來說,這只是一個簡單的 cli!
類別「 data-animated-image="" style="max-width: 100%;">
該程式易於擴展並遵循 UNIX 理念。由於它是用 Python 編寫的,因此可以獨立於平台使用!您可以輕鬆地將其包含在 Python 或 bash 腳本中。例如,您可以將其輸出透過管道傳輸到另一個程序,或使用 bash 腳本將其輸出寫入檔案。
classis "Who is Marcus Aurelius?" | cat
而且,您不必依賴瀏覽器來存取 Open Assistant 的 API,只需使用簡單的命令列提示符即可,真是太舒適了!
它非常容易使用。只需在classis寫下您的提示並用引號括起來,您就可以開始了。
classis "What is a terminal?"
它將輸出:
A terminal is a computer program that allows users to interact with a computer system and perform various tasks. It is typically used to access a computer system over a network, such as the internet, and to execute commands and programs.
非常容易使用,不是嗎?
如果您想發出多個提示,只需在提示後寫上 -chat 即可與 API 聊天。
classis "What is a terminal?" -chat
要停止聊天,請寫入:
exit
在基於 arch 的發行版下使用 install.sh 腳本時, classis通常應該開箱即用地安裝。然而,如果您的電腦上未安裝 Python、venv(僅在基於 arch 的發行版上)和 pip,安裝程式可能會遇到麻煩。通常應由安裝腳本安裝的其他依賴項/Python 模組有:
克隆存儲庫。
git clone https://github.com/ginschel/classis.git
對於基於 arch 的發行版:
cd classis && sh install.sh
對於基於 Debian 的發行版(Ubuntu、Linux Mint 等):
cd classis && sh debian_install.sh
您將需要一個 API 令牌來運行此程序,從此處獲取免費的 HuggingFace API 令牌
現在使用 -c 子命令執行classis並輸入您的標記作為參數。
classis -c yourapitoken
恭喜你的機器上已經設定了classis !
如果您想使用其他模型,請變更現在位於 ~/local/bin/ classis -files 中的 python 腳本中 #config 部分中的 modelname 變量