langtrace-python-sdk 1.2.6__py3-none-any.whl → 1.2.8__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,130 @@
1
+ Metadata-Version: 2.3
2
+ Name: langtrace-python-sdk
3
+ Version: 1.2.8
4
+ Summary: Python SDK for LangTrace
5
+ Project-URL: Homepage, https://github.com/Scale3-Labs/langtrace-python-sdk
6
+ Author-email: Scale3 Labs <engineering@scale3labs.com>
7
+ License-Expression: Apache-2.0
8
+ License-File: LICENSE
9
+ Classifier: License :: OSI Approved :: Apache Software License
10
+ Classifier: Operating System :: OS Independent
11
+ Classifier: Programming Language :: Python :: 3
12
+ Requires-Python: >=3.9
13
+ Requires-Dist: opentelemetry-api
14
+ Requires-Dist: opentelemetry-instrumentation
15
+ Requires-Dist: opentelemetry-sdk
16
+ Requires-Dist: pinecone-client
17
+ Requires-Dist: tiktoken
18
+ Requires-Dist: trace-attributes
19
+ Provides-Extra: dev
20
+ Requires-Dist: anthropic; extra == 'dev'
21
+ Requires-Dist: chromadb; extra == 'dev'
22
+ Requires-Dist: langchain; extra == 'dev'
23
+ Requires-Dist: langchain-openai; extra == 'dev'
24
+ Requires-Dist: llama-index; extra == 'dev'
25
+ Requires-Dist: openai; extra == 'dev'
26
+ Requires-Dist: python-dotenv; extra == 'dev'
27
+ Description-Content-Type: text/markdown
28
+
29
+ # What is Langtrace?
30
+
31
+ Langtrace stands as a developer-centric, open-source solution, fully compatible with OpenTelemetry. It enables developers to effortlessly trace, monitor, and debug their LLM applications, offering robust support for automatic instrumentation.
32
+
33
+ ## Supported LLM Modules
34
+
35
+ Langtrace supports a comprehensive range of LLMs, VectorDBs, and frameworks, ensuring wide coverage for your development needs:
36
+
37
+ ### LLMs
38
+
39
+ 1. OpenAI
40
+ 2. Anthropic
41
+ 3. Azure OpenAI
42
+
43
+ ### VectorDBs
44
+
45
+ 1. Pinecone
46
+ 2. Chromadb
47
+
48
+ ### Frameworks
49
+
50
+ 1. LangChain
51
+ 2. LlamaIndex
52
+ 3. Haystack
53
+
54
+ We are actively working to extend our support to additional libraries!
55
+
56
+ ## Getting Started
57
+
58
+ To begin utilizing Langtrace, follow these straightforward steps:
59
+
60
+ 1. Install the package using `pip install langtrace-python-sdk`.
61
+ 2. Incorporate Langtrace into your project with `from langtrace_python_sdk import langtrace`.
62
+ - This import should precede any other LLM module imports (such as OpenAI, LlamaIndex, etc.) to ensure proper functionality.
63
+ 3. Initialize Langtrace by adding `langtrace.init({ write_to_remote_url: false})` to your code.
64
+ 4. Congratulations, you've completed the basic setup! You will now begin to see traces from your LLM modules logged directly to the console.
65
+
66
+
67
+ ## Exporting Traces to Langtrace
68
+
69
+ To configure trace exporting, you have two options:
70
+
71
+ You'll need a Langtrace `api_key`, which can be acquired by logging into your Langtrace account.
72
+
73
+ 1. Direct Initialization: Utilize `langtrace.init({ api_key: <YOUR_API_KEY>})`.
74
+ 2. Environment Variables: Set `LANGTRACE_API_KEY`, then add `langtrace.init()` at the beginning of your file.
75
+
76
+ ### Additional Customization
77
+
78
+ - `@with_langtrace_root_span` - this decorator is designed to organize and relate different spans, in a hierarchical manner. When you're performing multiple operations that you want to monitor together as a unit, this function helps by establishing a "parent" (`LangtraceRootSpan` or whatever is passed to `name`) span. Then, any calls to the LLM APIs made within the given function (fn) will be considered "children" of this parent span. This setup is especially useful for tracking the performance or behavior of a group of operations collectively, rather than individually.
79
+
80
+ ```python
81
+ from langtrace_python_sdk.utils.with_root_span import with_langtrace_root_span
82
+
83
+ @with_langtrace_root_span()
84
+ def example():
85
+ response = client.chat.completions.create(
86
+ model="gpt-4",
87
+ messages=[{"role": "user", "content": "Say this is a test three times"}],
88
+ stream=False,
89
+ )
90
+ return response
91
+ ```
92
+
93
+
94
+ - `with_additional_attributes` - this function is designed to enhance the traces by adding custom attributes to the current context. These custom attributes provide extra details about the operations being performed, making it easier to analyze and understand their behavior.
95
+
96
+ ```python
97
+ from langtrace_python_sdk.utils.with_root_span import (
98
+ with_langtrace_root_span,
99
+ with_additional_attributes,
100
+ )
101
+
102
+ @with_additional_attributes({"user.id": "1234", "user.feedback.rating": 1})
103
+ def api_call1():
104
+ response = client.chat.completions.create(
105
+ model="gpt-4",
106
+ messages=[{"role": "user", "content": "Say this is a test three times"}],
107
+ stream=False,
108
+ )
109
+ return response
110
+
111
+
112
+ @with_additional_attributes({"user.id": "5678", "user.feedback.rating": -1})
113
+ def api_call2():
114
+ response = client.chat.completions.create(
115
+ model="gpt-4",
116
+ messages=[{"role": "user", "content": "Say this is a test three times"}],
117
+ stream=False,
118
+ )
119
+ return response
120
+
121
+
122
+ @with_langtrace_root_span()
123
+ def chat_completion():
124
+ api_call1()
125
+ api_call2()
126
+ ```
127
+
128
+ ## Langtrace Cloud
129
+
130
+ Currently under development 🚧
@@ -4,59 +4,60 @@ examples/anthropic_example/completion.py,sha256=97CA6u7iLdTj6qQ5XA7nB0bcNMxUwXJK
4
4
  examples/chroma_example/__init__.py,sha256=Tq6pae7fHA7dwuDslabB5MTNedL21gu2RaZicpxSyLU,25
5
5
  examples/chroma_example/basic.py,sha256=VE-I7Db58Dyb0G6WgX9FeloHLGuRRvfB4aNvSIVL4Uk,910
6
6
  examples/langchain_example/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
- examples/langchain_example/basic.py,sha256=MlptA_Bz2o55wzvu273A1r0FSe_RUbWQaYtxHovt08A,2079
7
+ examples/langchain_example/basic.py,sha256=mSVcE-Kx7jNS4U_zrm5WZI98xyw6WTrhd2GMVGgn9Cg,2653
8
8
  examples/langchain_example/tool.py,sha256=8T8_IDbgA58XbsfyH5_xhA8ZKQfyfyFxF8wor-PsRjA,2556
9
9
  examples/llamaindex_example/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
10
  examples/llamaindex_example/basic.py,sha256=a8Z9F6egBdoo4GzcSMQ-0zkpBn2CuQg4JSI8kmSE-8Q,694
11
11
  examples/llamaindex_example/data/abramov.txt,sha256=Ou-GyWZm5AjHLgxviBoRE9ikNv5MScsF0cd--0vVVhI,32667
12
12
  examples/openai/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
- examples/openai/chat_completion.py,sha256=iq1Srhr_WBJS7_x7QAPdN4mkSs4cdd-0Yxv84S29Rkc,1336
13
+ examples/openai/chat_completion.py,sha256=ynVWdvEwDxNPpkWu9fv4al7_1mm3rFilFvqkrcRjdpA,1702
14
14
  examples/openai/embeddings_create.py,sha256=AhDNAqg-WzRYLJAE_b2RKGjuVCh4aZSU7MxcZv2kCHQ,518
15
15
  examples/openai/function_calling.py,sha256=Zd1gkl1TU-g_cxXox3_8vmFRZVyZSyyLaboEJLc6N2A,2375
16
16
  examples/openai/images_generate.py,sha256=ZioxTuHKE_yYlhpESqXKVzdkiwdegkmLVB7N8T2LU00,506
17
17
  examples/pinecone_example/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
18
18
  examples/pinecone_example/basic.py,sha256=hdV6-5Fmol9zeyFzDtdabD62vkqUJ4lCHG2YcVNpIpI,933
19
19
  langtrace_python_sdk/__init__.py,sha256=SlHg447-nQBbw8exRNJP_OyHUZ39Sldb7aaQ35hIRm8,262
20
- langtrace_python_sdk/langtrace.py,sha256=XS4lhorNLPgsdKB2hTFsHR31_kUgr9cHZTc4dLgJs_g,3251
21
- langtrace_python_sdk/version.py,sha256=vMQK58X8_YZGKzRm0ThvPAKFtpfyejGmUnDrY9RQ13w,22
20
+ langtrace_python_sdk/langtrace.py,sha256=sWC7WqbOdOUB1sZ_hzLZVp0_Q8fBTRJRMUvOPyO6f20,3170
21
+ langtrace_python_sdk/version.py,sha256=CfVXm0wwlKPW0khOcwhWw61TpgtZiLijCePsAIOK3aU,22
22
22
  langtrace_python_sdk/constants/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
23
+ langtrace_python_sdk/constants/exporter/langtrace_exporter.py,sha256=qicGmyWf0aCb9ki2wmkHOv8rb7TF5o61_rJhjrbHJzs,60
23
24
  langtrace_python_sdk/constants/instrumentation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
24
25
  langtrace_python_sdk/constants/instrumentation/anthropic.py,sha256=YX3llt3zwDY6XrYk3CB8WEVqgrzRXEw_ffyk56JoF3k,126
25
26
  langtrace_python_sdk/constants/instrumentation/chroma.py,sha256=hiPGYdHS0Yj4Kh3eaYBbuCAl_swqIygu80yFqkOgdak,955
26
- langtrace_python_sdk/constants/instrumentation/common.py,sha256=6sy6Am2sd-yJ-3ZI5P2UhmdF4PCvhYxLvhnZnTmZaiU,524
27
+ langtrace_python_sdk/constants/instrumentation/common.py,sha256=KzNCWEl_44pkZ5DcBBLAInh-QNgSMPSBkbhIcC8rH0A,602
27
28
  langtrace_python_sdk/constants/instrumentation/openai.py,sha256=9VF6ic9Ed3bpSvdp6iNmrpx2Ppo6DPav3hoUcqSQSv0,1048
28
29
  langtrace_python_sdk/constants/instrumentation/pinecone.py,sha256=Xaqqw-xBO0JJLGk75hiCUQGztNm0HiVaLQvjtYK7VJM,472
29
30
  langtrace_python_sdk/extensions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
30
- langtrace_python_sdk/extensions/langtrace_exporter.py,sha256=6dMS0MjYCmZbuj3CMb94JarR3DYmiHLeN81hXbPsKOA,4320
31
+ langtrace_python_sdk/extensions/langtrace_exporter.py,sha256=7lIsChmQSOWqFxiegNbHEA_rOTpbkm-RBlBYvKIHxg4,4097
31
32
  langtrace_python_sdk/instrumentation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
32
33
  langtrace_python_sdk/instrumentation/anthropic/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
33
34
  langtrace_python_sdk/instrumentation/anthropic/instrumentation.py,sha256=1shNkDE7Yb-JFVlEZHMcDbJ6zW8SkSFdxf_yFo9wTNA,1101
34
- langtrace_python_sdk/instrumentation/anthropic/patch.py,sha256=76fpf2SVwS_AP67U_nE3bvL5zyP_-xjH6d-gGOOSqdE,6876
35
+ langtrace_python_sdk/instrumentation/anthropic/patch.py,sha256=_-dNjxJbJTgJfHfwC_zGoxAXupL86jfBLlZefLuCBKk,7115
35
36
  langtrace_python_sdk/instrumentation/chroma/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
36
37
  langtrace_python_sdk/instrumentation/chroma/instrumentation.py,sha256=fSR1ZjoViwjbPYkUWJnRpFwWtwERyf4UqnMiDl8eGmY,1223
37
- langtrace_python_sdk/instrumentation/chroma/patch.py,sha256=NGHZR5TGaL0JgZX184L8Nt5U3hpDdD-htHUkMgQuT5A,1999
38
+ langtrace_python_sdk/instrumentation/chroma/patch.py,sha256=IORHg5GMrzFiuzMWzAbrZzmxQTRu-zzksgh5RDPGoG8,2245
38
39
  langtrace_python_sdk/instrumentation/langchain/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
39
40
  langtrace_python_sdk/instrumentation/langchain/instrumentation.py,sha256=im9RSJ3twIWVtzSE0sT-0VY82b_CxSzs-Tk7Z4nas3Q,2880
40
- langtrace_python_sdk/instrumentation/langchain/patch.py,sha256=B15XmjKUyCIKPIHpF4hvuj_aHmwM0IS-iPUB0HWiyUI,2990
41
+ langtrace_python_sdk/instrumentation/langchain/patch.py,sha256=z_brH_5BSze1MWjWBycyOPMrJAAw65OUM5vcvvatoZM,3236
41
42
  langtrace_python_sdk/instrumentation/langchain_community/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
42
43
  langtrace_python_sdk/instrumentation/langchain_community/instrumentation.py,sha256=CS6oAxnhQ98gjD5Xj7LrWDE9i-FVjWI3kOwZ4phspnU,4677
43
- langtrace_python_sdk/instrumentation/langchain_community/patch.py,sha256=XaEaeqTWivEdO4t3lkpVIEPiKXM29Cy-CwRzuOhSAoY,2869
44
+ langtrace_python_sdk/instrumentation/langchain_community/patch.py,sha256=7bUea2TifibcCdBqLoqqR-M5vn8UD977NVXU0ACqsgw,3115
44
45
  langtrace_python_sdk/instrumentation/langchain_core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
45
46
  langtrace_python_sdk/instrumentation/langchain_core/instrumentation.py,sha256=1Y4q_F2nN79y-dap_if35vH9oowIuDi6mo0ELYIltNI,5417
46
- langtrace_python_sdk/instrumentation/langchain_core/patch.py,sha256=dRckKaEW-eUyjkCuFipLQ8_102NmpiqI5GgIns-GQuQ,7597
47
+ langtrace_python_sdk/instrumentation/langchain_core/patch.py,sha256=zr5nvqeOX6IlD1gDbRLRz7Frep40EvrOSz8BCy1XgJc,7843
47
48
  langtrace_python_sdk/instrumentation/llamaindex/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
48
49
  langtrace_python_sdk/instrumentation/llamaindex/instrumentation.py,sha256=udDxk87H731x0mRFNr0jdtstfnSwiirxVPo6Z4UWAtY,2430
49
- langtrace_python_sdk/instrumentation/llamaindex/patch.py,sha256=BJyX9AFiDvCZ3EjgU3roSdhb4CNZdKfajPogvBv33vc,1739
50
+ langtrace_python_sdk/instrumentation/llamaindex/patch.py,sha256=wTWmyTD09J44ULGoMVmgmq72VN1H0xmdrISTdzqo1Yw,1985
50
51
  langtrace_python_sdk/instrumentation/openai/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
51
52
  langtrace_python_sdk/instrumentation/openai/instrumentation.py,sha256=6RmbONTwgr8_do92l3ll7-ia4maXMxQVCwPBRRa-3NA,1358
52
- langtrace_python_sdk/instrumentation/openai/patch.py,sha256=FdHW7JEcizQkl3qg2bq7SuLNB4jWJqn64cXnMIg2pno,14219
53
+ langtrace_python_sdk/instrumentation/openai/patch.py,sha256=ffj5W-R1WtcLkahur2e6s5eYJIGCiV7PkNIA8ZXwP1c,14982
53
54
  langtrace_python_sdk/instrumentation/pinecone/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
54
55
  langtrace_python_sdk/instrumentation/pinecone/instrumentation.py,sha256=PBkCMiaDr-WXkGfHt9iXtYqyl7a-xIO52pRmUFuMURo,1726
55
- langtrace_python_sdk/instrumentation/pinecone/patch.py,sha256=uDKUBjyOVCDL44YxXVR80VSZGgg-ZNCcQulBUwrgYPk,1896
56
+ langtrace_python_sdk/instrumentation/pinecone/patch.py,sha256=lvWL_xM7mxTQ1D-eY5Gh949c45BAKrN2N5IzKRkUhMY,2142
56
57
  langtrace_python_sdk/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
57
58
  langtrace_python_sdk/utils/llm.py,sha256=4z2e-md_ELXCEuOIRVWracR6qH2pmsOxCqpkuF9_3Nw,1589
58
- langtrace_python_sdk/utils/with_root_span.py,sha256=LgFVwHq7KZ6sj2d783NZXr2fFWqI1rqVWSjJR68Ad1E,1044
59
- langtrace_python_sdk-1.2.6.dist-info/METADATA,sha256=T_lC4-Z8756LuXKbG8PlDTSh7rynBD1jWxQe9EW10Wk,2773
60
- langtrace_python_sdk-1.2.6.dist-info/WHEEL,sha256=uNdcs2TADwSd5pVaP0Z_kcjcvvTUklh2S7bxZMF8Uj0,87
61
- langtrace_python_sdk-1.2.6.dist-info/licenses/LICENSE,sha256=VD-pauwiiia-Xi2zgKvalKRIFSJJjqRCQw6aIpK2T9U,33892
62
- langtrace_python_sdk-1.2.6.dist-info/RECORD,,
59
+ langtrace_python_sdk/utils/with_root_span.py,sha256=N7ONrcF0myZbHBy5gpQffDbX-Kf63Crsz9szG0i3m08,1889
60
+ langtrace_python_sdk-1.2.8.dist-info/METADATA,sha256=hUGy2U_g2c3kGrgG9QRlPQ77y7R9wtsrNpm_FXZ5D7M,4730
61
+ langtrace_python_sdk-1.2.8.dist-info/WHEEL,sha256=uNdcs2TADwSd5pVaP0Z_kcjcvvTUklh2S7bxZMF8Uj0,87
62
+ langtrace_python_sdk-1.2.8.dist-info/licenses/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
63
+ langtrace_python_sdk-1.2.8.dist-info/RECORD,,
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -1,76 +0,0 @@
1
- Metadata-Version: 2.3
2
- Name: langtrace-python-sdk
3
- Version: 1.2.6
4
- Summary: Python SDK for LangTrace
5
- Project-URL: Homepage, https://github.com/Scale3-Labs/langtrace-python-sdk
6
- Author-email: Scale3 Labs <engineering@scale3labs.com>
7
- License: AGPL-3.0-or-later
8
- License-File: LICENSE
9
- Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
10
- Classifier: Operating System :: OS Independent
11
- Classifier: Programming Language :: Python :: 3
12
- Requires-Python: >=3.9
13
- Requires-Dist: opentelemetry-api
14
- Requires-Dist: opentelemetry-instrumentation
15
- Requires-Dist: opentelemetry-sdk
16
- Requires-Dist: pinecone-client
17
- Requires-Dist: trace-attributes
18
- Provides-Extra: dev
19
- Requires-Dist: anthropic; extra == 'dev'
20
- Requires-Dist: chromadb; extra == 'dev'
21
- Requires-Dist: langchain; extra == 'dev'
22
- Requires-Dist: langchain-openai; extra == 'dev'
23
- Requires-Dist: llama-index; extra == 'dev'
24
- Requires-Dist: openai; extra == 'dev'
25
- Requires-Dist: python-dotenv; extra == 'dev'
26
- Description-Content-Type: text/markdown
27
-
28
- # What is Langtrace?
29
-
30
- Langtrace stands as a developer-centric, open-source solution, fully compatible with OpenTelemetry. It enables developers to effortlessly trace, monitor, and debug their LLM applications, offering robust support for automatic instrumentation.
31
-
32
- ## Supported LLM Modules
33
-
34
- Langtrace supports a comprehensive range of LLMs, VectorDBs, and frameworks, ensuring wide coverage for your development needs:
35
-
36
- ### LLMs
37
-
38
- 1. OpenAI
39
- 2. Anthropic
40
- 3. Azure OpenAI
41
-
42
- ### VectorDBs
43
-
44
- 1. Pinecone
45
- 2. Chromadb
46
-
47
- ### Frameworks
48
-
49
- 1. LangChain
50
- 2. LlamaIndex
51
- 3. Haystack
52
-
53
- We are actively working to extend our support to additional libraries!
54
-
55
- ## Getting Started
56
-
57
- To begin utilizing Langtrace, follow these straightforward steps:
58
-
59
- 1. Install the package using `pip install langtrace-python-sdk`.
60
- 2. Incorporate Langtrace into your project with `from langtrace_python_sdk import langtrace`.
61
- - This import should precede any other LLM module imports (such as OpenAI, LlamaIndex, etc.) to ensure proper functionality.
62
- 3. Initialize Langtrace by adding `langtrace.init({ write_to_remote_url: false})` to your code.
63
- 4. Congratulations, you've completed the basic setup! You will now begin to see traces from your LLM modules logged directly to the console.
64
-
65
- ## Exporting Traces to Langtrace
66
-
67
- To configure trace exporting, you have two options:
68
-
69
- You'll need both a Langtrace `api_key` and a `remote_url`, which can be acquired by logging into your Langtrace account.
70
-
71
- 1. Direct Initialization: Utilize `langtrace.init(batch=True, api_key=<YOUR_API_KEY>, remote_url=<YOUR_REMOTE_URL>)`.
72
- 2. Environment Variables: Set `API_KEY` and `URL`, then add `LangTrace.init(batch=True)` at the beginning of your file.
73
-
74
- ## Langtrace Cloud
75
-
76
- Currently under development 🚧