-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor: Port this project into typescript (#58)
* chore: remove all python related files * refactor: merge the TS port from bifrostlab/llm-assistant-v2 * refactor: update dev container and workflows * feat: remove unused env TZ * chore: update lintstaged biome command to not emit errors if glob is unmatched * feat: rename Command type to SlashCommand * build: update build config - Remove DTS generation since we're not exporting a library - clean output folder before building
- Loading branch information
Showing
71 changed files
with
6,070 additions
and
1,055 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,7 @@ | ||
FROM mcr.microsoft.com/devcontainers/python:3.12 | ||
LABEL org.opencontainers.image.authors="https://github.com/nqngo" | ||
LABEL description="Python 3.12 devcontainer with poetry" | ||
FROM mcr.microsoft.com/devcontainers/typescript-node:20-bookworm | ||
LABEL org.opencontainers.image.authors="https://github.com/nqngo,https://github.com/samhwang" | ||
LABEL description="TypeScript NodeJS devcontainers with PNPM" | ||
|
||
# Configure the dev environment | ||
RUN apt-get update && \ | ||
apt-get install -y bash-completion && \ | ||
rm -rf /var/lib/apt/list/* | ||
# Configure poetry | ||
RUN pipx install poetry && \ | ||
poetry completions bash > /etc/bash_completion.d/poetry | ||
ARG packages="pnpm typescript" | ||
RUN npm -g install ${packages} && \ | ||
npm cache clean --force |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
#!/bin/bash | ||
poetry install | ||
poetry shell | ||
poetry run pre-commit install | ||
pnpm install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
node_modules | ||
|
||
.DS_Store | ||
*.local | ||
|
||
# Test Coverage | ||
coverage | ||
|
||
# Build output | ||
dist | ||
|
||
# Env | ||
.env* | ||
|
||
# Log & README | ||
*.log | ||
*.md | ||
*.MD | ||
|
||
# OS Specific | ||
Thumbs.db | ||
.DS_Store | ||
|
||
# Docker | ||
docker-compose.* | ||
Dockerfile | ||
|
||
# Misc | ||
LICENSE | ||
.github | ||
.idea | ||
.vscode | ||
.devcontainer | ||
|
||
# Not needed for prod | ||
litellm | ||
scripts | ||
playgrounds |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
# LiteLLM/OpenAI | ||
AI_SERVER_URL="http://localhost:8000" | ||
# AI SERVER | ||
AI_SERVER_URL="http://localhost:4000" | ||
|
||
# Discord Bot | ||
DISCORD_BOT_TOKEN="EXAMPLETokennnnnn.Gro00t.aaaaaBBBBBccccc11111DDDDDDD2222eeeeeeee" | ||
# THIS SHOULD BE ASSIGNED TO THE BOT'S `scopes` WHEN DEPLOYED | ||
DISCORD_GUILD_ID="99999999999999999999999" | ||
# BOT CONFIGS | ||
CLIENT_ID=CLIENT_ID_GOES_HERE | ||
# GUILD_ID=FOR_DEVELOPMENT_ONLY | ||
PUBLIC_KEY=PUBLIC_KEY_GOES_HERE | ||
TOKEN=YOUR_BOT_TOKEN_HERE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: setup-node-dependencies | ||
description: Setup Node Dependencies | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Install pnpm | ||
uses: pnpm/action-setup@v3 | ||
with: | ||
version: ^8.15.0 | ||
|
||
- name: Set up Node 20 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
cache: 'pnpm' | ||
|
||
- name: Set up project | ||
shell: bash | ||
run: pnpm install |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,10 @@ | ||
name: Test and Lint | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: ./.github/actions/setup-python | ||
|
||
- name: Lint with Ruff | ||
run: poetry run ruff check . | ||
|
||
format-check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: ./.github/actions/setup-python | ||
|
||
- name: Format check with Ruff | ||
run: poetry run ruff format --check . | ||
|
||
typecheck: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: ./.github/actions/setup-python | ||
|
||
- name: Typecheck with mypy | ||
run: poetry run mypy . | ||
test-and-lint: | ||
uses: ./.github/workflows/workflow-test-and-lint.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Build and deploy Docker Image | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
build-discord-bot: | ||
name: Build Discord Bot Docker Image | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to GitHub Docker | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and Push docker image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
pull: true | ||
push: true | ||
target: production | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache | ||
tags: | | ||
ghcr.io/${{ github.repository }}/llm-assistant:latest | ||
ghcr.io/${{ github.repository }}/llm-assistant:${{ github.sha }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Tests and Lints packages | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up project | ||
uses: ./.github/actions/setup-node-deps | ||
|
||
- name: Run linting | ||
run: pnpm lint | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up project | ||
uses: ./.github/actions/setup-node-deps | ||
|
||
- name: Run tests | ||
run: pnpm test | ||
|
||
typecheck: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up project | ||
uses: ./.github/actions/setup-node-deps | ||
|
||
- name: Run typecheck | ||
run: pnpm typecheck |
Oops, something went wrong.