1. Create a Composo Account

Sign up for a Composo account here.

2. Generate an API Key

After logging in, navigate to the API Keys section and create a new API key.

3. Run an Example

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

Continuous 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 and offer helpful solutions to the user's problem."
}

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

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

Next Steps

Learn more about our other evaluation methods: