Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Azure AI Agent Configuration
AZURE_AI_AGENT_MODEL_DEPLOYMENT_NAME = "your-model-deployment-name"
AZURE_AI_AGENT_ENDPOINT = "https://your-ai-service.services.ai.azure.com/models"
AZURE_AI_AGENT_SUBSCRIPTION_ID = "your-subscription-id"
AZURE_AI_AGENT_RESOURCE_GROUP_NAME = "your-resource-group"
AZURE_AI_AGENT_PROJECT_NAME = "your-project-name"

# Azure Storage Configuration (required for local file uploads)
AZURE_STORAGE_ACCOUNT_NAME="your-storage-account-name"

# Video Translation / Cognitive Service Configuration
COGNITIVE_SERVICES_ENDPOINT = "your-cognitive-services-endpoint"


# If you are using a project created in Azure AI Foundry before 05/19/2025
AZURE_AI_AGENT_PROJECT_CONNECTION_STRING = "your-region.api.azureml.ms;your-subscription-id;your-resource-group;your-project-name"

# If you are using a project created in Azure AI Foundry on or after 05/19/2025
AZURE_AI_AGENT_ENDPOINT = "https://your-resource.services.ai.azure.com/api/projects/your-project"
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Video Translation Agent


This code sample supports building agents for multilingual video localization with translation, subtitles, and speech generation. It leverages Azure AI Foundry, Azure AI Cognitive Services, and Azure Blob Storage to provide high-quality video translations between languages with customizable speech and subtitle options.

**IMPORTANT NOTE:** Starter templates, instructions, code samples and resources in this msft-agent-samples file (“samples”) are designed to assist in accelerating development of agents for specific scenarios. It is important that you review all provided resources and carefully test Agent behavior in the context of your use case: ([Learn More](https://learn.microsoft.com/en-us/legal/cognitive-services/agents/transparency-note?context=%2Fazure%2Fai-services%2Fagents%2Fcontext%2Fcontext)).
Expand All @@ -9,14 +8,7 @@ Certain Agent offerings may be subject to legal and regulatory requirements, may

## Demo

<div align="center">
<video width="800" controls>
<source src="./assets/demo.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
</div>

You can find the demo video at `./assets/demo.mp4` in the repository.
You can view the demo video [here](https://learn-video.azurefd.net/vod/player?id=24cc69cb-8e6a-4c1b-a3b5-7000dc81919f)!

## Use Cases

Expand All @@ -31,7 +23,7 @@ You can find the demo video at `./assets/demo.mp4` in the repository.
The Video Translation Agent uses:
- **Azure AI Agents** - For conversation management and orchestration
- **Semantic Kernel** - For creating the AI Agent and managing plugins
- **Azure AI's Cognitive Services Video Translation API** - For the core video translation functionality
- **Azure AI Speech's Video Translation API** - For the core video translation functionality
- **Azure Blob Storage** - For secure file storage and retrieval

<div align="center">
Expand All @@ -45,7 +37,7 @@ The Video Translation Agent uses:
- [Python > 3.11.10](https://www.python.org/downloads/)
- [Git](https://git-scm.com/downloads)
- Azure resources:
- **Azure subscription**: [Create a free account](https://azure.microsoft.com/free/) if you don't already have one
- **Azure subscription**: [Create an account](https://azure.microsoft.com/free/) if you don't already have one
- **Azure AI Speech Services**:
- Create a [Speech resource](https://portal.azure.com/#create/Microsoft.CognitiveServicesSpeechServices) in a [supported region for video translation](https://learn.microsoft.com/azure/ai-services/speech-service/regions#speech-service)
- **Azure Blob Storage**:
Expand All @@ -61,7 +53,7 @@ Follow the [official Azure AI Agent Service documentation](https://learn.microso

### Quickstart

1. Clone the repository and navigate to the `video-translation-agent` folder using the "cd" command in the terminal.
1. Clone the repository and navigate to the `video-translation-agent` folder.

2. Create and activate a virtual environment:

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
from datetime import datetime, timedelta
from typing import Optional, Callable
from urllib3.util import Url
from video_translation_enum import *
from video_translation_dataclass import *
from video_translation_util import *
import time
from azure.core.credentials import TokenCredential
from azure.identity import DefaultAzureCredential, get_bearer_token_provider

from src.video_translation_enum import *
from src.video_translation_dataclass import *
from src.video_translation_util import *

logger = logging.getLogger(__name__)

HTTP_HEADERS_OPERATION_LOCATION = "Operation-Location"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from urllib3.util import Url
from typing import Optional

from video_translation_enum import *
from src.video_translation_enum import *

@dataclass(kw_only=True)
class OperationDefinition():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

from semantic_kernel.functions import kernel_function

from video_translation_client import VideoTranslationClient
from video_translation_enum import VoiceKind, WebvttFileKind
from src.video_translation_client import VideoTranslationClient
from src.video_translation_enum import VoiceKind, WebvttFileKind

logging.basicConfig(
level=logging.ERROR,
Expand Down