mirror of
https://github.com/langchain-ai/langsmith-csv-migration-tool.git
synced 2026-07-01 01:37:54 -04:00
43 lines
1.2 KiB
Python
43 lines
1.2 KiB
Python
#!/usr/bin/env python3
|
|
"""Run tests on migrated datasets with their configured evaluators"""
|
|
|
|
import json
|
|
from langsmith import Client
|
|
from langsmith.evaluation import run_on_dataset
|
|
|
|
# Load test configurations
|
|
with open("dataset_test_configs.json", "r") as f:
|
|
test_configs = json.load(f)
|
|
|
|
client = Client()
|
|
|
|
def dummy_model(inputs):
|
|
"""Replace with your actual model/chain"""
|
|
return {"output": "This is a placeholder response"}
|
|
|
|
for config in test_configs:
|
|
dataset_id = config["dataset_id"]
|
|
dataset_name = config["dataset_name"]
|
|
|
|
print(f"Running test on dataset: {dataset_name}")
|
|
|
|
# Create evaluators from config
|
|
evaluators = []
|
|
for eval_config in config["evaluators"]:
|
|
# Create evaluator based on type
|
|
# This is where you would implement actual evaluator creation
|
|
pass
|
|
|
|
# Run evaluation
|
|
# results = run_on_dataset(
|
|
# client=client,
|
|
# dataset_name=dataset_name,
|
|
# llm_or_chain_factory=dummy_model,
|
|
# evaluation=evaluators,
|
|
# project_name=config["test_name"]
|
|
# )
|
|
|
|
print(f"Test configuration ready for dataset: {dataset_name}")
|
|
print(f" - Dataset ID: {dataset_id}")
|
|
print(f" - Evaluators: {len(config['evaluators'])}")
|