Skip to content

Commit 52f42c7

Browse files
committed
Merge branch 'main' of https://github.com/deepsense-ai/ragbits into 687-feat-pptx-parser
2 parents 4d6d621 + f2c65e0 commit 52f42c7

File tree

152 files changed

+6733
-1361
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

152 files changed

+6733
-1361
lines changed

.github/scripts/run_examples.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ export LOGFIRE_TOKEN
1313
GIT_URL_TEMPLATE="git+https://github.com/deepsense-ai/ragbits.git@%s#subdirectory=packages/%s"
1414
PR_BRANCH="${PR_BRANCH:-main}"
1515

16+
has_script_section() {
17+
local file="$1"
18+
grep -q "^# /// script" "$file"
19+
}
20+
1621
patch_dependencies() {
1722
local file="$1"
1823
local branch="$2"
@@ -51,8 +56,14 @@ patch_dependencies() {
5156
}
5257

5358
export -f patch_dependencies
59+
export -f has_script_section
5460

5561
find examples -name '*.py' | while read -r file; do
62+
if ! has_script_section "$file"; then
63+
echo "Skipping $file (no script section found)"
64+
continue
65+
fi
66+
5667
echo "Running the script: $file"
5768
patch_dependencies "$file" "$PR_BRANCH"
5869

.github/workflows/run-examples.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Check examples
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- 'release/**'
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
examples:
15+
name: Check examples job
16+
runs-on: ubuntu-latest
17+
timeout-minutes: 15
18+
permissions:
19+
checks: write
20+
pull-requests: write
21+
contents: read
22+
23+
services:
24+
postgres:
25+
image: pgvector/pgvector:${{ vars.PGVECTOR_IMAGE_TAG || '0.8.0-pg17' }}
26+
env:
27+
POSTGRES_USER: ragbits_example
28+
POSTGRES_PASSWORD: ragbits_example
29+
POSTGRES_DB: ragbits_example
30+
ports:
31+
- 5432:5432
32+
options: >-
33+
--health-cmd "pg_isready -U postgres"
34+
--health-interval 10s
35+
--health-timeout 5s
36+
--health-retries 5
37+
38+
weaviate:
39+
image: cr.weaviate.io/semitechnologies/weaviate:${{ vars.WEAVIATE_IMAGE_TAG || '1.30.6' }}
40+
env:
41+
QUERY_DEFAULTS_LIMIT: 25
42+
AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: true
43+
PERSISTENCE_DATA_PATH: /var/lib/weaviate
44+
ENABLE_API_BASED_MODULES: true
45+
CLUSTER_HOSTNAME: node1
46+
ports:
47+
- 8080:8080
48+
- 50051:50051
49+
options: >-
50+
--health-cmd "wget --no-verbose --tries=1 --spider http://localhost:8080/v1/.well-known/ready || exit 1"
51+
--health-interval 10s
52+
--health-timeout 5s
53+
--health-retries 5
54+
55+
grafana:
56+
image: grafana/otel-lgtm
57+
ports:
58+
- 3000:3000
59+
- 4317:4317
60+
- 4318:4318
61+
62+
steps:
63+
- uses: actions/checkout@v4
64+
65+
- name: Install uv
66+
uses: astral-sh/setup-uv@v2
67+
with:
68+
version: ${{ vars.UV_VERSION || '0.6.9' }}
69+
70+
- name: Run examples
71+
env:
72+
PR_BRANCH: ${{ github.head_ref }}
73+
GOOGLE_CLOUD_PROJECT: ${{ secrets.GCP_PROJECT_ID }}
74+
GCP_KEY: ${{ secrets.GCP_KEY }}
75+
GOOGLE_APPLICATION_CREDENTIALS: ${{ github.workspace }}/gcp_key.json
76+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
77+
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
78+
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
79+
LOGFIRE_TOKEN: ${{ secrets.LOGFIRE_TOKEN }}
80+
run: |
81+
echo "$GCP_KEY" | base64 --decode > "$GOOGLE_APPLICATION_CREDENTIALS"
82+
./.github/scripts/run_examples.sh

.github/workflows/shared-client.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ jobs:
3636
run: npm run build
3737
working-directory: typescript/@ragbits/api-client
3838

39+
- name: Run @ragbits/api-client tests
40+
run: npm run test:run
41+
working-directory: typescript/@ragbits/api-client
42+
3943
- name: Run @ragbits/api-client-react ESLint
4044
run: npm run lint
4145
working-directory: typescript/@ragbits/api-client-react
@@ -47,3 +51,7 @@ jobs:
4751
- name: Build @ragbits/api-client-react
4852
run: npm run build
4953
working-directory: typescript/@ragbits/api-client-react
54+
55+
- name: Run @ragbits/api-client-react tests
56+
run: npm run test:run
57+
working-directory: typescript/@ragbits/api-client-react

.github/workflows/shared-modules.yml

Lines changed: 0 additions & 57 deletions
This file was deleted.

.github/workflows/shared-packages.yml

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -118,58 +118,7 @@ jobs:
118118
path: dist/**
119119
retention-days: 3
120120

121-
examples:
122-
name: Run examples
123-
runs-on: ubuntu-latest
124-
timeout-minutes: 15
125-
permissions:
126-
checks: write
127-
pull-requests: write
128-
contents: read
129-
130-
services:
131-
postgres:
132-
image: pgvector/pgvector:0.8.0-pg17
133-
env:
134-
POSTGRES_USER: ragbits_example
135-
POSTGRES_PASSWORD: ragbits_example
136-
POSTGRES_DB: ragbits_example
137-
ports:
138-
- 5432:5432
139-
options: >-
140-
--health-cmd "pg_isready -U postgres"
141-
--health-interval 10s
142-
--health-timeout 5s
143-
--health-retries 5
144-
145-
grafana:
146-
image: grafana/otel-lgtm
147-
ports:
148-
- 3000:3000
149-
- 4317:4317
150-
- 4318:4318
151-
152-
steps:
153-
- uses: actions/checkout@v4
154121

155-
- name: Install uv
156-
uses: astral-sh/setup-uv@v2
157-
with:
158-
version: ${{ vars.UV_VERSION || '0.6.9' }}
159-
160-
- name: Run examples
161-
env:
162-
PR_BRANCH: ${{ github.head_ref }}
163-
GOOGLE_CLOUD_PROJECT: ${{ secrets.GCP_PROJECT_ID }}
164-
GCP_KEY: ${{ secrets.GCP_KEY }}
165-
GOOGLE_APPLICATION_CREDENTIALS: ${{ github.workspace }}/gcp_key.json
166-
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
167-
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
168-
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
169-
LOGFIRE_TOKEN: ${{ secrets.LOGFIRE_TOKEN }}
170-
run: |
171-
echo "$GCP_KEY" | base64 --decode > "$GOOGLE_APPLICATION_CREDENTIALS"
172-
./.github/scripts/run_examples.sh
173122

174123
tests:
175124
name: Run tests

.github/workflows/shared-ui.yml

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ on:
44
workflow_call:
55

66
jobs:
7-
lints:
8-
name: Run linters
7+
checks:
8+
name: Run linters & tests
99
continue-on-error: false
1010
runs-on: ubuntu-latest
1111
steps:
@@ -16,12 +16,23 @@ jobs:
1616
with:
1717
node-version: "lts/*"
1818

19+
- name: Install uv
20+
uses: astral-sh/setup-uv@v2
21+
with:
22+
version: ${{ vars.UV_VERSION || '0.6.9' }}
23+
24+
- name: Sync Python packages
25+
run: |
26+
uv venv
27+
source .venv/bin/activate
28+
uv sync
29+
1930
- name: Install Ragbits API Client dependencies
20-
run: npm i
31+
run: npm ci
2132
working-directory: typescript/@ragbits/api-client
2233

2334
- name: Install Ragbits API Client React dependencies
24-
run: npm i
35+
run: npm ci
2536
working-directory: typescript/@ragbits/api-client-react
2637

2738
- name: Build Ragbits API Client
@@ -33,7 +44,7 @@ jobs:
3344
working-directory: typescript/@ragbits/api-client-react
3445

3546
- name: Install UI dependencies
36-
run: npm i
47+
run: npm ci
3748
working-directory: typescript/ui
3849

3950
- name: Run ESLint
@@ -50,7 +61,14 @@ jobs:
5061

5162
- name: Check Ragbits Chat UI build sync
5263
run: |
53-
git diff --quiet || {
64+
git diff --quiet * || {
5465
echo "ragbits-chat package ui build not synced"
5566
exit 1
5667
}
68+
working-directory: typescript/ui
69+
70+
- name: Run integration tests
71+
run: |
72+
source .venv/bin/activate
73+
cd typescript/ui
74+
npm run test:integration

.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ venv/
99
__pycache__/
1010
**.egg-info/
1111

12+
# Local cursor rules
13+
.cursor/rules/local/
14+
1215
# Byte-compiled / optimized / DLL files
1316
__pycache__/
1417
*.py[cod]
@@ -101,5 +104,4 @@ qdrant/
101104
.aider*
102105

103106
.DS_Store
104-
105-
node_modules/
107+
node_modules/

.libraries-whitelist.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ psycopg
1111
pytest-postgresql
1212
python-bidi
1313
griffe
14-
types-requests
14+
types-requests
15+
sse-starlette

0 commit comments

Comments
 (0)