Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/Gurubase/gurubase into t…
Browse files Browse the repository at this point in the history
…ask/discord-slack-bots
  • Loading branch information
aralyekta committed Jan 27, 2025
2 parents 0eabf56 + 4b9efe4 commit 29f27aa
Show file tree
Hide file tree
Showing 12 changed files with 57 additions and 13 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/link-checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Documentation

on:
push:
branches:
- master
- develop
pull_request:
branches:
- master
- develop

jobs:
link-checker:
name: Check links
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4

- name: Check the links
uses: lycheeverse/lychee-action@v1
with:
args: --max-concurrency 1 -v *.md **/*.md
fail: true
3 changes: 3 additions & 0 deletions .lycheeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
http://localhost:8029/
https://platform.openai.com/api-keys
https://mastodon.social/@gurubaseio
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
[![Twitter](https://img.shields.io/badge/Twitter-%231DA1F2.svg?logo=x&logoColor=white)](https://twitter.com/gurubaseio)
[![Mastodon](https://img.shields.io/badge/Mastodon-%236364FF.svg?logo=mastodon&logoColor=white)](https://mastodon.social/@gurubaseio)
[![Bluesky](https://img.shields.io/badge/Bluesky-%230285FF.svg?logo=bluesky&logoColor=white)](https://bsky.app/profile/gurubase.bsky.social)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/Gurubase/gurubase/blob/main/LICENSE)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/Gurubase/gurubase/blob/master/LICENSE)
</div>

- [What is Gurubase](#what-is-gurubase)
Expand Down
6 changes: 3 additions & 3 deletions src/gurubase-backend/ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Gurubase is a scalable RAG (Retrieval Augmented Generation) system built to prov

## System Components

![Gurubase Architecture](architecture.png)
![Gurubase Architecture](imgs/architecture.png)

### Frontend (Next.js)
- Built with Next.js
Expand Down Expand Up @@ -195,7 +195,7 @@ The task is run in three stages:

An example of the summarization process looks like this:

![Data Source Summarization](ds-summarization.png)
![Data Source Summarization](imgs/ds-summarization.png)

In this example, the red summarizations are the initial summarizations, and the blue summarizations are the recursive summarizations. And summarization 11 is the final summarization of the whole guru type. While the first stage creates summarizations 1-6, the second stage creates summarizations 7 and 8, and the third stage creates summarizations 9-11.

Expand Down Expand Up @@ -295,7 +295,7 @@ For any questions related to date, remember today's date is {date}.
#### 2. Context Retrieval

![Context Retrieval](context-retrieval.png)
![Context Retrieval](imgs/context-retrieval.png)

The `vector_db_fetch` function in `backend/core/utils.py` is responsible for context retrieval. It happens in multiple stages:

Expand Down
6 changes: 3 additions & 3 deletions src/gurubase-backend/INTEGRATION_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
- `${backend_url}/slack/events`
8. Go to Intergrations and add this as Redirect URL:
- `${frontend_url}/OAuth`
9. Add these as Bot and User Token scopes:
9. Go to OAuth & Permissions and add these as Bot and User Token scopes:
- Bot
- `channels:history`
- `channels.join`
Expand All @@ -87,7 +87,7 @@
- `groups:read`
- `im:history`
- `im:read`
- `npim:read`
- `mpim:read`
- User
- `channels:history`
- `channels:read`
Expand All @@ -99,7 +99,7 @@
11. Enable it
12. Set this as request url:
- `${backend_url}/slack/events`
13. Add these as Subscribe to bot events:
13. Go to Event Subscriptions and add these as Subscribe to bot events:
- message.channels
14. Go to Manage Distribution
15. Click and confirm "Remove Hard Coded Information"
Expand Down
10 changes: 6 additions & 4 deletions src/gurubase-backend/backend/backend/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@
ROOT_PASSWORD = config('ROOT_PASSWORD', default='ChangeMe')

SENTRY_ENABLED = config('SENTRY_ENABLED', default=False, cast=bool)
if SENTRY_ENABLED:

if SENTRY_ENABLED or ENV == "selfhosted":
import sentry_sdk
from sentry_sdk.integrations.celery import CeleryIntegration
from sentry_sdk.integrations.django import DjangoIntegration
SENTRY_DSN = config('SENTRY_DSN')
from sentry_sdk.integrations.django import DjangoIntegration
# Use the configured DSN or fallback to selfhosted DSN - https://sentry.zendesk.com/hc/en-us/articles/26741783759899-My-DSN-key-is-publicly-visible-is-this-a-security-vulnerability
SENTRY_DSN = config('SENTRY_DSN', default="https://[email protected]/4508715634982912")
sentry_sdk.init(
dsn=SENTRY_DSN,
integrations=[DjangoIntegration(), CeleryIntegration(monitor_beat_tasks=False)],
Expand Down Expand Up @@ -411,7 +413,7 @@

SLACK_CLIENT_ID = config('SLACK_CLIENT_ID', default='')
SLACK_CLIENT_SECRET = config('SLACK_CLIENT_SECRET', default='')
PROD_BACKEND_URL = config('PROD_BACKEND_URL', default='https://kubernetesguru-backend-api.getanteon.com')
PROD_BACKEND_URL = config('PROD_BACKEND_URL', default='https://api.gurubase.io')


API_CONCURRENCY_THROTTLE_RATE = config('API_CONCURRENCY_THROTTLE_RATE', default='10/m')
2 changes: 1 addition & 1 deletion src/gurubase-backend/backend/core/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def wrapper(request, *args, **kwargs):
if widget_id_obj.domain_url:
origin = request.headers.get('Origin')
if not origin or not origin.rstrip('/').endswith(widget_id_obj.domain_url):
return Response({'msg': 'Invalid domain'}, status=status.HTTP_401_UNAUTHORIZED)
return Response({'msg': 'Invalid domain. Please check your domain URL in Gurubase platform'}, status=status.HTTP_401_UNAUTHORIZED)

request.guru_type = widget_id_obj.guru_type
return view_func(request, *args, **kwargs)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Generated by Django 4.2.18 on 2025-01-26 19:45

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('core', '0022_merge_0021_apikey_name_0021_merge_20250120_0950'),
('core', '0028_alter_integration_unique_together'),
]

operations = [
]
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const IntegrationContent = ({ type, customGuru, error }) => {
description:
"By connecting your account, you can easily share all your posts and invite your friends.",
iconSize: "w-5 h-5",
url: `https://slack.com/oauth/v2/authorize?client_id=8327841447732.8318709976774&scope=app_mentions:read,channels:history,channels:join,channels:read,chat:write,groups:history,groups:read,groups:write,im:history,im:read,im:write,mpim:read,mpim:write,channels:manage&user_scope=channels:history,channels:read,chat:write,groups:history,groups:read,im:history,channels:write,groups:write,mpim:write,im:write`,
url: `https://slack.com/oauth/v2/authorize?client_id=1269209097589.8354424793156&scope=assistant:write,channels:history,channels:join,channels:read,chat:write,groups:history,groups:read,im:history,im:read,mpim:read&user_scope=channels:history,channels:read,chat:write,groups:history,groups:read,im:history`,
icon: SlackIcon
},
discord: {
Expand Down

0 comments on commit 29f27aa

Please sign in to comment.