Note: This SDK is for Python users. If you’re using TypeScript, JavaScript, or other languages, please refer to the REST API Reference to call the API directly.
Composo
and AsyncComposo
clients accept the following parameters during instantiation:
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
api_key | str | No* | None | Your Composo API key. If not provided, will use COMPOSO_API_KEY environment variable |
num_retries | int | No | 1 | Number of retry attempts for failed requests |
COMPOSO_API_KEY
environment variable is not set.
evaluate()
method accepts the following parameters:
Parameter | Type | Required | Description |
---|---|---|---|
messages | List[Dict] | Yes | List of message dictionaries with ‘role’ and ‘content’ keys |
criteria | str or List[str] | Yes | Evaluation criteria (single string or list of criteria) |
tools | List[Dict] | No | Tool definitions for evaluating tool calls |
result | OpenAI/Anthropic Result Object | No | Pre-computed LLM result object to evaluate |
COMPOSO_API_KEY
: Your Composo API key (used when api_key
parameter is not provided)evaluate
method returns an EvaluationResponse
object: