olca 0.2.72__tar.gz → 0.2.75__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.72
3
+ Version: 0.2.75
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
@@ -368,6 +368,7 @@ Requires-Dist: langgraph
368
368
  Requires-Dist: langfuse
369
369
  Requires-Dist: pytz
370
370
  Requires-Dist: google.generativeai
371
+ Requires-Dist: arxiv
371
372
 
372
373
  # oLCa
373
374
 
@@ -151,6 +151,16 @@ def main():
151
151
  parser_daily_metrics.add_argument('--from_timestamp', type=str, help='Start date in ISO format')
152
152
  parser_daily_metrics.add_argument('--to_timestamp', type=str, help='End date in ISO format')
153
153
 
154
+ # list_prompts command
155
+ parser_list_prompts = subparsers.add_parser('list_prompts', help='List prompts', aliases=['lp'])
156
+ parser_list_prompts.add_argument('--name', type=str, help='Filter by prompt name')
157
+ parser_list_prompts.add_argument('--label', type=str, help='Filter by prompt label')
158
+ parser_list_prompts.add_argument('--tag', type=str, help='Filter by prompt tag')
159
+ parser_list_prompts.add_argument('-L', '--limit', type=int, default=100, help='Number of prompts to fetch')
160
+ parser_list_prompts.add_argument('--start_date', type=str, help='Start date in ISO format')
161
+ parser_list_prompts.add_argument('--end_date', type=str, help='End date in ISO format')
162
+ parser_list_prompts.add_argument('-o', '--output', type=str, help='Output JSON file path')
163
+
154
164
  args = parser.parse_args()
155
165
 
156
166
  if args.command == 'list_traces' or args.command == 'lt':
@@ -337,6 +347,27 @@ def main():
337
347
  from_timestamp=args.from_timestamp,
338
348
  to_timestamp=args.to_timestamp
339
349
  )
350
+ elif args.command == 'list_prompts' or args.command == 'lp':
351
+ prompts = fu.list_prompts(
352
+ name=args.name,
353
+ label=args.label,
354
+ tag=args.tag,
355
+ limit=args.limit,
356
+ start_date=args.start_date,
357
+ end_date=args.end_date
358
+ )
359
+ if prompts:
360
+ if args.output:
361
+ try:
362
+ with open(args.output, 'w') as f:
363
+ json.dump(prompts, f, indent=2)
364
+ print(f"Prompts written to {os.path.realpath(args.output)}")
365
+ except Exception as e:
366
+ print(f"Error writing to file {args.output}: {e}")
367
+ else:
368
+ print(json.dumps(prompts, indent=2))
369
+ else:
370
+ print("No prompts found.")
340
371
  else:
341
372
  parser.print_help()
342
373
  exit(1)
@@ -496,4 +496,31 @@ def get_daily_metrics(trace_name=None, user_id=None, tags=None, from_timestamp=N
496
496
  Get daily metrics with optional filtering.
497
497
  """
498
498
  # TODO: Implement API call to GET /metrics/daily with query params
499
- pass
499
+ pass
500
+
501
+ def list_prompts(name=None, label=None, tag=None, limit=100, start_date=None, end_date=None):
502
+ """
503
+ List prompts with optional filtering.
504
+ """
505
+ base_url = os.environ.get("LANGFUSE_HOST")
506
+ public_key = os.environ.get("LANGFUSE_PUBLIC_KEY")
507
+ secret_key = os.environ.get("LANGFUSE_SECRET_KEY")
508
+ url = f"{base_url}/api/public/v2/prompts"
509
+ params = {"limit": limit}
510
+ if name:
511
+ params["name"] = name
512
+ if label:
513
+ params["label"] = label
514
+ if tag:
515
+ params["tag"] = tag
516
+ if start_date:
517
+ params["fromUpdatedAt"] = datetime.datetime.fromisoformat(start_date).isoformat() + 'Z'
518
+ if end_date:
519
+ params["toUpdatedAt"] = datetime.datetime.fromisoformat(end_date).isoformat() + 'Z'
520
+ try:
521
+ response = requests.get(url, auth=(public_key, secret_key), params=params)
522
+ response.raise_for_status()
523
+ return response.json()
524
+ except Exception as e:
525
+ print(f"Error retrieving prompts: {e}")
526
+ return None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: olca
3
- Version: 0.2.72
3
+ Version: 0.2.75
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
@@ -368,6 +368,7 @@ Requires-Dist: langgraph
368
368
  Requires-Dist: langfuse
369
369
  Requires-Dist: pytz
370
370
  Requires-Dist: google.generativeai
371
+ Requires-Dist: arxiv
371
372
 
372
373
  # oLCa
373
374
 
@@ -15,3 +15,4 @@ langgraph
15
15
  langfuse
16
16
  pytz
17
17
  google.generativeai
18
+ arxiv
@@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"
7
7
 
8
8
  [project]
9
9
  name = "olca"
10
- version = "0.2.72"
10
+ version = "0.2.75"
11
11
 
12
12
  description = "A Python package for experimental usage of Langchain and Human-in-the-Loop"
13
13
  readme = "README.md"
@@ -34,6 +34,7 @@ dependencies = [
34
34
  "langfuse",
35
35
  "pytz",
36
36
  "google.generativeai",
37
+ "arxiv",
37
38
  ]
38
39
  classifiers = [
39
40
  "Programming Language :: Python :: 3",
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name='olca',
5
- version = "0.2.72",
5
+ version = "0.2.75",
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