Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
7c1cbc9
Update README title from '.NET SDK' to 'SDK Samples' (#1)
pontemonti Nov 5, 2025
d81af2c
Added CODEOWNERS and .gitignore files (#2)
pontemonti Nov 5, 2025
c3c1e74
Add .NET Semantic Kernel Sample Agent (#3)
pontemonti Nov 5, 2025
1d90369
Update License to MIT License (#4)
rahuldevikar761 Nov 5, 2025
39a239c
Added Python OpenAI sample (#5)
pontemonti Nov 5, 2025
6f236de
Add LangChain Sample (#7)
JesuTerraz Nov 5, 2025
4cbd949
Add Node.js Claude Sample Agent (#6)
pontemonti Nov 6, 2025
1c0b548
Fix Agent Notifs and update env (#8)
JesuTerraz Nov 6, 2025
ea11209
[Python][AgentFramework] Adding Python Agent Framework Sample (#9)
JesuTerraz Nov 6, 2025
9b124ba
Add TM (#11)
rahuldevikar761 Nov 7, 2025
e99aa17
Revise README for Agent 365 Sample Agent (#13)
pontemonti Nov 7, 2025
d221266
Add TM (#14)
rahuldevikar761 Nov 7, 2025
e733e9c
Update Agents SDK for LangChain Sample (#15)
JesuTerraz Nov 7, 2025
45fffa8
Adding Notifications on AF (#16)
mrunalhirve128 Nov 10, 2025
c311f08
initial code for python claude sdk agent
msftairaamane Nov 11, 2025
b0b32c2
initial code for python claude sdk agent
msftairaamane Nov 11, 2025
e3cde97
fixes
msftairaamane Nov 11, 2025
d325188
fixes
msftairaamane Nov 11, 2025
de6f424
add documentation files
msftairaamane Nov 11, 2025
188cfca
add documentation files
msftairaamane Nov 11, 2025
a2da548
remove unused file
msftairaamane Nov 11, 2025
3f0cbbe
remove unused file
msftairaamane Nov 11, 2025
198f9dc
fixes
msftairaamane Nov 12, 2025
e42357e
fixes
msftairaamane Nov 12, 2025
183ffec
fixes
msftairaamane Nov 12, 2025
aacd349
fixes
msftairaamane Nov 12, 2025
21fcf03
Removed duplicate entry of ENABLE_A365_OBSERVABILITY_EXPORTER configu…
Dec 19, 2025
8aacef6
Removed duplicate entry of ENABLE_A365_OBSERVABILITY_EXPORTER configu…
Dec 19, 2025
c3c7f0b
Corrected copyright header format
Dec 19, 2025
87cd9a0
Corrected copyright header format
Dec 19, 2025
2cbabfa
Removed inconsistent whitespaces
Dec 19, 2025
5d846b2
Removed inconsistent whitespaces
Dec 19, 2025
57d95f1
Removed unused imports, inconsistent indentations, and removed unnece…
Dec 19, 2025
27a13f0
Removed unused imports, inconsistent indentations, and removed unnece…
Dec 19, 2025
2d305dc
Removed ENABLE_OBSERVABILITY variable from env file and updated READM…
Dec 19, 2025
b93e41d
Removed ENABLE_OBSERVABILITY variable from env file and updated READM…
Dec 19, 2025
e117ac1
Updated AGENT-CODE-WALKTHROUGH
Dec 19, 2025
d8c3a07
Updated AGENT-CODE-WALKTHROUGH
Dec 19, 2025
1a8cd55
Merge branch 'airaamane/claude-python' of https://github.com/microsof…
Dec 30, 2025
df761a7
Revert "Updated AGENT-CODE-WALKTHROUGH"
Dec 30, 2025
a820956
Revert "Removed ENABLE_OBSERVABILITY variable from env file and updat…
Dec 30, 2025
56dc696
Revert "Removed unused imports, inconsistent indentations, and remove…
Dec 30, 2025
1aba903
Removed unused imports, inconsistent indentations and updated the REA…
Dec 30, 2025
73b9588
Updated AGENT-CODE-WALKTHROUGH
Dec 30, 2025
3c9a6ea
Minor changes
Dec 30, 2025
82b14b8
Made changes including notification flag, removing main method, remov…
Dec 31, 2025
e215f1d
Fixed issues in workflows
Dec 31, 2025
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
93 changes: 93 additions & 0 deletions .github/workflows/python-claude-sample.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: Python Claude Sample - Build Validation

on:
push:
branches:
- main
- develop
paths:
- 'python/claude/sample-agent/**'
- '.github/workflows/python-claude-sample.yml'
pull_request:
branches:
- main
- develop
paths:
- 'python/claude/sample-agent/**'
- '.github/workflows/python-claude-sample.yml'

permissions:
contents: read

jobs:
build-and-validate:
name: Build and Validate Claude Sample
runs-on: ubuntu-latest
defaults:
run:
working-directory: python/claude/sample-agent

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install uv
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.cargo/bin" >> $GITHUB_PATH

- name: Create virtual environment
run: uv venv

- name: Install dependencies
run: |
uv pip install -e .

- name: Check Python syntax
run: |
python -m py_compile agent.py
python -m py_compile host_agent_server.py
python -m py_compile start_with_generic_host.py
python -m py_compile agent_interface.py
python -m py_compile local_authentication_options.py
python -m py_compile token_cache.py
python -m py_compile observability_helpers.py

- name: Validate pyproject.toml
run: |
if [ ! -f "pyproject.toml" ]; then
echo "pyproject.toml not found"
exit 1
fi
python -c "import tomllib; tomllib.load(open('pyproject.toml', 'rb'))" 2>/dev/null || python -c "import tomli; tomli.load(open('pyproject.toml', 'rb'))"

- name: Check for required files
run: |
required_files=("README.md" "AGENT-CODE-WALKTHROUGH.md" ".env.template" "ToolingManifest.json")
for file in "${required_files[@]}"; do
if [ ! -f "$file" ]; then
echo "Required file $file not found"
exit 1
fi
done

- name: Validate imports
run: |
python -c "
import sys
sys.path.insert(0, '.')
try:
import agent_interface
import local_authentication_options
import token_cache
import observability_helpers
print('✅ All imports validated successfully')
except ImportError as e:
print(f'❌ Import validation failed: {e}')
sys.exit(1)
"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ build/
.eggs/
.pytest_cache/
_version.py
uv.lock

# Virtual environments
.venv/
Expand Down
120 changes: 120 additions & 0 deletions python/claude/sample-agent/.env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
# =============================================================================
# CLAUDE AGENT SDK CONFIGURATION
# =============================================================================

# Anthropic API Key (required)
# Get your API key from: https://console.anthropic.com/
ANTHROPIC_API_KEY=your_anthropic_api_key_here

# Claude Model to use (optional, defaults to claude-sonnet-4-20250514)
# Options: claude-opus-4-20250514, claude-sonnet-4-20250514, claude-haiku-4-20250514
CLAUDE_MODEL=claude-sonnet-4-20250514


# =============================================================================
# MCP (Model Context Protocol) CONFIGURATION (Optional)
# =============================================================================

# MCP Server Host
MCP_SERVER_HOST=

# MCP Platform Endpoint
MCP_PLATFORM_ENDPOINT=

# =============================================================================
# MICROSOFT 365 AGENTS SDK CONFIGURATION
# =============================================================================

# Agent ID (required for agentic authentication)
AGENT_ID=your-agent-id

# Environment ID (optional, defaults to prod)
# Options: dev, test, preprod, prod
ENVIRONMENT_ID=prod
ENV_ID=

# =============================================================================
# AUTHENTICATION OPTIONS
# =============================================================================

# Use agentic authentication (optional, defaults to false)
# Set to "true" to use agentic authentication with M365 Agents SDK
USE_AGENTIC_AUTH=false

# Bearer token (required if not using client credentials)
# Use for development/testing without full app registration
BEARER_TOKEN=your_bearer_token_here

# Agentic authentication scope (required if USE_AGENTIC_AUTH=true)
# Example: https://api.powerplatform.com/.default
AGENTIC_AUTH_SCOPE=https://api.powerplatform.com/.default

# =============================================================================
# AGENT365 AGENTIC AUTHENTICATION CONFIGURATION
# =============================================================================

# Service connection settings for Agent365
CONNECTIONS__SERVICE_CONNECTION__SETTINGS__CLIENTID=
CONNECTIONS__SERVICE_CONNECTION__SETTINGS__CLIENTSECRET=
CONNECTIONS__SERVICE_CONNECTION__SETTINGS__TENANTID=
CONNECTIONS__SERVICE_CONNECTION__SETTINGS__SCOPES=

# Agent application user authorization settings
AGENTAPPLICATION__USERAUTHORIZATION__HANDLERS__AGENTIC__SETTINGS__TYPE=AgenticUserAuthorization
AGENTAPPLICATION__USERAUTHORIZATION__HANDLERS__AGENTIC__SETTINGS__SCOPES=https://graph.microsoft.com/.default
AGENTAPPLICATION__USERAUTHORIZATION__HANDLERS__AGENTIC__SETTINGS__ALTERNATEBLUEPRINTCONNECTIONNAME=https://graph.microsoft.com/.default

# Connections map configuration
CONNECTIONSMAP_0_SERVICEURL=*
CONNECTIONSMAP_0_CONNECTION=SERVICE_CONNECTION

# =============================================================================
# CLIENT CREDENTIALS AUTHENTICATION (Optional)
# =============================================================================
# For production deployments, use client credentials instead of bearer token

# Azure AD Client ID
# CLIENT_ID=your-client-id

# Azure AD Tenant ID
# TENANT_ID=your-tenant-id

# Azure AD Client Secret
# CLIENT_SECRET=your-client-secret

# =============================================================================
# SERVER CONFIGURATION
# =============================================================================

# Port to run the server on (optional, defaults to 3978)
PORT=3978

# =============================================================================
# LOGGING CONFIGURATION
# =============================================================================

# Logging level (optional, defaults to INFO)
# Options: DEBUG, INFO, WARNING, ERROR, CRITICAL
LOG_LEVEL=INFO

# =============================================================================
# OBSERVABILITY CONFIGURATION (Optional)
# =============================================================================

# Enable observability tracing (set to true to track agent operations)
ENABLE_OBSERVABILITY=true

# Service name for observability
OBSERVABILITY_SERVICE_NAME=claude-agent

# Service namespace for observability
OBSERVABILITY_SERVICE_NAMESPACE=agent365-samples

# Enable Agent 365 Observability Exporter (optional, defaults to false)
# Set to "true" to export telemetry to Agent 365 backend
# When false, uses ConsoleSpanExporter for local debugging
ENABLE_A365_OBSERVABILITY_EXPORTER=false

# Python environment (influences target cluster/category)
# Options: development, production
PYTHON_ENVIRONMENT=development
Loading
Loading