Skip to content

Commit

Permalink
updated pip package readme & fix bugs with GH action (dgarnitz#89)
Browse files Browse the repository at this point in the history
updated pip package readme & fix bugs with GH action
  • Loading branch information
dgarnitz authored Oct 31, 2023
1 parent fdfafba commit 62a3391
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 55 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

name: Vectorflow_Unittests
name: Unittests

on:
pull_request:
Expand All @@ -8,12 +8,9 @@ on:


jobs:
build:

unittests:
name: Unit Tests
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10"]

env:
LOCAL_VECTOR_DB: qdrant
Expand All @@ -23,7 +20,7 @@ jobs:
- name: Setup Python # Set Python version
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
python-version: 3.9

- name: Install dependencies - Api
run: |
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,21 @@ cd vectorflow
```

#### Embed Documents with Client
To start embedding documents locally, [install the VectorFlow Client python library](https://pypi.org/project/vectorflow-client/)
To start embedding documents locally, [install the VectorFlow Client python library](https://pypi.org/project/vectorflow-client/) in your python application's virtual environment.
```
pip install vectorflow-client
```
then run the following
```
from vectorflow-client.client.vectorflow import Vectorflow
vectorflow = Vectorflow()
vectorflow.embeddings_api_key = os.getenv("OPEN_AI_KEY")
paths = ['path_to_your_file']
paths = ['path_to_your_file1', 'path_to_your_file2', ...]
response = vectorflow.upload(paths)
```

for more instructions see the `README.md` in the `client` directory.
You do **not** need to clone the VectorFlow repo to utilize the client functionality via pip. For more instructions see the `README.md` in the `client` directory.

See the appendix for details on how to use the `testing_clients` scripts.

Expand Down
5 changes: 1 addition & 4 deletions client/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
# VectorFlow Python Client
Use this Python client to embed documents with VectorFlow and check on the status of those embeddings.




### How to Use
The client has 2 methods for uploading documents to embed and 2 for checking statuses, listed below. All four methods return a python `response` object from the python `requests` library. You must parse the response using the `.json()` method.

#### Initialize
```
from client.vectorflow import Vectorflow
from vectorflow-client.client.vectorflow import Vectorflow
vectorflow = Vectorflow()
vectorflow.embedding_api_key = "YOUR_OPEN_AI_KEY"
Expand Down
18 changes: 0 additions & 18 deletions setup-client.py

This file was deleted.

22 changes: 9 additions & 13 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
from setuptools import setup
from setuptools import setup, find_packages

# Read the content of your README file
with open("README.md", "r", encoding="utf-8") as fh:
with open("./client/README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()

setup(
name="vectorflow-ai",
version="0.1.1", # Update version as needed
name="vectorflow-client",
version="0.0.5",
packages=find_packages(where="client") + ["shared"],
package_dir={"": "client", "shared": "src/shared"},
install_requires=[
# No dependencies right now since this is only for setting up docker-compose
'requests==2.31.0'
],
entry_points={
'console_scripts': [
'vectorflow=vectorflow:main',
],
},
py_modules=["vectorflow"],
include_package_data=True, # This ensures non-python files (like your setup.sh) are included
include_package_data=True, # This is the line that reads the MANIFEST.in
long_description=long_description,
long_description_content_type="text/markdown", # This is important! It tells PyPI the README is in Markdown
long_description_content_type="text/markdown",
)
10 changes: 0 additions & 10 deletions vectorflow.py

This file was deleted.

0 comments on commit 62a3391

Please sign in to comment.