olca 0.2.79__py3-none-any.whl → 0.2.81__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.
- olca/fusewill_cli.py +11 -11
- olca/fusewill_utils.py +4 -4
- {olca-0.2.79.dist-info → olca-0.2.81.dist-info}/METADATA +1 -1
- {olca-0.2.79.dist-info → olca-0.2.81.dist-info}/RECORD +8 -8
- {olca-0.2.79.dist-info → olca-0.2.81.dist-info}/LICENSE +0 -0
- {olca-0.2.79.dist-info → olca-0.2.81.dist-info}/WHEEL +0 -0
- {olca-0.2.79.dist-info → olca-0.2.81.dist-info}/entry_points.txt +0 -0
- {olca-0.2.79.dist-info → olca-0.2.81.dist-info}/top_level.txt +0 -0
olca/fusewill_cli.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
from ast import alias
|
2
2
|
import os
|
3
3
|
import sys
|
4
|
-
import json
|
4
|
+
import json as _json
|
5
5
|
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)))
|
6
6
|
import argparse
|
7
7
|
import fusewill_utils as fu
|
@@ -187,7 +187,7 @@ def main():
|
|
187
187
|
print("Quitting.")
|
188
188
|
break
|
189
189
|
elif args.command == 'create_dataset' or args.command == 'cd':
|
190
|
-
metadata =
|
190
|
+
metadata = _json.loads(args.metadata)
|
191
191
|
create_dataset(name=args.name, description=args.description, metadata=metadata)
|
192
192
|
elif args.command == 'create_prompt':
|
193
193
|
create_prompt(
|
@@ -234,12 +234,12 @@ def main():
|
|
234
234
|
if args.output:
|
235
235
|
try:
|
236
236
|
with open(args.output, 'w') as f:
|
237
|
-
|
237
|
+
_json.dump(scores, f, indent=2)
|
238
238
|
print(f"Scores written to {os.path.realpath(args.output)}")
|
239
239
|
except Exception as e:
|
240
240
|
print(f"Error writing to file {args.output}: {e}")
|
241
241
|
else:
|
242
|
-
print(
|
242
|
+
print(_json.dumps(scores, indent=2))
|
243
243
|
else:
|
244
244
|
print("No scores found.")
|
245
245
|
elif args.command == 'search_traces' or args.command == 'st':
|
@@ -265,7 +265,7 @@ def main():
|
|
265
265
|
if args.output:
|
266
266
|
try:
|
267
267
|
with open(args.output, 'w') as f:
|
268
|
-
|
268
|
+
_json.dump([trace.__dict__ for trace in traces], f, indent=2, default=str)
|
269
269
|
print(f"Traces written to {os.path.realpath(args.output)}")
|
270
270
|
except Exception as e:
|
271
271
|
print(f"Error writing to file {args.output}: {e}")
|
@@ -310,9 +310,9 @@ def main():
|
|
310
310
|
for s in sessions:
|
311
311
|
writer.writerow(s)
|
312
312
|
else: # default to JSON
|
313
|
-
import
|
313
|
+
import _json
|
314
314
|
with open(output_path, 'w') as f:
|
315
|
-
|
315
|
+
_json.dump(sessions, f, indent=2)
|
316
316
|
|
317
317
|
print(f"Sessions written to {os.path.realpath(output_path)}")
|
318
318
|
elif args.command == 'get_session' or args.command == 'gsess':
|
@@ -327,9 +327,9 @@ def main():
|
|
327
327
|
writer.writerow(session)
|
328
328
|
print(f"Session written to {os.path.realpath(args.output)}")
|
329
329
|
else:
|
330
|
-
import
|
330
|
+
import _json
|
331
331
|
with open(args.output, 'w') as f:
|
332
|
-
|
332
|
+
_json.dump(session, f, indent=2)
|
333
333
|
print(f"Session written to {os.path.realpath(args.output)}")
|
334
334
|
else:
|
335
335
|
print(session)
|
@@ -360,12 +360,12 @@ def main():
|
|
360
360
|
if args.output:
|
361
361
|
try:
|
362
362
|
with open(args.output, 'w') as f:
|
363
|
-
|
363
|
+
_json.dump(prompts, f, indent=2)
|
364
364
|
print(f"Prompts written to {os.path.realpath(args.output)}")
|
365
365
|
except Exception as e:
|
366
366
|
print(f"Error writing to file {args.output}: {e}")
|
367
367
|
else:
|
368
|
-
print(
|
368
|
+
print(_json.dumps(prompts, indent=2))
|
369
369
|
else:
|
370
370
|
print("No prompts found.")
|
371
371
|
else:
|
olca/fusewill_utils.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import os
|
2
2
|
import sys
|
3
|
-
import json
|
3
|
+
import json as _json
|
4
4
|
import dotenv
|
5
5
|
import webbrowser
|
6
6
|
import requests # Add this import
|
@@ -304,7 +304,7 @@ def export_traces(format='json', output_path=None, start_date=None, end_date=Non
|
|
304
304
|
|
305
305
|
if format == 'json':
|
306
306
|
with open(output_path, 'w') as f:
|
307
|
-
|
307
|
+
_json.dump(exported_data, f, indent=2, default=str)
|
308
308
|
elif format == 'csv':
|
309
309
|
import csv
|
310
310
|
fieldnames = ['id', 'name', 'input', 'output', 'createdAt']
|
@@ -324,7 +324,7 @@ def export_traces(format='json', output_path=None, start_date=None, end_date=Non
|
|
324
324
|
# Sort traces by createdAt to ensure the oldest date is first
|
325
325
|
all_traces.sort(key=lambda x: x.createdAt)
|
326
326
|
first_trace_date = datetime.datetime.fromisoformat(all_traces[0].createdAt.replace('Z', '+00:00')).strftime('%Y-%m-%d %H:%M:%S')
|
327
|
-
last_trace_date = datetime.datetime.fromisoformat(all_traces[-1].
|
327
|
+
last_trace_date = datetime.datetime.fromisoformat(all_traces[-1].CreatedAt.replace('Z', '+00:00')).strftime('%Y-%m-%d %H:%M:%S')
|
328
328
|
print(f"Traces exported to {output_path}. Total traces exported: {len(all_traces)}")
|
329
329
|
print(f"Date range: {first_trace_date} to {last_trace_date}")
|
330
330
|
else:
|
@@ -363,7 +363,7 @@ def import_traces(format='json', input_path=None):
|
|
363
363
|
try:
|
364
364
|
if format == 'json':
|
365
365
|
with open(input_path, 'r') as f:
|
366
|
-
data =
|
366
|
+
data = _json.load(f)
|
367
367
|
elif format == 'csv':
|
368
368
|
import csv
|
369
369
|
data = []
|
@@ -1,15 +1,15 @@
|
|
1
1
|
olca/__init__.py,sha256=3QyLLAys_KiiDIe-cfO_7QyY7di_qCaCS-sVziW2BOw,23
|
2
|
-
olca/fusewill_cli.py,sha256=
|
3
|
-
olca/fusewill_utils.py,sha256=
|
2
|
+
olca/fusewill_cli.py,sha256=umPt718y8_0Mx38DgNcdyScW9AM9rU5q6VGudKGS5Eg,18716
|
3
|
+
olca/fusewill_utils.py,sha256=n9Pt5IisvRU632SSw-NfTfbDodTlkkr3PlGYMr3aGGw,19204
|
4
4
|
olca/oiv.py,sha256=TyhbgjzE9B5woacln8AtITLv1X7iv9ZivJBdk0MyP4U,4610
|
5
5
|
olca/olcacli.py,sha256=wwn4mL1kGonigI9w6UEsnFJDWQ6yONxqvogjrCj-Og4,11246
|
6
6
|
olca/olcahelper.py,sha256=v16ETPboJFdJdkL1iAJ86_oAhkFo5jMFfx5oivOG8kA,4115
|
7
7
|
olca/prompts.py,sha256=q7lvDZ8n_K6ea2nu3K5R2fgBgQYrCIEjh0cA9fUlMFI,3697
|
8
8
|
olca/tracing.py,sha256=cEfPNZoI-PbMHFpX8bvY7OajeW4yvZBMycqwj6sRpDE,1637
|
9
9
|
olca/utils.py,sha256=kDxKwD51234OvA6PIW9IfAND8DHwd8lSyOvSf4abvPE,916
|
10
|
-
olca-0.2.
|
11
|
-
olca-0.2.
|
12
|
-
olca-0.2.
|
13
|
-
olca-0.2.
|
14
|
-
olca-0.2.
|
15
|
-
olca-0.2.
|
10
|
+
olca-0.2.81.dist-info/LICENSE,sha256=gXf5dRMhNSbfLPYYTY_5hsZ1r7UU1OaKQEAQUhuIBkM,18092
|
11
|
+
olca-0.2.81.dist-info/METADATA,sha256=QjUudChyCY803PBIMXpvS7xQrHFIi9oK3UU5IzgpDMk,26000
|
12
|
+
olca-0.2.81.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
13
|
+
olca-0.2.81.dist-info/entry_points.txt,sha256=W2UkinpMZYsCLH54must9ahwbzCRl-rekcZ7rL5u3wA,123
|
14
|
+
olca-0.2.81.dist-info/top_level.txt,sha256=bGDtAReS-xlS0F6MM-DyD0IQUqjNdWmgemnM3vNtrpI,5
|
15
|
+
olca-0.2.81.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|