From 5f7502fc549d03858374843a7f405a762965ad1f Mon Sep 17 00:00:00 2001 From: Zachary BENSALEM Date: Wed, 14 Aug 2024 22:31:26 +0000 Subject: [PATCH 1/3] changes --- requirements.txt | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index e6393f098..000000000 --- a/requirements.txt +++ /dev/null @@ -1,18 +0,0 @@ -ipykernel -PyPDF2 -ipywidgets -python-dotenv -fastapi -fastapi -packaging -azure-core -plotly -azure-storage-blob -openai -streamlit -requests -uvicorn -python-dotenv -chainlit -pyautogen -marker-pdf From dda5f28955d0e80698c2c8ee299cd40eaef1f11d Mon Sep 17 00:00:00 2001 From: Zachary BENSALEM Date: Wed, 14 Aug 2024 22:58:33 +0000 Subject: [PATCH 2/3] test --- .github/workflows/python-publish.yml | 71 ++++++++---- README.md | 30 ++---- graphfleet/api/openapi.stainless.yml | 61 ----------- graphfleet/api/openapi.yml | 155 --------------------------- 4 files changed, 59 insertions(+), 258 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index b6d387582..4ec4c189c 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -5,35 +5,60 @@ # They are provided by a third-party and are governed by # separate terms of service, privacy policy, and support # documentation. + -name: Upload Python Package - +name: Python Publish on: release: - types: [published] + types: [created] + push: + branches: [main] -permissions: - contents: read +env: + POETRY_VERSION: "1.8.3" + PYTHON_VERSION: "3.10" jobs: - deploy: - + publish: + name: Upload release to PyPI + if: github.ref == 'refs/heads/main' runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/graphfleet + permissions: + id-token: write # IMPORTANT: this permission is mandatory for trusted publishing steps: - - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.x' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install build - - name: Build package - run: python -m build - - name: Publish package - uses: pypa/gh-action-pypi-publish@ec4db0b4ddc65acdf4bff5fa45ac92d78b56bdf0 - with: - user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} \ No newline at end of file + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + fetch-tags: true + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: ${{ env.PYTHON_VERSION }} + + - name: Install Poetry + uses: abatilo/actions-poetry@v3.0.0 + with: + poetry-version: ${{ env.POETRY_VERSION }} + + - name: Install dependencies + shell: bash + run: poetry install + + - name: Export Publication Version + run: echo "version=`poetry version --short`" >> $GITHUB_OUTPUT + + - name: Build Distributable + shell: bash + run: poetry build + + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + packages-dir: dist + skip-existing: true + verbose: true \ No newline at end of file diff --git a/README.md b/README.md index 95dce2ad1..72f475f00 100644 --- a/README.md +++ b/README.md @@ -10,8 +10,7 @@ GraphFleet uses knowledge graphs to provide substantial improvements in question <<<<<<< HEAD ## Roadmap -======= ->>>>>>> origin/main + - [ ] Provide a FleetUI Design Kit and a quicker way of starting GraphFleet locally. - [ ] Provide a Toddle interface ready to use for GraphFleet @@ -33,7 +32,7 @@ GraphFleet uses knowledge graphs to provide substantial improvements in question - Leave us a star ♥ - Fork and contribute to the project -- [![Join the discord](https://api.star-history.com/svg?repos=Qredence/GraphFleet&type=Date)](https://star-history.com/#Qredence/GraphFleet&Date) +- [![Join the discord](https://discord.gg/BD8MPgzEJc) ## Getting Started @@ -51,21 +50,19 @@ GraphFleet uses knowledge graphs to provide substantial improvements in question ### Installation 1. Clone the repository: -<<<<<<< HEAD -======= ``` bash git clone https://github.com/Qredence/GraphFleet.git cd GraphFleet ``` ->>>>>>> origin/main + ``` bash git clone https://github.com/Qredence/GraphFleet.git cd GraphFleet ``` -<<<<<<< HEAD + 2. Simply run these in your terminal: ``` bash @@ -73,7 +70,7 @@ GraphFleet uses knowledge graphs to provide substantial improvements in question poetry install ``` -======= + 2. Create a virtual environment and activate it: ``` bash @@ -86,13 +83,13 @@ source gfleetenv/bin/activate ``` pip install -r requirements.txt ``` ->>>>>>> origin/main + ### Usage 1. Configuration: Environment Variables: Set up your environment variables in a .env file (refer to the .env.example file for available options). Key variables include: -<<<<<<< HEAD + ```sh export GRAPHRAG_API_KEY="" @@ -125,7 +122,7 @@ streamlit run app.py Access the interface in your web browser at the provided URL (usually ). -======= + ``` GRAPHRAG_API_KEY @@ -154,7 +151,7 @@ streamlit run app.py ``` Access the interface in your web browser at the provided URL (usually http://localhost:8080). ->>>>>>> origin/main + ``` bash python -m graphrag.query --root ./graphfleet --method local "What are the key features of GraphRAG ??" ``` @@ -164,10 +161,8 @@ For Global query mode : ``` bash python -m graphrag.query --root ./graphfleet --method global "What are the top main features of GraphRAG" ``` -<<<<<<< HEAD -======= ->>>>>>> origin/main + ### Running the API only To run the API, save the code in a file named api.py and execute the following command in your terminal: @@ -186,8 +181,5 @@ uvicorn api:app --reload --port 8001 ## Star History -<<<<<<< HEAD [![Star History Chart](https://api.star-history.com/svg?repos=Qredence/GraphFleet&type=Date)](https://star-history.com/#Qredence/GraphFleet&Date) -======= -[![Star History Chart](https://api.star-history.com/svg?repos=Qredence/GraphFleet&type=Date)](https://star-history.com/#Qredence/GraphFleet&Date) ->>>>>>> origin/main + diff --git a/graphfleet/api/openapi.stainless.yml b/graphfleet/api/openapi.stainless.yml index dcf9a9f5c..e69de29bb 100644 --- a/graphfleet/api/openapi.stainless.yml +++ b/graphfleet/api/openapi.stainless.yml @@ -1,61 +0,0 @@ -# yaml-language-server: $schema=https://app.stainlessapi.com/config.schema.json - -organization: - name: Qredence - docs: https://docs.qredence.ai - contact: zachary@qredence.ai - github_org: Qredence -resources: - root: - methods: - retrieve: get / - $client: - methods: - process_local_query: post /process_local_query/ - process_global_query: post /process_global_query/ - add_message: post /add_message/ - chat_history: - methods: - list: get /get_chat_history/ - delete: delete /clear_chat_history/ -targets: - node: - package_name: graphfleet - production_repo: null - publish: - npm: false - python: - package_name: graphfleet - production_repo: null - publish: - pypi: false -settings: - license: Apache-2.0 -client_settings: - opts: {} - omit_platform_headers: false - default_headers: {} - default_timeout: PT60S - default_retries: - max_retries: 2 - initial_delay_seconds: 0.5 - max_delay_seconds: 8 -environments: - production: https://localhost:8080/test-api -query_settings: - nested_format: brackets - array_format: comma -readme: - example_requests: - default: - type: request - endpoint: post /add_message/ - params: &ref_0 {} - headline: - type: request - endpoint: post /add_message/ - params: *ref_0 - pagination: - type: request - endpoint: get /get_chat_history/ - params: {} \ No newline at end of file diff --git a/graphfleet/api/openapi.yml b/graphfleet/api/openapi.yml index 066d53e65..e69de29bb 100644 --- a/graphfleet/api/openapi.yml +++ b/graphfleet/api/openapi.yml @@ -1,155 +0,0 @@ -openapi: '3.1.0' -info: - title: 'GraphFleet' - version: '0.4.0' -paths: - '/': - get: - summary: 'Read Root' - operationId: 'read_root__get' - responses: - '200': - description: 'Successful Response' - content: - application/json: - schema: {} - '/process_local_query/': - post: - summary: 'Process Local Query Endpoint' - operationId: 'process_local_query_endpoint_process_local_query__post' - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/QueryRequest' - required: true - responses: - '200': - description: 'Successful Response' - content: - application/json: - schema: {} - '422': - description: 'Validation Error' - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - '/process_global_query/': - post: - summary: 'Process Global Query Endpoint' - operationId: 'process_global_query_endpoint_process_global_query__post' - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/QueryRequest' - required: true - responses: - '200': - description: 'Successful Response' - content: - application/json: - schema: {} - '422': - description: 'Validation Error' - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - '/add_message/': - post: - summary: 'Add Message' - operationId: 'add_message_add_message__post' - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ChatMessage' - required: true - responses: - '200': - description: 'Successful Response' - content: - application/json: - schema: {} - '422': - description: 'Validation Error' - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - '/get_chat_history/': - get: - summary: 'Get Chat History' - operationId: 'get_chat_history_get_chat_history__get' - responses: - '200': - description: 'Successful Response' - content: - application/json: - schema: {} - '/clear_chat_history/': - delete: - summary: 'Clear Chat History' - operationId: 'clear_chat_history_clear_chat_history__delete' - responses: - '200': - description: 'Successful Response' - content: - application/json: - schema: {} -components: - schemas: - ChatMessage: - type: 'object' - title: 'ChatMessage' - required: - - role - - content - properties: - role: - type: 'string' - title: 'Role' - content: - type: 'string' - title: 'Content' - HTTPValidationError: - type: 'object' - title: 'HTTPValidationError' - properties: - detail: - type: 'array' - title: 'Detail' - items: - $ref: '#/components/schemas/ValidationError' - QueryRequest: - type: 'object' - title: 'QueryRequest' - required: - - query - properties: - query: - type: 'string' - title: 'Query' - ValidationError: - type: 'object' - title: 'ValidationError' - required: - - loc - - msg - - type - properties: - loc: - type: 'array' - title: 'Location' - items: - anyOf: - - type: 'string' - - type: 'integer' - msg: - type: 'string' - title: 'Message' - type: - type: 'string' - title: 'Error Type' \ No newline at end of file From 0b2b1e94f1fbbd58245bef9c8dfd24cf034dce6b Mon Sep 17 00:00:00 2001 From: Zachary BENSALEM Date: Wed, 14 Aug 2024 23:46:27 +0000 Subject: [PATCH 3/3] Your descriptive commit message --- README.md | 70 ++++-------- graphfleet/api/openapi.stainless.yml | 61 +++++++++++ graphfleet/api/openapi.yml | 155 +++++++++++++++++++++++++++ pyproject.toml | 2 +- 4 files changed, 237 insertions(+), 51 deletions(-) diff --git a/README.md b/README.md index 72f475f00..769963dfd 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ GraphFleet is an advanced implementation of [GraphRAG from Microsoft](https://gi ## GraphFleet GraphFleet uses knowledge graphs to provide substantial improvements in question-and-answer performance when reasoning about complex information. It addresses limitations of traditional RAG approaches: -<<<<<<< HEAD + ## Roadmap @@ -38,14 +38,11 @@ GraphFleet uses knowledge graphs to provide substantial improvements in question ### Prerequisites -<<<<<<< HEAD + - Python 3.10 - Poetry - Make sure to have a virtual environment manager such as `virtualenv` installed -======= -- Python 3.11 -- Make sure to have a virtual environment manager such as `virtualenv` installed ->>>>>>> origin/main + ### Installation @@ -56,35 +53,13 @@ GraphFleet uses knowledge graphs to provide substantial improvements in question cd GraphFleet ``` - - ``` bash - git clone https://github.com/Qredence/GraphFleet.git - cd GraphFleet - ``` - - -2. Simply run these in your terminal: +1. Simply run these in your terminal: ``` bash poetry shell poetry install ``` - -2. Create a virtual environment and activate it: - -``` bash -python3.11 -m venv gfleetenv -source gfleetenv/bin/activate -``` - -3. Install dependencies: - -``` -pip install -r requirements.txt -``` - - ### Usage 1. Configuration: @@ -114,25 +89,16 @@ Jupyter Notebooks: Explore GraphFleet's capabilities with the provided notebooks app.py (FastAPI Application): Run a Streamlit-powered web interface to interact with GraphFleet using a user-friendly chat-like interface. -### Start the application +### Start the application API only +``` bash +uvicorn graphfleet.api.api:app --host 0.0.0.0 --port 8001 ``` -streamlit run app.py -``` - -Access the interface in your web browser at the provided URL (usually ). - +Access the interface in your web browser at the provided URL . -``` -GRAPHRAG_API_KEY -GRAPHRAG_API_BASE (for Azure OpenAI) -GRAPHRAG_API_VERSION (for Azure OpenAI) -Other settings related to your LLM and embedding models. -settings.yaml: Customize GraphFleet's behavior further by modifying the settings.yaml file within the graphfleet directory. -``` -2. Data Indexing: +1. Data Indexing: Jupyter Notebook Guide: Follow the instructions provided in the get-started-graphfleet.ipynb notebook to learn how to index your data with GraphFleet. This notebook provides a hands-on experience for setting up your knowledge base. @@ -144,13 +110,19 @@ Local Search Notebook.ipynb: Demonstrates local search techniques. [Add descriptions of other notebooks and their purpose here] app.py (FastAPI Application): Run a Streamlit-powered web interface to interact with GraphFleet using a user-friendly chat-like interface: -### Start the application: +### Running the API only +To run the API, save the code in a file named api.py and execute the following command in your terminal: + +``` bash +uvicorn api:app --reload --port 8001 ``` -streamlit run app.py -``` -Access the interface in your web browser at the provided URL (usually http://localhost:8080). +### Start the application + +``` bash +streamlit run app.py # Access the interface in your web browser at the provided URL (usually http://localhost:8080). +``` ``` bash python -m graphrag.query --root ./graphfleet --method local "What are the key features of GraphRAG ??" @@ -162,7 +134,6 @@ For Global query mode : python -m graphrag.query --root ./graphfleet --method global "What are the top main features of GraphRAG" ``` - ### Running the API only To run the API, save the code in a file named api.py and execute the following command in your terminal: @@ -181,5 +152,4 @@ uvicorn api:app --reload --port 8001 ## Star History -[![Star History Chart](https://api.star-history.com/svg?repos=Qredence/GraphFleet&type=Date)](https://star-history.com/#Qredence/GraphFleet&Date) - +[![Star History Chart](https://api.star-history.com/svg?repos=Qredence/GraphFleet&type=Date)](https://star-history.com/#Qredence/GraphFleet&Date) \ No newline at end of file diff --git a/graphfleet/api/openapi.stainless.yml b/graphfleet/api/openapi.stainless.yml index e69de29bb..dcf9a9f5c 100644 --- a/graphfleet/api/openapi.stainless.yml +++ b/graphfleet/api/openapi.stainless.yml @@ -0,0 +1,61 @@ +# yaml-language-server: $schema=https://app.stainlessapi.com/config.schema.json + +organization: + name: Qredence + docs: https://docs.qredence.ai + contact: zachary@qredence.ai + github_org: Qredence +resources: + root: + methods: + retrieve: get / + $client: + methods: + process_local_query: post /process_local_query/ + process_global_query: post /process_global_query/ + add_message: post /add_message/ + chat_history: + methods: + list: get /get_chat_history/ + delete: delete /clear_chat_history/ +targets: + node: + package_name: graphfleet + production_repo: null + publish: + npm: false + python: + package_name: graphfleet + production_repo: null + publish: + pypi: false +settings: + license: Apache-2.0 +client_settings: + opts: {} + omit_platform_headers: false + default_headers: {} + default_timeout: PT60S + default_retries: + max_retries: 2 + initial_delay_seconds: 0.5 + max_delay_seconds: 8 +environments: + production: https://localhost:8080/test-api +query_settings: + nested_format: brackets + array_format: comma +readme: + example_requests: + default: + type: request + endpoint: post /add_message/ + params: &ref_0 {} + headline: + type: request + endpoint: post /add_message/ + params: *ref_0 + pagination: + type: request + endpoint: get /get_chat_history/ + params: {} \ No newline at end of file diff --git a/graphfleet/api/openapi.yml b/graphfleet/api/openapi.yml index e69de29bb..066d53e65 100644 --- a/graphfleet/api/openapi.yml +++ b/graphfleet/api/openapi.yml @@ -0,0 +1,155 @@ +openapi: '3.1.0' +info: + title: 'GraphFleet' + version: '0.4.0' +paths: + '/': + get: + summary: 'Read Root' + operationId: 'read_root__get' + responses: + '200': + description: 'Successful Response' + content: + application/json: + schema: {} + '/process_local_query/': + post: + summary: 'Process Local Query Endpoint' + operationId: 'process_local_query_endpoint_process_local_query__post' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/QueryRequest' + required: true + responses: + '200': + description: 'Successful Response' + content: + application/json: + schema: {} + '422': + description: 'Validation Error' + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + '/process_global_query/': + post: + summary: 'Process Global Query Endpoint' + operationId: 'process_global_query_endpoint_process_global_query__post' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/QueryRequest' + required: true + responses: + '200': + description: 'Successful Response' + content: + application/json: + schema: {} + '422': + description: 'Validation Error' + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + '/add_message/': + post: + summary: 'Add Message' + operationId: 'add_message_add_message__post' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ChatMessage' + required: true + responses: + '200': + description: 'Successful Response' + content: + application/json: + schema: {} + '422': + description: 'Validation Error' + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + '/get_chat_history/': + get: + summary: 'Get Chat History' + operationId: 'get_chat_history_get_chat_history__get' + responses: + '200': + description: 'Successful Response' + content: + application/json: + schema: {} + '/clear_chat_history/': + delete: + summary: 'Clear Chat History' + operationId: 'clear_chat_history_clear_chat_history__delete' + responses: + '200': + description: 'Successful Response' + content: + application/json: + schema: {} +components: + schemas: + ChatMessage: + type: 'object' + title: 'ChatMessage' + required: + - role + - content + properties: + role: + type: 'string' + title: 'Role' + content: + type: 'string' + title: 'Content' + HTTPValidationError: + type: 'object' + title: 'HTTPValidationError' + properties: + detail: + type: 'array' + title: 'Detail' + items: + $ref: '#/components/schemas/ValidationError' + QueryRequest: + type: 'object' + title: 'QueryRequest' + required: + - query + properties: + query: + type: 'string' + title: 'Query' + ValidationError: + type: 'object' + title: 'ValidationError' + required: + - loc + - msg + - type + properties: + loc: + type: 'array' + title: 'Location' + items: + anyOf: + - type: 'string' + - type: 'integer' + msg: + type: 'string' + title: 'Message' + type: + type: 'string' + title: 'Error Type' \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index fdcc0ec3a..422349982 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "graphfleet" -version = "0.4.0" +version = "0.4.1" description = "Build upon GraphRAG, provide a quick solution setup and is part of the overall Qredence System like AgenticFleet and FleetUI" authors = ["Zachary "] license = "Apache-2.0"