-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yaml
More file actions
103 lines (92 loc) · 3.48 KB
/
action.yaml
File metadata and controls
103 lines (92 loc) · 3.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: "SQLite AI - AI search for documents"
description: "Out-of-the-box database for AI search for documents powered by SQLite AI."
author: "SQLite AI Team"
inputs:
connection_string:
description: The SQLite Cloud project connection string.
required: true
base_url:
description: Your website's documentation base url.
required: true
database_name:
description: The name of the database to use on SQLite Cloud
required: true
source_files:
description: The path of the files, by default it will parse every file recursively starting from the working directory.
required: false
default: "./"
only_extensions:
description: Comma-separated list of file extensions to include (e.g., "md,txt,html"). If not set, all supported file types are included.
required: false
default: ""
exclude_extensions:
description: Comma-separated list of file extensions to exclude (e.g., "js,jsx"). If not set, no file types are excluded.
required: false
default: ""
hf_model_id:
description: The Hugging Face model ID to use for generating embeddings.
required: false
default: "unsloth/embeddinggemma-300m-GGUF"
hf_gguf_file:
description: The GGUF file name for the Hugging Face model.
required: false
default: "embeddinggemma-300M-Q8_0.gguf"
hf_gguf_update_date:
description: The date to force update the GGUF model cache, format YYYYMMDD.
required: false
default: "20250904"
hf_model_local_path:
description: The local path to store the downloaded Hugging Face model.
required: false
default: "./models"
branding:
icon: "search"
color: "blue"
runs:
using: "composite"
steps:
- name: Set GitHub Path
run: echo "${{ github.action_path }}/src" >> $GITHUB_PATH
shell: bash
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install SQLite RAG
run: |
python -m pip install --upgrade pip
pip install sqlite-rag
shell: bash
# Cache the downloaded model between workflows
- name: Restore GGUF model cache
uses: actions/cache@v4
id: cache-model
with:
path: ${{ inputs.hf_model_local_path }}
# Change the HF_GGUF_UPDATE_DATE variable to force update the cache
key: gguf-${{ inputs.hf_model_id }}-${{ inputs.hf_gguf_file }}-${{ inputs.hf_gguf_update_date }}
restore-keys: |
gguf-${{ inputs.hf_model_id }}-${{ inputs.hf_gguf_file }}-${{ inputs.hf_gguf_update_date }}-
- name: Download Hugging Face model
run: |
sqlite-rag download-model "${{ inputs.hf_model_id }}" "${{ inputs.hf_gguf_file }}" --local-dir="${{ inputs.hf_model_local_path }}"
if: steps.cache-model.outputs.cache-hit != 'true'
shell: bash
- name: Parse documents and create the database
run: |
sqlite-rag add \
--recursive "${{ inputs.source_files }}" \
--metadata '{"base_url": "${{ inputs.base_url }}"}' \
--relative-paths \
--only "${{ inputs.only_extensions }}" \
--exclude "${{ inputs.exclude_extensions }}"
shell: bash
- name: Upload the database to SQLite Cloud
run: bash $GITHUB_ACTION_PATH/upload.sh
env:
GITHUB_ACTION_PATH: ${{ github.action_path }}
CONNECTION_STRING: ${{ inputs.connection_string }}
# default sqlite-rag database path
DATABASE_PATH: "./sqliterag.sqlite"
DATABASE: ${{ inputs.database_name }}
shell: bash