diff --git a/packages/sample-app/poetry.lock b/packages/sample-app/poetry.lock index c9633724d..389aba944 100644 --- a/packages/sample-app/poetry.lock +++ b/packages/sample-app/poetry.lock @@ -274,32 +274,32 @@ typecheck = ["mypy"] [[package]] name = "boto3" -version = "1.34.0" +version = "1.33.11" description = "The AWS SDK for Python" optional = false -python-versions = ">= 3.8" +python-versions = ">= 3.7" files = [ - {file = "boto3-1.34.0-py3-none-any.whl", hash = "sha256:8b3c4d4e720c0ad706590c284b8f30c76de3472c1ce1bac610425f99bf6ab53b"}, - {file = "boto3-1.34.0.tar.gz", hash = "sha256:c9b400529932ed4652304756528ab235c6730aa5d00cb4d9e4848ce460c82c16"}, + {file = "boto3-1.33.11-py3-none-any.whl", hash = "sha256:8d54fa3a9290020f9a7f488f9cbe821029de0af05a677751b12973a5f726a5e2"}, + {file = "boto3-1.33.11.tar.gz", hash = "sha256:620f1eb3e18e780be58383b4a4e10db003d2314131190514153996032c8d932d"}, ] [package.dependencies] -botocore = ">=1.34.0,<1.35.0" +botocore = ">=1.33.11,<1.34.0" jmespath = ">=0.7.1,<2.0.0" -s3transfer = ">=0.9.0,<0.10.0" +s3transfer = ">=0.8.2,<0.9.0" [package.extras] crt = ["botocore[crt] (>=1.21.0,<2.0a0)"] [[package]] name = "botocore" -version = "1.34.0" +version = "1.33.11" description = "Low-level, data-driven core of boto 3." optional = false -python-versions = ">= 3.8" +python-versions = ">= 3.7" files = [ - {file = "botocore-1.34.0-py3-none-any.whl", hash = "sha256:6ec19f6c9f61c3df22fb3e083940ac7946a3d96128db1f370f10aea702bb157f"}, - {file = "botocore-1.34.0.tar.gz", hash = "sha256:711b406de910585395466ca649bceeea87a04300ddf74d9a2e20727c7f27f2f1"}, + {file = "botocore-1.33.11-py3-none-any.whl", hash = "sha256:b46227eb3fa9cfdc8f5a83920ef347e67adea8095830ed265a3373b13b54421f"}, + {file = "botocore-1.33.11.tar.gz", hash = "sha256:b14b328f902d120de0a09eaa657a9a701c0ceeb711197c2f01ef0523f855086c"}, ] [package.dependencies] @@ -668,13 +668,13 @@ numpy = "*" [[package]] name = "chromadb" -version = "0.4.19" +version = "0.4.18" description = "Chroma." optional = false python-versions = ">=3.8" files = [ - {file = "chromadb-0.4.19-py3-none-any.whl", hash = "sha256:da7c1d7a31610fc4d09fdaf090a0b34554bbe2bdb18beda27424ac4f1a0ea2ef"}, - {file = "chromadb-0.4.19.tar.gz", hash = "sha256:378948be2c4c72a5fd38a2e77658b6685815b4a05aec996f27b4a11705e4781e"}, + {file = "chromadb-0.4.18-py3-none-any.whl", hash = "sha256:6de20f8c1dc880bef1d49c10d9f998ddb9d7e39b6c1e757d8b58e37b535ad625"}, + {file = "chromadb-0.4.18.tar.gz", hash = "sha256:42f1e8f3f48884abfb43fbbb132940d0b78c0f633baf888d2525c970678b886c"}, ] [package.dependencies] @@ -686,7 +686,7 @@ grpcio = ">=1.58.0" importlib-resources = "*" kubernetes = ">=28.1.0" mmh3 = ">=4.0.1" -numpy = ">=1.22.5" +numpy = {version = ">=1.22.5", markers = "python_version >= \"3.8\""} onnxruntime = ">=1.14.1" opentelemetry-api = ">=1.2.0" opentelemetry-exporter-otlp-proto-grpc = ">=1.2.0" @@ -902,13 +902,13 @@ test = ["pytest (>=6)"] [[package]] name = "fastapi" -version = "0.105.0" +version = "0.104.1" description = "FastAPI framework, high performance, easy to learn, fast to code, ready for production" optional = false python-versions = ">=3.8" files = [ - {file = "fastapi-0.105.0-py3-none-any.whl", hash = "sha256:f19ebf6fdc82a3281d10f2cb4774bdfa90238e3b40af3525a0c09fd08ad1c480"}, - {file = "fastapi-0.105.0.tar.gz", hash = "sha256:4d12838819aa52af244580675825e750ad67c9df4614f557a769606af902cf22"}, + {file = "fastapi-0.104.1-py3-none-any.whl", hash = "sha256:752dc31160cdbd0436bb93bad51560b57e525cbb1d4bbf6f4904ceee75548241"}, + {file = "fastapi-0.104.1.tar.gz", hash = "sha256:e5e4540a7c5e1dcfbbcf5b903c234feddcdcd881f191977a1c5dfd917487e7ae"}, ] [package.dependencies] @@ -1035,13 +1035,13 @@ files = [ [[package]] name = "fsspec" -version = "2023.12.2" +version = "2023.12.1" description = "File-system specification" optional = false python-versions = ">=3.8" files = [ - {file = "fsspec-2023.12.2-py3-none-any.whl", hash = "sha256:d800d87f72189a745fa3d6b033b9dc4a34ad069f60ca60b943a63599f5501960"}, - {file = "fsspec-2023.12.2.tar.gz", hash = "sha256:8548d39e8810b59c38014934f6b31e57f40c1b20f911f4cc2b85389c7e9bf0cb"}, + {file = "fsspec-2023.12.1-py3-none-any.whl", hash = "sha256:6271f1d3075a378bfe432f6f42bf7e1d2a6ba74f78dd9b512385474c579146a0"}, + {file = "fsspec-2023.12.1.tar.gz", hash = "sha256:c4da01a35ac65c853f833e43f67802c25213f560820d54ddf248f92eddd5e990"}, ] [package.extras] @@ -1665,13 +1665,13 @@ text-helpers = ["chardet (>=5.1.0,<6.0.0)"] [[package]] name = "langchain-core" -version = "0.0.13" +version = "0.0.12" description = "Building applications with LLMs through composability" optional = false python-versions = ">=3.8.1,<4.0" files = [ - {file = "langchain_core-0.0.13-py3-none-any.whl", hash = "sha256:36d33a3d280877fb29a1f0f292b9b02b9ba29bf43fb54090b7364f00d5925459"}, - {file = "langchain_core-0.0.13.tar.gz", hash = "sha256:fcfc13d2c314c0441c8f1f8b79395316df5873c1c7a687c8c5c553b3824840b6"}, + {file = "langchain_core-0.0.12-py3-none-any.whl", hash = "sha256:7dd7379c3848f9473c93b71992d96ab73b4889c1951bf3d899417b849ba0236c"}, + {file = "langchain_core-0.0.12.tar.gz", hash = "sha256:9c6cca4ed25a10950071be80dc62921b30caafae73ac1bd4b93d9f070967a7b2"}, ] [package.dependencies] @@ -1689,13 +1689,13 @@ extended-testing = ["jinja2 (>=3,<4)"] [[package]] name = "langsmith" -version = "0.0.70" +version = "0.0.69" description = "Client library to connect to the LangSmith LLM Tracing and Evaluation Platform." optional = false python-versions = ">=3.8.1,<4.0" files = [ - {file = "langsmith-0.0.70-py3-none-any.whl", hash = "sha256:a0d4cac3af94fe44c2ef3814c32b6740f92aebe267e395d62e62040bc5bad343"}, - {file = "langsmith-0.0.70.tar.gz", hash = "sha256:3a546c45e67f6600d6669ef63f1f58b772e505703126338ad4f22fe0e2bbf677"}, + {file = "langsmith-0.0.69-py3-none-any.whl", hash = "sha256:49a2546bb83eedb0552673cf81a068bb08078d6d48471f4f1018e1d5c6aa46b1"}, + {file = "langsmith-0.0.69.tar.gz", hash = "sha256:8fb5297f274db0576ec650d9bab0319acfbb6622d62bc5bb9fe31c6235dc0358"}, ] [package.dependencies] @@ -2299,51 +2299,6 @@ files = [ {file = "numpy-1.24.4.tar.gz", hash = "sha256:80f5e3a4e498641401868df4208b74581206afbee7cf7b8329daae82676d9463"}, ] -[[package]] -name = "numpy" -version = "1.26.2" -description = "Fundamental package for array computing in Python" -optional = false -python-versions = ">=3.9" -files = [ - {file = "numpy-1.26.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:3703fc9258a4a122d17043e57b35e5ef1c5a5837c3db8be396c82e04c1cf9b0f"}, - {file = "numpy-1.26.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:cc392fdcbd21d4be6ae1bb4475a03ce3b025cd49a9be5345d76d7585aea69440"}, - {file = "numpy-1.26.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:36340109af8da8805d8851ef1d74761b3b88e81a9bd80b290bbfed61bd2b4f75"}, - {file = "numpy-1.26.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bcc008217145b3d77abd3e4d5ef586e3bdfba8fe17940769f8aa09b99e856c00"}, - {file = "numpy-1.26.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:3ced40d4e9e18242f70dd02d739e44698df3dcb010d31f495ff00a31ef6014fe"}, - {file = "numpy-1.26.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:b272d4cecc32c9e19911891446b72e986157e6a1809b7b56518b4f3755267523"}, - {file = "numpy-1.26.2-cp310-cp310-win32.whl", hash = "sha256:22f8fc02fdbc829e7a8c578dd8d2e15a9074b630d4da29cda483337e300e3ee9"}, - {file = "numpy-1.26.2-cp310-cp310-win_amd64.whl", hash = "sha256:26c9d33f8e8b846d5a65dd068c14e04018d05533b348d9eaeef6c1bd787f9919"}, - {file = "numpy-1.26.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:b96e7b9c624ef3ae2ae0e04fa9b460f6b9f17ad8b4bec6d7756510f1f6c0c841"}, - {file = "numpy-1.26.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:aa18428111fb9a591d7a9cc1b48150097ba6a7e8299fb56bdf574df650e7d1f1"}, - {file = "numpy-1.26.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:06fa1ed84aa60ea6ef9f91ba57b5ed963c3729534e6e54055fc151fad0423f0a"}, - {file = "numpy-1.26.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:96ca5482c3dbdd051bcd1fce8034603d6ebfc125a7bd59f55b40d8f5d246832b"}, - {file = "numpy-1.26.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:854ab91a2906ef29dc3925a064fcd365c7b4da743f84b123002f6139bcb3f8a7"}, - {file = "numpy-1.26.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:f43740ab089277d403aa07567be138fc2a89d4d9892d113b76153e0e412409f8"}, - {file = "numpy-1.26.2-cp311-cp311-win32.whl", hash = "sha256:a2bbc29fcb1771cd7b7425f98b05307776a6baf43035d3b80c4b0f29e9545186"}, - {file = "numpy-1.26.2-cp311-cp311-win_amd64.whl", hash = "sha256:2b3fca8a5b00184828d12b073af4d0fc5fdd94b1632c2477526f6bd7842d700d"}, - {file = "numpy-1.26.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:a4cd6ed4a339c21f1d1b0fdf13426cb3b284555c27ac2f156dfdaaa7e16bfab0"}, - {file = "numpy-1.26.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:5d5244aabd6ed7f312268b9247be47343a654ebea52a60f002dc70c769048e75"}, - {file = "numpy-1.26.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6a3cdb4d9c70e6b8c0814239ead47da00934666f668426fc6e94cce869e13fd7"}, - {file = "numpy-1.26.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:aa317b2325f7aa0a9471663e6093c210cb2ae9c0ad824732b307d2c51983d5b6"}, - {file = "numpy-1.26.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:174a8880739c16c925799c018f3f55b8130c1f7c8e75ab0a6fa9d41cab092fd6"}, - {file = "numpy-1.26.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:f79b231bf5c16b1f39c7f4875e1ded36abee1591e98742b05d8a0fb55d8a3eec"}, - {file = "numpy-1.26.2-cp312-cp312-win32.whl", hash = "sha256:4a06263321dfd3598cacb252f51e521a8cb4b6df471bb12a7ee5cbab20ea9167"}, - {file = "numpy-1.26.2-cp312-cp312-win_amd64.whl", hash = "sha256:b04f5dc6b3efdaab541f7857351aac359e6ae3c126e2edb376929bd3b7f92d7e"}, - {file = "numpy-1.26.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:4eb8df4bf8d3d90d091e0146f6c28492b0be84da3e409ebef54349f71ed271ef"}, - {file = "numpy-1.26.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:1a13860fdcd95de7cf58bd6f8bc5a5ef81c0b0625eb2c9a783948847abbef2c2"}, - {file = "numpy-1.26.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:64308ebc366a8ed63fd0bf426b6a9468060962f1a4339ab1074c228fa6ade8e3"}, - {file = "numpy-1.26.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:baf8aab04a2c0e859da118f0b38617e5ee65d75b83795055fb66c0d5e9e9b818"}, - {file = "numpy-1.26.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:d73a3abcac238250091b11caef9ad12413dab01669511779bc9b29261dd50210"}, - {file = "numpy-1.26.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:b361d369fc7e5e1714cf827b731ca32bff8d411212fccd29ad98ad622449cc36"}, - {file = "numpy-1.26.2-cp39-cp39-win32.whl", hash = "sha256:bd3f0091e845164a20bd5a326860c840fe2af79fa12e0469a12768a3ec578d80"}, - {file = "numpy-1.26.2-cp39-cp39-win_amd64.whl", hash = "sha256:2beef57fb031dcc0dc8fa4fe297a742027b954949cabb52a2a376c144e5e6060"}, - {file = "numpy-1.26.2-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:1cc3d5029a30fb5f06704ad6b23b35e11309491c999838c31f124fee32107c79"}, - {file = "numpy-1.26.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:94cc3c222bb9fb5a12e334d0479b97bb2df446fbe622b470928f5284ffca3f8d"}, - {file = "numpy-1.26.2-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:fe6b44fb8fcdf7eda4ef4461b97b3f63c466b27ab151bec2366db8b197387841"}, - {file = "numpy-1.26.2.tar.gz", hash = "sha256:f65738447676ab5777f11e6bbbdb8ce11b785e105f690bc45966574816b6d3ea"}, -] - [[package]] name = "nvidia-cublas-cu12" version = "12.1.3.1" @@ -2660,7 +2615,7 @@ wrapt = ">=1.0.0,<2.0.0" [[package]] name = "opentelemetry-instrumentation-anthropic" -version = "0.5.3" +version = "0.5.1" description = "OpenTelemetry Anthropic instrumentation" optional = false python-versions = ">=3.8.1,<4" @@ -2700,7 +2655,7 @@ test = ["opentelemetry-instrumentation-asgi[instruments]", "opentelemetry-test-u [[package]] name = "opentelemetry-instrumentation-bedrock" -version = "0.5.3" +version = "0.5.1" description = "OpenTelemetry Bedrock instrumentation" optional = false python-versions = ">=3.8.1,<4" @@ -2718,7 +2673,7 @@ url = "../opentelemetry-instrumentation-bedrock" [[package]] name = "opentelemetry-instrumentation-chromadb" -version = "0.5.3" +version = "0.5.1" description = "OpenTelemetry Chroma DB instrumentation" optional = false python-versions = ">=3.8.1,<4" @@ -2737,7 +2692,7 @@ url = "../opentelemetry-instrumentation-chromadb" [[package]] name = "opentelemetry-instrumentation-cohere" -version = "0.5.3" +version = "0.5.1" description = "OpenTelemetry Cohere instrumentation" optional = false python-versions = ">=3.8.1,<4" @@ -2797,7 +2752,7 @@ test = ["httpx (>=0.22,<1.0)", "opentelemetry-instrumentation-fastapi[instrument [[package]] name = "opentelemetry-instrumentation-haystack" -version = "0.5.3" +version = "0.5.1" description = "OpenTelemetry Haystack instrumentation" optional = false python-versions = ">=3.8.1,<4" @@ -2815,7 +2770,7 @@ url = "../opentelemetry-instrumentation-haystack" [[package]] name = "opentelemetry-instrumentation-langchain" -version = "0.5.3" +version = "0.5.1" description = "OpenTelemetry Langchain instrumentation" optional = false python-versions = ">=3.8.1,<4" @@ -2833,7 +2788,7 @@ url = "../opentelemetry-instrumentation-langchain" [[package]] name = "opentelemetry-instrumentation-llamaindex" -version = "0.5.3" +version = "0.5.1" description = "OpenTelemetry LlamaIndex instrumentation" optional = false python-versions = ">=3.8.1,<4" @@ -2852,7 +2807,7 @@ url = "../opentelemetry-instrumentation-llamaindex" [[package]] name = "opentelemetry-instrumentation-openai" -version = "0.5.3" +version = "0.5.1" description = "OpenTelemetry OpenAI instrumentation" optional = false python-versions = ">=3.8.1,<4" @@ -2870,7 +2825,7 @@ url = "../opentelemetry-instrumentation-openai" [[package]] name = "opentelemetry-instrumentation-pinecone" -version = "0.5.3" +version = "0.5.1" description = "OpenTelemetry Pinecone instrumentation" optional = false python-versions = ">=3.8.1,<4" @@ -2929,7 +2884,7 @@ test = ["httpretty (>=1.0,<2.0)", "opentelemetry-instrumentation-requests[instru [[package]] name = "opentelemetry-instrumentation-transformers" -version = "0.5.3" +version = "0.5.1" description = "OpenTelemetry transformers instrumentation" optional = false python-versions = ">=3.8.1,<4" @@ -3826,13 +3781,13 @@ pyasn1 = ">=0.1.3" [[package]] name = "s3transfer" -version = "0.9.0" +version = "0.8.2" description = "An Amazon S3 Transfer Manager" optional = false -python-versions = ">= 3.8" +python-versions = ">= 3.7" files = [ - {file = "s3transfer-0.9.0-py3-none-any.whl", hash = "sha256:01d4d2c35a016db8cb14f9a4d5e84c1f8c96e7ffc211422555eed45c11fa7eb1"}, - {file = "s3transfer-0.9.0.tar.gz", hash = "sha256:9e1b186ec8bb5907a1e82b51237091889a9973a2bb799a924bcd9f301ff79d3d"}, + {file = "s3transfer-0.8.2-py3-none-any.whl", hash = "sha256:c9e56cbe88b28d8e197cf841f1f0c130f246595e77ae5b5a05b69fe7cb83de76"}, + {file = "s3transfer-0.8.2.tar.gz", hash = "sha256:368ac6876a9e9ed91f6bc86581e319be08188dc60d50e0d56308ed5765446283"}, ] [package.dependencies] @@ -4409,7 +4364,7 @@ telegram = ["requests"] [[package]] name = "traceloop-sdk" -version = "0.5.3" +version = "0.5.1" description = "Traceloop Software Development Kit (SDK) for Python" optional = false python-versions = ">=3.8.1,<4" @@ -4561,13 +4516,13 @@ test = ["black (>=22.3.0,<23.0.0)", "coverage (>=6.2,<7.0)", "isort (>=5.0.6,<6. [[package]] name = "typing-extensions" -version = "4.9.0" +version = "4.8.0" description = "Backported and Experimental Type Hints for Python 3.8+" optional = false python-versions = ">=3.8" files = [ - {file = "typing_extensions-4.9.0-py3-none-any.whl", hash = "sha256:af72aea155e91adfc61c3ae9e0e342dbc0cba726d6cba4b6c72c1f34e47291cd"}, - {file = "typing_extensions-4.9.0.tar.gz", hash = "sha256:23478f88c37f27d76ac8aee6c905017a143b0b1b886c3c9f66bc2fd94f9f5783"}, + {file = "typing_extensions-4.8.0-py3-none-any.whl", hash = "sha256:8f92fc8806f9a6b641eaa5318da32b44d401efaac0f6678c9bc448ba3605faa0"}, + {file = "typing_extensions-4.8.0.tar.gz", hash = "sha256:df8e4339e9cb77357558cbdbceca33c303714cf861d1eef15e1070055ae8b7ef"}, ] [[package]] diff --git a/packages/sample-app/sample_app/methods_decorated_app.py b/packages/sample-app/sample_app/methods_decorated_app.py index df4e3d1bf..641ad5b47 100644 --- a/packages/sample-app/sample_app/methods_decorated_app.py +++ b/packages/sample-app/sample_app/methods_decorated_app.py @@ -66,7 +66,5 @@ def joke_workflow(): signature = generate_signature(pirate_joke) print(pirate_joke + "\n\n" + signature) - Traceloop.report_score("chat_id", "chat_9876", 1) - joke_workflow() diff --git a/packages/traceloop-sdk/traceloop/sdk/__init__.py b/packages/traceloop-sdk/traceloop/sdk/__init__.py index e20e5f2e6..6a207fa6f 100644 --- a/packages/traceloop-sdk/traceloop/sdk/__init__.py +++ b/packages/traceloop-sdk/traceloop/sdk/__init__.py @@ -32,7 +32,6 @@ class Traceloop: AUTO_CREATED_URL = str(Path.home() / ".cache" / "traceloop" / "auto_created_url") __tracer_wrapper: TracerWrapper - __fetcher: Fetcher @staticmethod def init( @@ -58,8 +57,7 @@ def init( and not exporter and not processor ): - Traceloop.__fetcher = Fetcher(base_url=api_endpoint, api_key=api_key) - Traceloop.__fetcher.run() + Fetcher(base_url=api_endpoint, api_key=api_key).run() print( Fore.GREEN + "Traceloop syncing configuration and prompts" + Fore.RESET ) @@ -160,27 +158,3 @@ def set_correlation_id(correlation_id: str) -> None: def set_association_properties(properties: dict) -> None: set_association_properties(properties) - - def report_score( - association_property_name: str, - association_property_id: str, - score: float, - ): - if not Traceloop.__fetcher: - print( - Fore.RED - + "Error: Cannot report score. Missing Traceloop API key," - + " go to https://https://app.traceloop.com/settings/api-keys to create one" - ) - print("Set the TRACELOOP_API_KEY environment variable to the key") - print(Fore.RESET) - return - - Traceloop.__fetcher.post( - "score", - { - "entity_name": f"traceloop.association.properties.{association_property_name}", - "entity_id": association_property_id, - "score": score, - }, - ) diff --git a/packages/traceloop-sdk/traceloop/sdk/fetcher.py b/packages/traceloop-sdk/traceloop/sdk/fetcher.py index 4fc15b192..d9dbace3b 100644 --- a/packages/traceloop-sdk/traceloop/sdk/fetcher.py +++ b/packages/traceloop-sdk/traceloop/sdk/fetcher.py @@ -6,7 +6,7 @@ import requests from threading import Thread, Event -from typing import Dict, Optional +from typing import Optional from tenacity import ( RetryError, retry, @@ -61,9 +61,6 @@ def run(self): self._exit_monitor.start() self._poller_thread.start() - def post(self, api: str, body: Dict[str, str]): - post_url(f"{self._base_url}/v1/traceloop/{api}", self._api_key, body) - class RetryIfServerError(retry_if_exception): def __init__( @@ -103,20 +100,6 @@ def fetch_url(url: str, api_key: str): return response.json() -def post_url(url: str, api_key: str, body: Dict[str, str]): - response = requests.post( - url, - headers={ - "Authorization": f"Bearer {api_key}", - "X-Traceloop-SDK-Version": __version__, - }, - json=body, - ) - - if response.status_code != 200: - raise requests.exceptions.HTTPError(response=response) - - def thread_func( prompt_registry: PromptRegistry, content_allow_list: ContentAllowList, @@ -141,10 +124,10 @@ def refresh_data( prompt_registry: PromptRegistry, content_allow_list: ContentAllowList, ): - response = fetch_url(f"{base_url}/v1/traceloop/prompts", api_key) + response = fetch_url(f"{base_url}/v1/prompts", api_key) prompt_registry.load(response) - response = fetch_url(f"{base_url}/v1/traceloop/pii/tracing-allow-list", api_key) + response = fetch_url(f"{base_url}/v1/config/pii/tracing-allow-list", api_key) content_allow_list.load(response)