Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix all weird bugs #4

Merged
merged 2 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Ignore all but src/
*
!src/neuroagent/*
!pyproject.toml

# Ignore the __pycache__ that are in the whitelisted folders.
*/__pycache__/
*/*/__pycache__/
*/*/*/__pycache__/

54 changes: 54 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# required.
NEUROAGENT_TOOLS__LITERATURE__URL=
NEUROAGENT_KNOWLEDGE_GRAPH__BASE_URL=
NEUROAGENT_GENERATIVE__OPENAI__TOKEN=

# Important but not required
NEUROAGENT_AGENT__MODEL=
NEUROAGENT_AGENT__CHAT=
NEUROAGENT_KNOWLEDGE_GRAPH__USE_TOKEN=
NEUROAGENT_KNOWLEDGE_GRAPH__TOKEN=
NEUROAGENT_KNOWLEDGE_GRAPH__DOWNLOAD_HIERARCHY=

# Useful but not required.
NEUROAGENT_DB__PREFIX=
NEUROAGENT_DB__USER=
NEUROAGENT_DB__PASSWORD=
NEUROAGENT_DB__HOST=
NEUROAGENT_DB__PORT=
NEUROAGENT_DB__NAME=
NEUROAGENT_TOOLS__LITERATURE__RETRIEVER_K=
NEUROAGENT_TOOLS__LITERATURE__RERANKER_K=
NEUROAGENT_TOOLS__LITERATURE__USE_RERANKER=

NEUROAGENT_TOOLS__KNOWLEDGE_GRAPH__SEARCH_SIZE=

NEUROAGENT_TOOLS__TRACE__SEARCH_SIZE=

NEUROAGENT_TOOLS__KG_MORPHO__SEARCH_SIZE=

NEUROAGENT_GENERATIVE__LLM_TYPE= # can only be openai for now
NEUROAGENT_GENERATIVE__OPENAI__MODEL=
NEUROAGENT_GENERATIVE__OPENAI__TEMPERATURE=
NEUROAGENT_GENERATIVE__OPENAI__MAX_TOKENS=

NEUROAGENT_COHERE__TOKEN=

NEUROAGENT_LOGGING__LEVEL=
NEUROAGENT_LOGGING__EXTERNAL_PACKAGES=

NEUROAGENT_KNOWLEDGE_GRAPH__BR_SAVING_PATH=
NEUROAGENT_KNOWLEDGE_GRAPH__CT_SAVING_PATH=

NEUROAGENT_MISC__APPLICATION_PREFIX=
NEUROAGENT_MISC__CORS_ORIGINS=

NEUROAGENT_KEYCLOAK__ISSUER=
NEUROAGENT_KEYCLOAK__VALIDATE_TOKEN=
NEUROAGENT_KEYCLOAK__CLIENT_ID=
NEUROAGENT_KEYCLOAK__USERNAME=
NEUROAGENT_KEYCLOAK__PASSWORD=

# other.
SSL_CERT_FILE=(path to cert file)(etc/ssl/certs/ca-certificates.crt for ubuntu, for mac check Nicolas tutorial)
REQUESTS_CA_BUNDLE=(path to cert file)(etc/ssl/certs/ca-certificates.crt for ubuntu, for mac check Nicolas tutorial)
154 changes: 154 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
# Custom entries
/.idea/
.DS_Store
.env*
!.env*.example
.python-version
.vscode
.pypirc

# Version file

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# static files generated from Django application using `collectstatic`
media
static
35 changes: 35 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-added-large-files
- id: check-json
- id: check-toml
- id: check-yaml
- id: requirements-txt-fixer
- id: trailing-whitespace
- id: end-of-file-fixer
- id: no-commit-to-branch
args: [--branch, master, --branch, main]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.5
hooks:
- id: ruff
args: [ --fix ]
- id: ruff-format

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
hooks:
- id: mypy
files: ^src/
additional_dependencies: ['pydantic', 'types-requests']

- repo: https://github.com/PyCQA/bandit
rev: 1.7.4
hooks:
- id: bandit
args: [-c, pyproject.toml, -qr]
files: ^src/
additional_dependencies: ["bandit[toml]"]
8 changes: 8 additions & 0 deletions AUTHORS.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@


- [Boris Bergsma](https://github.com/BoBer78) @ Blue Brain Project, EPFL
- [Emilie Delattre](https://github.com/EmilieDel) @ Blue Brain Project, EPFL
- [Nicolas Frank](https://github.com/WonderPG) @ Blue Brain Project, EPFL
- [Jan Krepl](https://github.com/jankrepl) @ Blue Brain Project, EPFL
- [Kerem Kurban](https://github.com/KeremKurban) @ Blue Brain Project, EPFL
- [Csaba Zsolnai]() @ Blue Brain Project, EPFL
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Removed
- Github action to create the docs.
- Github action to create the docs.

### Changed
- Migration to pydantic V2.
17 changes: 15 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
FROM python:3.10-slim
FROM python:3.10

CMD python
ENV PYTHONUNBUFFERED=1

RUN apt-get -y update
RUN apt-get -y install curl

RUN pip install --no-cache-dir --upgrade pip
COPY ./ /code
RUN pip install --no-cache-dir /code[api]
RUN rm -rf /code

WORKDIR /

EXPOSE 8078
CMD neuroagent-api --host 0.0.0.0 --port 8078
Loading
Loading