Skip to content

Commit

Permalink
docs(reuse): Add SPDX header
Browse files Browse the repository at this point in the history
Signed-off-by: Andy Scherzinger <[email protected]>
  • Loading branch information
AndyScherzinger committed Dec 16, 2024
1 parent 4241397 commit 15b9068
Show file tree
Hide file tree
Showing 52 changed files with 433 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: Bug report
name: 🐞 Bug report
about: Create a report to help us improve
title: "[bug]: <short description>"
labels: bug
Expand Down
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.md.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
SPDX-License-Identifier: AGPL-3.0-or-later
12 changes: 12 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
contact_links:
- name: 🚨 Report a security or privacy issue
url: https://hackerone.com/nextcloud
about: Report security and privacy related issues privately to the Nextcloud team, so we can coordinate the fix and release without potentially exposing all Nextcloud servers and users in the meantime.
- name: ❓ Community Support and Help
url: https://help.nextcloud.com/
about: Configuration, webserver/proxy or performance issues and other questions
- name: 💼 Nextcloud Enterprise
url: https://portal.nextcloud.com/
about: If you are a Nextcloud Enterprise customer, or need Professional support, so it can be resolved directly by our dedicated engineers more quickly
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/installation-help.md.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
SPDX-License-Identifier: AGPL-3.0-or-later
3 changes: 3 additions & 0 deletions .github/workflows/appstore-build-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
#
# https://github.com/nextcloud/.github
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
#
# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: MIT

name: Build and publish app release

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/stale-action.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: MIT
name: 'Close stale issues'
on:
schedule:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
.venv*/
__pycache__/
.env
Expand Down
2 changes: 2 additions & 0 deletions .nextcloudignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
.git
.github
.gitignore
Expand Down
2 changes: 2 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
ci:
skip: [pyright]

Expand Down
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
#
FROM nvidia/cuda:12.2.2-runtime-ubuntu22.04

ARG CCB_DB_NAME=ccb
Expand Down
235 changes: 235 additions & 0 deletions LICENSES/AGPL-3.0-or-later.txt

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions LICENSES/MIT.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
MIT License

Copyright (c) <year> <copyright holders>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
.DEFAULT_GOAL := help

.PHONY: help
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<!--
- SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
- SPDX-License-Identifier: AGPL-3.0-or-later
-->
# Nextcloud Assistant Context Chat Backend

> [!NOTE]
Expand Down
12 changes: 12 additions & 0 deletions REUSE.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
version = 1
SPDX-PackageName = "context_chat_backend"
SPDX-PackageSupplier = "Nextcloud <[email protected]>"
SPDX-PackageDownloadLocation = "https://github.com/nextcloud/context_chat_backend"

[[annotations]]
path = ["requirements.txt", "requirements_dev.txt"]
precedence = "aggregate"
SPDX-FileCopyrightText = "2024 Nextcloud GmbH and Nextcloud contributors"
SPDX-License-Identifier = "AGPL-3.0-or-later"
4 changes: 4 additions & 0 deletions appinfo/info.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<?xml version="1.0"?>
<!--
- SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
- SPDX-License-Identifier: AGPL-3.0-or-later
-->
<info>
<id>context_chat_backend</id>
<name>Context Chat Backend</name>
Expand Down
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<!--
- SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
- SPDX-License-Identifier: AGPL-3.0-or-later
-->
# Change Log
All notable changes to this project will be documented in this file.

Expand Down
2 changes: 2 additions & 0 deletions config.cpu.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
debug: true
disable_aaa: false
httpx_verify_ssl: true
Expand Down
2 changes: 2 additions & 0 deletions config.gpu.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
debug: true
disable_aaa: false
httpx_verify_ssl: true
Expand Down
4 changes: 4 additions & 0 deletions context_chat_backend/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#
# SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
#
5 changes: 5 additions & 0 deletions context_chat_backend/chain/ingest/doc_loader.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#
# SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
#

import re
import tempfile
import traceback
Expand Down
4 changes: 4 additions & 0 deletions context_chat_backend/chain/ingest/injest.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#
# SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
#
import re

from fastapi.datastructures import UploadFile
Expand Down
4 changes: 4 additions & 0 deletions context_chat_backend/chain/ingest/mimetype_list.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#
# SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
#
SUPPORTED_MIMETYPES = [
'text/plain',
'text/markdown',
Expand Down
4 changes: 4 additions & 0 deletions context_chat_backend/chain/query_proc.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#
# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
#
from langchain.llms.base import LLM

from ..types import TConfig
Expand Down
4 changes: 4 additions & 0 deletions context_chat_backend/dyn_loader.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#ruff: noqa: I001
#
# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
#

import gc
import multiprocessing as mp
Expand Down
4 changes: 4 additions & 0 deletions context_chat_backend/models/ctransformer.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#
# SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
#
from os import getenv, path

from langchain_community.llms.ctransformers import CTransformers
Expand Down
4 changes: 4 additions & 0 deletions context_chat_backend/models/hugging_face.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#
# SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
#
from os import getenv, path

from langchain_community.llms.huggingface_pipeline import HuggingFacePipeline
Expand Down
4 changes: 4 additions & 0 deletions context_chat_backend/models/llama.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#
# SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
#
from os import getenv, path

from langchain_community.llms.llamacpp import LlamaCpp
Expand Down
4 changes: 4 additions & 0 deletions context_chat_backend/models/nc_texttotext.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#
# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
#
import json
import time
from typing import Any
Expand Down
4 changes: 4 additions & 0 deletions context_chat_backend/network_em.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#
# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
#
from typing import Literal, TypedDict

import httpx
Expand Down
4 changes: 4 additions & 0 deletions context_chat_backend/ocs_utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#
# SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
#
import json
from base64 import b64decode, b64encode
from logging import error as log_error
Expand Down
4 changes: 4 additions & 0 deletions context_chat_backend/repair/repair2001_date20240412153300.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#
# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
#
import os

'''
Expand Down
4 changes: 4 additions & 0 deletions context_chat_backend/repair/repair2002_date20240620015734.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#
# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
#
import os

'''
Expand Down
4 changes: 4 additions & 0 deletions context_chat_backend/repair/repair4000_date20241108175224.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#
# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
#
import os
import shutil

Expand Down
5 changes: 4 additions & 1 deletion context_chat_backend/repair/runner.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/usr/bin/env python3

#
# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
#
import os
import re
from importlib import import_module
Expand Down
4 changes: 4 additions & 0 deletions context_chat_backend/setup_functions.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#
# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
#
import os
import subprocess

Expand Down
4 changes: 4 additions & 0 deletions context_chat_backend/utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#
# SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
#
import multiprocessing as mp
import re
import traceback
Expand Down
4 changes: 4 additions & 0 deletions context_chat_backend/vectordb/base.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#
# SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
#
from abc import ABC, abstractmethod
from typing import Any

Expand Down
4 changes: 4 additions & 0 deletions context_chat_backend/vectordb/pgvector.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#
# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
#
import os
from datetime import datetime
from logging import error as log_error
Expand Down
5 changes: 4 additions & 1 deletion dockerfile_scripts/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash

#
# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
#
set -e

source /etc/environment;
Expand Down
5 changes: 4 additions & 1 deletion dockerfile_scripts/install_deps.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/bin/bash

#
# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
#
apt-get update
apt-get install -y --no-install-recommends vim git pciutils libgomp1
5 changes: 4 additions & 1 deletion dockerfile_scripts/install_py11.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash

#
# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
#
apt-get update
apt-get install -y software-properties-common
add-apt-repository -y ppa:deadsnakes/ppa
Expand Down
4 changes: 4 additions & 0 deletions dockerfile_scripts/pgsql/env
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#
# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
#
# Define the PostgreSQL data directory
BASE_DIR="${APP_PERSISTENT_STORAGE:-persistent_storage}/vector_db_data"
DATA_DIR="${BASE_DIR}/pgsql"
Expand Down
6 changes: 4 additions & 2 deletions dockerfile_scripts/pgsql/install.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/bash

# Stolen from https://github.com/cloud-py-api/flow
#
# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
#

set -e

Expand Down
6 changes: 4 additions & 2 deletions dockerfile_scripts/pgsql/setup.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/bash

# Stolen from https://github.com/cloud-py-api/flow
#
# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
#

set -e

Expand Down
3 changes: 3 additions & 0 deletions example.env
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
#
# rename this file to .env

# Persistent files directory
Expand Down
5 changes: 4 additions & 1 deletion genrepair.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/usr/bin/env sh

#
# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
#
parts=(${APP_VERSION//./ })
repair_filename="repair${parts[0]}$(printf %03d ${parts[1]})_date$(date +%Y%m%d%H%M%S).py"

Expand Down
5 changes: 4 additions & 1 deletion hwdetect.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/usr/bin/env sh

#
# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
#
set -e

accel=$COMPUTE_DEVICE
Expand Down
2 changes: 2 additions & 0 deletions krankerl.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
[package]
before_cmds = []
5 changes: 4 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/usr/bin/env python3

#
# SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
#
from os import getenv

import uvicorn
Expand Down
Loading

0 comments on commit 15b9068

Please sign in to comment.