olca 0.2.79__tar.gz → 0.2.81__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: olca
3
- Version: 0.2.79
3
+ Version: 0.2.81
4
4
  Summary: A Python package for experimental usage of Langchain and Human-in-the-Loop
5
5
  Home-page: https://github.com/jgwill/olca
6
6
  Author: Jean GUillaume ISabelle
@@ -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 = json.loads(args.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
- json.dump(scores, f, indent=2)
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(json.dumps(scores, indent=2))
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
- json.dump([trace.__dict__ for trace in traces], f, indent=2, default=str)
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 json
313
+ import _json
314
314
  with open(output_path, 'w') as f:
315
- json.dump(sessions, f, indent=2)
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 json
330
+ import _json
331
331
  with open(args.output, 'w') as f:
332
- json.dump(session, f, indent=2)
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
- json.dump(prompts, f, indent=2)
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(json.dumps(prompts, indent=2))
368
+ print(_json.dumps(prompts, indent=2))
369
369
  else:
370
370
  print("No prompts found.")
371
371
  else:
@@ -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
- json.dump(exported_data, f, indent=2, default=str)
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].createdAt.replace('Z', '+00:00')).strftime('%Y-%m-%d %H:%M:%S')
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 = json.load(f)
366
+ data = _json.load(f)
367
367
  elif format == 'csv':
368
368
  import csv
369
369
  data = []
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: olca
3
- Version: 0.2.79
3
+ Version: 0.2.81
4
4
  Summary: A Python package for experimental usage of Langchain and Human-in-the-Loop
5
5
  Home-page: https://github.com/jgwill/olca
6
6
  Author: Jean GUillaume ISabelle
@@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"
7
7
 
8
8
  [project]
9
9
  name = "olca"
10
- version = "0.2.79"
10
+ version = "0.2.81"
11
11
 
12
12
  description = "A Python package for experimental usage of Langchain and Human-in-the-Loop"
13
13
  readme = "README.md"
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name='olca',
5
- version = "0.2.79",
5
+ version = "0.2.81",
6
6
  author='Jean GUillaume ISabelle',
7
7
  author_email='jgi@jgwill.com',
8
8
  description='A Python package for experimenting with Langchain agent and interactivity in Terminal modalities.',
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes