Skip to content

Commit

Permalink
Package-as-docker (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
iandebeer authored Nov 7, 2023
1 parent 04b4d4a commit 5295ce8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,33 @@
# D@wn Patrol

![dawn-patrol](src/resources/DawnPatrolLogo.png)

DawnPatrol provides a chatbot interface to messaging services such as Signal, Slack, WhatsApp and Telegram.
It utilizes LLM's such as ChatGPT to provide a conversational capability to support a large variety of client inputs
Special messages:

- Admin messages: @admin|add <name> <mobilenumber>- allows administrators to add new users to ecosystem
- Admin messages: `@admin|add <name> <mobilenumber>` allows administrators to add new users to ecosystem
This will be replaced by uploading .vcf file

- Location data: Upload a Google Maps format pin.

## Prerequisites

Two API-keys are required to bet set as environment variables in order to run the AI logic that's built into DawnPatrol:

- `HF_API_KEY` = a free key obtained from Hugging Face
- `OPENAI_TOKEN` = an OpenAI token for the charged API calls

Additionally, this project uses [scala-cli](https://scala-cli.virtuslab.org/docs/overview/) as build tool.
Additionally, this project uses [scala-cli](https://scala-cli.virtuslab.org/docs/overview/) as build tool.

Installing scala-cli on Linux:

```bash
curl -sSLf https://scala-cli.virtuslab.org/get | sh
```

or on Mac:

```bash
brew install Virtuslab/scala-cli/scala-cli
```
Expand All @@ -37,3 +41,9 @@ scala-cli run .
Once running, the application will poll the Signal API, obtaining messages for the configured phone number (`signal-conf.signal-phone` in [application.conf](src/resources/application.conf)), and responding accordingly.

The messaging logic is defined in [DawnPatrol](src/xyz/didx/DawnPatrol.scala) and [ConversationPollingHandler](src/xyz/didx/ConversationPollingHandler.scala)

To create a docker container for DawnPatrol use:

```bash
scala-cli --power package --native --docker . --docker-from ghcr.io/graalvm/jdk-community:21 --docker-image-repository dawn-patrol
```
1 change: 1 addition & 0 deletions project.scala
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@

//> using dep ch.qos.logback:logback-classic:1.4.11
//> using dep org.apache.logging.log4j:log4j-core:2.21.1
//> using dep org.typelevel::log4cats-slf4j:2.6.0

0 comments on commit 5295ce8

Please sign in to comment.