QyrusAI Python SDK
The QyrusAI Python SDK provides a Python client to access our SOTA Single Use testing Agents for test case generation, test data generation, API test case generation, and many more.
Key Features
- Nova: Nova generates functional test scenarios, then test steps (2-stage) from JIRA, Rally, Azure DevOps, or a user description.
app_urlis optional. - Nova API Assertions: Nova API Assertions provide a quick way to create assertions to test API responses. These assertions include header, schema, JSON Path, and JSON Body test cases.
- API Builder: API builder helps in visualizing virtualized APIs and provide a well planned Swagger documentation with APIs for the provided use case description.
- Vision Nova: Vision Nova helps in creating functional tests from Figma design frames.
- Data Amplification: Data Amplification helps create highly realistic context specific data for testing needs.
- LLM Evaluator: LLM Evaluator provides comprehensive evaluation for RAG (Retrieval-Augmented Generation) and MCP (Model Context Protocol) systems with advanced metrics.
Installation
You can install qyrusai from the source as of now.
From Source
pip install git+https://github.com/QQyrus/qyrusai-sdk.git
Usage
Nova is a 2-stage flow:
- Generate scenarios → wait for
job_idand each scenario’stest_script_id - Generate steps → pass that
job_idand the ids you want, e.g.[1, 4, 5]
app_url is optional on every scenario call. Skip it if you do not have an application URL.
Initialize QyrusAI SDK
from qyrusai import SyncQyrusAI
client = SyncQyrusAI(api_key="sk_staging_...")
Generate scenarios from a JIRA ticket
scenarios_resp = client.nova.generate_scenarios.from_jira(
jira_endpoint="https://your-domain.atlassian.net",
jira_api_token="your_jira_token",
jira_username="your_jira_email",
jira_id="PROJ-123",
# app_url="https://your-app.example.com", # optional
)
print(scenarios_resp.job_id)
for scenario in scenarios_resp.scenarios or []:
print(scenario.test_script_id, scenario.test_script_name)
steps_resp = client.nova.generate_steps.create(
job_id=scenarios_resp.job_id,
test_script_ids=[1, 4, 5], # pick ids from the response above
)
Generate scenarios from a user description
scenarios_resp = client.nova.generate_scenarios.from_description(
"Create tests for login page",
# app_url="https://your-app.example.com", # optional
)
steps_resp = client.nova.generate_steps.create(
job_id=scenarios_resp.job_id,
test_script_ids=[1, 4, 5],
)
Generate scenarios from a Rally ticket
scenarios_resp = client.nova.generate_scenarios.from_rally(
rally_host_url="https://rally1.rallydev.com",
rally_api_key="your_rally_api_key",
ticket_id="US12345",
rally_workspace_url="https://rally1.rallydev.com/slm/webservice/v2.0/workspace/...",
)
steps_resp = client.nova.generate_steps.create(
job_id=scenarios_resp.job_id,
test_script_ids=[1, 4, 5],
)
Generate scenarios from Azure DevOps
scenarios_resp = client.nova.generate_scenarios.from_azure(
work_item_id=12345,
personal_access_token="your_ado_pat",
organization_name="your-ado-org",
)
steps_resp = client.nova.generate_steps.create(
job_id=scenarios_resp.job_id,
test_script_ids=[1, 4, 5],
)
Legacy aliases (client.nova.from_jira.create(...), from_description.create(...), from_rally.create(...)) still map to generate_scenarios. Prefer generate_scenarios / generate_steps.
Data Amplification
Generate Realistic Test Data
from qyrusai import SyncQyrusAI
client = SyncQyrusAI(api_key="your_api_key")
# Define your data structure
data = [
{
"column_name": "first_name",
"column_description": "User's first name",
"column_restriction": "no restrictions",
"column_values": ["John", "Jane", "Michael", "Emily", "Sarah"]
},
{
"column_name": "email",
"column_description": "User's email address",
"column_restriction": "valid email format",
"column_values": ["john@example.com", "jane@test.com"]
}
]
# Generate 10 new rows of data
result = client.data_amplifier.amplify(data, data_count=10)
print("Generated data:")
for key, values in result.data.items():
print(f"{key}: {values}")
API Builder
Generate API Documentation from Description
from qyrusai import SyncQyrusAI
client = SyncQyrusAI(api_key="your_api_key")
swagger_spec = client.api_builder.build(
email="developer@company.com",
user_description="Generate APIs for e-commerce platform with user management and product catalog"
)
print("Generated Swagger specification:")
print(f"Title: {swagger_spec['info']['title']}")
print(f"Paths: {list(swagger_spec['paths'].keys())}")
API Assertions
Generate Header Assertions
from qyrusai import SyncQyrusAI
client = SyncQyrusAI(api_key="your_api_key")
assertions = client.api_assertions.headers.create(headers=headers)
for assertion in assertions:
print(f"Assert {assertion['assertHeaderKey']}: {assertion['assertHeaderValue']}")
Generate JSON Body Assertions
response_data = {
"status": "success",
"data": {
"user_id": 123,
"username": "john_doe",
"email": "john@example.com"
},
"message": "User retrieved successfully"
}
assertions = client.api_assertions.jsonbody.create(response=response_data)
for assertion in assertions:
print(f"Assert contains: {assertion['value']} - {assertion['assertionDescription']}")
Generate JSON Path Assertions
jsonpath_assertions = client.api_assertions.jsonpath.create(response=response_data)
for assertion in jsonpath_assertions:
print(f"JSONPath: {assertion['jsonPath']} == {assertion['jsonPathValue']}")
Generate JSON Schema Assertions
schema = client.api_assertions.jsonschema.create(response=response_data)
print("Generated JSON Schema:")
print(schema)
Vision Nova
Generate Tests from UI Images
from qyrusai import SyncQyrusAI
client = SyncQyrusAI(api_key="your_api_key")
# Generate functional tests from image URL
image_url = "https://example.com/login-page-screenshot.jpg"
test_scenarios = client.vision_nova.generate_test.generate(image_url)
print(f"Generated {len(test_scenarios.scenarios)} test scenarios from image:")
for scenario in test_scenarios.scenarios:
print(f"- {scenario['scenario_name']}: {scenario['objective']}")
print(f" Steps: {len(scenario['steps'])} steps")
Verify UI Accessibility
# Verify accessibility compliance of UI design
accessibility_report = client.vision_nova.verify_accessibility.verify(image_url)
print("Accessibility Report:")
for item in accessibility_report.visual_accessibility:
print(f"- {item['accessibility_type']}: {item['accessibility_comment']}")
LLM Evaluator
Initialize LLM Evaluator
from qyrusai import AsyncQyrusAI
from qyrusai._types import RAGRequest, MCPRequest
client = AsyncQyrusAI(api_key="your_api_key")
evaluator = client.llm_evaluator.evaluator
Evaluate RAG (Retrieval-Augmented Generation) Systems
# Basic RAG evaluation
rag_request = RAGRequest(
app_name="customer_support_rag",
qid="test_001",
question="How do I reset my password?",
answer="Click 'Forgot Password' on the sign-in page. The reset link expires in 24 hours.",
retrieved=[
{
"doc_id": "kb-12",
"text": "To reset your password, click 'Forgot Password' on the sign-in page. An email link is valid for 24 hours.",
"score": 0.89
}
],
citations=[0],
params={"model": "gpt-4o-mini", "temperature": 0.2}
)
# Evaluate the RAG system
result = await evaluator.evaluate_rag(rag_request)
print(f"Status: {result['status']}")
print(f"Faithfulness: {result['metrics']['faithfulness']}")
print(f"Relevance: {result['metrics']['relevance']}")
Evaluate MCP (Model Context Protocol) Tool-Calling Systems
# Basic MCP evaluation
mcp_request = MCPRequest(
app_name="customer_support_mcp",
qid="test_002",
question="What's my order status?",
answer="Your order ABC-123 has shipped and will arrive tomorrow.",
tools=[
{
"name": "orders.getStatus",
"args": {"order_id": "ABC-123"},
"args_valid": True,
"status": "ok",
"latency_ms": 150,
"result_text": "Order ABC-123 status: shipped, estimated delivery: tomorrow"
}
]
)
# Evaluate the MCP system
result = await evaluator.evaluate_mcp(mcp_request)
print(f"Status: {result['status']}")
print(f"Tool Selection Quality: {result['metrics']['tool_selection_quality']}")
print(f"Args Valid Rate: {result['metrics']['args_valid_rate']}")
Batch Evaluation
# Evaluate multiple requests at once
requests = [rag_request, mcp_request]
batch_result = await evaluator.evaluate_batch(requests)
print(f"Total: {batch_result['total']}")
print(f"Successful: {batch_result['successful']}")
print(f"Failed: {batch_result['failed']}")
for result in batch_result['results']:
print(f"- {result['qid']}: {result['status']}")
Using JSON Input (Alternative to Pydantic)
# You can also use plain dictionaries instead of Pydantic models
rag_dict = {
"app_name": "customer_support_rag",
"qid": "test_003",
"question": "What are the pricing plans?",
"answer": "We offer Basic ($10/month) and Premium ($25/month) plans.",
"retrieved": [
{
"doc_id": "pricing-1",
"text": "Basic plan costs $10/month. Premium plan costs $25/month.",
"score": 0.95
}
],
"citations": [0]
}
# The evaluator automatically validates and converts JSON to Pydantic
result = await evaluator.evaluate_rag(rag_dict)
Legacy Judge Evaluation (Backwards Compatibility)
# Original evaluate method still works
score = await evaluator.evaluate(
context="User wants to reset password",
expected_output="Provide reset link instructions",
executed_output=["Click 'Forgot Password' on login page"],
guardrails="Always mention link expiration time"
)
print(f"Evaluation score: {score}")
Synchronous Usage
from qyrusai import SyncQyrusAI
# All methods are available in synchronous versions
client = SyncQyrusAI(api_key="your_api_key")
evaluator = client.llm_evaluator.evaluator
# Synchronous RAG evaluation
result = evaluator.evaluate_rag(rag_request)
# Synchronous batch evaluation
batch_result = evaluator.evaluate_batch([rag_request, mcp_request])
Advanced MCP with Schema Validation
# MCP with automatic argument validation
mcp_with_schema = MCPRequest(
app_name="advanced_mcp_app",
qid="test_004",
question="Search for customer orders",
answer="Found 5 orders for customer John Doe.",
tool_schemas={
"database.query": {
"type": "object",
"properties": {
"sql": {"type": "string"},
"timeout": {"type": "number", "minimum": 1}
},
"required": ["sql"]
}
},
tools=[
{
"name": "database.query",
"args": {"sql": "SELECT * FROM orders WHERE customer_name='John Doe'"},
# args_valid will be automatically computed from schema
"status": "ok",
"latency_ms": 245,
"result_text": "Found 5 orders"
}
]
)
result = await evaluator.evaluate_mcp(mcp_with_schema)
Complete Example
import os
import asyncio
from qyrusai import AsyncQyrusAI
from qyrusai._types import RAGRequest, MCPRequest
async def main():
# Initialize client
client = AsyncQyrusAI(api_key=os.getenv("QYRUS_API_KEY"))
# Generate test scenarios from JIRA
scenarios = await client.nova.from_description.create(
"Create tests for user registration form"
)
print(f"Generated {len(scenarios.scenarios)} test scenarios")
# Generate test data
data_schema = [{
"column_name": "username",
"column_description": "unique username",
"column_restriction": "alphanumeric only",
"column_values": ["user1", "testuser", "admin"]
}]
test_data = client.data_amplifier.amplify(data_schema, data_count=5)
print(f"Generated test data: {test_data.data}")
# Build API documentation
api_spec = client.api_builder.build(
email="dev@company.com",
user_description="User management API with registration and authentication"
)
print(f"Generated API with {len(api_spec['paths'])} endpoints")
# Evaluate RAG system
rag_evaluation = await client.llm_evaluator.evaluator.evaluate_rag({
"app_name": "help_desk_rag",
"qid": "eval_001",
"question": "How to reset password?",
"answer": "Use the forgot password link",
"retrieved": [{"doc_id": "kb1", "text": "Click forgot password link", "score": 0.9}],
"citations": [0]
})
print(f"RAG Status: {rag_evaluation['status']}")
if __name__ == "__main__":
asyncio.run(main())
Note: Both Asynchronous and Synchronous interactions are available. Replace
AsyncQyrusAIwithSyncQyrusAIand removeawaitfor synchronous usage.
Note: Store your API key securely using environment variables. Get your API key from the Qyrus platform.
Metadata
Release files for qyrusai 1.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| qyrusai-1.0.5.tar.gz | 29.5 kB | Without provenance | Details for qyrusai-1.0.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| qyrusai-1.0.5-py3-none-any.whl | Python 3 | none | any | Details for qyrusai-1.0.5-py3-none-any.whl |
Total release size: 66.1 kB
Release files / qyrusai-1.0.5.tar.gz
| Download URL | qyrusai-1.0.5.tar.gz |
|---|---|
| Size | 29.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e95da10ce340c5c2c03daa5605391c6fb85ed510376c5636bd050287209a4acf
|
|
BLAKE2b-256 checksum How to use checksums |
b485587efe399be4fd37bcd129785ef436c4a608a1c6bd1bd434e64ea4359f20
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.12
|
Release files / qyrusai-1.0.5-py3-none-any.whl
| Download URL | qyrusai-1.0.5-py3-none-any.whl |
|---|---|
| Size | 36.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9a84fa4cec83c0ec22ea9b62bdc4bfb585c5a191fcacf9ea4012d8a56f81d74e
|
|
BLAKE2b-256 checksum How to use checksums |
03433e69957abb74b1a82c4bf3e1fb879651b8a089ce99109b7a9baa3e8169e4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.12
|
Security for qyrusai 1.0.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.