From 70f851283fb21ac89fe52c45f69ecfe4bce022d0 Mon Sep 17 00:00:00 2001 From: Diwank Singh Tomer Date: Sat, 30 Mar 2024 21:02:23 +0530 Subject: [PATCH 1/2] wip: Python client fix + example keys whitelist Signed-off-by: Diwank Singh Tomer --- agents-api/docker-compose.yml | 8 +++----- gateway/traefik.yml.template | 2 ++ .../api/types/chat_input_data_tool_choice.py | 1 - sdks/python/julep/client.py | 4 ++-- sdks/python/poetry.lock | 19 ++++++++++++++++++- sdks/python/pyproject.toml | 1 + 6 files changed, 26 insertions(+), 9 deletions(-) diff --git a/agents-api/docker-compose.yml b/agents-api/docker-compose.yml index 91e894732..cbb772b42 100644 --- a/agents-api/docker-compose.yml +++ b/agents-api/docker-compose.yml @@ -70,11 +70,9 @@ services: text-embeddings-inference: container_name: text-embeddings-inference - env_file: - - path: .env - required: false - - path: ../.env - required: true + environment: + - DTYPE=float16 + - MODEL_ID=BAAI/llm-embedder image: ghcr.io/huggingface/text-embeddings-inference:1.0 ports: diff --git a/gateway/traefik.yml.template b/gateway/traefik.yml.template index c3983423b..9743e6b8a 100644 --- a/gateway/traefik.yml.template +++ b/gateway/traefik.yml.template @@ -107,6 +107,8 @@ http: X-Developer-Id: sub X-Developer-Email: email OpaHttpStatusField: allow_status_code + KeysWhitelist: + - eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIwOTc3MjBjNS1hYjg0LTQzOGMtYjhiMC02OGUwZWFiZDMxZmYiLCJlbWFpbCI6ImVAbWFpbC5jb20iLCJpYXQiOjE3MTE4MDcwNDEsImV4cCI6MTcyMDQ0NzA0MX0.torXnwO-bzLJLQLiFCh90i1oOhMgDcpzcIySZ6Cu22noUxXVTfIIVS2yqYSJ3pVztl_eu1FxvVz1XGnQ1_5xRw services: service-model-api: diff --git a/sdks/python/julep/api/types/chat_input_data_tool_choice.py b/sdks/python/julep/api/types/chat_input_data_tool_choice.py index 2885d0693..769c451c0 100644 --- a/sdks/python/julep/api/types/chat_input_data_tool_choice.py +++ b/sdks/python/julep/api/types/chat_input_data_tool_choice.py @@ -3,7 +3,6 @@ import typing from .named_tool_choice import NamedToolChoice -from .named_tool_choice_function import NamedToolChoiceFunction from .tool_choice_option import ToolChoiceOption ChatInputDataToolChoice = typing.Union[ToolChoiceOption, NamedToolChoice] diff --git a/sdks/python/julep/client.py b/sdks/python/julep/client.py index 756548d5b..4c91490dd 100644 --- a/sdks/python/julep/client.py +++ b/sdks/python/julep/client.py @@ -119,7 +119,7 @@ def __init__( ) self._api_client = JulepApi( - api_key=api_key, + api_key=f"Bearer {api_key}", base_url=base_url, httpx_client=httpx_client, *args, @@ -240,7 +240,7 @@ def __init__( ), "base_url must be provided or set as env var JULEP_API_URL" self._api_client = AsyncJulepApi( - api_key=api_key, base_url=base_url, *args, **kwargs + api_key=f"Bearer {api_key}", base_url=base_url, *args, **kwargs ) self.agents = AsyncAgentsManager(api_client=self._api_client) diff --git a/sdks/python/poetry.lock b/sdks/python/poetry.lock index cece36c1a..b2d821076 100644 --- a/sdks/python/poetry.lock +++ b/sdks/python/poetry.lock @@ -2124,6 +2124,23 @@ files = [ plugins = ["importlib-metadata"] windows-terminal = ["colorama (>=0.4.6)"] +[[package]] +name = "pyjwt" +version = "2.8.0" +description = "JSON Web Token implementation in Python" +optional = false +python-versions = ">=3.7" +files = [ + {file = "PyJWT-2.8.0-py3-none-any.whl", hash = "sha256:59127c392cc44c2da5bb3192169a91f429924e17aff6534d70fdc02ab3e04320"}, + {file = "PyJWT-2.8.0.tar.gz", hash = "sha256:57e28d156e3d5c10088e0c68abb90bfac3df82b40a71bd0daa20c65ccd5c23de"}, +] + +[package.extras] +crypto = ["cryptography (>=3.4.0)"] +dev = ["coverage[toml] (==5.0.4)", "cryptography (>=3.4.0)", "pre-commit", "pytest (>=6.0.0,<7.0.0)", "sphinx (>=4.5.0,<5.0.0)", "sphinx-rtd-theme", "zope.interface"] +docs = ["sphinx (>=4.5.0,<5.0.0)", "sphinx-rtd-theme", "zope.interface"] +tests = ["coverage[toml] (==5.0.4)", "pytest (>=6.0.0,<7.0.0)"] + [[package]] name = "pyparsing" version = "3.1.2" @@ -3094,4 +3111,4 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p [metadata] lock-version = "2.0" python-versions = ">=3.8,<3.14" -content-hash = "cfca93f9754579d0c632082ab676e343514e237156bb0579ca0a084bde0d4ed0" +content-hash = "938c28c766f1d0f4e9045d7ade0c17f24471a0a6359b5bd4b9dbfd9b55cc7988" diff --git a/sdks/python/pyproject.toml b/sdks/python/pyproject.toml index 43cf0e89f..855ae3fbb 100644 --- a/sdks/python/pyproject.toml +++ b/sdks/python/pyproject.toml @@ -26,6 +26,7 @@ ipython = "<8.13" pyright = "^1.1.348" handsdown = "^2.1.0" jupyterlab = "^4.1.0" +pyjwt = "^2.8.0" [build-system] requires = ["poetry-core"] From e725718f973eddae8fb5119bdd631a4609c40bb5 Mon Sep 17 00:00:00 2001 From: Diwank Singh Tomer Date: Mon, 1 Apr 2024 09:55:31 +0530 Subject: [PATCH 2/2] Update traefik.yml.template --- gateway/traefik.yml.template | 2 -- 1 file changed, 2 deletions(-) diff --git a/gateway/traefik.yml.template b/gateway/traefik.yml.template index 9743e6b8a..c3983423b 100644 --- a/gateway/traefik.yml.template +++ b/gateway/traefik.yml.template @@ -107,8 +107,6 @@ http: X-Developer-Id: sub X-Developer-Email: email OpaHttpStatusField: allow_status_code - KeysWhitelist: - - eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIwOTc3MjBjNS1hYjg0LTQzOGMtYjhiMC02OGUwZWFiZDMxZmYiLCJlbWFpbCI6ImVAbWFpbC5jb20iLCJpYXQiOjE3MTE4MDcwNDEsImV4cCI6MTcyMDQ0NzA0MX0.torXnwO-bzLJLQLiFCh90i1oOhMgDcpzcIySZ6Cu22noUxXVTfIIVS2yqYSJ3pVztl_eu1FxvVz1XGnQ1_5xRw services: service-model-api: