langtrace-python-sdk 3.8.14__py3-none-any.whl → 3.8.15__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.
@@ -8,8 +8,8 @@ langtrace.init(disable_instrumentations={"all_except": ["dspy", "anthropic"]})
8
8
 
9
9
  # configure the language model to be used by dspy
10
10
 
11
- llm = dspy.Claude()
12
- dspy.settings.configure(lm=llm)
11
+ lm = dspy.LM('claude-3-opus-20240229')
12
+ dspy.configure(lm=lm)
13
13
 
14
14
  # create a prompt format that says that the llm will take a question and give back an answer
15
15
  predict = dspy.Predict("question -> answer")
@@ -7,8 +7,8 @@ load_dotenv()
7
7
  langtrace.init(disable_instrumentations={"all_except": ["dspy", "anthropic"]})
8
8
 
9
9
  # configure the language model to be used by dspy
10
- llm = dspy.Claude()
11
- dspy.settings.configure(lm=llm)
10
+ lm = dspy.LM('claude-3-opus-20240229')
11
+ dspy.configure(lm=lm)
12
12
 
13
13
 
14
14
  # create a signature for basic question answering
@@ -7,8 +7,8 @@ load_dotenv()
7
7
  langtrace.init(disable_instrumentations={"all_except": ["dspy", "anthropic"]})
8
8
 
9
9
  # configure the language model to be used by dspy
10
- llm = dspy.Claude()
11
- dspy.settings.configure(lm=llm)
10
+ lm = dspy.LM('claude-3-opus-20240229')
11
+ dspy.configure(lm=lm)
12
12
 
13
13
 
14
14
  # create a signature for basic question answering
@@ -7,8 +7,8 @@ load_dotenv()
7
7
  langtrace.init(disable_instrumentations={"all_except": ["dspy", "anthropic"]})
8
8
 
9
9
  # configure the language model to be used by dspy
10
- llm = dspy.Claude()
11
- dspy.settings.configure(lm=llm)
10
+ lm = dspy.LM('claude-3-opus-20240229')
11
+ dspy.configure(lm=lm)
12
12
 
13
13
 
14
14
  # create a signature for basic question answering
@@ -7,8 +7,8 @@ from langtrace_python_sdk import langtrace, with_langtrace_root_span
7
7
 
8
8
  langtrace.init()
9
9
 
10
- turbo = dspy.OpenAI(model="gpt-3.5-turbo", max_tokens=250)
11
- dspy.settings.configure(lm=turbo)
10
+ lm = dspy.LM('gpt-3.5-turbo')
11
+ dspy.configure(lm=lm)
12
12
 
13
13
  # Load math questions from the GSM8K dataset
14
14
  gsm8k = GSM8K()
@@ -9,8 +9,8 @@ from langtrace_python_sdk import langtrace, with_langtrace_root_span, inject_add
9
9
 
10
10
  langtrace.init()
11
11
 
12
- turbo = dspy.OpenAI(model="gpt-3.5-turbo", max_tokens=250)
13
- dspy.settings.configure(lm=turbo)
12
+ lm = dspy.LM('gpt-3.5-turbo')
13
+ dspy.configure(lm=lm)
14
14
 
15
15
  # Load math questions from the GSM8K dataset
16
16
  gsm8k = GSM8K()
@@ -5,8 +5,8 @@ from langtrace_python_sdk import langtrace, with_langtrace_root_span
5
5
 
6
6
  langtrace.init()
7
7
 
8
- turbo = dspy.OpenAI(model="gpt-3.5-turbo", max_tokens=250)
9
- dspy.settings.configure(lm=turbo)
8
+ lm = dspy.LM('gpt-3.5-turbo')
9
+ dspy.configure(lm=lm)
10
10
 
11
11
 
12
12
  # Define a simple signature for basic question answering
@@ -15,8 +15,8 @@ from langtrace_python_sdk import langtrace, with_langtrace_root_span
15
15
 
16
16
  langtrace.init()
17
17
 
18
- turbo = dspy.OpenAI(model="gpt-3.5-turbo", max_tokens=250)
19
- dspy.settings.configure(lm=turbo)
18
+ lm = dspy.LM('gpt-3.5-turbo')
19
+ dspy.configure(lm=lm)
20
20
 
21
21
  colbertv2_wiki17_abstracts = dspy.ColBERTv2(
22
22
  url="http://20.102.90.50:2017/wiki17_abstracts"
@@ -63,6 +63,10 @@ def generic_patch(version: str, tracer: Tracer) -> Callable:
63
63
  result_json = str(result)
64
64
 
65
65
  span.set_attribute("tlm.result", str(result_json))
66
+ trustworthiness_score = result_json["trustworthiness_score"]
67
+ log = result_json["log"]
68
+ span.set_attribute("tlm.trustworthiness_score", str(trustworthiness_score))
69
+ span.set_attribute("tlm.explanation", str(log.get("explanation", "")))
66
70
  span.set_status(Status(StatusCode.OK))
67
71
 
68
72
  return result
@@ -70,11 +70,6 @@ class DspyInstrumentation(BaseInstrumentor):
70
70
  "MultiChainComparison.forward",
71
71
  patch_signature("MultiChainComparison.forward", version, tracer),
72
72
  )
73
- _W(
74
- "dspy.predict.retry",
75
- "Retry.forward",
76
- patch_signature("Retry.forward", version, tracer),
77
- )
78
73
  _W(
79
74
  "dspy.evaluate.evaluate",
80
75
  "Evaluate.__call__",
@@ -38,7 +38,7 @@ def patch_bootstrapfewshot_optimizer(operation_name, version, tracer):
38
38
  prog = {
39
39
  "name": args[0].prog.__class__.__name__,
40
40
  "signature": (
41
- str(args[0].prog.signature) if args[0].prog.signature else None
41
+ str(args[0].prog.signature) if hasattr(args[0].prog, "signature") else None
42
42
  ),
43
43
  }
44
44
  span_attributes["dspy.optimizer.module.prog"] = json.dumps(prog)
@@ -1 +1 @@
1
- __version__ = "3.8.14"
1
+ __version__ = "3.8.15"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: langtrace-python-sdk
3
- Version: 3.8.14
3
+ Version: 3.8.15
4
4
  Summary: Python SDK for LangTrace
5
5
  Project-URL: Homepage, https://github.com/Scale3-Labs/langtrace-python-sdk
6
6
  Author-email: Scale3 Labs <engineering@scale3labs.com>
@@ -39,15 +39,15 @@ examples/crewai_example/trip_planner/main.py,sha256=dwEh60RABqaBodhkPr3lB7KS83f7
39
39
  examples/crewai_example/trip_planner/tasks.py,sha256=ZGRaTAgkA66IN7q9EYbJqM8xWhUTxcF4ynnqTyBcSL4,5667
40
40
  examples/crewai_example/trip_planner/tools/calculator.py,sha256=bMfxJDAwbn6D26pe880S4BB3rcFeyvEyb15QR00T8kI,522
41
41
  examples/crewai_example/trip_planner/tools/search_tools.py,sha256=p8qZe_bi45OjBwiwwrH0lhTaQI_ZiLThSTEEN5dWxF0,2700
42
- examples/dspy_example/QA_basic.py,sha256=8qlHC8FcDAHIxns7Xax8e5tMUNgppbF1RdRbZwxZGAs,553
43
- examples/dspy_example/QA_basic_with_chain_of_thought.py,sha256=u0yxUSiAWbSe-pXxXU5pKORc7kaTRgBdFUcA6cqTiOk,814
44
- examples/dspy_example/QA_basic_with_signature.py,sha256=iGVhm-pIutBWLQDbviSmH38etTAxxbz1ouBmT66beW4,890
45
- examples/dspy_example/QA_multi_step_with_chain_of_thought.py,sha256=mIUiG1Y7tuKi_Y6ZHk_b9WskjyklR-Ar4OUbpqtCNmw,1382
46
- examples/dspy_example/math_problems_cot.py,sha256=Z98nB6myt8WJse2dWS6Ap7CFUhC27lBNb37R1Gg80VQ,1282
47
- examples/dspy_example/math_problems_cot_parallel.py,sha256=5clw-IIVA0mWm0N0xWNDMQaSY07YVYW8R1mcyCJJ1_8,1764
48
- examples/dspy_example/program_of_thought_basic.py,sha256=oEbtJdeKENMUbex25-zyStWwurRWW6OdP0KDs-jUkko,984
42
+ examples/dspy_example/QA_basic.py,sha256=dNEDgooB8sva8hiAMDH6WZXcHrro8CEoGw4zDKV8HH8,562
43
+ examples/dspy_example/QA_basic_with_chain_of_thought.py,sha256=GBhVftBPhw9QZqhLADaZgfQZHyKgeSCjxDQ_d0ivlf4,823
44
+ examples/dspy_example/QA_basic_with_signature.py,sha256=nF1jLO0-Z35oDRoVsnru0NotBjH0ZDIvRgTdv1ahB_8,899
45
+ examples/dspy_example/QA_multi_step_with_chain_of_thought.py,sha256=67o-Ol7AMXEjWrTFt0vcEWLxxMiotYG31u5IzWdoack,1391
46
+ examples/dspy_example/math_problems_cot.py,sha256=czYlfKVvzyocorgGf14J4nUJoEzyWqjdFda056Y6DI0,1241
47
+ examples/dspy_example/math_problems_cot_parallel.py,sha256=xDKTWYuhtgj8pJViEl4GoGQShF1B0iFhsmXAYqBrnL8,1723
48
+ examples/dspy_example/program_of_thought_basic.py,sha256=uk5O-xQPNoOOPku3jarHdMZmlGTaJpKE7kaicnuemTM,943
49
49
  examples/dspy_example/quiz_gen.py,sha256=OyGhepeX8meKOtLdmlYUjMD2ECk-ZQuQXUZif1hFQY4,3371
50
- examples/dspy_example/react.py,sha256=APAnHqgy9w-qY5jnPD_WbBx6bwo9C-DhPnUuhL-t7sg,1376
50
+ examples/dspy_example/react.py,sha256=PAye54eHzv2ATSvV6xnUnL9CvNrSO3rMzJZZFMvlOio,1335
51
51
  examples/dspy_example/optimizers/bootstrap_fewshot.py,sha256=IxJJIaPKowP0-iZSuviKQnhc0bLj0_46cO13O9vLAlc,3135
52
52
  examples/embedchain_example/simple.py,sha256=1lwnsh5wVjGjQ18OinID6aJ_itR-x0TOngtNU1E-Emc,373
53
53
  examples/fastapi_example/__init__.py,sha256=INIfvJP7zC_KkJCtulS1qbh61-MJTPAHnzAgzeKi0yU,87
@@ -121,7 +121,7 @@ examples/weaviate_example/__init__.py,sha256=8JMDBsRSEV10HfTd-YC7xb4txBjD3la56sn
121
121
  examples/weaviate_example/query_text.py,sha256=wPHQTc_58kPoKTZMygVjTj-2ZcdrIuaausJfMxNQnQc,127162
122
122
  langtrace_python_sdk/__init__.py,sha256=VZM6i71NR7pBQK6XvJWRelknuTYUhqwqE7PlicKa5Wg,1166
123
123
  langtrace_python_sdk/langtrace.py,sha256=JYBCbklWv463lzRUH7pfkHAVoc3YHh-q_2Iv6LZ2HhU,14896
124
- langtrace_python_sdk/version.py,sha256=o1YxXVHZc6TZFzK0b_XFqGQHEQN04JFH9ZHn5KGykdE,23
124
+ langtrace_python_sdk/version.py,sha256=zVdntVJdm-11j_n2E2RXCsklIAlpwHH2GJDDprZvteg,23
125
125
  langtrace_python_sdk/constants/__init__.py,sha256=3CNYkWMdd1DrkGqzLUgNZXjdAlM6UFMlf_F-odAToyc,146
126
126
  langtrace_python_sdk/constants/exporter/langtrace_exporter.py,sha256=EVCrouYCpY98f0KSaKr4PzNxPULTZZO6dSA_crEOyJU,106
127
127
  langtrace_python_sdk/constants/instrumentation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -171,7 +171,7 @@ langtrace_python_sdk/instrumentation/chroma/instrumentation.py,sha256=nT6PS6bsrI
171
171
  langtrace_python_sdk/instrumentation/chroma/patch.py,sha256=jYcqBeu-0cYA29PO880oXYRwYh-R1oseXmzfK6UDBps,9074
172
172
  langtrace_python_sdk/instrumentation/cleanlab/__init__.py,sha256=UuwRiRAPH2i6cucqK8CgNYOGrsG4t_SGAQJSExRuZ1U,99
173
173
  langtrace_python_sdk/instrumentation/cleanlab/instrumentation.py,sha256=CtWdtDUCqh60HU2Vs38O9Y32rlB4jzHIEbVRbwIf_Wg,2088
174
- langtrace_python_sdk/instrumentation/cleanlab/patch.py,sha256=aI0QfG9UH5P7OvmzeIdeMhRd28oV4JMuXIkPv8s869s,3138
174
+ langtrace_python_sdk/instrumentation/cleanlab/patch.py,sha256=RuBW7Qty4er1D9XqBntgUv5phmiiXtGARU09x4j-jGA,3451
175
175
  langtrace_python_sdk/instrumentation/cohere/__init__.py,sha256=sGUSLdTUyYf36Tm6L5jQflhzCqvmWrhnBOMYHjvp6Hs,95
176
176
  langtrace_python_sdk/instrumentation/cohere/instrumentation.py,sha256=1wxMhWMfsvKprdV52BIfCZhZS1beRYBW9rUzUDDkyCk,2854
177
177
  langtrace_python_sdk/instrumentation/cohere/patch.py,sha256=qeXm4ycnXfDO7lxWrpA2GaUIvGTkLcSMiq9-xMtlP6U,25782
@@ -182,8 +182,8 @@ langtrace_python_sdk/instrumentation/crewai_tools/__init__.py,sha256=4aINgRu-2FZ
182
182
  langtrace_python_sdk/instrumentation/crewai_tools/instrumentation.py,sha256=eqvnRu6ycPyjqYg5Vb4-QKPXVfBEzJQjZ7-MPUOyfOQ,1617
183
183
  langtrace_python_sdk/instrumentation/crewai_tools/patch.py,sha256=HbqvxUizo20zYY_iP1-5MFYKp3S_QegIa5Glg7ht2i8,2602
184
184
  langtrace_python_sdk/instrumentation/dspy/__init__.py,sha256=tM1srfi_QgyCzrde4izojMrRq2Wm7Dj5QUvVQXIJzkk,84
185
- langtrace_python_sdk/instrumentation/dspy/instrumentation.py,sha256=qx2vBeuODI7rubf-0bkuNzDWu4bLI-E5uabrWTEuH6k,2923
186
- langtrace_python_sdk/instrumentation/dspy/patch.py,sha256=sbW6cJGbZCc17jl5wSCz-eAvlyEppzVe0kCSkNZ-5lg,10221
185
+ langtrace_python_sdk/instrumentation/dspy/instrumentation.py,sha256=R8NDQlaalCfahTolzTZzRiq452MllF-vm_AEQ2IBZbw,2775
186
+ langtrace_python_sdk/instrumentation/dspy/patch.py,sha256=U-gIQ6gfwmvosCrhuBd4DGas-LHQXYoczd4rxB0xwRA,10233
187
187
  langtrace_python_sdk/instrumentation/embedchain/__init__.py,sha256=5L6n8-brMnRWZ0CMmHEuN1mrhIxrYLNtxRy0Ujc-hOY,103
188
188
  langtrace_python_sdk/instrumentation/embedchain/instrumentation.py,sha256=dShwm0duy25IvL7g9I_v-2oYuyh2fadeiJqXtXBay-8,1987
189
189
  langtrace_python_sdk/instrumentation/embedchain/patch.py,sha256=ovvBrtqUDwGSmSgK_S3pOOrDa4gkPSFG-HvmsxqmJE8,3627
@@ -312,8 +312,8 @@ tests/pinecone/cassettes/test_query.yaml,sha256=b5v9G3ssUy00oG63PlFUR3JErF2Js-5A
312
312
  tests/pinecone/cassettes/test_upsert.yaml,sha256=neWmQ1v3d03V8WoLl8FoFeeCYImb8pxlJBWnFd_lITU,38607
313
313
  tests/qdrant/conftest.py,sha256=9n0uHxxIjWk9fbYc4bx-uP8lSAgLBVx-cV9UjnsyCHM,381
314
314
  tests/qdrant/test_qdrant.py,sha256=pzjAjVY2kmsmGfrI2Gs2xrolfuaNHz7l1fqGQCjp5_o,3353
315
- langtrace_python_sdk-3.8.14.dist-info/METADATA,sha256=cXX15evxHYxT3H0ZnwQym26pmT4cvZX2YJHUCs2p3Wc,15845
316
- langtrace_python_sdk-3.8.14.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
317
- langtrace_python_sdk-3.8.14.dist-info/entry_points.txt,sha256=1_b9-qvf2fE7uQNZcbUei9vLpFZBbbh9LrtGw95ssAo,70
318
- langtrace_python_sdk-3.8.14.dist-info/licenses/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
319
- langtrace_python_sdk-3.8.14.dist-info/RECORD,,
315
+ langtrace_python_sdk-3.8.15.dist-info/METADATA,sha256=bwp9ceCkaDntiZrMjbZb4IPkzgJVPMS-dqibINbH-KA,15845
316
+ langtrace_python_sdk-3.8.15.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
317
+ langtrace_python_sdk-3.8.15.dist-info/entry_points.txt,sha256=1_b9-qvf2fE7uQNZcbUei9vLpFZBbbh9LrtGw95ssAo,70
318
+ langtrace_python_sdk-3.8.15.dist-info/licenses/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
319
+ langtrace_python_sdk-3.8.15.dist-info/RECORD,,