Python SDK for Copado AI - AI-powered DevOps assistant with document analysis and knowledge integration
Project description
Copado AI SDK
The official Python SDK for Copado AI Platform. Build intelligent automation, chat with your data, and integrate Copado's AI capabilities into your DevOps workflows.
🚀 Quick Start
Installation
Install the SDK using pip:
pip install copado-ai-sdk
Prerequisites
Before using the SDK, you'll need:
- Copado AI Organization - Access to a Copado AI Platform organization
- Personal Access Key - API key generated from your Copado AI Platform profile
- Organization ID - Your organization's ID from the platform
Getting Your Credentials
1. Create a Personal Access Key
- Navigate to your profile in the Copado AI Platform
- Click the New Key button
- Give it a name (e.g., "Python SDK Key")
- Click Submit and copy the key value
2. Get Your Organization ID
- Click your profile icon on the top right
- Select Organization to see your Org ID
Authentication & Setup
Choose your base URL based on your region:
from copado_ai_sdk import CopadoClient
# Region-specific base URLs
BASE_URLS = {
"US": "https://copadogpt-api.robotic.copado.com",
"EU": "https://copadogpt-api.eu-robotic.copado.com",
"Australia": "https://copadogpt-api.au-robotic.copado.com",
"Singapore": "https://copadogpt-api.sg-robotic.copado.com"
}
# Initialize client with your region
client = CopadoClient(
base_url=BASE_URLS["US"], # Choose your region
api_key="your-personal-access-key",
organization_id=12345 # Your org ID
)
Create Your First Workspace
# Create a workspace with AI capabilities
workspace = client.workspaces.create_with_features(
name="My Project Workspace",
description="Workspace for my automation project",
enable_data_analysis=True,
enable_web_search=True,
enable_reasoning_mode=True
)
# Set as current workspace
client.set_workspace(workspace.id)
# Save the workspace ID for future sessions
print(f"Save this for future sessions: {workspace.id}")
Start Chatting
# Create a dialogue (conversation)
dialogue = client.dialogues.create(name="My First Chat")
# Send a message and get AI response
response = client.dialogues.chat(
dialogue_id=dialogue.id,
prompt="Hello! How can you help me with Copado DevOps?",
stream=True # Streams response to console
)
print(response)
📖 Usage Patterns
Using an Existing Workspace
# If you already have a workspace ID
client = CopadoClient(
base_url="https://copadogpt-api.robotic.copado.com",
api_key="your-api-key",
organization_id=123,
workspace_id="your-saved-workspace-id" # Use existing workspace
)
# Ready to use immediately - no need to create/set workspace
dialogue = client.dialogues.create(name="Continuing Work")
Session Management
# Check current workspace
workspace_id = client.get_workspace_id()
if workspace_id:
print(f"Using workspace: {workspace_id}")
else:
print("No workspace set")
# Switch between workspaces
client.set_workspace("workspace-id-1") # Switch to different workspace
client.switch_workspace("workspace-id-2") # Alternative method
# For environment-based persistence
import os
os.environ["COPADO_WORKSPACE_ID"] = workspace.id # Save for scripts
Document Analysis
# Create workspace with knowledge capabilities
workspace = client.workspaces.create_with_knowledge_capabilities(
name="Document Analysis Workspace",
description="Workspace for analyzing Copado configurations",
enable_custom_knowledge=True,
enable_essentials_knowledge=True,
enable_crt_knowledge=True, # Copado Robotic Testing knowledge
enable_metadata_format_knowledge=True,
enable_source_format_knowledge=True
)
client.set_workspace(workspace.id)
# Create dialogue and upload documents
dialogue = client.dialogues.create(name="Document Analysis")
# Upload and analyze files
response = client.dialogues.chat_with_documents(
dialogue_id=dialogue.id,
prompt="Analyze these Copado configurations and suggest improvements",
document_paths=["pipeline.yml", "metadata.xml", "rules.json"],
stream=True
)
📚 Documentation
- Features Guide - Comprehensive API reference
- Copado AI Documentation - Official platform docs
- REST API Specification (Swagger) - Interactive API documentation
🔑 Key Features
- 🤖 AI Conversations - Chat with Copado's AI about DevOps, automation, and best practices
- 📄 Document Analysis - Upload and analyze Copado configurations, metadata, and pipeline files
- 🧠 Knowledge Integration - Access Copado Essentials, CRT documentation, and custom knowledge bases
- ⚡ Workspace Management - Persistent sessions with customizable AI capabilities
- 🔗 DevOps Automation - Integrate AI insights into your CI/CD workflows
- 🌐 Web Search - AI can search for real-time information when needed
🌍 Regional Endpoints
The Copado AI Platform is available in multiple regions:
| Region | Base URL |
|---|---|
| US | https://copadogpt-api.robotic.copado.com |
| EU | https://copadogpt-api.eu-robotic.copado.com |
| Australia | https://copadogpt-api.au-robotic.copado.com |
| Singapore | https://copadogpt-api.sg-robotic.copado.com |
🆘 Support
- Issues: GitHub Issues
- Documentation: Copado AI Docs
- Community: Copado Community
Made with ❤️ by the Copado Team
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file copado_ai_sdk-0.1.0.tar.gz.
File metadata
- Download URL: copado_ai_sdk-0.1.0.tar.gz
- Upload date:
- Size: 16.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d99319029544387d434afdf014270d58805262347827d222c17c4cb513e7f708
|
|
| MD5 |
3bbb4dc5d63a89398e7fe397cdc35cf3
|
|
| BLAKE2b-256 |
fcc2bb2096ab482d1799141b105f89a5a66a3b33381d58e653de81545aee8b7b
|
File details
Details for the file copado_ai_sdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: copado_ai_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 18.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
37533e4f00ddda510835950327ec394bc6591e4d04f507923d2711784892c897
|
|
| MD5 |
addba57f417c9b4d7d601311cb5e7d05
|
|
| BLAKE2b-256 |
2fd7f925fa6b7299947fce1b729ac9395060dfbcc0229b740841507bacc790d2
|