Skip to content

Latest commit

 

History

History
63 lines (44 loc) · 1.64 KB

README.md

File metadata and controls

63 lines (44 loc) · 1.64 KB

Terminal Groq

This repository is forked from https://github.com/tomwarias/Terminal-Groq-Chat 该贡献者提出了一种在命令行调用Groq的API展开多轮对话的prompt界面,就像这样:

>>> User: 
<<< Jarvis: 

运行Terminal-Groq-Chat的代码需要在其项目目录下使用python3 groq.py命令,而无法随时随地使用tgroq运行,也不能像这样tgroq "My Question is..."

However, 我做了以下改进:

  1. rename groq.pytgroq 以避免import groq和自身文件名的冲突
  2. 修改代码使得可以直接将问题作为参数以运行tgroq "My Question is..."
  3. 编辑了init.sh并添加到环境变量以随时随地调用tgroq呼出
  4. 保留了多轮对话机制。当无参调用tgroq时,开始多轮对话,当使用tgroq "My Question is..."时,直接将回答输出到终端

Installation Steps

  1. Clone the Repository

    git clone https://github.com/AWSzyAI/tgroq.git
    cd tgroq
  2. Install Dependencies

    Set API key, you can found it here https://console.groq.com/keys:

    export GROQ_API_KEY=<your_api> 
  3. Install Dependencies Install pip:

    python3 get-pip.py

    Install the necessary Python packages by running:

    pip install groq asyncio
  4. Add tgroq to PATH

    chmod +x init.sh
    sudo ./init.sh /usr/local/bin/

/usr/local/bin/ can also be changed by any PATH you want to add.

  1. Run the Application

    Start the code with:

    tgroq
    tgroq "Your question"