beyondhyx / smalltalk

A tinystruct-based chat module which integrated with @OpenAI ChatGPT. @tinystruct

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

smalltalk

Build Status

smalltalk is a tinystruct-based project that provides instant messaging functionality, It allows users to send text and share images, documents, and other content. also It allows you to interact with ChatGPT which is a language model developed by OpenAI, through a command-line interface (CLI) or a web interface.

Installation

  1. Download the project from GitHub by clicking the "Clone or download" button, then selecting "Download ZIP".
  2. Extract the downloaded ZIP file to your local machine.
  3. If you are using git clone, then you should execute the following command:
git clone https://github.com/tinystruct/smalltalk.git 
  1. You will need a Java Development Kit (JDK) installed on your computer, as well as a Java development environment such as Eclipse or IntelliJ IDEA.
  2. Import the extracted / cloned project into your Java development environment.
  3. Go to src/main/resources/application.properties file and update the chatGPT.api_key with your own key or set the environment variable CHATGPT_API_KEY with your own key.

Usage

You can run smalltalk in different ways:

CLI mode

  1. Open a terminal and navigate to the project's root directory.
  2. To execute it in CLI mode, run the following command:
./mvnw compile
bin/dispatcher --version

To see the available commands, run the following command:

bin/dispatcher --help

To interact with ChatGPT, use the say command, for example:

bin/dispatcher chat

Web mode
  1. Run the project in a servlet container or in a HTTP server:
  2. To run it in a servlet container, you need to compile the project first:
./mvnw compile

then you can run it on tomcat server by running the following command:

sudo bin/dispatcher start --import org.tinystruct.system.TomcatServer --server-port 777

or run it on netty http server by running the following command:

sudo bin/dispatcher start --import org.tinystruct.system.NettyHttpServer --server-port 777
  1. To run it in a Docker container, you can use the command below:
docker run -d -p 777:777 -e "CHATGPT_API_KEY=[YOUR-CHATGPT-API-KEY]" m0ver/smalltalk
  1. Access the application by navigating to http://localhost:777/?q=talk in your web browser
  2. If you want to talk with ChatGPT, please type @ChatGPT in your topic of the conversation when you set up the topic.

Demonstration

A demonstration for the comet technology, without any websocket and support any web browser:

https://tinystruct.herokuapp.com/?q=talk

Troubleshooting

  • If you encounter any problems during the installation or usage of the project, please check the project's documentation or build files for information about how to set up and run the project.
  • If you still have problems, please open an issue on GitHub or contact the project maintainers for help.

Contribution

We welcome contributions to the smalltalk project. If you are interested in contributing, please read the CONTRIBUTING.md file for more information about the project's development process and coding standards.

Acknowledgements

smalltalk uses the OpenAI API to interact with the ChatGPT language model. We would like to thank OpenAI for providing this powerful tool to the community.

License

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

A tinystruct-based chat module which integrated with @OpenAI ChatGPT. @tinystruct


Languages

Language:Java 88.9%Language:Batchfile 4.1%Language:CSS 3.4%Language:Shell 2.6%Language:Dockerfile 0.8%Language:Procfile 0.3%