Skip to content

zenml-io/agents-vs-workflows

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Agent or Workflow? The Great AI Debate

A Streamlit app that helps users understand the difference between AI agents and workflows through an interactive quiz.

Setup

  1. Install dependencies:
pip install -r requirements.txt
  1. Set up Google Sheets integration:

    a. Create a Google Cloud Project:

    • Go to Google Cloud Console
    • Click "Select a project" at the top
    • Click "New Project"
    • Name it (e.g., "zenml-quiz")
    • Click "Create"

    b. Enable the Google Sheets API:

    • In your project, go to "APIs & Services" > "Library"
    • Search for "Google Sheets API"
    • Click "Enable"

    c. Create a Service Account:

    • Go to "APIs & Services" > "Credentials"
    • Click "Create Credentials" > "Service Account"
    • Name it (e.g., "zenml-quiz-sa")
    • Click "Create and Continue"
    • Skip role assignment (click "Continue")
    • Click "Done"

    d. Create and Download Service Account Key:

    • In the Service Accounts list, find your new service account
    • Click the three dots (⋮) > "Manage keys"
    • Click "Add Key" > "Create new key"
    • Choose "JSON"
    • Click "Create" (this will download your credentials)

    e. Create and Share Google Sheet:

    • Go to Google Sheets
    • Create a new sheet named "ZenML Quiz Votes"
    • Click "Share" button
    • Add your service account email (found in the JSON file as "client_email")
    • Give it "Editor" access
    • Click "Share"

    f. Set up credentials:

    • Copy .streamlit/secrets.toml.template to .streamlit/secrets.toml
    • Open the downloaded JSON file
    • Copy each value from the JSON to the corresponding field in secrets.toml:
      • project_idproject_id
      • private_key_idprivate_key_id
      • private_keyprivate_key
      • client_emailclient_email
      • client_idclient_id
      • client_x509_cert_urlclient_x509_cert_url
    • The other fields (auth_uri, token_uri, auth_provider_x509_cert_url) can stay as they are
  2. Run the app:

streamlit run app.py

Deployment to Streamlit Cloud

  1. Push your code to GitHub
  2. Go to share.streamlit.io
  3. Click "New app" and connect your GitHub repository
  4. In the app settings, go to "Secrets" and add your Google Sheets credentials:
    [gsheets]
    type = "service_account"
    project_id = "your-project-id"
    private_key_id = "your-private-key-id"
    private_key = "your-private-key"
    client_email = "[email protected]"
    client_id = "your-client-id"
    auth_uri = "https://accounts.google.com/o/oauth2/auth"
    token_uri = "https://oauth2.googleapis.com/token"
    auth_provider_x509_cert_url = "https://www.googleapis.com/oauth2/v1/certs"
    client_x509_cert_url = "your-client-cert-url"
  5. Make sure your Google Sheet is shared with the service account email
  6. Deploy the app

Development

  • The app uses Streamlit's built-in Google Sheets connection for storing quiz votes
  • Quiz data is stored in QUIZ_DATA in app.py
  • Styling is defined in the custom CSS section of app.py

Visualizing Results

This repository includes a separate dashboard to visualize the aggregated results from the Google Sheet.

  1. Install development dependencies:

    pip install -r requirements-dev.txt
  2. Run the visualization app: Make sure your .streamlit/secrets.toml file is configured correctly.

    streamlit run visualize.py

Security Note

Never commit .streamlit/secrets.toml to version control. This file contains sensitive credentials that should be kept private. For Streamlit Cloud deployment, add the secrets through the dashboard instead.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages