# ChatGPT Retrieval Plugin
Find an example video of a Retrieval Plugin that has access to the UN Annual Reports from 2018 to 2022 [here](https://cdn.openai.com/chat-plugins/retrieval-gh-repo-readme/Retrieval-Final.mp4).
## Introduction
The ChatGPT Retrieval Plugin repository provides a flexible solution for semantic search and retrieval of personal or organizational documents using natural language queries. The repository is organized into several directories:
| Directory | Description |
| ------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| [`datastore`](/datastore) | Contains the core logic for storing and querying document embeddings using various vector database providers. |
| [`docs`](/docs) | Includes documentation for setting up and using each vector database provider, webhooks, and removing unused dependencies. |
| [`examples`](/examples) | Provides example configurations, authentication methods, and provider-specific examples. |
| [`local_server`](/local_server) | Contains an implementation of the retrieval plugin configured for localhost testing. |
| [`models`](/models) | Contains the data models used by the plugin, such as document and metadata models. |
| [`scripts`](/scripts) | Offers scripts for processing and uploading documents from different data sources. |
| [`server`](/server) | Houses the main FastAPI server implementation. |
| [`services`](/services) | Contains utility services for tasks like chunking, metadata extraction, and PII detection. |
| [`tests`](/tests) | Includes integration tests for various vector database providers. |
| [`.well-known`](/.well-known) | Stores the plugin manifest file and OpenAPI schema, which define the plugin configuration and API specification. |
This README provides detailed information on how to set up, develop, and deploy the ChatGPT Retrieval Plugin.
## Table of Contents
- [Quickstart](#quickstart)
- [About](#about)
- [Plugins](#plugins)
- [Retrieval Plugin](#retrieval-plugin)
- [Memory Feature](#memory-feature)
- [Security](#security)
- [API Endpoints](#api-endpoints)
- [Development](#development)
- [Setup](#setup)
- [General Environment Variables](#general-environment-variables)
- [Choosing a Vector Database](#choosing-a-vector-database)
- [Pinecone](#pinecone)
- [Elasticsearch](#elasticsearch)
- [Weaviate](#weaviate)
- [Zilliz](#zilliz)
- [Milvus](#milvus)
- [Qdrant](#qdrant)
- [Redis](#redis)
- [Llama Index](#llamaindex)
- [Chroma](#chroma)
- [Azure Cognitive Search](#azure-cognitive-search)
- [Supabase](#supabase)
- [Postgres](#postgres)
- [AnalyticDB](#analyticdb)
- [Running the API Locally](#running-the-api-locally)
- [Testing a Localhost Plugin in ChatGPT](#testing-a-localhost-plugin-in-chatgpt)
- [Personalization](#personalization)
- [Authentication Methods](#authentication-methods)
- [Deployment](#deployment)
- [Installing a Developer Plugin](#installing-a-developer-plugin)
- [Webhooks](#webhooks)
- [Scripts](#scripts)
- [Limitations](#limitations)
- [Contributors](#contributors)
- [Future Directions](#future-directions)
## Quickstart
Follow these steps to quickly set up and run the ChatGPT Retrieval Plugin:
1. Install Python 3.10, if not already installed.
2. Clone the repository: `git clone https://github.com/openai/chatgpt-retrieval-plugin.git`
3. Navigate to the cloned repository directory: `cd /path/to/chatgpt-retrieval-plugin`
4. Install poetry: `pip install poetry`
5. Create a new virtual environment with Python 3.10: `poetry env use python3.10`
6. Activate the virtual environment: `poetry shell`
7. Install app dependencies: `poetry install`
8. Create a [bearer token](#general-environment-variables)
9. Set the required environment variables:
```
export DATASTORE=<your_datastore>
export BEARER_TOKEN=<your_bearer_token>
export OPENAI_API_KEY=<your_openai_api_key>
# Optional environment variables used when running Azure OpenAI
export OPENAI_API_BASE=https://<AzureOpenAIName>.openai.azure.com/
export OPENAI_API_TYPE=azure
export OPENAI_EMBEDDINGMODEL_DEPLOYMENTID=<Name of text-embedding-ada-002 model deployment>
export OPENAI_METADATA_EXTRACTIONMODEL_DEPLOYMENTID=<Name of deployment of model for metatdata>
export OPENAI_COMPLETIONMODEL_DEPLOYMENTID=<Name of general model deployment used for completion>
export OPENAI_EMBEDDING_BATCH_SIZE=<Batch size of embedding, for AzureOAI, this value need to be set as 1>
# Add the environment variables for your chosen vector DB.
# Some of these are optional; read the provider's setup docs in /docs/providers for more information.
# Pinecone
export PINECONE_API_KEY=<your_pinecone_api_key>
export PINECONE_ENVIRONMENT=<your_pinecone_environment>
export PINECONE_INDEX=<your_pinecone_index>
# Weaviate
export WEAVIATE_URL=<your_weaviate_instance_url>
export WEAVIATE_API_KEY=<your_api_key_for_WCS>
export WEAVIATE_CLASS=<your_optional_weaviate_class>
# Zilliz
export ZILLIZ_COLLECTION=<your_zilliz_collection>
export ZILLIZ_URI=<your_zilliz_uri>
export ZILLIZ_USER=<your_zilliz_username>
export ZILLIZ_PASSWORD=<your_zilliz_password>
# Milvus
export MILVUS_COLLECTION=<your_milvus_collection>
export MILVUS_HOST=<your_milvus_host>
export MILVUS_PORT=<your_milvus_port>
export MILVUS_USER=<your_milvus_username>
export MILVUS_PASSWORD=<your_milvus_password>
# Qdrant
export QDRANT_URL=<your_qdrant_url>
export QDRANT_PORT=<your_qdrant_port>
export QDRANT_GRPC_PORT=<your_qdrant_grpc_port>
export QDRANT_API_KEY=<your_qdrant_api_key>
export QDRANT_COLLECTION=<your_qdrant_collection>
# AnalyticDB
export PG_HOST=<your_analyticdb_host>
export PG_PORT=<your_analyticdb_port>
export PG_USER=<your_analyticdb_username>
export PG_PASSWORD=<your_analyticdb_password>
export PG_DATABASE=<your_analyticdb_database>
export PG_COLLECTION=<your_analyticdb_collection>
# Redis
export REDIS_HOST=<your_redis_host>
export REDIS_PORT=<your_redis_port>
export REDIS_PASSWORD=<your_redis_password>
export REDIS_INDEX_NAME=<your_redis_index_name>
export REDIS_DOC_PREFIX=<your_redis_doc_prefix>
export REDIS_DISTANCE_METRIC=<your_redis_distance_metric>
export REDIS_INDEX_TYPE=<your_redis_index_type>
# Llama
export LLAMA_INDEX_TYPE=<gpt_vector_index_type>
export LLAMA_INDEX_JSON_PATH=<path_to_saved_index_json_file>
export LLAMA_QUERY_KWARGS_JSON_PATH=<path_to_saved_query_kwargs_json_file>
export LLAMA_RESPONSE_MODE=<response_mode_for_query>
# Chroma
export CHROMA_COLLECTION=<your_chroma_collection>
export CHROMA_IN_MEMORY=<true_or_false>
export CHROMA_PERSISTENCE_DIR=<your_chroma_persistence_directory>
export CHROMA_HOST=<your_chroma_host>
export CHROMA_PORT=<your_chroma_port>
# Azure Cognitive Search
export AZURESEARCH_SERVICE=<your_search_service_name>
export AZURESEARCH_INDEX=<your_search_index_name>
export AZURESEARCH_API_KEY=<your_api_key> (optional, uses key-free managed identity if not set)
# Supabase
export SUPABASE_URL=<supabase_project_url>
export SUPABASE_ANON_KEY=<supabase_project_api_anon_key>
# Postgres
export PG_HOST=<postgres_host>
export PG_PORT=<postgres_port>
export PG_USER=<postgres_user>
export
没有合适的资源?快使用搜索试试~ 我知道了~
ChatGPT插件:帮助用户轻松地找到个人或工作文件
共109个文件
py:46个
md:26个
json:10个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 25 浏览量
2023-11-16
17:11:58
上传
评论
收藏 603KB ZIP 举报
温馨提示
一个方便的工具,可以帮助用户轻松地找到个人或工作文件,通过询问自然语言的问题。它结合了ChatGPT的强大的对话生成能力和文档检索功能,为用户提供高效的信息查询和搜索工具。
资源推荐
资源详情
资源评论
收起资源包目录
ChatGPT插件:帮助用户轻松地找到个人或工作文件 (109个子文件)
Dockerfile 584B
.dockerignore 135B
.gitignore 2KB
.gitignore 27B
semantic-search.ipynb 40KB
search.ipynb 29KB
semantic-search-and-filter.ipynb 19KB
ai-plugin.json 1KB
documents.json 1KB
ai-plugin.json 870B
ai-plugin.json 868B
ai-plugin.json 804B
ai-plugin.json 789B
ai-plugin.json 712B
ai-plugin.json 706B
example.json 630B
queries.json 86B
example.jsonl 879B
LICENSE 1KB
poetry.lock 346KB
Makefile 357B
README.md 49KB
setup.md 6KB
setup.md 5KB
setup.md 5KB
setup.md 4KB
setup.md 4KB
setup.md 4KB
setup.md 3KB
setup.md 3KB
heroku.md 3KB
flyio.md 3KB
removing-unused-dependencies.md 3KB
setup.md 3KB
README.md 3KB
setup.md 3KB
README.md 3KB
setup.md 3KB
README.md 3KB
setup.md 3KB
other-options.md 3KB
setup.md 2KB
pull_request_template.md 2KB
render.md 2KB
README.md 1KB
README.md 1KB
README.md 107B
render-thumbnail.png 254KB
logo.png 17KB
logo.png 17KB
milvus_datastore.py 24KB
test_weaviate_datastore.py 17KB
redis_datastore.py 14KB
azuresearch_datastore.py 14KB
weaviate_datastore.py 13KB
elasticsearch_datastore.py 13KB
analyticdb_datastore.py 11KB
pinecone_datastore.py 11KB
qdrant_datastore.py 11KB
test_milvus_datastore.py 11KB
test_analyticdb_datastore.py 10KB
test_chroma_datastore.py 9KB
chroma_datastore.py 9KB
test_supabase_datastore.py 8KB
test_postgres_datastore.py 8KB
test_qdrant_datastore.py 8KB
chunks.py 7KB
test_azuresearch_datastore.py 7KB
llama_datastore.py 7KB
pgvector_datastore.py 7KB
main.py 6KB
process_zip.py 6KB
process_json.py 5KB
process_jsonl.py 5KB
postgres_datastore.py 5KB
main.py 5KB
test_elasticsearch_datastore.py 4KB
main.py 4KB
main.py 4KB
file.py 4KB
supabase_datastore.py 3KB
datastore.py 3KB
test_llama_datastore.py 3KB
zilliz_datastore.py 2KB
openai.py 2KB
factory.py 2KB
test_redis_datastore.py 2KB
models.py 1KB
pii_detection.py 1KB
extract_metadata.py 1KB
date.py 825B
test_zilliz_datastore.py 816B
api.py 620B
__init__.py 0B
__init__.py 0B
__init__.py 0B
20230414142107_init_pg_vector.sql 2KB
seed.sql 0B
config.toml 3KB
pyproject.toml 1KB
共 109 条
- 1
- 2
资源评论
UnknownToKnown
- 粉丝: 1w+
- 资源: 633
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 【React框架】教程&案例&相关项目资源.docx
- cisco packet 笔记(待整理)
- redis-5.0.13-1.el7.remi.x86-64
- QML构件-数字键盘 代码工程
- 海光平台大数据软件部署、优化指南-海光平台技术培训系列
- 山东大学软件学院算法设计与分析2024年以前的部分往年题总结附答案
- 2023-04-06-项目笔记 - 第一百六十四阶段 - 4.4.2.162全局变量的作用域-162 -2024.06.14
- idea连接mysql数据库.docx
- 基于多线程的非阻塞 socket 编程
- Linux、Mac、Windows、Android、IOS等操作系统开发/调试的案例
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功