1. Create a Composo Account

Sign up for a Composo account here.

2. Generate an API Key

After logging in, navigate to Profile then API Keys and create a new API key.

If your organization has a fine-tuned model with Composo, all API keys created with organization accounts will automatically route to that finetuned model.

3. Run an Example

Test the Evals API by running one of the following examples:

Reward Score Evaluation Example

import requests

url = "https://platform.composo.ai/api/v1/evals/reward"
headers = {
    "API-Key": "YOUR_API_KEY"
}
payload = {
    "messages": [
        {"role": "user", "content": "I'm really frustrated with my device not working."},
        {"role": "assistant", "content": "I'm sorry to hear that you're experiencing issues with your device. Let's see how I can assist you to resolve this problem."}
    ],
    "evaluation_criteria": "Reward responses that express appropriate empathy if the user is facing a problem they're finding frustrating"
}

response = requests.post(url, headers=headers, json=payload)
result = response.json()

print(f"Score: {result['score']}")
print(f"Explanation: {result.get('explanation', 'No feedback provided.')}")

Next Steps

Learn more about our other evaluation methods: