Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
S

smalltalk

> 编程语言
Open source

A tinystruct-based chat module which integrated with @OpenAI GPT-4 / 3.5-turbo / ChatGPT. @tinystruct

356 stars0 likes0 views
WebsiteGitHub

About

A tinystruct-based chat module which integrated with @OpenAI GPT-4 / 3.5-turbo / ChatGPT. @tinystruct

smalltalk

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 used to use git, then you should execute the following command to instead of above steps:
bash
git clone https://github.com/tinystruct/smalltalk.git 
  1. You will need to follow this tutorial to install the Java Development Kit (JDK 11+) on your computer first. If you choose to download and install it manually, please check it in this OpenJDK Archive. And Java development environment such as Eclipse or IntelliJ IDEA is just better to have, not required.

If your current envirionment is using JDK 8, you can execute the below command to upgrade it quickly.

bin/openjdk-upgrade
  1. Import the extracted / cloned project into your Java development environment.
  2. Go to src/main/resources/application.properties file and update the openai.api_key with your own key or set the environment variable OPENAI_API_KEY with your own key.
  3. Here is the last step for installation:
tcsh
./mvnw compile

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:
tcsh
bin/dispatcher --version

To see the available commands, run the following command:

tcsh
bin/dispatcher --help

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

tcsh
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:

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

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

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

tcsh
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:
tcsh
docker run -d -p 777:777 -e "OPENAI_API_KEY=[YOUR-OPENAI-API-KEY]" -e "STABILITY_API_KEY=[YOUR-STABILITY-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.

Database Schema (SQLite)

The system uses SQLite for storage with the following schema:

…

Integration with Smalltalk

The document QA functionality is integrated in the Smalltalk application:

  • When a user uploads a document, it's automatically processed
  • When a user asks a question, the system searches for relevant document fragments
  • Retrieved fragments are included in the system prompt to provide context for the AI's response
  • The AI can reference the specific document when answering questions

Usage

Document Upload

Documents can be uploaded through the Smalltalk interface. Supported file types include:

  • Plain text files (text/plain)
  • Markdown files (text/markdown)
  • PDF documents (application/pdf)
  • Word documents (docx, doc)
  • Excel spreadsheets (xlsx, xls)
  • PowerPoint presentations (pptx, ppt)
  • Other text-based files (text/*)

Asking Questions

Simply ask questions in the chat interface. The system will automatically:

  1. Convert your question to an embedding
  2. Find the most relevant document fragments
  3. Include those fragments in the context sent to the AI
  4. Return an answer that incorporates information from your documents

Testing

The system includes several test classes to verify functionality:

  • DocumentEmbedding.main() - Tests embedding storage and retrieval
  • DocumentQATest - Tests the end-to-end document QA functionality
  • DocumentProcessor.main() - Tests document processing and fragmentation

Run the tests using the provided batch file:

runtest.bat

This script will:

  1. Initialize the SQLite database if needed
  2. Run all test classes
  3. Test document processing for various file formats

Dependencies

The system relies on the following key libraries:

  • SQLite - For database storage
  • Apache Tika (3.1.0) - For extracting text from various document formats
  • OpenAI API - For generating embeddings
  • tinystruct - For application framework and database access

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.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Javachat-applicationchatbotchatgptdeepseek

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言