Skip to content

genai-musings/dawdling-with-D-ID

Repository files navigation

dawdling-with-D-ID

License: MPL 2.0 Bandit Safety Check Super-Linter [CodeQL Markdown Links Check Spell-Checker Unit-Tests Code-Coverage Docker-Build-Push Docker-Push-README

Repository for dawdling with D-ID Studio.

This repository contains Python code, and associated unit tests, which uses the D-ID Studio API to retrieve talks from an account.

To run program

Your D-ID API key needs to be passed to program via an environment variable

export DID_KEY="Your D-ID key"
python main.py

To generate an D-ID key browse to D-ID API Keys and select "Generate key".

Credits

You can generate talks using a trial account at D-ID Studio. To generate talks you need credits, after the trial period expires you will need to purchase D-ID Studio Credits to continue using the studio.

To run unit tests

pytest

To build and run an instance of a Docker image locally.

The username and password for Docker Hub are stored as secrets this GitHub repository.

Note: To set up the secrets in your GitHub repository, go to the repository page, navigate to the "Settings" tab, and then select "Secrets" from the left menu. Add a secret named DOCKERHUB_USERNAME with the Docker Hub username to be used, and another secret named DOCKERHUB_PASSWORD with the Docker Hub password to be used.

Build

Build the Docker image.

docker build -t dawdling-with-d-id .

Run

Run the Docker image as a container.

export DID_KEY="Your D-ID key"
docker run -it -e DID_KEY=$DID_KEY dawdling-with-d-id

To pull and run an instance of the Docker image from Docker Hub

Pull

docker pull <dockerhub-username>/dawdling-with-d-id:<tag>

Replace with your Docker Hub username and with the specific tag of the Docker image you want to pull.

Run

export DID_KEY="Your D-ID key"
docker run -it -e DID_KEY=$DID_KEY <dockerhub-username>/dawdling-with-d-id:<tag>

D-ID Studio API Reference

For more information on the API available see the D-ID Studio API Reference Documentation.