-
Notifications
You must be signed in to change notification settings - Fork 2
Home
Welcome to the Terminal-Agent-X wiki! 👻
此功能适合较短的代码,例如在 Linux 环境中执行bash指令。
$ tax Count the number of *.py files in the current directory and subfolder
find . -name "*.py" | wc -l
Do you want to execute the command? (y/n) y
3
目前仅支持 WSL
和 Linux
上使用中文提问。
$ tax 现在有多个形如 ViT-coco-64-0.2-0.5-0.15-1682613197.log 的文件,使用bash打印出每个文件的最后一行和对应的文件名
for file in ViT-coco-64-0.2-0.5-*-*.log; do echo "$(tail -1 $file) - $file"; done
Do you want to execute the command? (y/n) y
[ 70] C: 1.7311, S: 0.0114, R: 0.0407, mAP: 0.9368, MAX mAP: 0.9374 - ViT-coco-64-0.2-0.5-0.0-1682593391.log
[ 70] C: 1.6659, S: 0.0114, R: 0.0405, mAP: 0.9351, MAX mAP: 0.9357 - ViT-coco-64-0.2-0.5-0.05-1682599979.log
[ 70] C: 1.7584, S: 0.0126, R: 0.0413, mAP: 0.9343, MAX mAP: 0.9353 - ViT-coco-64-0.2-0.5-0.1-1682606584.log
[ 70] C: 1.7151, S: 0.0111, R: 0.0411, mAP: 0.9332, MAX mAP: 0.9336 - ViT-coco-64-0.2-0.5-0.15-1682613197.log
[ 70] C: 1.7275, S: 0.0126, R: 0.0404, mAP: 0.9352, MAX mAP: 0.9356 - ViT-coco-64-0.2-0.5-0.2-1682619814.log
[ 70] C: 1.6624, S: 0.0123, R: 0.0402, mAP: 0.9330, MAX mAP: 0.9337 - ViT-coco-64-0.2-0.5-0.25-1682626378.log
[ 70] C: 1.7599, S: 0.0136, R: 0.0407, mAP: 0.9345, MAX mAP: 0.9350 - ViT-coco-64-0.2-0.5-0.3-1682632953.log
$ tax write a python code for fibonacci
def fibonacci(n):
if n <= 1:
return n
else:
return(fibonacci(n-1) + fibonacci(n-2))
num_terms = int(input("Enter the number of terms: "))
if num_terms <= 0:
print("Please enter a positive integer!")
else:
print("Fibonacci sequence:")
for i in range(num_terms):
print(fibonacci(i))
$ tax 用Pytorch写一个情感分类的代码
Too Long; Don't Read. 可以查看 https://paste.ubuntu.com/p/TzV5RMZ8xN/
对于一些需要多步操作的功能,可以使用以下命令输出完整的markdown操作引导。
$ tax how to install docker on ubuntu --file docker-manual.md
$ head docker-manual.md
1. Update the apt package index
```console
sudo apt-get update
```
2. Install prerequisites which allow apt to use a repository over HTTPS
```console
sudo apt-get install apt-transport-https ca-certificates curl gnupg lsb-release
这个过程等同于向 GPT-3.5-turbo
发送单次询问请求。
$ tax write a python code for fibonacci --openai_key sk-xxx
不需要。我搭建了反代理服务 https://api.lyulumos.space/,可以不开代理访问,但是相较于直接访问 OpenAI API,速度会慢一些。
暂时不使用官方api,因为从亚洲地区使用官方api可能会导致封号。考虑到部分使用者难以具体指定使用某地的代理,因此统一请求到自建代理服务。后续版本会开放选项。
这是因为 tax 没有添加到环境变量中,通过 whereis tax
查看 tax 的安装位置,然后 export PATH=$PATH:<tax的路径>
将其添加到环境变量中即可。
目前经过测试大概需要10s左右,较长的代码可能需要更多的时间,同时也受网络影响,原因如问题1所示。在 GitHub CodeSpaces
的测试速度大概为4s左右。请耐心等待。
可以在Linux/WSL环境下使用中文,当前版本 0.1.0
在Windows下由于编码原因不支持中文。
[OpenAI_KEY] 出现错误:Error: OpenAI key not found. Please specify it in system environment variables or pass it as an argument.
首先你需要注册一个OpenAI账号,并在这里获取你的OpenAI_KEY
。每次调用OpenAI API需要根据 token
数量支付一定费用,一般每个账号有预设的 credit
,个人使用很长时间。
然后你需要将 OpenAI_KEY
添加到环境变量中,Windows系统可以请参考这里,Linux用户可以参见 README.md 中的配置部分。
请检查你的 OpenAI_KEY
是否正确,包括账户是否有余额。
目前Windows系统仅支持 cmd
和 WSL
。'Powershell' 提供了一个测试版本但是有待完善。
Windows Powershell 中的 curl
本质上是 Invoke-WebRequest
的 alias,功能非常有限,初始版本还没有提供对应支持。早于 Windows 10
的系统不自带 curl
,需要下载 curl on Windows
才能使用。
我在之前的版本中实现了 Python-requests
的版本,但是需要等待约45s才能返回结果,出于速度考虑,目前仍选择使用 curl
发送请求。
多试几次,会有不同的结果。