Getting Started
1. Prerequisites
Before you begin, ensure you have the following:
Python 3.8 or higher installed on your system.
pip (Python’s package installer) updated to the latest version.
A Chronocast API key (Check our Github).
Before you begin, ensure you have the following:
Python 3.8 or higher installed on your system.
pip (Python’s package installer) updated to the latest version.
A Chronocast API key (sign up at Chronocast Beta to get yours).
Step 1: Install the SDK
Open your terminal or command prompt and run:
pip install chronocast-sdk
Step 2: Verify Installation
To ensure the SDK is installed correctly, run:
pip show chronocast-sdk
You should see details like the version number and installation path.
3. Setting Up Your First AI Host
Now that the SDK is installed, let’s create your first AI host.
Step 1: Import the SDK
Start by importing the Chronocast SDK into your Python script:
from chronocast import Chronocast
Step 2: Initialize the SDK
Use your API key to initialize the SDK:
api_key = "your_api_key_here" # Replace with your Chronocast API key
chronocast = Chronocast(api_key)
Step 3: Create an AI Host
Define your AI host’s personality and traits:
ai_host = chronocast.create_ai_host(
name="Alex",
personality="Energetic",
voice="en-US-Wavenet-C", # Choose from available voices
traits=["Curious", "Friendly"]
)
print(f"AI Host Created: {ai_host.name}")
4. Streaming with Your AI Host
Once your AI host is created, you can start streaming and interacting with your audience.
Step 1: Start a Livestream
Use the start_stream
method to begin streaming:
stream = ai_host.start_stream(
platform="twitch", # Options: "twitch", "youtube", "tiktok"
stream_key="your_stream_key_here" # Replace with your platform’s stream key
)
print(f"Stream Started: {stream.id}")
Step 2: Enable Real-Time Interaction
Allow your AI host to interact with viewers in real time:
def handle_chat_message(message):
response = ai_host.generate_response(message)
print(f"Viewer: {message}")
print(f"AI Host: {response}")
# Simulate a chat message
handle_chat_message("What’s your favorite game?")
5. Advanced Features
1. Tokenized Rewards
Incentivize viewer engagement by rewarding them with $CHRONO tokens:
def reward_viewer(viewer_id, amount):
chronocast.reward_tokens(viewer_id, amount)
print(f"Rewarded {amount} $CHRONO to viewer {viewer_id}")
# Example usage
reward_viewer("viewer123", 10)
2. Minting AI Host NFTs
Turn your AI host into a tradable NFT:
nft_metadata = {
"name": "Alex",
"description": "An energetic and curious AI host.",
"image_url": "https://example.com/alex.png"
}
nft_id = chronocast.mint_ai_host_nft(ai_host.id, nft_metadata)
print(f"AI Host NFT Minted: {nft_id}")
6. Troubleshooting
Common Issues
API Key Not Working: Ensure you’ve copied the correct API key from your Chronocast dashboard.
Stream Not Starting: Verify your platform’s stream key and ensure your internet connection is stable.
AI Host Not Responding: Check if the AI host’s personality and traits are configured correctly.
Need Help?
Visit our Support Page or join the Chronocast Community Forum for assistance.
7. Next Steps
Now that you’ve set up your AI host and started streaming, here’s what you can do next:
Explore advanced customization options for your AI host.
Integrate tokenized economies to monetize your streams.
Dive into Web3 features like minting AI host NFTs.
Last updated