对于想要通过终端访问 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 变量