prompty 0.1.21__py2.py3-none-any.whl → 0.1.23__py2.py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
prompty/tracer.py CHANGED
@@ -112,7 +112,7 @@ def _results(result: Any) -> dict:
112
112
 
113
113
 
114
114
  def _trace_sync(
115
- func: Callable = None, *, description: str = None, type: str = None
115
+ func: Callable = None, *, description: str = None, itemtype: str = None
116
116
  ) -> Callable:
117
117
  description = description or ""
118
118
 
@@ -124,8 +124,8 @@ def _trace_sync(
124
124
  if description and description != "":
125
125
  trace("description", description)
126
126
 
127
- if type and type != "":
128
- trace("type", type)
127
+ if itemtype and itemtype != "":
128
+ trace("type", itemtype)
129
129
 
130
130
  inputs = _inputs(func, args, kwargs)
131
131
  trace("inputs", inputs)
@@ -139,7 +139,7 @@ def _trace_sync(
139
139
  {
140
140
  "exception": {
141
141
  "type": type(e),
142
- "traceback": traceback.format_tb(),
142
+ "traceback": traceback.format_tb(tb=e.__traceback__) if e.__traceback__ else None,
143
143
  "message": str(e),
144
144
  "args": to_dict(e.args),
145
145
  }
@@ -153,7 +153,7 @@ def _trace_sync(
153
153
 
154
154
 
155
155
  def _trace_async(
156
- func: Callable = None, *, description: str = None, type: str = None
156
+ func: Callable = None, *, description: str = None, itemtype: str = None
157
157
  ) -> Callable:
158
158
  description = description or ""
159
159
 
@@ -165,8 +165,8 @@ def _trace_async(
165
165
  if description and description != "":
166
166
  trace("description", description)
167
167
 
168
- if type and type != "":
169
- trace("type", type)
168
+ if itemtype and itemtype != "":
169
+ trace("type", itemtype)
170
170
 
171
171
  inputs = _inputs(func, args, kwargs)
172
172
  trace("inputs", inputs)
@@ -179,7 +179,7 @@ def _trace_async(
179
179
  {
180
180
  "exception": {
181
181
  "type": type(e),
182
- "traceback": traceback.format_tb(),
182
+ "traceback": traceback.format_tb(tb=e.__traceback__) if e.__traceback__ else None,
183
183
  "message": str(e),
184
184
  "args": to_dict(e.args),
185
185
  }
@@ -193,14 +193,14 @@ def _trace_async(
193
193
 
194
194
 
195
195
  def trace(
196
- func: Callable = None, *, description: str = None, type: str = None
196
+ func: Callable = None, *, description: str = None, itemtype: str = None
197
197
  ) -> Callable:
198
198
  if func is None:
199
- return partial(trace, description=description, type=type)
199
+ return partial(trace, description=description, itemtype=itemtype)
200
200
 
201
201
  wrapped_method = _trace_async if inspect.iscoroutinefunction(func) else _trace_sync
202
202
 
203
- return wrapped_method(func, description=description, type=type)
203
+ return wrapped_method(func, description=description, itemtype=itemtype)
204
204
 
205
205
 
206
206
  class PromptyTracer:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: prompty
3
- Version: 0.1.21
3
+ Version: 0.1.23
4
4
  Summary: Prompty is a new asset class and format for LLM prompts that aims to provide observability, understandability, and portability for developers. It includes spec, tooling, and a runtime. This Prompty runtime supports Python
5
5
  Author-Email: Seth Juarez <seth.juarez@microsoft.com>
6
6
  Requires-Dist: pyyaml>=6.0.1
@@ -1,7 +1,7 @@
1
- prompty-0.1.21.dist-info/METADATA,sha256=XyxNZdKikmbDcN4rf8yfc8e8tJ3GWN--a5uSWuG8a0A,9037
2
- prompty-0.1.21.dist-info/WHEEL,sha256=CuZGaXTwoRLAOVv0AcE3bCTxO5ejVuBEJkUBe9C-kvk,94
3
- prompty-0.1.21.dist-info/entry_points.txt,sha256=9y1lKPWUpPWRJzUslcVH-gMwbNoa2PzjyoZsKYLQqyw,45
4
- prompty-0.1.21.dist-info/licenses/LICENSE,sha256=KWSC4z9cfML_t0xThoQYjzTdcZQj86Y_mhXdatzU-KM,1052
1
+ prompty-0.1.23.dist-info/METADATA,sha256=jxIN-iLH2JzTWPDha6eHMX61oKf-Do0raKMpC4NAXrQ,9037
2
+ prompty-0.1.23.dist-info/WHEEL,sha256=CuZGaXTwoRLAOVv0AcE3bCTxO5ejVuBEJkUBe9C-kvk,94
3
+ prompty-0.1.23.dist-info/entry_points.txt,sha256=9y1lKPWUpPWRJzUslcVH-gMwbNoa2PzjyoZsKYLQqyw,45
4
+ prompty-0.1.23.dist-info/licenses/LICENSE,sha256=KWSC4z9cfML_t0xThoQYjzTdcZQj86Y_mhXdatzU-KM,1052
5
5
  prompty/__init__.py,sha256=XTUgJ3xT7HYJieuWW5PBItey0BWneg3G7iBBjIeNJZU,11628
6
6
  prompty/azure/__init__.py,sha256=ptGajCh68s_tugPv45Y4GJCyBToNFCExUzUh9yIBIfo,292
7
7
  prompty/azure/executor.py,sha256=4BiVgDcoDaJ2QcSd3O1LIm_3Fh-ln6wjqO2ZoVYjslc,4700
@@ -16,5 +16,5 @@ prompty/renderers.py,sha256=RSHFQFx7AtKLUfsMLCXR0a56Mb7DL1NJNgjUqgg3IqU,776
16
16
  prompty/serverless/__init__.py,sha256=NPqoFATEMQ96G8OQkVcGxUWU4llIQCwxfJePPo8YFY8,279
17
17
  prompty/serverless/executor.py,sha256=jbTnYE2aq8oS5PWcZ96NhhjL-gU1a_tlUoB449QqHaY,4648
18
18
  prompty/serverless/processor.py,sha256=pft1XGbPzo0MzQMbAt1VxsLsvRrjQO3B8MXEE2PfSA0,1982
19
- prompty/tracer.py,sha256=jGgnWnDSQcfzppmdz6o_0KyawYfwcNSkLT-oLcY80Vo,10563
20
- prompty-0.1.21.dist-info/RECORD,,
19
+ prompty/tracer.py,sha256=WNI7V9ySGrOywY_StGt3swM7BuT-XtaPTSVSs4DteSs,10709
20
+ prompty-0.1.23.dist-info/RECORD,,