olca 0.2.73__py3-none-any.whl → 0.2.76__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 +31 -0
- olca/fusewill_utils.py +28 -1
- {olca-0.2.73.dist-info → olca-0.2.76.dist-info}/METADATA +2 -1
- {olca-0.2.73.dist-info → olca-0.2.76.dist-info}/RECORD +8 -8
- {olca-0.2.73.dist-info → olca-0.2.76.dist-info}/LICENSE +0 -0
- {olca-0.2.73.dist-info → olca-0.2.76.dist-info}/WHEEL +0 -0
- {olca-0.2.73.dist-info → olca-0.2.76.dist-info}/entry_points.txt +0 -0
- {olca-0.2.73.dist-info → olca-0.2.76.dist-info}/top_level.txt +0 -0
olca/fusewill_cli.py
CHANGED
|
@@ -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)
|
olca/fusewill_utils.py
CHANGED
|
@@ -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.
|
|
3
|
+
Version: 0.2.76
|
|
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
|
|
|
@@ -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=3n9aWEJyHEIzRW_soe1HgIFKt4nMEhAt38sbz1LhYLM,18697
|
|
3
|
+
olca/fusewill_utils.py,sha256=a9MzXTKlyvjq_7gqE3Lh-dNqi4Es2UxUiGLLG2XWmrI,19200
|
|
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.76.dist-info/LICENSE,sha256=gXf5dRMhNSbfLPYYTY_5hsZ1r7UU1OaKQEAQUhuIBkM,18092
|
|
11
|
+
olca-0.2.76.dist-info/METADATA,sha256=QCDSNxQPB2wNtaTby-h1LV96s-z7ERgmc6BSRgof7B8,26000
|
|
12
|
+
olca-0.2.76.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
13
|
+
olca-0.2.76.dist-info/entry_points.txt,sha256=W2UkinpMZYsCLH54must9ahwbzCRl-rekcZ7rL5u3wA,123
|
|
14
|
+
olca-0.2.76.dist-info/top_level.txt,sha256=bGDtAReS-xlS0F6MM-DyD0IQUqjNdWmgemnM3vNtrpI,5
|
|
15
|
+
olca-0.2.76.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|