Skip to content

Commit

Permalink
Openai similiartiy checker (#3160)
Browse files Browse the repository at this point in the history
  • Loading branch information
krrish-sehgal authored Dec 24, 2024
1 parent c98a151 commit a20333e
Show file tree
Hide file tree
Showing 10 changed files with 1,119 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
release: python manage.py migrate --noinput
web: gunicorn blt.wsgi --log-file - --workers 2 --worker-class gthread --threads 2 --timeout 120
web: uvicorn blt.asgi:application --host 0.0.0.0 --port 8000 --workers 2
28 changes: 28 additions & 0 deletions blt/asgi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# asgi.py

import os

import django

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "blt.settings")
django.setup()

from channels.auth import AuthMiddlewareStack
from channels.routing import ProtocolTypeRouter, URLRouter
from django.core.asgi import get_asgi_application
from django.urls import path

from website import consumers # You will define a consumer for handling WebSockets

application = ProtocolTypeRouter(
{
"http": get_asgi_application(),
"websocket": AuthMiddlewareStack(
URLRouter(
[
path("ws/similarity/", consumers.SimilarityConsumer.as_asgi()), # WebSocket URL
]
)
),
}
)
11 changes: 11 additions & 0 deletions blt/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -617,3 +617,14 @@
BITCOIN_RPC_PASSWORD = os.environ.get("BITCOIN_RPC_PASSWORD", "yourpassword")
BITCOIN_RPC_HOST = os.environ.get("BITCOIN_RPC_HOST", "localhost")
BITCOIN_RPC_PORT = os.environ.get("BITCOIN_RPC_PORT", "8332")

ASGI_APPLICATION = "blt.asgi.application"

CHANNEL_LAYERS = {
"default": {
"BACKEND": "channels_redis.core.RedisChannelLayer",
"CONFIG": {
"hosts": [os.environ.get("REDISCLOUD_URL")],
},
},
}
5 changes: 5 additions & 0 deletions blt/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,11 @@
path("teams/delete-team/", delete_team, name="delete_team"),
path("teams/leave-team/", leave_team, name="leave_team"),
path("teams/kick-member/", kick_member, name="kick_member"),
path(
"similarity-scan",
TemplateView.as_view(template_name="similarity.html"),
name="similarity_scan",
),
]

if settings.DEBUG:
Expand Down
135 changes: 133 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ openpyxl = "^3.1.5"
atproto = "^0.0.55"
slack-bolt = "^1.22.0"
django-redis = "^5.4.0"
uvicorn = "^0.34.0"
channels = "^4.2.0"
channels-redis = "^4.2.1"

[tool.poetry.group.dev.dependencies]
black = "^24.8.0"
Expand Down
Loading

0 comments on commit a20333e

Please sign in to comment.