|
1 | | -# Epsilla Python SDK |
| 1 | +<p align="center"> |
| 2 | + <img width="275" alt="Epsilla Logo" src="https://epsilla-misc.s3.amazonaws.com/epsilla-horizontal.png"> |
| 3 | +</p> |
2 | 4 |
|
3 | | -Welcome to Python SDK for Epsilla Vector Database! |
4 | | -https://pypi.org/project/pyepsilla/#history |
| 5 | +<p align="center"> |
| 6 | + <b>Python Client for <a href="https://github.com/epsilla-cloud/vectordb">Epsilla</a> Vector Database</b> |
| 7 | +</p> |
5 | 8 |
|
6 | | -## Installation |
7 | | -```shell |
8 | | -pip3 install pyepsilla |
9 | | -``` |
10 | | -or |
| 9 | +<hr /> |
| 10 | + |
| 11 | +Welcome to Python SDK for Epsilla Vector Database! |
| 12 | +- <a href="https://epsilla-inc.gitbook.io/epsilladb/vector-database/connect-to-a-database">QuickStart</a> |
| 13 | +- <a href="https://pypi.org/project/pyepsilla/#history">Release History</a> |
| 14 | + |
| 15 | +## Install pyepsilla |
11 | 16 | ```shell |
12 | 17 | pip3 install --upgrade pyepsilla |
13 | 18 | ``` |
14 | 19 |
|
15 | | -## Documentation |
| 20 | +## Connect to Epsilla Vector Database |
16 | 21 |
|
17 | | -### 1.1 Run epsilla vectordb on localhost |
| 22 | +#### Run epsilla vectordb on localhost |
18 | 23 | ```shell |
19 | 24 | docker pull epsilla/vectordb |
20 | 25 | docker run -d -p 8888:8888 epsilla/vectordb |
21 | 26 | ``` |
22 | 27 |
|
23 | | -### 1.2 Use pyepsilla to connect to and interact with local vector database |
| 28 | +#### Use pyepsilla to connect to and interact with local vector database |
24 | 29 |
|
25 | 30 | ```python |
26 | 31 | from pyepsilla import vectordb |
@@ -76,46 +81,65 @@ status_code, response = client.query( |
76 | 81 | ) |
77 | 82 | print(response) |
78 | 83 |
|
79 | | - |
80 | | - |
81 | 84 | ## delete records by primary_keys (and filter) |
82 | | -# status_code, response = client.delete(table_name="MyTable", ids=[3]) |
83 | 85 | status_code, response = client.delete(table_name="MyTable", primary_keys=[3, 4]) |
84 | | -# status_code, response = client.delete(table_name="MyTable", filter="Doc <> 'San Francisco'") |
| 86 | +status_code, response = client.delete(table_name="MyTable", filter="Doc <> 'San Francisco'") |
85 | 87 | print(response) |
86 | 88 |
|
87 | 89 |
|
88 | 90 | ## drop a table |
89 | | -#client.drop_table("MyTable") |
| 91 | +client.drop_table("MyTable") |
90 | 92 |
|
91 | 93 | ## unload a database from memory |
92 | | -#client.unload_db("MyDB") |
| 94 | +client.unload_db("MyDB") |
93 | 95 | ``` |
94 | 96 |
|
95 | 97 |
|
| 98 | +## Connect to Epsilla Cloud |
96 | 99 |
|
97 | | -### 2 Run epsilla vectordb on epsilla cloud |
| 100 | +#### Register and create vectordb on Epsilla Cloud |
| 101 | +https://cloud.epsilla.com |
98 | 102 |
|
| 103 | +#### Use Epsilla Cloud module to connect with the vectordb |
| 104 | +Please check <a href="https://github.com/epsilla-cloud/epsilla-python-client/blob/main/examples/hello_epsilla_cloud.py">example</a> for detail. |
99 | 105 | ```python3 |
100 | | - |
101 | 106 | from pyepsilla import cloud |
102 | 107 |
|
103 | 108 | # Connect to Epsilla Cloud |
104 | | -client = cloud.Client(project_id="32ef3a3f-****-****-****-************", api_key="epsilla*****") |
| 109 | +client = cloud.Client(project_id="32ef3a3f-****-****-****-************", api_key="eps_**********") |
105 | 110 |
|
106 | 111 | # Connect to Vectordb |
107 | 112 | db = client.vectordb(db_id="df7431d0-****-****-****-************") |
108 | | - |
109 | 113 | ``` |
110 | | -Please check https://github.com/epsilla-cloud/epsilla-python-client/blob/main/examples/hello_epsilla_cloud.py for detail. |
111 | 114 |
|
112 | 115 |
|
| 116 | +## Connect to Epsilla RAG |
| 117 | + |
| 118 | +The resp will contains answer as well as contexts, like {"answer": "****", "contexts": ['context1','context2', ...]} |
| 119 | + |
| 120 | +```python3 |
| 121 | +from pyepsilla import cloud |
| 122 | + |
| 123 | +# Connect to Epsilla RAG |
| 124 | +client = cloud.RAG( |
| 125 | + project_id="ce07c6fc-****-****-b7bd-b7819f22bcff", |
| 126 | + api_key="eps_**********", |
| 127 | + ragapp_id="153a5a49-****-****-b2b8-496451eda8b5", |
| 128 | + conversation_id="6fa22a6a-****-****-b1c3-5c795d0f45ef", |
| 129 | +) |
| 130 | + |
| 131 | +# Start a new conversation with RAG |
| 132 | +client.start_new_conversation() |
| 133 | +resp = client.query("What's RAG?") |
| 134 | + |
| 135 | +print("[INFO] response is", resp) |
| 136 | +``` |
113 | 137 |
|
114 | 138 |
|
115 | 139 | ## Contributing |
116 | | -Bug reports and pull requests are welcome on GitHub at https://github.com/epsilla-cloud/epsilla-python-client/ |
| 140 | +Bug reports and pull requests are welcome on GitHub at [here](https://github.com/epsilla-cloud/epsilla-python-client) |
117 | 141 |
|
118 | | -If you have any question or problem, please join our discord https://discord.com/invite/cDaY2CxZc5 |
| 142 | +If you have any question or problem, please join our [discord](https://discord.com/invite/cDaY2CxZc5) |
119 | 143 |
|
120 | | -## We love your <a href="https://forms.gle/z73ra1sGBxH9wiUR8">Feedback</a>! |
| 144 | +We love your <a href="https://forms.gle/z73ra1sGBxH9wiUR8">Feedback</a>! |
121 | 145 |
|
0 commit comments