From bff892695ab9a7aa33ecbf0942831f40a6fb6124 Mon Sep 17 00:00:00 2001 From: Liam Thompson Date: Mon, 31 Jul 2023 17:53:07 +0200 Subject: [PATCH 1/3] Update readmes, consolidate examples, rename folders --- .DS_Store | Bin 0 -> 6148 bytes README.md | 27 ++++++++++---- colab-notebooks-examples/index.md | 0 esre-examples/README.md | 11 ------ example-apps/.DS_Store | Bin 0 -> 8196 bytes example-apps/ElasticDocs_GPT/README.md | 33 ++++++++++++++++++ .../elasticdocs_gpt-summarize5.py | 0 .../ElasticDocs_GPT/elasticdocs_gpt.py | 0 ...lasticChat GPT Diagram - No line text.jpeg | Bin ...icDocs GPT - elastic cloud autoscaling.png | Bin .../elasticDocs GPT - elastic jvm apm.png | Bin .../elasticDocs GPT - inference processor.png | Bin .../images/elasticDocs GPT - redact pii.png | Bin .../load_embedding_model.ipynb | 0 .../ElasticDocs_GPT/requirements.txt | 0 .../.well-known/ai-plugin.json | 0 .../ElasticGPT_Plugin/Dockerfile | 0 .../ElasticGPT_Plugin/LICENSE.txt | 0 example-apps/ElasticGPT_Plugin/README.md | 19 ++++++++++ .../ElasticGPT_Plugin/app.py | 0 .../ElasticGPT_Plugin/app.py-bak | 0 .../ElasticGPT_Plugin/logo.png | Bin .../ElasticGPT_Plugin/openapi.yaml | 0 .../OpenAI-embeddings/OpenAI-JS}/.gitignore | 0 .../OpenAI-embeddings/OpenAI-JS}/LICENSE | 0 .../OpenAI-embeddings/OpenAI-JS}/README.md | 2 +- .../OpenAI-JS}/generate_embeddings.js | 0 .../OpenAI-JS}/images/elastic_cloud_id.png | Bin .../OpenAI-JS}/images/elastic_credentials.png | Bin .../OpenAI-JS}/images/openai_api_key.png | Bin .../OpenAI-JS}/images/search.png | Bin .../OpenAI-JS}/package-lock.json | 0 .../OpenAI-embeddings/OpenAI-JS}/package.json | 0 .../OpenAI-JS}/sample_data/medicare.json | 0 .../OpenAI-JS}/search_app.js | 0 .../OpenAI-embeddings/OpenAI-JS}/utils.js | 0 .../OpenAI-JS}/views/search.hbs | 0 .../OpenAI-embeddings/OpenAI-Py}/.gitignore | 0 .../OpenAI-embeddings/OpenAI-Py}/LICENSE | 0 .../OpenAI-embeddings/OpenAI-Py}/README.md | 0 .../OpenAI-Py}/generate_embeddings.py | 0 .../OpenAI-Py}/images/elastic_cloud_id.png | Bin .../OpenAI-Py}/images/elastic_credentials.png | Bin .../OpenAI-Py}/images/openai_api_key.png | Bin .../OpenAI-Py}/images/search.png | Bin .../OpenAI-Py}/requirements.txt | 0 .../OpenAI-Py}/sample_data/medicare.json | 0 .../OpenAI-Py}/search_app.py | 0 .../OpenAI-Py}/templates/search.html | 0 example-apps/OpenAI-embeddings/README.md | 14 ++++++++ example-apps/README.md | 14 ++++++++ .../Workplace-Search}/.gitignore | 0 .../Workplace-Search}/Dockerfile | 0 .../Workplace-Search}/README.md | 5 +-- .../Workplace-Search}/api/app.py | 0 .../Workplace-Search}/api/requirements.txt | 0 .../Workplace-Search}/app-demo.gif | Bin .../Workplace-Search}/example-data/README.md | 0 .../Workplace-Search}/example-data/data.json | 0 .../images/add-inference-fields.png | Bin .../images/add-inference-pipeline.png | Bin .../example-data/images/cloud-id.png | Bin .../example-data/images/copy-customize.png | Bin .../images/ent-search-landing.png | Bin .../example-data/images/fields-mapping.png | Bin .../example-data/index-data.py | 0 .../example-data/load-data.sh | 0 .../example-data/load-medicare.sh | 0 .../example-data/medicare.json | 0 .../example-data/requirements.txt | 0 .../Workplace-Search}/frontend/package.json | 0 .../frontend/public/favicon.ico | Bin .../frontend/public/index.html | 0 .../frontend/public/logo192.png | Bin .../frontend/public/logo512.png | Bin .../frontend/public/manifest.json | 0 .../frontend/public/robots.txt | 0 .../frontend/src/App.test.tsx | 0 .../Workplace-Search}/frontend/src/App.tsx | 0 .../FeedbackControl/_feedback_control.scss | 0 .../FeedbackControl/feedback_control.tsx | 0 .../frontend/src/components/avatar.tsx | 0 .../frontend/src/components/chat/input.tsx | 0 .../src/components/chat/search_input.tsx | 0 .../frontend/src/components/chat_message.tsx | 0 .../src/components/chat_message_list.tsx | 0 .../frontend/src/components/header.tsx | 0 .../src/components/images/SendIcon.tsx | 0 .../frontend/src/components/images/bug.svg | 0 .../frontend/src/components/images/bug.tsx | 0 .../src/components/images/confluence.png | Bin .../src/components/images/conversation.tsx | 0 .../src/components/images/disappointed.svg | 0 .../src/components/images/disappointed.tsx | 0 .../frontend/src/components/images/docs.png | Bin .../src/components/images/dropbox.png | Bin .../src/components/images/elasticTypeMark.png | Bin .../frontend/src/components/images/excel.png | Bin .../frontend/src/components/images/faq.png | Bin .../frontend/src/components/images/github.png | Bin .../src/components/images/neutral.svg | 0 .../src/components/images/neutral.tsx | 0 .../src/components/images/onedrive.png | Bin .../frontend/src/components/images/pdf.png | Bin .../frontend/src/components/images/reload.tsx | 0 .../src/components/images/robot-avatar.png | Bin .../src/components/images/searchIcon.tsx | 0 .../src/components/images/sharepoint.png | Bin .../frontend/src/components/images/sheets.png | Bin .../frontend/src/components/images/slides.png | Bin .../frontend/src/components/images/smile.svg | 0 .../frontend/src/components/images/smile.tsx | 0 .../src/components/images/sql server.png | Bin .../frontend/src/components/images/teams.png | Bin .../frontend/src/components/images/word.png | Bin .../frontend/src/components/source_icon.tsx | 0 .../frontend/src/components/source_item.tsx | 0 .../frontend/src/components/sources.tsx | 0 .../frontend/src/components/summary.tsx | 0 .../Workplace-Search}/frontend/src/index.css | 0 .../Workplace-Search}/frontend/src/index.tsx | 0 .../frontend/src/lib/utils.ts | 0 .../Workplace-Search}/frontend/src/logo.svg | 0 .../frontend/src/store/provider.tsx | 0 .../frontend/src/types/images.d.ts | 0 .../frontend/src/types/index.ts | 0 .../frontend/tailwind.config.js | 0 .../Workplace-Search}/frontend/tsconfig.json | 0 .../Workplace-Search}/frontend/yarn.lock | 0 gai-examples/ElasticDocs_GPT/README.md | 29 --------------- gai-examples/ElasticGPT_Plugin/README.md | 8 ----- notebooks/README.md | 20 +++++++++++ .../generative-ai/chatbot.ipynb | 0 .../generative-ai/question-answering.ipynb | 0 .../hugging-face/hugging-face-endpoints.ipynb | 0 .../loading-model-from-hugging-face.ipynb | 0 .../integrations/llama-index/intro.ipynb | 0 .../integrations/openai/intro.ipynb | 0 .../langchain-elasticsearch-embeddings.ipynb | 0 .../langchain/langchain-vector-store.ipynb | 0 .../search/00-quick-start.ipynb | 0 .../01-keyword-querying-filtering.ipynb | 0 .../search/02-hybrid-search.ipynb | 0 .../search/03-ELSER.ipynb | 0 .../search/data.json | 0 145 files changed, 124 insertions(+), 58 deletions(-) create mode 100644 .DS_Store delete mode 100644 colab-notebooks-examples/index.md delete mode 100644 esre-examples/README.md create mode 100644 example-apps/.DS_Store create mode 100644 example-apps/ElasticDocs_GPT/README.md rename {gai-examples => example-apps}/ElasticDocs_GPT/elasticdocs_gpt-summarize5.py (100%) rename {gai-examples => example-apps}/ElasticDocs_GPT/elasticdocs_gpt.py (100%) rename {gai-examples => example-apps}/ElasticDocs_GPT/images/ElasticChat GPT Diagram - No line text.jpeg (100%) rename {gai-examples => example-apps}/ElasticDocs_GPT/images/elasticDocs GPT - elastic cloud autoscaling.png (100%) rename {gai-examples => example-apps}/ElasticDocs_GPT/images/elasticDocs GPT - elastic jvm apm.png (100%) rename {gai-examples => example-apps}/ElasticDocs_GPT/images/elasticDocs GPT - inference processor.png (100%) rename {gai-examples => example-apps}/ElasticDocs_GPT/images/elasticDocs GPT - redact pii.png (100%) rename {gai-examples => example-apps}/ElasticDocs_GPT/load_embedding_model.ipynb (100%) rename {gai-examples => example-apps}/ElasticDocs_GPT/requirements.txt (100%) rename {gai-examples => example-apps}/ElasticGPT_Plugin/.well-known/ai-plugin.json (100%) rename {gai-examples => example-apps}/ElasticGPT_Plugin/Dockerfile (100%) rename {gai-examples => example-apps}/ElasticGPT_Plugin/LICENSE.txt (100%) create mode 100644 example-apps/ElasticGPT_Plugin/README.md rename {gai-examples => example-apps}/ElasticGPT_Plugin/app.py (100%) rename {gai-examples => example-apps}/ElasticGPT_Plugin/app.py-bak (100%) rename {gai-examples => example-apps}/ElasticGPT_Plugin/logo.png (100%) rename {gai-examples => example-apps}/ElasticGPT_Plugin/openapi.yaml (100%) rename {esre-examples/openai-integration-example-javascript => example-apps/OpenAI-embeddings/OpenAI-JS}/.gitignore (100%) rename {esre-examples/openai-integration-example-javascript => example-apps/OpenAI-embeddings/OpenAI-JS}/LICENSE (100%) rename {esre-examples/openai-integration-example-javascript => example-apps/OpenAI-embeddings/OpenAI-JS}/README.md (99%) rename {esre-examples/openai-integration-example-javascript => example-apps/OpenAI-embeddings/OpenAI-JS}/generate_embeddings.js (100%) rename {esre-examples/openai-integration-example-javascript => example-apps/OpenAI-embeddings/OpenAI-JS}/images/elastic_cloud_id.png (100%) rename {esre-examples/openai-integration-example-javascript => example-apps/OpenAI-embeddings/OpenAI-JS}/images/elastic_credentials.png (100%) rename {esre-examples/openai-integration-example-javascript => example-apps/OpenAI-embeddings/OpenAI-JS}/images/openai_api_key.png (100%) rename {esre-examples/openai-integration-example-javascript => example-apps/OpenAI-embeddings/OpenAI-JS}/images/search.png (100%) rename {esre-examples/openai-integration-example-javascript => example-apps/OpenAI-embeddings/OpenAI-JS}/package-lock.json (100%) rename {esre-examples/openai-integration-example-javascript => example-apps/OpenAI-embeddings/OpenAI-JS}/package.json (100%) rename {esre-examples/openai-integration-example-javascript => example-apps/OpenAI-embeddings/OpenAI-JS}/sample_data/medicare.json (100%) rename {esre-examples/openai-integration-example-javascript => example-apps/OpenAI-embeddings/OpenAI-JS}/search_app.js (100%) rename {esre-examples/openai-integration-example-javascript => example-apps/OpenAI-embeddings/OpenAI-JS}/utils.js (100%) rename {esre-examples/openai-integration-example-javascript => example-apps/OpenAI-embeddings/OpenAI-JS}/views/search.hbs (100%) rename {esre-examples/openai-integration-example-python => example-apps/OpenAI-embeddings/OpenAI-Py}/.gitignore (100%) rename {esre-examples/openai-integration-example-python => example-apps/OpenAI-embeddings/OpenAI-Py}/LICENSE (100%) rename {esre-examples/openai-integration-example-python => example-apps/OpenAI-embeddings/OpenAI-Py}/README.md (100%) rename {esre-examples/openai-integration-example-python => example-apps/OpenAI-embeddings/OpenAI-Py}/generate_embeddings.py (100%) rename {esre-examples/openai-integration-example-python => example-apps/OpenAI-embeddings/OpenAI-Py}/images/elastic_cloud_id.png (100%) rename {esre-examples/openai-integration-example-python => example-apps/OpenAI-embeddings/OpenAI-Py}/images/elastic_credentials.png (100%) rename {esre-examples/openai-integration-example-python => example-apps/OpenAI-embeddings/OpenAI-Py}/images/openai_api_key.png (100%) rename {esre-examples/openai-integration-example-python => example-apps/OpenAI-embeddings/OpenAI-Py}/images/search.png (100%) rename {esre-examples/openai-integration-example-python => example-apps/OpenAI-embeddings/OpenAI-Py}/requirements.txt (100%) rename {esre-examples/openai-integration-example-python => example-apps/OpenAI-embeddings/OpenAI-Py}/sample_data/medicare.json (100%) rename {esre-examples/openai-integration-example-python => example-apps/OpenAI-embeddings/OpenAI-Py}/search_app.py (100%) rename {esre-examples/openai-integration-example-python => example-apps/OpenAI-embeddings/OpenAI-Py}/templates/search.html (100%) create mode 100644 example-apps/OpenAI-embeddings/README.md create mode 100644 example-apps/README.md rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/.gitignore (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/Dockerfile (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/README.md (94%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/api/app.py (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/api/requirements.txt (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/app-demo.gif (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/example-data/README.md (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/example-data/data.json (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/example-data/images/add-inference-fields.png (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/example-data/images/add-inference-pipeline.png (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/example-data/images/cloud-id.png (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/example-data/images/copy-customize.png (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/example-data/images/ent-search-landing.png (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/example-data/images/fields-mapping.png (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/example-data/index-data.py (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/example-data/load-data.sh (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/example-data/load-medicare.sh (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/example-data/medicare.json (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/example-data/requirements.txt (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/frontend/package.json (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/frontend/public/favicon.ico (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/frontend/public/index.html (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/frontend/public/logo192.png (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/frontend/public/logo512.png (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/frontend/public/manifest.json (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/frontend/public/robots.txt (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/frontend/src/App.test.tsx (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/frontend/src/App.tsx (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/frontend/src/components/FeedbackControl/_feedback_control.scss (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/frontend/src/components/FeedbackControl/feedback_control.tsx (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/frontend/src/components/avatar.tsx (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/frontend/src/components/chat/input.tsx (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/frontend/src/components/chat/search_input.tsx (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/frontend/src/components/chat_message.tsx (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/frontend/src/components/chat_message_list.tsx (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/frontend/src/components/header.tsx (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/frontend/src/components/images/SendIcon.tsx (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/frontend/src/components/images/bug.svg (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/frontend/src/components/images/bug.tsx (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/frontend/src/components/images/confluence.png (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/frontend/src/components/images/conversation.tsx (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/frontend/src/components/images/disappointed.svg (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/frontend/src/components/images/disappointed.tsx (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/frontend/src/components/images/docs.png (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/frontend/src/components/images/dropbox.png (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/frontend/src/components/images/elasticTypeMark.png (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/frontend/src/components/images/excel.png (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/frontend/src/components/images/faq.png (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/frontend/src/components/images/github.png (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/frontend/src/components/images/neutral.svg (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/frontend/src/components/images/neutral.tsx (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/frontend/src/components/images/onedrive.png (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/frontend/src/components/images/pdf.png (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/frontend/src/components/images/reload.tsx (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/frontend/src/components/images/robot-avatar.png (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/frontend/src/components/images/searchIcon.tsx (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/frontend/src/components/images/sharepoint.png (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/frontend/src/components/images/sheets.png (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/frontend/src/components/images/slides.png (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/frontend/src/components/images/smile.svg (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/frontend/src/components/images/smile.tsx (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/frontend/src/components/images/sql server.png (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/frontend/src/components/images/teams.png (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/frontend/src/components/images/word.png (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/frontend/src/components/source_icon.tsx (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/frontend/src/components/source_item.tsx (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/frontend/src/components/sources.tsx (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/frontend/src/components/summary.tsx (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/frontend/src/index.css (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/frontend/src/index.tsx (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/frontend/src/lib/utils.ts (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/frontend/src/logo.svg (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/frontend/src/store/provider.tsx (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/frontend/src/types/images.d.ts (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/frontend/src/types/index.ts (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/frontend/tailwind.config.js (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/frontend/tsconfig.json (100%) rename {esre-examples/python-flask-example => example-apps/Workplace-Search}/frontend/yarn.lock (100%) delete mode 100644 gai-examples/ElasticDocs_GPT/README.md delete mode 100644 gai-examples/ElasticGPT_Plugin/README.md create mode 100644 notebooks/README.md rename {colab-notebooks-examples => notebooks}/generative-ai/chatbot.ipynb (100%) rename {colab-notebooks-examples => notebooks}/generative-ai/question-answering.ipynb (100%) rename {colab-notebooks-examples => notebooks}/integrations/hugging-face/hugging-face-endpoints.ipynb (100%) rename {colab-notebooks-examples => notebooks}/integrations/hugging-face/loading-model-from-hugging-face.ipynb (100%) rename {colab-notebooks-examples => notebooks}/integrations/llama-index/intro.ipynb (100%) rename {colab-notebooks-examples => notebooks}/integrations/openai/intro.ipynb (100%) rename {colab-notebooks-examples => notebooks}/langchain/langchain-elasticsearch-embeddings.ipynb (100%) rename {colab-notebooks-examples => notebooks}/langchain/langchain-vector-store.ipynb (100%) rename {colab-notebooks-examples => notebooks}/search/00-quick-start.ipynb (100%) rename {colab-notebooks-examples => notebooks}/search/01-keyword-querying-filtering.ipynb (100%) rename {colab-notebooks-examples => notebooks}/search/02-hybrid-search.ipynb (100%) rename {colab-notebooks-examples => notebooks}/search/03-ELSER.ipynb (100%) rename {colab-notebooks-examples => notebooks}/search/data.json (100%) diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..d4f56079ef5d898ed0f5c2d6ea257bd421db30a8 GIT binary patch literal 6148 zcmeHK%}T>S5Z-O8O{hW-iXIodR&1?56fdFH7cim+m70*E!I%wAYJ^hARbR+A@p+ut z-72N_;z6X$!0fj>JCkL;3H!qsvp^9`HZ(s7&ZEvr$ygA%`bNScHekEV zW67L18U7;!Si3c-*$dR{399y8zl5cJo+f@IeeikrlPFBHX7huW%9WMXs#UdW)~)*> zb2sy{QQGx}*EqV6GV-T=&%X=@dB47KD&x!xY-@98@8rDy7(K=ERddSW_fxWNa0+kGS(x6l zJB%Y4--FLIei}ze3=jjvz)~|{Ha)Ah)LBw;!~iky8wPNH5TJ;T!9t_jI-tSpBhFV4 zQJ{}+2}EJgF<5AX84#{R0d*)hPYkZZ!7hxSW3bSu!x>jA!*|Te+`Le@S{>{{xiju) zq?Q;U24)#3>tP+w|FgyK|JfiK5d*})QZc|QJ-63|l+4*WmmHq80`v|P1^o(*Um?&@ iM=|)~QM?VR1ndGkfR4dJBUnJ_BA{rXh8Xx$20j70!cL?B literal 0 HcmV?d00001 diff --git a/README.md b/README.md index 25118f8e..610f8cd2 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,23 @@ -# Elasticsearch Labs +# Elasticsearch Labs -This repository contains several sample applications for demonstrating the features of Elasticsearch and Elasticsearch Relevance Engine (ESRE) to build modern conversational search experiences powered by generative AI. -Elasticsearch is a distributed RESTful search and analytics platform at the heart of our [ESRE](https://www.elastic.co/enterprise-search/generative-ai) capabilities. +This repository contains executable Python notebooks, sample apps, and resources for testing out the Elastic platform: + +- Learn how to use Elasticsearch as a vector database to store embeddings, power hybrid and semantic search experiences, and more. +- Test Elastic's leading-edge, out-of-the-box capabilities like the [Elastic Learned Sparse Encoder](https://www.elastic.co/guide/en/machine-learning/current/ml-nlp-elser.html) and [reciprocal rank fusion (RRF)](https://www.elastic.co/blog/whats-new-elastic-enterprise-search-8-9-0#hybrid-search-with-reciprocal-rank-fusion-(rrf)-combines-multiple-search-techniques-for-better-results), which produce best-in-class results without training or tuning. +- Integrate with projects like OpenAI, Hugging Face, and LangChain to use Elasticsearch as the backbone of your LLM-powered applications. For use cases like retrieval augmented generation (RAG), summarization, and question answering (QA). + +# Python notebooks 📒 + +The [`notebooks` folder](notebooks/README.md) contains a range of executable Python notebooks, so you can test these features out for yourself. Colab provides an easy-to-use Python virtual environment in the browser. + +# Example apps đŸ’ģ + +The [`example-apps`](example-apps/README.md) folder contains example apps that demonstrate Elasticsearch for a number of use cases, using different programming languages and frameworks. + +# Support 🛟 + +Learn how to [get Support](docs/SUPPORT.md). + +# License âš–ī¸ -# Guides -- [Getting Support](docs/SUPPORT.md) - -# License This software is licensed under the [Apache License, version 2 ("ALv2")](https://github.com/elastic/elasticsearch-labs/blob/main/LICENSE). diff --git a/colab-notebooks-examples/index.md b/colab-notebooks-examples/index.md deleted file mode 100644 index e69de29b..00000000 diff --git a/esre-examples/README.md b/esre-examples/README.md deleted file mode 100644 index f3e777ca..00000000 --- a/esre-examples/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# Elasticsearch Relevance Engine (ESRE) code examples - -This repository contains examples for demonstrating the features of the Elasticsearch Relevance Engine ([ESRE](https://www.elastic.co/enterprise-search/generative-ai)). - -The following examples are currently available: - -| Directory | Description | -|---|---| -| [openai-integration-example-javascript](openai-integration-example-javascript) | Node.js/Express.js application demonstrating using OpenAI embeddings during indexing and in Elastic queries. | -| [openai-integration-example-python](openai-integration-example-python) | Python/Flask application demonstrating using OpenAI embeddings during indexing and in Elastic queries. | -| [python-flask-example](python-flask-example) | Python/Flask/Node.js application demonstrating querying with the Elastic Learned Sparse Encoder model and reranking results with RRF. | diff --git a/example-apps/.DS_Store b/example-apps/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5dba2668130c897be621faa3fba6f2f824f61deb GIT binary patch literal 8196 zcmeI1&2G~`6ov1kfjX)XsRW`+OKgxxOG*o9 zTX+ukEO`@N2hRMoQ=AMZ?#}j{^*truT5{-VePP9Tq4yw}X62f1K+OO(N zDcLQ`C*UW_DW*0xNg{G#0!)AjFaajO1pY+=cxJ2OT=3jCdpR-zCh%VpQ1=HHRjFsS zFsg4I2s#CTma$nEw2=pBk89PlS{T(<9MfbE!dit*F@&*WzpJ`KJ*$OLV<%zkB<#q- zW++0B4xg*LlkkjkWCBcJmVkQp-=!T&D4=X2f6u5zuW64Cb`#kS6B(kX`f_cfuKm&l zt-0=Skaey5N7zl`EU(vpiqb;)*6l@S(OGgn`p0tM=Rw}j8bR;9dUqgY5}vh#@Lk*) zw5s=B$utk*wA0guIO?Fwhr>9H5;#+m7YG?icUX^^mY7P@2JpU1EBPx7LreFGr(TrL}%c>r7m?S#Z26#RkThiM2zqPSm4bj;fim7`)F*& zF4Np2+!VNTPjm`yh4wLbx3Prx2D%2c(Im{0n&aa$wMvIr?(5MBE{eK|v~ej`$wv&Z zwN1y9eo=$}@t=#q&wudX!UV2?z=9cbMg0cYxp@8m8a^2h$po0dRS^*7rr&H}w6kBp z(*vtq+eQ6^s*37Y7}XX8osL6wIu1Sm!w_v3U6sePS{TI^6kZ6>7&tJ2D<$w7MCK`5 literal 0 HcmV?d00001 diff --git a/example-apps/ElasticDocs_GPT/README.md b/example-apps/ElasticDocs_GPT/README.md new file mode 100644 index 00000000..3be3332a --- /dev/null +++ b/example-apps/ElasticDocs_GPT/README.md @@ -0,0 +1,33 @@ +# ElasticDocs GPT + +Combine the search power of Elasticsearch with the Question Answering power of GPT. + +This application supports the popular Elastic blog [ChatGPT and Elasticsearch: OpenAI meets private data](https://www.elastic.co/blog/chatgpt-elasticsearch-openai-meets-private-data). + +## Overview + +The following diagram shows the high level architecture of the application: + +![diagram](https://raw.githubusercontent.com/jeffvestal/ElasticDocs_GPT/main/images/ElasticChat%20GPT%20Diagram%20-%20No%20line%20text.jpeg) + +1. A **Python interface** accepts user questions + - Generates a hybrid search request for Elasticsearch + - BM25 match on the `title` field + - kNN searches on the `title-vector` field + - Boost `kNN` search results to align scores + - Set `size=1` to return only the top scored document +2. **Search request** is sent to Elasticsearch +3. **Documentation body and original url** are returned to Python +4. **API call** is made to OpenAI ChatCompletion with the prompt: + - _"answer this question using only this document "_ +5. **Generated response** is returned to Python +6. Python adds **original documentation source url** to generated response and **prints it to the screen** for the user + +# Examples + ![autoscale](https://raw.githubusercontent.com/jeffvestal/ElasticDocs_GPT/main/images/elasticDocs%20GPT%20-%20elastic%20cloud%20autoscaling.png) + + ![apm](https://raw.githubusercontent.com/jeffvestal/ElasticDocs_GPT/main/images/elasticDocs%20GPT%20-%20elastic%20jvm%20apm.png) + + ![inference](https://github.com/jeffvestal/ElasticDocs_GPT/blob/main/images/elasticDocs%20GPT%20-%20inference%20processor.png) + + ![pii](https://raw.githubusercontent.com/jeffvestal/ElasticDocs_GPT/main/images/elasticDocs%20GPT%20-%20redact%20pii.png) \ No newline at end of file diff --git a/gai-examples/ElasticDocs_GPT/elasticdocs_gpt-summarize5.py b/example-apps/ElasticDocs_GPT/elasticdocs_gpt-summarize5.py similarity index 100% rename from gai-examples/ElasticDocs_GPT/elasticdocs_gpt-summarize5.py rename to example-apps/ElasticDocs_GPT/elasticdocs_gpt-summarize5.py diff --git a/gai-examples/ElasticDocs_GPT/elasticdocs_gpt.py b/example-apps/ElasticDocs_GPT/elasticdocs_gpt.py similarity index 100% rename from gai-examples/ElasticDocs_GPT/elasticdocs_gpt.py rename to example-apps/ElasticDocs_GPT/elasticdocs_gpt.py diff --git a/gai-examples/ElasticDocs_GPT/images/ElasticChat GPT Diagram - No line text.jpeg b/example-apps/ElasticDocs_GPT/images/ElasticChat GPT Diagram - No line text.jpeg similarity index 100% rename from gai-examples/ElasticDocs_GPT/images/ElasticChat GPT Diagram - No line text.jpeg rename to example-apps/ElasticDocs_GPT/images/ElasticChat GPT Diagram - No line text.jpeg diff --git a/gai-examples/ElasticDocs_GPT/images/elasticDocs GPT - elastic cloud autoscaling.png b/example-apps/ElasticDocs_GPT/images/elasticDocs GPT - elastic cloud autoscaling.png similarity index 100% rename from gai-examples/ElasticDocs_GPT/images/elasticDocs GPT - elastic cloud autoscaling.png rename to example-apps/ElasticDocs_GPT/images/elasticDocs GPT - elastic cloud autoscaling.png diff --git a/gai-examples/ElasticDocs_GPT/images/elasticDocs GPT - elastic jvm apm.png b/example-apps/ElasticDocs_GPT/images/elasticDocs GPT - elastic jvm apm.png similarity index 100% rename from gai-examples/ElasticDocs_GPT/images/elasticDocs GPT - elastic jvm apm.png rename to example-apps/ElasticDocs_GPT/images/elasticDocs GPT - elastic jvm apm.png diff --git a/gai-examples/ElasticDocs_GPT/images/elasticDocs GPT - inference processor.png b/example-apps/ElasticDocs_GPT/images/elasticDocs GPT - inference processor.png similarity index 100% rename from gai-examples/ElasticDocs_GPT/images/elasticDocs GPT - inference processor.png rename to example-apps/ElasticDocs_GPT/images/elasticDocs GPT - inference processor.png diff --git a/gai-examples/ElasticDocs_GPT/images/elasticDocs GPT - redact pii.png b/example-apps/ElasticDocs_GPT/images/elasticDocs GPT - redact pii.png similarity index 100% rename from gai-examples/ElasticDocs_GPT/images/elasticDocs GPT - redact pii.png rename to example-apps/ElasticDocs_GPT/images/elasticDocs GPT - redact pii.png diff --git a/gai-examples/ElasticDocs_GPT/load_embedding_model.ipynb b/example-apps/ElasticDocs_GPT/load_embedding_model.ipynb similarity index 100% rename from gai-examples/ElasticDocs_GPT/load_embedding_model.ipynb rename to example-apps/ElasticDocs_GPT/load_embedding_model.ipynb diff --git a/gai-examples/ElasticDocs_GPT/requirements.txt b/example-apps/ElasticDocs_GPT/requirements.txt similarity index 100% rename from gai-examples/ElasticDocs_GPT/requirements.txt rename to example-apps/ElasticDocs_GPT/requirements.txt diff --git a/gai-examples/ElasticGPT_Plugin/.well-known/ai-plugin.json b/example-apps/ElasticGPT_Plugin/.well-known/ai-plugin.json similarity index 100% rename from gai-examples/ElasticGPT_Plugin/.well-known/ai-plugin.json rename to example-apps/ElasticGPT_Plugin/.well-known/ai-plugin.json diff --git a/gai-examples/ElasticGPT_Plugin/Dockerfile b/example-apps/ElasticGPT_Plugin/Dockerfile similarity index 100% rename from gai-examples/ElasticGPT_Plugin/Dockerfile rename to example-apps/ElasticGPT_Plugin/Dockerfile diff --git a/gai-examples/ElasticGPT_Plugin/LICENSE.txt b/example-apps/ElasticGPT_Plugin/LICENSE.txt similarity index 100% rename from gai-examples/ElasticGPT_Plugin/LICENSE.txt rename to example-apps/ElasticGPT_Plugin/LICENSE.txt diff --git a/example-apps/ElasticGPT_Plugin/README.md b/example-apps/ElasticGPT_Plugin/README.md new file mode 100644 index 00000000..e331a6bd --- /dev/null +++ b/example-apps/ElasticGPT_Plugin/README.md @@ -0,0 +1,19 @@ +# ElasticGPT plugin + +Implement a ChatGPT plugin and extend ChatGPT usage to any content indexed into Elasticsearch: + +- Implement a ChatGPT plugin that allows access to Elasticsearch data for context-relevant responses. +- ChatGPT plugins are extensions developed to assist the model in completing its knowledge or executing actions. +- The plugin architecture involves making a call to the `/search` endpoint of the plugin, which sends a search request to Elasticsearch. +- The plugin then returns the document body and URL to ChatGPT, which uses this information to craft its response. +- Deployment of the plugin on Google Cloud Platform (GCP) is demonstrated using Cloud Run. +- Users can install the plugin in ChatGPT and query Elasticsearch data to enhance ChatGPT's knowledge and functionality. + +For full details refer to the original Elastic Blog Post: + +- [ChatGPT and Elasticsearch: A plugin to use ChatGPT with your Elastic data](https://www.elastic.co/blog/chatgpt-elasticsearch-plugin-elastic-data) + + +> â„šī¸ **Note**: +> _This is an Elastic Labs project. Elastic Labs projects are for illustrative and experimental purposes only. This Elastic Labs project is not part of any product or services offering provided or supported under a commercial license or subscription. This project is made available as-is under the terms of the license associated with this project._ +> _The release and timing of any features or functionality described in this project remain at Elastic's sole discretion. Any features or functionality not currently available may not be delivered on time or at all._ diff --git a/gai-examples/ElasticGPT_Plugin/app.py b/example-apps/ElasticGPT_Plugin/app.py similarity index 100% rename from gai-examples/ElasticGPT_Plugin/app.py rename to example-apps/ElasticGPT_Plugin/app.py diff --git a/gai-examples/ElasticGPT_Plugin/app.py-bak b/example-apps/ElasticGPT_Plugin/app.py-bak similarity index 100% rename from gai-examples/ElasticGPT_Plugin/app.py-bak rename to example-apps/ElasticGPT_Plugin/app.py-bak diff --git a/gai-examples/ElasticGPT_Plugin/logo.png b/example-apps/ElasticGPT_Plugin/logo.png similarity index 100% rename from gai-examples/ElasticGPT_Plugin/logo.png rename to example-apps/ElasticGPT_Plugin/logo.png diff --git a/gai-examples/ElasticGPT_Plugin/openapi.yaml b/example-apps/ElasticGPT_Plugin/openapi.yaml similarity index 100% rename from gai-examples/ElasticGPT_Plugin/openapi.yaml rename to example-apps/ElasticGPT_Plugin/openapi.yaml diff --git a/esre-examples/openai-integration-example-javascript/.gitignore b/example-apps/OpenAI-embeddings/OpenAI-JS/.gitignore similarity index 100% rename from esre-examples/openai-integration-example-javascript/.gitignore rename to example-apps/OpenAI-embeddings/OpenAI-JS/.gitignore diff --git a/esre-examples/openai-integration-example-javascript/LICENSE b/example-apps/OpenAI-embeddings/OpenAI-JS/LICENSE similarity index 100% rename from esre-examples/openai-integration-example-javascript/LICENSE rename to example-apps/OpenAI-embeddings/OpenAI-JS/LICENSE diff --git a/esre-examples/openai-integration-example-javascript/README.md b/example-apps/OpenAI-embeddings/OpenAI-JS/README.md similarity index 99% rename from esre-examples/openai-integration-example-javascript/README.md rename to example-apps/OpenAI-embeddings/OpenAI-JS/README.md index b15cb830..6e8aace4 100644 --- a/esre-examples/openai-integration-example-javascript/README.md +++ b/example-apps/OpenAI-embeddings/OpenAI-JS/README.md @@ -1,4 +1,4 @@ -# Elastic OpenAI integration example - JavaScript +# Elastic OpenAI embeddings example - JavaScript ## Overview diff --git a/esre-examples/openai-integration-example-javascript/generate_embeddings.js b/example-apps/OpenAI-embeddings/OpenAI-JS/generate_embeddings.js similarity index 100% rename from esre-examples/openai-integration-example-javascript/generate_embeddings.js rename to example-apps/OpenAI-embeddings/OpenAI-JS/generate_embeddings.js diff --git a/esre-examples/openai-integration-example-javascript/images/elastic_cloud_id.png b/example-apps/OpenAI-embeddings/OpenAI-JS/images/elastic_cloud_id.png similarity index 100% rename from esre-examples/openai-integration-example-javascript/images/elastic_cloud_id.png rename to example-apps/OpenAI-embeddings/OpenAI-JS/images/elastic_cloud_id.png diff --git a/esre-examples/openai-integration-example-javascript/images/elastic_credentials.png b/example-apps/OpenAI-embeddings/OpenAI-JS/images/elastic_credentials.png similarity index 100% rename from esre-examples/openai-integration-example-javascript/images/elastic_credentials.png rename to example-apps/OpenAI-embeddings/OpenAI-JS/images/elastic_credentials.png diff --git a/esre-examples/openai-integration-example-javascript/images/openai_api_key.png b/example-apps/OpenAI-embeddings/OpenAI-JS/images/openai_api_key.png similarity index 100% rename from esre-examples/openai-integration-example-javascript/images/openai_api_key.png rename to example-apps/OpenAI-embeddings/OpenAI-JS/images/openai_api_key.png diff --git a/esre-examples/openai-integration-example-javascript/images/search.png b/example-apps/OpenAI-embeddings/OpenAI-JS/images/search.png similarity index 100% rename from esre-examples/openai-integration-example-javascript/images/search.png rename to example-apps/OpenAI-embeddings/OpenAI-JS/images/search.png diff --git a/esre-examples/openai-integration-example-javascript/package-lock.json b/example-apps/OpenAI-embeddings/OpenAI-JS/package-lock.json similarity index 100% rename from esre-examples/openai-integration-example-javascript/package-lock.json rename to example-apps/OpenAI-embeddings/OpenAI-JS/package-lock.json diff --git a/esre-examples/openai-integration-example-javascript/package.json b/example-apps/OpenAI-embeddings/OpenAI-JS/package.json similarity index 100% rename from esre-examples/openai-integration-example-javascript/package.json rename to example-apps/OpenAI-embeddings/OpenAI-JS/package.json diff --git a/esre-examples/openai-integration-example-javascript/sample_data/medicare.json b/example-apps/OpenAI-embeddings/OpenAI-JS/sample_data/medicare.json similarity index 100% rename from esre-examples/openai-integration-example-javascript/sample_data/medicare.json rename to example-apps/OpenAI-embeddings/OpenAI-JS/sample_data/medicare.json diff --git a/esre-examples/openai-integration-example-javascript/search_app.js b/example-apps/OpenAI-embeddings/OpenAI-JS/search_app.js similarity index 100% rename from esre-examples/openai-integration-example-javascript/search_app.js rename to example-apps/OpenAI-embeddings/OpenAI-JS/search_app.js diff --git a/esre-examples/openai-integration-example-javascript/utils.js b/example-apps/OpenAI-embeddings/OpenAI-JS/utils.js similarity index 100% rename from esre-examples/openai-integration-example-javascript/utils.js rename to example-apps/OpenAI-embeddings/OpenAI-JS/utils.js diff --git a/esre-examples/openai-integration-example-javascript/views/search.hbs b/example-apps/OpenAI-embeddings/OpenAI-JS/views/search.hbs similarity index 100% rename from esre-examples/openai-integration-example-javascript/views/search.hbs rename to example-apps/OpenAI-embeddings/OpenAI-JS/views/search.hbs diff --git a/esre-examples/openai-integration-example-python/.gitignore b/example-apps/OpenAI-embeddings/OpenAI-Py/.gitignore similarity index 100% rename from esre-examples/openai-integration-example-python/.gitignore rename to example-apps/OpenAI-embeddings/OpenAI-Py/.gitignore diff --git a/esre-examples/openai-integration-example-python/LICENSE b/example-apps/OpenAI-embeddings/OpenAI-Py/LICENSE similarity index 100% rename from esre-examples/openai-integration-example-python/LICENSE rename to example-apps/OpenAI-embeddings/OpenAI-Py/LICENSE diff --git a/esre-examples/openai-integration-example-python/README.md b/example-apps/OpenAI-embeddings/OpenAI-Py/README.md similarity index 100% rename from esre-examples/openai-integration-example-python/README.md rename to example-apps/OpenAI-embeddings/OpenAI-Py/README.md diff --git a/esre-examples/openai-integration-example-python/generate_embeddings.py b/example-apps/OpenAI-embeddings/OpenAI-Py/generate_embeddings.py similarity index 100% rename from esre-examples/openai-integration-example-python/generate_embeddings.py rename to example-apps/OpenAI-embeddings/OpenAI-Py/generate_embeddings.py diff --git a/esre-examples/openai-integration-example-python/images/elastic_cloud_id.png b/example-apps/OpenAI-embeddings/OpenAI-Py/images/elastic_cloud_id.png similarity index 100% rename from esre-examples/openai-integration-example-python/images/elastic_cloud_id.png rename to example-apps/OpenAI-embeddings/OpenAI-Py/images/elastic_cloud_id.png diff --git a/esre-examples/openai-integration-example-python/images/elastic_credentials.png b/example-apps/OpenAI-embeddings/OpenAI-Py/images/elastic_credentials.png similarity index 100% rename from esre-examples/openai-integration-example-python/images/elastic_credentials.png rename to example-apps/OpenAI-embeddings/OpenAI-Py/images/elastic_credentials.png diff --git a/esre-examples/openai-integration-example-python/images/openai_api_key.png b/example-apps/OpenAI-embeddings/OpenAI-Py/images/openai_api_key.png similarity index 100% rename from esre-examples/openai-integration-example-python/images/openai_api_key.png rename to example-apps/OpenAI-embeddings/OpenAI-Py/images/openai_api_key.png diff --git a/esre-examples/openai-integration-example-python/images/search.png b/example-apps/OpenAI-embeddings/OpenAI-Py/images/search.png similarity index 100% rename from esre-examples/openai-integration-example-python/images/search.png rename to example-apps/OpenAI-embeddings/OpenAI-Py/images/search.png diff --git a/esre-examples/openai-integration-example-python/requirements.txt b/example-apps/OpenAI-embeddings/OpenAI-Py/requirements.txt similarity index 100% rename from esre-examples/openai-integration-example-python/requirements.txt rename to example-apps/OpenAI-embeddings/OpenAI-Py/requirements.txt diff --git a/esre-examples/openai-integration-example-python/sample_data/medicare.json b/example-apps/OpenAI-embeddings/OpenAI-Py/sample_data/medicare.json similarity index 100% rename from esre-examples/openai-integration-example-python/sample_data/medicare.json rename to example-apps/OpenAI-embeddings/OpenAI-Py/sample_data/medicare.json diff --git a/esre-examples/openai-integration-example-python/search_app.py b/example-apps/OpenAI-embeddings/OpenAI-Py/search_app.py similarity index 100% rename from esre-examples/openai-integration-example-python/search_app.py rename to example-apps/OpenAI-embeddings/OpenAI-Py/search_app.py diff --git a/esre-examples/openai-integration-example-python/templates/search.html b/example-apps/OpenAI-embeddings/OpenAI-Py/templates/search.html similarity index 100% rename from esre-examples/openai-integration-example-python/templates/search.html rename to example-apps/OpenAI-embeddings/OpenAI-Py/templates/search.html diff --git a/example-apps/OpenAI-embeddings/README.md b/example-apps/OpenAI-embeddings/README.md new file mode 100644 index 00000000..2caf554c --- /dev/null +++ b/example-apps/OpenAI-embeddings/README.md @@ -0,0 +1,14 @@ +## Overview + +Tiny example applications that integrate Elastic with [OpenAI embeddings](https://platform.openai.com/docs/guides/embeddings): + +- Process JSON files +- Generate text embeddings using OpenAI [embeddings API](https://platform.openai.com/docs/api-reference/embeddings) +- Store data in Elasticsearch +- Run semantic search in web app using Elasticsearch kNN search +- Return relevant search results + +## Programming languages + +- [Python](./OpenAI-Py/README.md) +- [JavaScript](./OpenAI-JS/README.md) diff --git a/example-apps/README.md b/example-apps/README.md new file mode 100644 index 00000000..df966b78 --- /dev/null +++ b/example-apps/README.md @@ -0,0 +1,14 @@ +# Elasticsearch example apps + +## Overview + +The following example apps demonstrate Elasticsearch for a variety of use cases, such as semantic search and retrieval augmented generation, using different programming languages and frameworks. + +Use these apps as a starting point for your own projects. + +## Apps + +- [ElasticDocs GPT](./ElasticDocs_GPT/README.md). Combine Elasticsearch with the question answering power of ChatGPT. +- [ElasticGPT plugin](./ElasticGPT_Plugin/README.md). Implement a ChatGPT plugin and extend ChatGPT usage to any content indexed into Elasticsearch. +- [OpenAI embeddings](./OpenAI-embeddings/README.md). Use OpenAI embeddings at index time and in Elastic kNN queries. Available in [JavaScript](./OpenAI-embeddings/OpenAI-JS/README.md) and [Python](./OpenAI-embeddings/OpenAI-Py/README.md) versions. +- [Workplace search](./Workplace-Search/README.MD). Build a semantic search experience for organizational/workplace data. diff --git a/esre-examples/python-flask-example/.gitignore b/example-apps/Workplace-Search/.gitignore similarity index 100% rename from esre-examples/python-flask-example/.gitignore rename to example-apps/Workplace-Search/.gitignore diff --git a/esre-examples/python-flask-example/Dockerfile b/example-apps/Workplace-Search/Dockerfile similarity index 100% rename from esre-examples/python-flask-example/Dockerfile rename to example-apps/Workplace-Search/Dockerfile diff --git a/esre-examples/python-flask-example/README.md b/example-apps/Workplace-Search/README.md similarity index 94% rename from esre-examples/python-flask-example/README.md rename to example-apps/Workplace-Search/README.md index db7c9832..a08aaf71 100644 --- a/esre-examples/python-flask-example/README.md +++ b/example-apps/Workplace-Search/README.md @@ -6,11 +6,12 @@ This is a sample app that combines Elasticsearch and OpenAI to create a semantic ## 1. Download the Project -Download the project from Github and extract the python-flask-example folder. +Download the project from Github and extract the Workplace-Search folder. ```bash curl https://codeload.github.com/elastic/elasticsearch-labs/tar.gz/main | \ -tar -xz --strip=2 elasticsearch-labs-main/esre-examples/python-flask-example +tar -xz --strip=2 elasticsearch-labs-main/esre-examples/Workplace-Search +``` ``` ## 2. Index Data diff --git a/esre-examples/python-flask-example/api/app.py b/example-apps/Workplace-Search/api/app.py similarity index 100% rename from esre-examples/python-flask-example/api/app.py rename to example-apps/Workplace-Search/api/app.py diff --git a/esre-examples/python-flask-example/api/requirements.txt b/example-apps/Workplace-Search/api/requirements.txt similarity index 100% rename from esre-examples/python-flask-example/api/requirements.txt rename to example-apps/Workplace-Search/api/requirements.txt diff --git a/esre-examples/python-flask-example/app-demo.gif b/example-apps/Workplace-Search/app-demo.gif similarity index 100% rename from esre-examples/python-flask-example/app-demo.gif rename to example-apps/Workplace-Search/app-demo.gif diff --git a/esre-examples/python-flask-example/example-data/README.md b/example-apps/Workplace-Search/example-data/README.md similarity index 100% rename from esre-examples/python-flask-example/example-data/README.md rename to example-apps/Workplace-Search/example-data/README.md diff --git a/esre-examples/python-flask-example/example-data/data.json b/example-apps/Workplace-Search/example-data/data.json similarity index 100% rename from esre-examples/python-flask-example/example-data/data.json rename to example-apps/Workplace-Search/example-data/data.json diff --git a/esre-examples/python-flask-example/example-data/images/add-inference-fields.png b/example-apps/Workplace-Search/example-data/images/add-inference-fields.png similarity index 100% rename from esre-examples/python-flask-example/example-data/images/add-inference-fields.png rename to example-apps/Workplace-Search/example-data/images/add-inference-fields.png diff --git a/esre-examples/python-flask-example/example-data/images/add-inference-pipeline.png b/example-apps/Workplace-Search/example-data/images/add-inference-pipeline.png similarity index 100% rename from esre-examples/python-flask-example/example-data/images/add-inference-pipeline.png rename to example-apps/Workplace-Search/example-data/images/add-inference-pipeline.png diff --git a/esre-examples/python-flask-example/example-data/images/cloud-id.png b/example-apps/Workplace-Search/example-data/images/cloud-id.png similarity index 100% rename from esre-examples/python-flask-example/example-data/images/cloud-id.png rename to example-apps/Workplace-Search/example-data/images/cloud-id.png diff --git a/esre-examples/python-flask-example/example-data/images/copy-customize.png b/example-apps/Workplace-Search/example-data/images/copy-customize.png similarity index 100% rename from esre-examples/python-flask-example/example-data/images/copy-customize.png rename to example-apps/Workplace-Search/example-data/images/copy-customize.png diff --git a/esre-examples/python-flask-example/example-data/images/ent-search-landing.png b/example-apps/Workplace-Search/example-data/images/ent-search-landing.png similarity index 100% rename from esre-examples/python-flask-example/example-data/images/ent-search-landing.png rename to example-apps/Workplace-Search/example-data/images/ent-search-landing.png diff --git a/esre-examples/python-flask-example/example-data/images/fields-mapping.png b/example-apps/Workplace-Search/example-data/images/fields-mapping.png similarity index 100% rename from esre-examples/python-flask-example/example-data/images/fields-mapping.png rename to example-apps/Workplace-Search/example-data/images/fields-mapping.png diff --git a/esre-examples/python-flask-example/example-data/index-data.py b/example-apps/Workplace-Search/example-data/index-data.py similarity index 100% rename from esre-examples/python-flask-example/example-data/index-data.py rename to example-apps/Workplace-Search/example-data/index-data.py diff --git a/esre-examples/python-flask-example/example-data/load-data.sh b/example-apps/Workplace-Search/example-data/load-data.sh similarity index 100% rename from esre-examples/python-flask-example/example-data/load-data.sh rename to example-apps/Workplace-Search/example-data/load-data.sh diff --git a/esre-examples/python-flask-example/example-data/load-medicare.sh b/example-apps/Workplace-Search/example-data/load-medicare.sh similarity index 100% rename from esre-examples/python-flask-example/example-data/load-medicare.sh rename to example-apps/Workplace-Search/example-data/load-medicare.sh diff --git a/esre-examples/python-flask-example/example-data/medicare.json b/example-apps/Workplace-Search/example-data/medicare.json similarity index 100% rename from esre-examples/python-flask-example/example-data/medicare.json rename to example-apps/Workplace-Search/example-data/medicare.json diff --git a/esre-examples/python-flask-example/example-data/requirements.txt b/example-apps/Workplace-Search/example-data/requirements.txt similarity index 100% rename from esre-examples/python-flask-example/example-data/requirements.txt rename to example-apps/Workplace-Search/example-data/requirements.txt diff --git a/esre-examples/python-flask-example/frontend/package.json b/example-apps/Workplace-Search/frontend/package.json similarity index 100% rename from esre-examples/python-flask-example/frontend/package.json rename to example-apps/Workplace-Search/frontend/package.json diff --git a/esre-examples/python-flask-example/frontend/public/favicon.ico b/example-apps/Workplace-Search/frontend/public/favicon.ico similarity index 100% rename from esre-examples/python-flask-example/frontend/public/favicon.ico rename to example-apps/Workplace-Search/frontend/public/favicon.ico diff --git a/esre-examples/python-flask-example/frontend/public/index.html b/example-apps/Workplace-Search/frontend/public/index.html similarity index 100% rename from esre-examples/python-flask-example/frontend/public/index.html rename to example-apps/Workplace-Search/frontend/public/index.html diff --git a/esre-examples/python-flask-example/frontend/public/logo192.png b/example-apps/Workplace-Search/frontend/public/logo192.png similarity index 100% rename from esre-examples/python-flask-example/frontend/public/logo192.png rename to example-apps/Workplace-Search/frontend/public/logo192.png diff --git a/esre-examples/python-flask-example/frontend/public/logo512.png b/example-apps/Workplace-Search/frontend/public/logo512.png similarity index 100% rename from esre-examples/python-flask-example/frontend/public/logo512.png rename to example-apps/Workplace-Search/frontend/public/logo512.png diff --git a/esre-examples/python-flask-example/frontend/public/manifest.json b/example-apps/Workplace-Search/frontend/public/manifest.json similarity index 100% rename from esre-examples/python-flask-example/frontend/public/manifest.json rename to example-apps/Workplace-Search/frontend/public/manifest.json diff --git a/esre-examples/python-flask-example/frontend/public/robots.txt b/example-apps/Workplace-Search/frontend/public/robots.txt similarity index 100% rename from esre-examples/python-flask-example/frontend/public/robots.txt rename to example-apps/Workplace-Search/frontend/public/robots.txt diff --git a/esre-examples/python-flask-example/frontend/src/App.test.tsx b/example-apps/Workplace-Search/frontend/src/App.test.tsx similarity index 100% rename from esre-examples/python-flask-example/frontend/src/App.test.tsx rename to example-apps/Workplace-Search/frontend/src/App.test.tsx diff --git a/esre-examples/python-flask-example/frontend/src/App.tsx b/example-apps/Workplace-Search/frontend/src/App.tsx similarity index 100% rename from esre-examples/python-flask-example/frontend/src/App.tsx rename to example-apps/Workplace-Search/frontend/src/App.tsx diff --git a/esre-examples/python-flask-example/frontend/src/components/FeedbackControl/_feedback_control.scss b/example-apps/Workplace-Search/frontend/src/components/FeedbackControl/_feedback_control.scss similarity index 100% rename from esre-examples/python-flask-example/frontend/src/components/FeedbackControl/_feedback_control.scss rename to example-apps/Workplace-Search/frontend/src/components/FeedbackControl/_feedback_control.scss diff --git a/esre-examples/python-flask-example/frontend/src/components/FeedbackControl/feedback_control.tsx b/example-apps/Workplace-Search/frontend/src/components/FeedbackControl/feedback_control.tsx similarity index 100% rename from esre-examples/python-flask-example/frontend/src/components/FeedbackControl/feedback_control.tsx rename to example-apps/Workplace-Search/frontend/src/components/FeedbackControl/feedback_control.tsx diff --git a/esre-examples/python-flask-example/frontend/src/components/avatar.tsx b/example-apps/Workplace-Search/frontend/src/components/avatar.tsx similarity index 100% rename from esre-examples/python-flask-example/frontend/src/components/avatar.tsx rename to example-apps/Workplace-Search/frontend/src/components/avatar.tsx diff --git a/esre-examples/python-flask-example/frontend/src/components/chat/input.tsx b/example-apps/Workplace-Search/frontend/src/components/chat/input.tsx similarity index 100% rename from esre-examples/python-flask-example/frontend/src/components/chat/input.tsx rename to example-apps/Workplace-Search/frontend/src/components/chat/input.tsx diff --git a/esre-examples/python-flask-example/frontend/src/components/chat/search_input.tsx b/example-apps/Workplace-Search/frontend/src/components/chat/search_input.tsx similarity index 100% rename from esre-examples/python-flask-example/frontend/src/components/chat/search_input.tsx rename to example-apps/Workplace-Search/frontend/src/components/chat/search_input.tsx diff --git a/esre-examples/python-flask-example/frontend/src/components/chat_message.tsx b/example-apps/Workplace-Search/frontend/src/components/chat_message.tsx similarity index 100% rename from esre-examples/python-flask-example/frontend/src/components/chat_message.tsx rename to example-apps/Workplace-Search/frontend/src/components/chat_message.tsx diff --git a/esre-examples/python-flask-example/frontend/src/components/chat_message_list.tsx b/example-apps/Workplace-Search/frontend/src/components/chat_message_list.tsx similarity index 100% rename from esre-examples/python-flask-example/frontend/src/components/chat_message_list.tsx rename to example-apps/Workplace-Search/frontend/src/components/chat_message_list.tsx diff --git a/esre-examples/python-flask-example/frontend/src/components/header.tsx b/example-apps/Workplace-Search/frontend/src/components/header.tsx similarity index 100% rename from esre-examples/python-flask-example/frontend/src/components/header.tsx rename to example-apps/Workplace-Search/frontend/src/components/header.tsx diff --git a/esre-examples/python-flask-example/frontend/src/components/images/SendIcon.tsx b/example-apps/Workplace-Search/frontend/src/components/images/SendIcon.tsx similarity index 100% rename from esre-examples/python-flask-example/frontend/src/components/images/SendIcon.tsx rename to example-apps/Workplace-Search/frontend/src/components/images/SendIcon.tsx diff --git a/esre-examples/python-flask-example/frontend/src/components/images/bug.svg b/example-apps/Workplace-Search/frontend/src/components/images/bug.svg similarity index 100% rename from esre-examples/python-flask-example/frontend/src/components/images/bug.svg rename to example-apps/Workplace-Search/frontend/src/components/images/bug.svg diff --git a/esre-examples/python-flask-example/frontend/src/components/images/bug.tsx b/example-apps/Workplace-Search/frontend/src/components/images/bug.tsx similarity index 100% rename from esre-examples/python-flask-example/frontend/src/components/images/bug.tsx rename to example-apps/Workplace-Search/frontend/src/components/images/bug.tsx diff --git a/esre-examples/python-flask-example/frontend/src/components/images/confluence.png b/example-apps/Workplace-Search/frontend/src/components/images/confluence.png similarity index 100% rename from esre-examples/python-flask-example/frontend/src/components/images/confluence.png rename to example-apps/Workplace-Search/frontend/src/components/images/confluence.png diff --git a/esre-examples/python-flask-example/frontend/src/components/images/conversation.tsx b/example-apps/Workplace-Search/frontend/src/components/images/conversation.tsx similarity index 100% rename from esre-examples/python-flask-example/frontend/src/components/images/conversation.tsx rename to example-apps/Workplace-Search/frontend/src/components/images/conversation.tsx diff --git a/esre-examples/python-flask-example/frontend/src/components/images/disappointed.svg b/example-apps/Workplace-Search/frontend/src/components/images/disappointed.svg similarity index 100% rename from esre-examples/python-flask-example/frontend/src/components/images/disappointed.svg rename to example-apps/Workplace-Search/frontend/src/components/images/disappointed.svg diff --git a/esre-examples/python-flask-example/frontend/src/components/images/disappointed.tsx b/example-apps/Workplace-Search/frontend/src/components/images/disappointed.tsx similarity index 100% rename from esre-examples/python-flask-example/frontend/src/components/images/disappointed.tsx rename to example-apps/Workplace-Search/frontend/src/components/images/disappointed.tsx diff --git a/esre-examples/python-flask-example/frontend/src/components/images/docs.png b/example-apps/Workplace-Search/frontend/src/components/images/docs.png similarity index 100% rename from esre-examples/python-flask-example/frontend/src/components/images/docs.png rename to example-apps/Workplace-Search/frontend/src/components/images/docs.png diff --git a/esre-examples/python-flask-example/frontend/src/components/images/dropbox.png b/example-apps/Workplace-Search/frontend/src/components/images/dropbox.png similarity index 100% rename from esre-examples/python-flask-example/frontend/src/components/images/dropbox.png rename to example-apps/Workplace-Search/frontend/src/components/images/dropbox.png diff --git a/esre-examples/python-flask-example/frontend/src/components/images/elasticTypeMark.png b/example-apps/Workplace-Search/frontend/src/components/images/elasticTypeMark.png similarity index 100% rename from esre-examples/python-flask-example/frontend/src/components/images/elasticTypeMark.png rename to example-apps/Workplace-Search/frontend/src/components/images/elasticTypeMark.png diff --git a/esre-examples/python-flask-example/frontend/src/components/images/excel.png b/example-apps/Workplace-Search/frontend/src/components/images/excel.png similarity index 100% rename from esre-examples/python-flask-example/frontend/src/components/images/excel.png rename to example-apps/Workplace-Search/frontend/src/components/images/excel.png diff --git a/esre-examples/python-flask-example/frontend/src/components/images/faq.png b/example-apps/Workplace-Search/frontend/src/components/images/faq.png similarity index 100% rename from esre-examples/python-flask-example/frontend/src/components/images/faq.png rename to example-apps/Workplace-Search/frontend/src/components/images/faq.png diff --git a/esre-examples/python-flask-example/frontend/src/components/images/github.png b/example-apps/Workplace-Search/frontend/src/components/images/github.png similarity index 100% rename from esre-examples/python-flask-example/frontend/src/components/images/github.png rename to example-apps/Workplace-Search/frontend/src/components/images/github.png diff --git a/esre-examples/python-flask-example/frontend/src/components/images/neutral.svg b/example-apps/Workplace-Search/frontend/src/components/images/neutral.svg similarity index 100% rename from esre-examples/python-flask-example/frontend/src/components/images/neutral.svg rename to example-apps/Workplace-Search/frontend/src/components/images/neutral.svg diff --git a/esre-examples/python-flask-example/frontend/src/components/images/neutral.tsx b/example-apps/Workplace-Search/frontend/src/components/images/neutral.tsx similarity index 100% rename from esre-examples/python-flask-example/frontend/src/components/images/neutral.tsx rename to example-apps/Workplace-Search/frontend/src/components/images/neutral.tsx diff --git a/esre-examples/python-flask-example/frontend/src/components/images/onedrive.png b/example-apps/Workplace-Search/frontend/src/components/images/onedrive.png similarity index 100% rename from esre-examples/python-flask-example/frontend/src/components/images/onedrive.png rename to example-apps/Workplace-Search/frontend/src/components/images/onedrive.png diff --git a/esre-examples/python-flask-example/frontend/src/components/images/pdf.png b/example-apps/Workplace-Search/frontend/src/components/images/pdf.png similarity index 100% rename from esre-examples/python-flask-example/frontend/src/components/images/pdf.png rename to example-apps/Workplace-Search/frontend/src/components/images/pdf.png diff --git a/esre-examples/python-flask-example/frontend/src/components/images/reload.tsx b/example-apps/Workplace-Search/frontend/src/components/images/reload.tsx similarity index 100% rename from esre-examples/python-flask-example/frontend/src/components/images/reload.tsx rename to example-apps/Workplace-Search/frontend/src/components/images/reload.tsx diff --git a/esre-examples/python-flask-example/frontend/src/components/images/robot-avatar.png b/example-apps/Workplace-Search/frontend/src/components/images/robot-avatar.png similarity index 100% rename from esre-examples/python-flask-example/frontend/src/components/images/robot-avatar.png rename to example-apps/Workplace-Search/frontend/src/components/images/robot-avatar.png diff --git a/esre-examples/python-flask-example/frontend/src/components/images/searchIcon.tsx b/example-apps/Workplace-Search/frontend/src/components/images/searchIcon.tsx similarity index 100% rename from esre-examples/python-flask-example/frontend/src/components/images/searchIcon.tsx rename to example-apps/Workplace-Search/frontend/src/components/images/searchIcon.tsx diff --git a/esre-examples/python-flask-example/frontend/src/components/images/sharepoint.png b/example-apps/Workplace-Search/frontend/src/components/images/sharepoint.png similarity index 100% rename from esre-examples/python-flask-example/frontend/src/components/images/sharepoint.png rename to example-apps/Workplace-Search/frontend/src/components/images/sharepoint.png diff --git a/esre-examples/python-flask-example/frontend/src/components/images/sheets.png b/example-apps/Workplace-Search/frontend/src/components/images/sheets.png similarity index 100% rename from esre-examples/python-flask-example/frontend/src/components/images/sheets.png rename to example-apps/Workplace-Search/frontend/src/components/images/sheets.png diff --git a/esre-examples/python-flask-example/frontend/src/components/images/slides.png b/example-apps/Workplace-Search/frontend/src/components/images/slides.png similarity index 100% rename from esre-examples/python-flask-example/frontend/src/components/images/slides.png rename to example-apps/Workplace-Search/frontend/src/components/images/slides.png diff --git a/esre-examples/python-flask-example/frontend/src/components/images/smile.svg b/example-apps/Workplace-Search/frontend/src/components/images/smile.svg similarity index 100% rename from esre-examples/python-flask-example/frontend/src/components/images/smile.svg rename to example-apps/Workplace-Search/frontend/src/components/images/smile.svg diff --git a/esre-examples/python-flask-example/frontend/src/components/images/smile.tsx b/example-apps/Workplace-Search/frontend/src/components/images/smile.tsx similarity index 100% rename from esre-examples/python-flask-example/frontend/src/components/images/smile.tsx rename to example-apps/Workplace-Search/frontend/src/components/images/smile.tsx diff --git a/esre-examples/python-flask-example/frontend/src/components/images/sql server.png b/example-apps/Workplace-Search/frontend/src/components/images/sql server.png similarity index 100% rename from esre-examples/python-flask-example/frontend/src/components/images/sql server.png rename to example-apps/Workplace-Search/frontend/src/components/images/sql server.png diff --git a/esre-examples/python-flask-example/frontend/src/components/images/teams.png b/example-apps/Workplace-Search/frontend/src/components/images/teams.png similarity index 100% rename from esre-examples/python-flask-example/frontend/src/components/images/teams.png rename to example-apps/Workplace-Search/frontend/src/components/images/teams.png diff --git a/esre-examples/python-flask-example/frontend/src/components/images/word.png b/example-apps/Workplace-Search/frontend/src/components/images/word.png similarity index 100% rename from esre-examples/python-flask-example/frontend/src/components/images/word.png rename to example-apps/Workplace-Search/frontend/src/components/images/word.png diff --git a/esre-examples/python-flask-example/frontend/src/components/source_icon.tsx b/example-apps/Workplace-Search/frontend/src/components/source_icon.tsx similarity index 100% rename from esre-examples/python-flask-example/frontend/src/components/source_icon.tsx rename to example-apps/Workplace-Search/frontend/src/components/source_icon.tsx diff --git a/esre-examples/python-flask-example/frontend/src/components/source_item.tsx b/example-apps/Workplace-Search/frontend/src/components/source_item.tsx similarity index 100% rename from esre-examples/python-flask-example/frontend/src/components/source_item.tsx rename to example-apps/Workplace-Search/frontend/src/components/source_item.tsx diff --git a/esre-examples/python-flask-example/frontend/src/components/sources.tsx b/example-apps/Workplace-Search/frontend/src/components/sources.tsx similarity index 100% rename from esre-examples/python-flask-example/frontend/src/components/sources.tsx rename to example-apps/Workplace-Search/frontend/src/components/sources.tsx diff --git a/esre-examples/python-flask-example/frontend/src/components/summary.tsx b/example-apps/Workplace-Search/frontend/src/components/summary.tsx similarity index 100% rename from esre-examples/python-flask-example/frontend/src/components/summary.tsx rename to example-apps/Workplace-Search/frontend/src/components/summary.tsx diff --git a/esre-examples/python-flask-example/frontend/src/index.css b/example-apps/Workplace-Search/frontend/src/index.css similarity index 100% rename from esre-examples/python-flask-example/frontend/src/index.css rename to example-apps/Workplace-Search/frontend/src/index.css diff --git a/esre-examples/python-flask-example/frontend/src/index.tsx b/example-apps/Workplace-Search/frontend/src/index.tsx similarity index 100% rename from esre-examples/python-flask-example/frontend/src/index.tsx rename to example-apps/Workplace-Search/frontend/src/index.tsx diff --git a/esre-examples/python-flask-example/frontend/src/lib/utils.ts b/example-apps/Workplace-Search/frontend/src/lib/utils.ts similarity index 100% rename from esre-examples/python-flask-example/frontend/src/lib/utils.ts rename to example-apps/Workplace-Search/frontend/src/lib/utils.ts diff --git a/esre-examples/python-flask-example/frontend/src/logo.svg b/example-apps/Workplace-Search/frontend/src/logo.svg similarity index 100% rename from esre-examples/python-flask-example/frontend/src/logo.svg rename to example-apps/Workplace-Search/frontend/src/logo.svg diff --git a/esre-examples/python-flask-example/frontend/src/store/provider.tsx b/example-apps/Workplace-Search/frontend/src/store/provider.tsx similarity index 100% rename from esre-examples/python-flask-example/frontend/src/store/provider.tsx rename to example-apps/Workplace-Search/frontend/src/store/provider.tsx diff --git a/esre-examples/python-flask-example/frontend/src/types/images.d.ts b/example-apps/Workplace-Search/frontend/src/types/images.d.ts similarity index 100% rename from esre-examples/python-flask-example/frontend/src/types/images.d.ts rename to example-apps/Workplace-Search/frontend/src/types/images.d.ts diff --git a/esre-examples/python-flask-example/frontend/src/types/index.ts b/example-apps/Workplace-Search/frontend/src/types/index.ts similarity index 100% rename from esre-examples/python-flask-example/frontend/src/types/index.ts rename to example-apps/Workplace-Search/frontend/src/types/index.ts diff --git a/esre-examples/python-flask-example/frontend/tailwind.config.js b/example-apps/Workplace-Search/frontend/tailwind.config.js similarity index 100% rename from esre-examples/python-flask-example/frontend/tailwind.config.js rename to example-apps/Workplace-Search/frontend/tailwind.config.js diff --git a/esre-examples/python-flask-example/frontend/tsconfig.json b/example-apps/Workplace-Search/frontend/tsconfig.json similarity index 100% rename from esre-examples/python-flask-example/frontend/tsconfig.json rename to example-apps/Workplace-Search/frontend/tsconfig.json diff --git a/esre-examples/python-flask-example/frontend/yarn.lock b/example-apps/Workplace-Search/frontend/yarn.lock similarity index 100% rename from esre-examples/python-flask-example/frontend/yarn.lock rename to example-apps/Workplace-Search/frontend/yarn.lock diff --git a/gai-examples/ElasticDocs_GPT/README.md b/gai-examples/ElasticDocs_GPT/README.md deleted file mode 100644 index c286ca45..00000000 --- a/gai-examples/ElasticDocs_GPT/README.md +++ /dev/null @@ -1,29 +0,0 @@ -# ElasticDocs_GPT -Combining the search power of Elasticsearch with the Question Answering power of GPT - -[Blog - ChatGPT and Elasticsearch: OpenAI meets private data](https://www.elastic.co/blog/chatgpt-elasticsearch-openai-meets-private-data) - - -![diagram](https://raw.githubusercontent.com/jeffvestal/ElasticDocs_GPT/main/images/ElasticChat%20GPT%20Diagram%20-%20No%20line%20text.jpeg) - -1. Python interface accepts user questions -- Generate a hybrid search request for Elasticsearch -- BM25 match on the title field -- kNN search on the title-vector field -- Boost kNN search results to align scores -- Set size=1 to return only the top scored document -2. Search request is sent to Elasticsearch -3. Documentation body and original url are returned to python -4. API call is made to OpenAI ChatCompletion -- Prompt: "answer this question using only this document " -5. Generated response is returned to python -6. Python adds on original documentation source url to generated response and prints it to the screen for the user - -# Examples - ![autoscale](https://raw.githubusercontent.com/jeffvestal/ElasticDocs_GPT/main/images/elasticDocs%20GPT%20-%20elastic%20cloud%20autoscaling.png) - - ![apm](https://raw.githubusercontent.com/jeffvestal/ElasticDocs_GPT/main/images/elasticDocs%20GPT%20-%20elastic%20jvm%20apm.png) - - ![inference](https://github.com/jeffvestal/ElasticDocs_GPT/blob/main/images/elasticDocs%20GPT%20-%20inference%20processor.png) - - ![pii](https://raw.githubusercontent.com/jeffvestal/ElasticDocs_GPT/main/images/elasticDocs%20GPT%20-%20redact%20pii.png) diff --git a/gai-examples/ElasticGPT_Plugin/README.md b/gai-examples/ElasticGPT_Plugin/README.md deleted file mode 100644 index ce148e0b..00000000 --- a/gai-examples/ElasticGPT_Plugin/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# ElasticGPT_Plugin - -See the full documentation online in this Elastic Blog Post. -https://www.elastic.co/blog/chatgpt-elasticsearch-plugin-elastic-data - -ElasticGPT_Plugin is an Elastic Labs project. Elastic Labs projects are for illustrative and experimental purposes only. This Elastic Labs project is not part of any product or services offering provided or supported under a commercial license or subscription. This project is made available as-is under the terms of the license associated with this project. - -The release and timing of any features or functionality described in this project remain at Elastic's sole discretion. Any features or functionality not currently available may not be delivered on time or at all. diff --git a/notebooks/README.md b/notebooks/README.md new file mode 100644 index 00000000..df729e69 --- /dev/null +++ b/notebooks/README.md @@ -0,0 +1,20 @@ +# Python notebooks 📒 + +This folder contains a range of executable Python notebooks, so you can test everything out for yourself. Use these examples as a blueprint for testing on your own data. + +Run notebooks locally using [Jupyter](https://jupyter.org/install), or use the links provided in each notebook to run them in Google [Colab](https://colab.research.google.com). +Colab provides an easy-to-use Python virtual environment in the browser. + +Notebooks are organized into the following folders: + +- [`search`](./search/). Learn the fundamentals of Elasticsearch, so you can index embeddings, run lexical, semantic and _hybrid_ searches, and more. + +- [`generative-ai`](./generative-ai/): Notebooks that demonstrate various use cases for Elasticsearch as the retrieval engine and vector store for LLM-powered applications. + +- [`integrations`](./integrations/): Notebooks that demonstrate how to integrate popular services and projects with Elasticsearch: + - [OpenAI](./integrations/openai) + - [Hugging Face](./integrations/hugging-face) + - [LlamaIndex](./integrations/llama-index) + +- [`langchain`](./langchain/): Notebooks that demonstrate how to integrate Elastic with [LangChain](https://langchain-langchain.vercel.app/docs/get_started/introduction.html), a framework for developing applications powered by language models. + diff --git a/colab-notebooks-examples/generative-ai/chatbot.ipynb b/notebooks/generative-ai/chatbot.ipynb similarity index 100% rename from colab-notebooks-examples/generative-ai/chatbot.ipynb rename to notebooks/generative-ai/chatbot.ipynb diff --git a/colab-notebooks-examples/generative-ai/question-answering.ipynb b/notebooks/generative-ai/question-answering.ipynb similarity index 100% rename from colab-notebooks-examples/generative-ai/question-answering.ipynb rename to notebooks/generative-ai/question-answering.ipynb diff --git a/colab-notebooks-examples/integrations/hugging-face/hugging-face-endpoints.ipynb b/notebooks/integrations/hugging-face/hugging-face-endpoints.ipynb similarity index 100% rename from colab-notebooks-examples/integrations/hugging-face/hugging-face-endpoints.ipynb rename to notebooks/integrations/hugging-face/hugging-face-endpoints.ipynb diff --git a/colab-notebooks-examples/integrations/hugging-face/loading-model-from-hugging-face.ipynb b/notebooks/integrations/hugging-face/loading-model-from-hugging-face.ipynb similarity index 100% rename from colab-notebooks-examples/integrations/hugging-face/loading-model-from-hugging-face.ipynb rename to notebooks/integrations/hugging-face/loading-model-from-hugging-face.ipynb diff --git a/colab-notebooks-examples/integrations/llama-index/intro.ipynb b/notebooks/integrations/llama-index/intro.ipynb similarity index 100% rename from colab-notebooks-examples/integrations/llama-index/intro.ipynb rename to notebooks/integrations/llama-index/intro.ipynb diff --git a/colab-notebooks-examples/integrations/openai/intro.ipynb b/notebooks/integrations/openai/intro.ipynb similarity index 100% rename from colab-notebooks-examples/integrations/openai/intro.ipynb rename to notebooks/integrations/openai/intro.ipynb diff --git a/colab-notebooks-examples/langchain/langchain-elasticsearch-embeddings.ipynb b/notebooks/langchain/langchain-elasticsearch-embeddings.ipynb similarity index 100% rename from colab-notebooks-examples/langchain/langchain-elasticsearch-embeddings.ipynb rename to notebooks/langchain/langchain-elasticsearch-embeddings.ipynb diff --git a/colab-notebooks-examples/langchain/langchain-vector-store.ipynb b/notebooks/langchain/langchain-vector-store.ipynb similarity index 100% rename from colab-notebooks-examples/langchain/langchain-vector-store.ipynb rename to notebooks/langchain/langchain-vector-store.ipynb diff --git a/colab-notebooks-examples/search/00-quick-start.ipynb b/notebooks/search/00-quick-start.ipynb similarity index 100% rename from colab-notebooks-examples/search/00-quick-start.ipynb rename to notebooks/search/00-quick-start.ipynb diff --git a/colab-notebooks-examples/search/01-keyword-querying-filtering.ipynb b/notebooks/search/01-keyword-querying-filtering.ipynb similarity index 100% rename from colab-notebooks-examples/search/01-keyword-querying-filtering.ipynb rename to notebooks/search/01-keyword-querying-filtering.ipynb diff --git a/colab-notebooks-examples/search/02-hybrid-search.ipynb b/notebooks/search/02-hybrid-search.ipynb similarity index 100% rename from colab-notebooks-examples/search/02-hybrid-search.ipynb rename to notebooks/search/02-hybrid-search.ipynb diff --git a/colab-notebooks-examples/search/03-ELSER.ipynb b/notebooks/search/03-ELSER.ipynb similarity index 100% rename from colab-notebooks-examples/search/03-ELSER.ipynb rename to notebooks/search/03-ELSER.ipynb diff --git a/colab-notebooks-examples/search/data.json b/notebooks/search/data.json similarity index 100% rename from colab-notebooks-examples/search/data.json rename to notebooks/search/data.json From 03700a7eef2133015be274065374de061ebdc176 Mon Sep 17 00:00:00 2001 From: Liam Thompson Date: Mon, 31 Jul 2023 17:57:37 +0200 Subject: [PATCH 2/3] Delete DS_Stores --- .DS_Store | Bin 6148 -> 0 bytes example-apps/.DS_Store | Bin 8196 -> 0 bytes 2 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .DS_Store delete mode 100644 example-apps/.DS_Store diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index d4f56079ef5d898ed0f5c2d6ea257bd421db30a8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK%}T>S5Z-O8O{hW-iXIodR&1?56fdFH7cim+m70*E!I%wAYJ^hARbR+A@p+ut z-72N_;z6X$!0fj>JCkL;3H!qsvp^9`HZ(s7&ZEvr$ygA%`bNScHekEV zW67L18U7;!Si3c-*$dR{399y8zl5cJo+f@IeeikrlPFBHX7huW%9WMXs#UdW)~)*> zb2sy{QQGx}*EqV6GV-T=&%X=@dB47KD&x!xY-@98@8rDy7(K=ERddSW_fxWNa0+kGS(x6l zJB%Y4--FLIei}ze3=jjvz)~|{Ha)Ah)LBw;!~iky8wPNH5TJ;T!9t_jI-tSpBhFV4 zQJ{}+2}EJgF<5AX84#{R0d*)hPYkZZ!7hxSW3bSu!x>jA!*|Te+`Le@S{>{{xiju) zq?Q;U24)#3>tP+w|FgyK|JfiK5d*})QZc|QJ-63|l+4*WmmHq80`v|P1^o(*Um?&@ iM=|)~QM?VR1ndGkfR4dJBUnJ_BA{rXh8Xx$20j70!cL?B diff --git a/example-apps/.DS_Store b/example-apps/.DS_Store deleted file mode 100644 index 5dba2668130c897be621faa3fba6f2f824f61deb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8196 zcmeI1&2G~`6ov1kfjX)XsRW`+OKgxxOG*o9 zTX+ukEO`@N2hRMoQ=AMZ?#}j{^*truT5{-VePP9Tq4yw}X62f1K+OO(N zDcLQ`C*UW_DW*0xNg{G#0!)AjFaajO1pY+=cxJ2OT=3jCdpR-zCh%VpQ1=HHRjFsS zFsg4I2s#CTma$nEw2=pBk89PlS{T(<9MfbE!dit*F@&*WzpJ`KJ*$OLV<%zkB<#q- zW++0B4xg*LlkkjkWCBcJmVkQp-=!T&D4=X2f6u5zuW64Cb`#kS6B(kX`f_cfuKm&l zt-0=Skaey5N7zl`EU(vpiqb;)*6l@S(OGgn`p0tM=Rw}j8bR;9dUqgY5}vh#@Lk*) zw5s=B$utk*wA0guIO?Fwhr>9H5;#+m7YG?icUX^^mY7P@2JpU1EBPx7LreFGr(TrL}%c>r7m?S#Z26#RkThiM2zqPSm4bj;fim7`)F*& zF4Np2+!VNTPjm`yh4wLbx3Prx2D%2c(Im{0n&aa$wMvIr?(5MBE{eK|v~ej`$wv&Z zwN1y9eo=$}@t=#q&wudX!UV2?z=9cbMg0cYxp@8m8a^2h$po0dRS^*7rr&H}w6kBp z(*vtq+eQ6^s*37Y7}XX8osL6wIu1Sm!w_v3U6sePS{TI^6kZ6>7&tJ2D<$w7MCK`5 From cfb1fec0737aa5043b54e8acb869b153ea581d8c Mon Sep 17 00:00:00 2001 From: Liam Thompson Date: Tue, 1 Aug 2023 15:47:00 +0200 Subject: [PATCH 3/3] Update urls in instructions --- example-apps/OpenAI-embeddings/OpenAI-JS/README.md | 2 +- example-apps/OpenAI-embeddings/OpenAI-Py/README.md | 2 +- example-apps/Workplace-Search/README.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/example-apps/OpenAI-embeddings/OpenAI-JS/README.md b/example-apps/OpenAI-embeddings/OpenAI-JS/README.md index 6e8aace4..c3e596dd 100644 --- a/example-apps/OpenAI-embeddings/OpenAI-JS/README.md +++ b/example-apps/OpenAI-embeddings/OpenAI-JS/README.md @@ -26,7 +26,7 @@ Download the project from Github and extract the openai-integration-example-pyth ```bash curl https://codeload.github.com/elastic/elasticsearch-labs/tar.gz/main | \ -tar -xz --strip=2 elasticsearch-labs-main/esre-examples/openai-integration-example-javascript +tar -xz --strip=2 elasticsearch-labs-main/example-apps/OpenAI-embeddings/OpenAI-Py ``` ### 2. Create OpenAI account and API key diff --git a/example-apps/OpenAI-embeddings/OpenAI-Py/README.md b/example-apps/OpenAI-embeddings/OpenAI-Py/README.md index f25e95b8..e11b2c5d 100644 --- a/example-apps/OpenAI-embeddings/OpenAI-Py/README.md +++ b/example-apps/OpenAI-embeddings/OpenAI-Py/README.md @@ -26,7 +26,7 @@ Download the project from Github and extract the openai-integration-example-pyth ```bash curl https://codeload.github.com/elastic/elasticsearch-labs/tar.gz/main | \ -tar -xz --strip=2 elasticsearch-labs-main/esre-examples/openai-integration-example-python +tar -xz --strip=2 elasticsearch-labs-main/example-apps/OpenAI-embeddings/OpenAI-Py ``` ### 2. Create OpenAI account and API key diff --git a/example-apps/Workplace-Search/README.md b/example-apps/Workplace-Search/README.md index a08aaf71..68ae7058 100644 --- a/example-apps/Workplace-Search/README.md +++ b/example-apps/Workplace-Search/README.md @@ -10,7 +10,7 @@ Download the project from Github and extract the Workplace-Search folder. ```bash curl https://codeload.github.com/elastic/elasticsearch-labs/tar.gz/main | \ -tar -xz --strip=2 elasticsearch-labs-main/esre-examples/Workplace-Search +tar -xz --strip=2 elasticsearch-labs-main/example-apps/Workplace-Search ``` ```