Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ If you want to use Terraform and AWS see [this tutorial](RUNNING_TERRAFORM_AWS.m
docker-compose up -d
```

### Execute the timeless-api
### Execute the timeless-api
Run using OpenAI or Ollama.

#### Using OpenAPI

> [!NOTE]
> Before you start, make sure to fill the `quarkus.langchain4j.openai.api-key` and `quarkus.langchain4j.openai.gpt-4-turbo.api-key` variables in the `timeless/src/main/resources/application.properties` file.
Expand All @@ -85,6 +88,20 @@ docker-compose up -d

3. Sign in at http://localhost:8080


#### Using Ollama

1. Go to `timeless-api` directory and execute:

```shell
./mvnw quarkus:dev -Pollama -Dquarkus.profile=local
```

2. Sign up at http://localhost:8080/sign-up

3. Sign in at http://localhost:8080


### Execute the whatsapp application

> [!NOTE]
Expand Down
6 changes: 6 additions & 0 deletions docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,9 @@ services:
- POSTGRES_DB=quarkus
volumes:
- ./postgres-data:/var/lib/postgresql/data

ollama:
image: ollama/ollama:latest
container_name: ollama
ports:
- "11434:11434"
28 changes: 23 additions & 5 deletions timeless-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,6 @@
<artifactId>quarkus-quinoa</artifactId>
<version>${quarkus-quinoa.version}</version>
</dependency>
<dependency>
<groupId>io.quarkiverse.langchain4j</groupId>
<artifactId>quarkus-langchain4j-openai</artifactId>
<version>${quarkus-langchain4j-openai.version}</version>
</dependency>
<dependency>
<groupId>io.quarkiverse.amazonservices</groupId>
<artifactId>quarkus-amazon-sqs</artifactId>
Expand Down Expand Up @@ -223,5 +218,28 @@
<quarkus.native.enabled>true</quarkus.native.enabled>
</properties>
</profile>
<profile>
<id>openai</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<dependencies>
<dependency>
<groupId>io.quarkiverse.langchain4j</groupId>
<artifactId>quarkus-langchain4j-openai</artifactId>
<version>${quarkus-langchain4j-openai.version}</version>
</dependency>
</dependencies>
</profile>
<profile>
<id>ollama</id>
<dependencies>
<dependency>
<groupId>io.quarkiverse.langchain4j</groupId>
<artifactId>quarkus-langchain4j-ollama</artifactId>
<version>${quarkus-langchain4j-openai.version}</version>
</dependency>
</dependencies>
</profile>
</profiles>
</project>
10 changes: 7 additions & 3 deletions timeless-api/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ quarkus.hibernate-orm.schema-management.strategy=update
%dev.quarkus.hibernate-orm.dev-ui.allow-hql=true

# ai
quarkus.langchain4j.openai.api-key=${OPENAI_API_KEY}
quarkus.langchain4j.openai.gpt-4-turbo.api-key=${OPENAI_API_KEY}
%dev.quarkus.langchain4j.openai.api-key=${OPENAI_API_KEY}
%dev.quarkus.langchain4j.openai.gpt-4-turbo.api-key=${OPENAI_API_KEY}
%local.quarkus.langchain4j.ollama.base-url=http://localhost:11434/
%local.quarkus.langchain4j.ollama.chat-model.model-id=llama3.2-vision:11b

# quinoa (frontend)
quarkus.quinoa.enable-spa-routing=true
Expand All @@ -33,4 +35,6 @@ quarkus.quinoa.build-dir=dist/timeless/browser
# jwt
mp.jwt.verify.publickey=${JWT_PUBLIC_KEY}
mp.jwt.verify.issuer=https://timelessapp.platformoon.com/issuer
smallrye.jwt.sign.key=${JWT_PRIVATE_KEY}
smallrye.jwt.sign.key=${JWT_PRIVATE_KEY}
%local.quarkus.log.category."io.smallrye.jwt".level=TRACE
%local.quarkus.log.category."io.quarkus.security".level=DEBUG
2 changes: 1 addition & 1 deletion whatsapp/.env.local
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ AWS_SECRET_ACCESS_KEY=test
AWS_REGION=us-east-1
ASSETS_BUCKET=timeless-local-assets
INCOMING_MESSAGE_FIFO_URL=http://localhost:4566/000000000000/incoming-messages.fifo
RECOGNIZED_MESSAGES_FIFO_URL=http://localhost:4566/000000000000/messages-processed.fifo
RECOGNIZED_MESSAGE_FIFO_URL=http://localhost:4566/000000000000/messages-processed.fifo
ALLOWED_PHONE_NUMBERS=
OPENAI_API_KEY=
Loading
Loading