# JaaS API Python SDK
[](https://badge.fury.io/py/jaas_ai)
[](https://pypi.org/project/jaas_ai/)
[](https://opensource.org/licenses/MIT)
A Python SDK for interacting with the JaaS AI evaluation API. This library provides a simple and intuitive interface for evaluating AI-generated responses against various criteria.
Visit jaas-ai.net for more information.
Note: a JaaS AI API key is required.
## Features
- 🚀 Simple and intuitive API
- 🔧 Support for multiple evaluation types (S, C, D, V), with multiple citeria
- 📊 Comprehensive evaluation criteria support including Hallucination Detection
- 🛡️ Robust error handling
- 📝 Type hints for better IDE support
- 🐍 Python 3.7+ support
## Installation
### From PyPI (recommended)
```bash
pip install jaas_ai
```
## Quick Start
```python
from jaas_ai import jaas_client
# Initialize the client with your API key
client = jaas_client(api_key="your-api-key-here")
# Evaluate an AI response
result = client.evaluate(
question="What is the capital of France?",
answer="The capital of France is Paris.",
evaluation_criteria=["accuracy", "completeness", "clarity"],
eval_type="S"
)
print(result)
```
## API Reference
### jaas_client
The main client class for interacting with the JaaS API.
#### Constructor
```python
jaas_client(api_key: str)
```
- `api_key` (str): Your JaaS API key
#### Methods
##### evaluate()
Submit an evaluation request to the JaaS API.
```python
def evaluate(
self,
question: str,
answer: str,
evaluation_criteria: List[str],
eval_type: str = "S",
ground_truth_answer: Optional[str] = None,
context: Optional[str] = None,
cohort: Optional[str] = None
) -> Dict
```
**Parameters:**
- `question` (str): The input question
- `answer` (str): The AI-generated answer to evaluate
- `evaluation_criteria` (List[str]): List of criteria to evaluate against
- `eval_type` (str, optional): Evaluation type. Options:
- `ground_truth_answer` (str, optional): Reference answer for comparison
- `context` (str, optional): Additional context for evaluation
- `cohort` (str, optional): Cohort name for grouping evaluations
**Returns:**
- `Dict`: Evaluation results from the API
**Raises:**
- `requests.exceptions.ConnectionError`: If unable to connect to the API
- `requests.exceptions.Timeout`: If the request times out
- `requests.exceptions.RequestException`: For other request-related errors
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## Support
- 📧 Email: info@jaas-ai.com
- 📖 Documentation: [https://jaas-ai.net ]
## Changelog
### v0.1.5 (2025-09-08)
- Improved error handling with cleaner error messages
- Better HTTP error reporting from server responses
### v0.1.4 (2025-09-08)
- Simplified use and API call
- Improved evaluation functionality
- Support for multiple evaluation types
- Comprehensive error handling
Raw data
{
"_id": null,
"home_page": null,
"name": "jaas-ai",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "JaaS <info@jaas-ai.com>",
"keywords": "ai, evaluation, api, sdk, machine learning, llm",
"author": null,
"author_email": "JaaS <info@jaas-ai.com>",
"download_url": "https://files.pythonhosted.org/packages/d6/42/d03c6a18553d40b906d6f265bf90d096e38a58063f8e3afb700b1082c68e/jaas_ai-0.1.9.tar.gz",
"platform": null,
"description": "# JaaS API Python SDK\r\n\r\n[](https://badge.fury.io/py/jaas_ai)\r\n[](https://pypi.org/project/jaas_ai/)\r\n[](https://opensource.org/licenses/MIT)\r\n\r\nA Python SDK for interacting with the JaaS AI evaluation API. This library provides a simple and intuitive interface for evaluating AI-generated responses against various criteria.\r\n\r\nVisit jaas-ai.net for more information.\r\nNote: a JaaS AI API key is required. \r\n\r\n## Features\r\n\r\n- \ud83d\ude80 Simple and intuitive API\r\n- \ud83d\udd27 Support for multiple evaluation types (S, C, D, V), with multiple citeria\r\n- \ud83d\udcca Comprehensive evaluation criteria support including Hallucination Detection\r\n- \ud83d\udee1\ufe0f Robust error handling\r\n- \ud83d\udcdd Type hints for better IDE support\r\n- \ud83d\udc0d Python 3.7+ support\r\n\r\n## Installation\r\n\r\n### From PyPI (recommended)\r\n\r\n```bash\r\npip install jaas_ai\r\n```\r\n\r\n\r\n## Quick Start\r\n\r\n```python\r\nfrom jaas_ai import jaas_client\r\n\r\n# Initialize the client with your API key\r\nclient = jaas_client(api_key=\"your-api-key-here\")\r\n\r\n# Evaluate an AI response\r\nresult = client.evaluate(\r\n question=\"What is the capital of France?\",\r\n answer=\"The capital of France is Paris.\",\r\n evaluation_criteria=[\"accuracy\", \"completeness\", \"clarity\"],\r\n eval_type=\"S\"\r\n)\r\n\r\nprint(result)\r\n```\r\n\r\n## API Reference\r\n\r\n### jaas_client\r\n\r\nThe main client class for interacting with the JaaS API.\r\n\r\n#### Constructor\r\n\r\n```python\r\njaas_client(api_key: str)\r\n```\r\n\r\n- `api_key` (str): Your JaaS API key\r\n\r\n#### Methods\r\n\r\n##### evaluate()\r\n\r\nSubmit an evaluation request to the JaaS API.\r\n\r\n```python\r\ndef evaluate(\r\n self,\r\n question: str,\r\n answer: str,\r\n evaluation_criteria: List[str],\r\n eval_type: str = \"S\",\r\n ground_truth_answer: Optional[str] = None,\r\n context: Optional[str] = None,\r\n cohort: Optional[str] = None\r\n) -> Dict\r\n```\r\n\r\n**Parameters:**\r\n\r\n- `question` (str): The input question\r\n- `answer` (str): The AI-generated answer to evaluate\r\n- `evaluation_criteria` (List[str]): List of criteria to evaluate against\r\n- `eval_type` (str, optional): Evaluation type. Options:\r\n- `ground_truth_answer` (str, optional): Reference answer for comparison\r\n- `context` (str, optional): Additional context for evaluation\r\n- `cohort` (str, optional): Cohort name for grouping evaluations\r\n\r\n**Returns:**\r\n\r\n- `Dict`: Evaluation results from the API\r\n\r\n**Raises:**\r\n\r\n- `requests.exceptions.ConnectionError`: If unable to connect to the API\r\n- `requests.exceptions.Timeout`: If the request times out\r\n- `requests.exceptions.RequestException`: For other request-related errors\r\n\r\n## License\r\n\r\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\r\n\r\n## Support\r\n\r\n- \ud83d\udce7 Email: info@jaas-ai.com\r\n- \ud83d\udcd6 Documentation: [https://jaas-ai.net ]\r\n\r\n## Changelog\r\n\r\n### v0.1.5 (2025-09-08)\r\n- Improved error handling with cleaner error messages\r\n- Better HTTP error reporting from server responses\r\n\r\n### v0.1.4 (2025-09-08)\r\n- Simplified use and API call\r\n- Improved evaluation functionality\r\n- Support for multiple evaluation types\r\n- Comprehensive error handling\r\n\r\n",
"bugtrack_url": null,
"license": null,
"summary": "Python SDK for JaaS AI evaluation API",
"version": "0.1.9",
"project_urls": null,
"split_keywords": [
"ai",
" evaluation",
" api",
" sdk",
" machine learning",
" llm"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "42dbbb660489fa634793afeca74de0dac91957075fa04e5a1728187e93ebd7b3",
"md5": "7bf9692e9e04f2827f1241e351c96851",
"sha256": "ccc705012145672f314c25b007fef661655e6ef544a47bb66995bc6c124305de"
},
"downloads": -1,
"filename": "jaas_ai-0.1.9-py3-none-any.whl",
"has_sig": false,
"md5_digest": "7bf9692e9e04f2827f1241e351c96851",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 5519,
"upload_time": "2025-09-08T18:05:33",
"upload_time_iso_8601": "2025-09-08T18:05:33.778146Z",
"url": "https://files.pythonhosted.org/packages/42/db/bb660489fa634793afeca74de0dac91957075fa04e5a1728187e93ebd7b3/jaas_ai-0.1.9-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "d642d03c6a18553d40b906d6f265bf90d096e38a58063f8e3afb700b1082c68e",
"md5": "6d992755dcec0fb0583207812ad6f7af",
"sha256": "a014bdc31f4daf5733c87719f3ee4e41abc0ddd5b38c65a9b1dff15617e671cb"
},
"downloads": -1,
"filename": "jaas_ai-0.1.9.tar.gz",
"has_sig": false,
"md5_digest": "6d992755dcec0fb0583207812ad6f7af",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 6450,
"upload_time": "2025-09-08T18:05:34",
"upload_time_iso_8601": "2025-09-08T18:05:34.632233Z",
"url": "https://files.pythonhosted.org/packages/d6/42/d03c6a18553d40b906d6f265bf90d096e38a58063f8e3afb700b1082c68e/jaas_ai-0.1.9.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-09-08 18:05:34",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "jaas-ai"
}