- python 3.11
- poetry 1.7.1 &
poetry install - task:
brew install go-task - install pre-commit hooks:
pre-commitinstall
VectorDB Qdrant
docker pull qdrant/qdrant:v1.6.1
docker run -p 6333:6333 -p 6334:6334 -v $(pwd)/qdrant_storage:/qdrant/storage:z qdrant/qdrant:v1.6.1
client = QdrantClient(host =QDRANT_URL, api_key=QDRANT_TOKEN, port=6333, grpc_port=6334 , https=False, prefer_grpc=True)
Go into the src/frontend folder and run:
streamlit run frontend.py
docker login
docker build -t fatemeh001/kicampus_chatbot:0.0.1 .
docker images
docker run -p 8501 fatemeh001/kicampus_chatbot:0.0.1
docker login kicwaacrdev.azurecr.io
docker tag fatemeh001/kicamp_chatbot:0.0.1 kicwaacrdev.azurecr.io/fatemeh001/kicampus_chatbot:0.0.1
docker push kicwaacrdev.azurecr.io/fatemeh001/kicampus_chatbot:0.0.1
docker run -it --rm -p 80:80 -v ~/.azure:/home/appuser/.azure kicwaacrdev.azurecr.io/rest-api:latest
Before pushing the docker image you need to be authenticated docker via gcloud auth configure-docker europe-west3-docker.pkg.dev.
If you're working with a mac that is using an arm64 architecture, you specifically need to build a docker image based on an amd architecture for cloud run.
To access content from Moodle, you need access to Moodle courses via the REST API. To set up the integration, do the following steps: 0. Get admin access to moodle.
- Enable Web Services: Site Administration -> General -> Advanced Features -> Enable web services
- Enable REST Protocol: Site Administration -> Server -> Web Services -> Manage Protocols -> Enable REST protocol
- (Optional): Create a technical new user/roles
- Create a new external service Site Administration -> Server -> External services. Give it a name and enable Enabled, Authorized users only and Can download files (under Show more...).
- Add the user as an Authorised User to the external service.
- Add the following functions to the external service:
- core_block_get_course_blocks
- core_course_get_categories
- core_course_get_contents
- core_course_get_course_content_items
- core_course_get_course_module
- core_course_get_courses
- core_course_get_module
- Create a token for the user and external service under Site Administration -> Server -> Manage tokens. This allows you to authenticate against the REST API.
You can try it out with a GET request against this url (swap TOKEN for your token und FUNCTION against the function to test): https://ki-campus-test.fernuni-hagen.de/webservice/rest/server.php?wstoken=TOKEN&wsfunction=FUNCTION&moodlewsrestformat=json