Measurements

Initialize a Client

from dyff.client import Client

client = Client(api_key="XXXXXX")

Create a Measurement workflow

from dyff.client import Client
from dyff.schema.requests import AnalysisArgument, AnalysisCreateRequest, AnalysisInput

API_KEY: str = ...
ACCOUNT: str = ...
# The ID of an existing Method to apply
METHOD_ID: str = ...

client = Client(api_key=API_KEY)

# Example arguments / inputs. These are specified by the Method.
request = AnalysisCreateRequest(
    account=ACCOUNT,
    method=METHOD_ID,
    arguments=[
        AnalysisArgument(keyword="temperature", value="1.0"),
    ],
    inputs=[
        AnalysisInput(keyword="prompts", entity=dataset_id),
        AnalysisInput(keyword="completions", entity=evaluation_id),
    ],
)

measurement = client.measurements.create(request)