Create http rpc client library
Browse files- requirements.txt +20 -1
- src/libs/rpc_client.py +14 -0
requirements.txt
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
|
|
| 1 |
aiofiles==23.2.1
|
| 2 |
aiohttp==3.9.5
|
| 3 |
aioitertools==0.11.0
|
| 4 |
aiosignal==1.3.1
|
| 5 |
annotated-types==0.7.0
|
|
|
|
| 6 |
anyio==3.7.1
|
| 7 |
appdirs==1.4.4
|
| 8 |
appnope==0.1.4
|
|
@@ -12,10 +14,13 @@ async-timeout==4.0.3
|
|
| 12 |
asyncer==0.0.2
|
| 13 |
attrs==23.2.0
|
| 14 |
backcall==0.2.0
|
|
|
|
| 15 |
beautifulsoup4==4.12.3
|
| 16 |
bidict==0.23.1
|
| 17 |
bitarray==2.9.2
|
| 18 |
bleach==6.1.0
|
|
|
|
|
|
|
| 19 |
certifi==2024.6.2
|
| 20 |
chainlit==1.1.300
|
| 21 |
charset-normalizer==3.3.2
|
|
@@ -43,6 +48,7 @@ exceptiongroup==1.2.1
|
|
| 43 |
executing==2.0.1
|
| 44 |
fastapi==0.110.3
|
| 45 |
fastjsonschema==2.19.1
|
|
|
|
| 46 |
filetype==1.2.0
|
| 47 |
frozendict==2.4.4
|
| 48 |
frozenlist==1.4.1
|
|
@@ -51,6 +57,7 @@ fs-s3fs==1.1.1
|
|
| 51 |
fsspec==2024.6.0
|
| 52 |
gitdb==4.0.11
|
| 53 |
GitPython==3.1.43
|
|
|
|
| 54 |
googleapis-common-protos==1.63.1
|
| 55 |
greenlet==3.0.3
|
| 56 |
grpcio==1.64.1
|
|
@@ -59,11 +66,13 @@ hexbytes==0.3.1
|
|
| 59 |
html5lib==1.1
|
| 60 |
httpcore==1.0.5
|
| 61 |
httpx==0.27.0
|
|
|
|
| 62 |
idna==3.7
|
| 63 |
importlib_metadata==7.1.0
|
| 64 |
ipython==8.12.3
|
| 65 |
jedi==0.19.1
|
| 66 |
Jinja2==3.1.4
|
|
|
|
| 67 |
jmespath==1.0.1
|
| 68 |
jsonpatch==1.33
|
| 69 |
jsonpointer==3.0.0
|
|
@@ -73,9 +82,13 @@ jupyter_client==8.6.2
|
|
| 73 |
jupyter_core==5.7.2
|
| 74 |
jupyterlab_pygments==0.3.0
|
| 75 |
langchain==0.2.4
|
|
|
|
| 76 |
langchain-community==0.2.4
|
| 77 |
langchain-core==0.2.6
|
|
|
|
| 78 |
langchain-text-splitters==0.2.1
|
|
|
|
|
|
|
| 79 |
langsmith==0.1.77
|
| 80 |
Lazify==0.4.0
|
| 81 |
literalai==0.0.604
|
|
@@ -95,6 +108,7 @@ nbclient==0.10.0
|
|
| 95 |
nbconvert==7.16.4
|
| 96 |
nbformat==5.10.4
|
| 97 |
nest-asyncio==1.6.0
|
|
|
|
| 98 |
numpy==1.26.4
|
| 99 |
openai==1.34.0
|
| 100 |
opentelemetry-api==1.25.0
|
|
@@ -140,6 +154,7 @@ pydantic-settings==2.3.3
|
|
| 140 |
pydantic_core==2.18.4
|
| 141 |
Pygments==2.18.0
|
| 142 |
PyJWT==2.8.0
|
|
|
|
| 143 |
pyreqwest_impersonate==0.4.7
|
| 144 |
python-dateutil==2.9.0.post0
|
| 145 |
python-dotenv==1.0.1
|
|
@@ -157,10 +172,10 @@ regex==2024.5.15
|
|
| 157 |
requests==2.32.3
|
| 158 |
rich==13.7.1
|
| 159 |
rlp==4.0.1
|
|
|
|
| 160 |
rpds-py==0.18.1
|
| 161 |
s3fs==2024.6.0
|
| 162 |
s3transfer==0.10.1
|
| 163 |
-
setuptools==70.0.0
|
| 164 |
shellingham==1.5.4
|
| 165 |
simple-websocket==1.0.0
|
| 166 |
six==1.16.0
|
|
@@ -170,15 +185,19 @@ soupsieve==2.5
|
|
| 170 |
SQLAlchemy==2.0.30
|
| 171 |
stack-data==0.6.3
|
| 172 |
starlette==0.37.2
|
|
|
|
| 173 |
syncer==2.0.3
|
| 174 |
tenacity==8.3.0
|
|
|
|
| 175 |
tinycss2==1.3.0
|
|
|
|
| 176 |
tomli==2.0.1
|
| 177 |
toolz==0.12.1
|
| 178 |
tornado==6.4.1
|
| 179 |
tqdm==4.66.4
|
| 180 |
traitlets==5.14.3
|
| 181 |
typer==0.12.3
|
|
|
|
| 182 |
typing-inspect==0.9.0
|
| 183 |
typing_extensions==4.12.2
|
| 184 |
tzdata==2024.1
|
|
|
|
| 1 |
+
aiobotocore==2.13.0
|
| 2 |
aiofiles==23.2.1
|
| 3 |
aiohttp==3.9.5
|
| 4 |
aioitertools==0.11.0
|
| 5 |
aiosignal==1.3.1
|
| 6 |
annotated-types==0.7.0
|
| 7 |
+
anthropic==0.28.0
|
| 8 |
anyio==3.7.1
|
| 9 |
appdirs==1.4.4
|
| 10 |
appnope==0.1.4
|
|
|
|
| 14 |
asyncer==0.0.2
|
| 15 |
attrs==23.2.0
|
| 16 |
backcall==0.2.0
|
| 17 |
+
baize==0.20.8
|
| 18 |
beautifulsoup4==4.12.3
|
| 19 |
bidict==0.23.1
|
| 20 |
bitarray==2.9.2
|
| 21 |
bleach==6.1.0
|
| 22 |
+
boto3==1.34.106
|
| 23 |
+
botocore==1.34.106
|
| 24 |
certifi==2024.6.2
|
| 25 |
chainlit==1.1.300
|
| 26 |
charset-normalizer==3.3.2
|
|
|
|
| 48 |
executing==2.0.1
|
| 49 |
fastapi==0.110.3
|
| 50 |
fastjsonschema==2.19.1
|
| 51 |
+
filelock==3.15.1
|
| 52 |
filetype==1.2.0
|
| 53 |
frozendict==2.4.4
|
| 54 |
frozenlist==1.4.1
|
|
|
|
| 57 |
fsspec==2024.6.0
|
| 58 |
gitdb==4.0.11
|
| 59 |
GitPython==3.1.43
|
| 60 |
+
google_search_results==2.4.2
|
| 61 |
googleapis-common-protos==1.63.1
|
| 62 |
greenlet==3.0.3
|
| 63 |
grpcio==1.64.1
|
|
|
|
| 66 |
html5lib==1.1
|
| 67 |
httpcore==1.0.5
|
| 68 |
httpx==0.27.0
|
| 69 |
+
huggingface-hub==0.23.3
|
| 70 |
idna==3.7
|
| 71 |
importlib_metadata==7.1.0
|
| 72 |
ipython==8.12.3
|
| 73 |
jedi==0.19.1
|
| 74 |
Jinja2==3.1.4
|
| 75 |
+
jiter==0.4.2
|
| 76 |
jmespath==1.0.1
|
| 77 |
jsonpatch==1.33
|
| 78 |
jsonpointer==3.0.0
|
|
|
|
| 82 |
jupyter_core==5.7.2
|
| 83 |
jupyterlab_pygments==0.3.0
|
| 84 |
langchain==0.2.4
|
| 85 |
+
langchain-anthropic==0.1.15
|
| 86 |
langchain-community==0.2.4
|
| 87 |
langchain-core==0.2.6
|
| 88 |
+
langchain-openai==0.1.8
|
| 89 |
langchain-text-splitters==0.2.1
|
| 90 |
+
langchainhub==0.1.20
|
| 91 |
+
langgraph==0.0.68
|
| 92 |
langsmith==0.1.77
|
| 93 |
Lazify==0.4.0
|
| 94 |
literalai==0.0.604
|
|
|
|
| 108 |
nbconvert==7.16.4
|
| 109 |
nbformat==5.10.4
|
| 110 |
nest-asyncio==1.6.0
|
| 111 |
+
numexpr==2.10.0
|
| 112 |
numpy==1.26.4
|
| 113 |
openai==1.34.0
|
| 114 |
opentelemetry-api==1.25.0
|
|
|
|
| 154 |
pydantic_core==2.18.4
|
| 155 |
Pygments==2.18.0
|
| 156 |
PyJWT==2.8.0
|
| 157 |
+
pypeln==0.4.9
|
| 158 |
pyreqwest_impersonate==0.4.7
|
| 159 |
python-dateutil==2.9.0.post0
|
| 160 |
python-dotenv==1.0.1
|
|
|
|
| 172 |
requests==2.32.3
|
| 173 |
rich==13.7.1
|
| 174 |
rlp==4.0.1
|
| 175 |
+
rpc.py==0.6.0
|
| 176 |
rpds-py==0.18.1
|
| 177 |
s3fs==2024.6.0
|
| 178 |
s3transfer==0.10.1
|
|
|
|
| 179 |
shellingham==1.5.4
|
| 180 |
simple-websocket==1.0.0
|
| 181 |
six==1.16.0
|
|
|
|
| 185 |
SQLAlchemy==2.0.30
|
| 186 |
stack-data==0.6.3
|
| 187 |
starlette==0.37.2
|
| 188 |
+
stopit==1.1.2
|
| 189 |
syncer==2.0.3
|
| 190 |
tenacity==8.3.0
|
| 191 |
+
tiktoken==0.7.0
|
| 192 |
tinycss2==1.3.0
|
| 193 |
+
tokenizers==0.19.1
|
| 194 |
tomli==2.0.1
|
| 195 |
toolz==0.12.1
|
| 196 |
tornado==6.4.1
|
| 197 |
tqdm==4.66.4
|
| 198 |
traitlets==5.14.3
|
| 199 |
typer==0.12.3
|
| 200 |
+
types-requests==2.32.0.20240602
|
| 201 |
typing-inspect==0.9.0
|
| 202 |
typing_extensions==4.12.2
|
| 203 |
tzdata==2024.1
|
src/libs/rpc_client.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
from dotenv import load_dotenv
|
| 3 |
+
|
| 4 |
+
import httpx
|
| 5 |
+
from rpcpy.client import Client
|
| 6 |
+
from rpcpy.serializers import MsgpackSerializer
|
| 7 |
+
|
| 8 |
+
load_dotenv()
|
| 9 |
+
|
| 10 |
+
rpc_client = Client(
|
| 11 |
+
httpx.AsyncClient(),
|
| 12 |
+
request_serializer=MsgpackSerializer(),
|
| 13 |
+
base_url=os.getenv("CHATXBT_RPC_SERVER_URL")
|
| 14 |
+
)
|