diff --git a/.gitignore b/.gitignore
index 7be844da..e5b4bab9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -165,3 +165,399 @@ cython_debug/
# macOS Finder
.DS_Store
+
+
+
+## Ignore Visual Studio temporary files, build results, and
+## files generated by popular Visual Studio add-ons.
+##
+## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
+
+# User-specific files
+*.rsuser
+*.suo
+*.user
+*.userosscache
+*.sln.docstates
+
+# User-specific files (MonoDevelop/Xamarin Studio)
+*.userprefs
+
+# Mono auto generated files
+mono_crash.*
+
+# Build results
+[Dd]ebug/
+[Dd]ebugPublic/
+[Rr]elease/
+[Rr]eleases/
+x64/
+x86/
+[Ww][Ii][Nn]32/
+[Aa][Rr][Mm]/
+[Aa][Rr][Mm]64/
+bld/
+[Bb]in/
+[Oo]bj/
+[Ll]og/
+[Ll]ogs/
+
+# Visual Studio 2015/2017 cache/options directory
+.vs/
+# Uncomment if you have tasks that create the project's static files in wwwroot
+#wwwroot/
+
+# Visual Studio 2017 auto generated files
+Generated\ Files/
+
+# MSTest test Results
+[Tt]est[Rr]esult*/
+[Bb]uild[Ll]og.*
+
+# NUnit
+*.VisualState.xml
+TestResult.xml
+nunit-*.xml
+
+# Build Results of an ATL Project
+[Dd]ebugPS/
+[Rr]eleasePS/
+dlldata.c
+
+# Benchmark Results
+BenchmarkDotNet.Artifacts/
+
+# .NET Core
+project.lock.json
+project.fragment.lock.json
+artifacts/
+
+# ASP.NET Scaffolding
+ScaffoldingReadMe.txt
+
+# StyleCop
+StyleCopReport.xml
+
+# Files built by Visual Studio
+*_i.c
+*_p.c
+*_h.h
+*.ilk
+*.meta
+*.obj
+*.iobj
+*.pch
+*.pdb
+*.ipdb
+*.pgc
+*.pgd
+*.rsp
+*.sbr
+*.tlb
+*.tli
+*.tlh
+*.tmp
+*.tmp_proj
+*_wpftmp.csproj
+*.log
+*.tlog
+*.vspscc
+*.vssscc
+.builds
+*.pidb
+*.svclog
+*.scc
+
+# Chutzpah Test files
+_Chutzpah*
+
+# Visual C++ cache files
+ipch/
+*.aps
+*.ncb
+*.opendb
+*.opensdf
+*.sdf
+*.cachefile
+*.VC.db
+*.VC.VC.opendb
+
+# Visual Studio profiler
+*.psess
+*.vsp
+*.vspx
+*.sap
+
+# Visual Studio Trace Files
+*.e2e
+
+# TFS 2012 Local Workspace
+$tf/
+
+# Guidance Automation Toolkit
+*.gpState
+
+# ReSharper is a .NET coding add-in
+_ReSharper*/
+*.[Rr]e[Ss]harper
+*.DotSettings.user
+
+# TeamCity is a build add-in
+_TeamCity*
+
+# DotCover is a Code Coverage Tool
+*.dotCover
+
+# AxoCover is a Code Coverage Tool
+.axoCover/*
+!.axoCover/settings.json
+
+# Coverlet is a free, cross platform Code Coverage Tool
+coverage*.json
+coverage*.xml
+coverage*.info
+
+# Visual Studio code coverage results
+*.coverage
+*.coveragexml
+
+# NCrunch
+_NCrunch_*
+.*crunch*.local.xml
+nCrunchTemp_*
+
+# MightyMoose
+*.mm.*
+AutoTest.Net/
+
+# Web workbench (sass)
+.sass-cache/
+
+# Installshield output folder
+[Ee]xpress/
+
+# DocProject is a documentation generator add-in
+DocProject/buildhelp/
+DocProject/Help/*.HxT
+DocProject/Help/*.HxC
+DocProject/Help/*.hhc
+DocProject/Help/*.hhk
+DocProject/Help/*.hhp
+DocProject/Help/Html2
+DocProject/Help/html
+
+# Click-Once directory
+publish/
+
+# Publish Web Output
+*.[Pp]ublish.xml
+*.azurePubxml
+# Note: Comment the next line if you want to checkin your web deploy settings,
+# but database connection strings (with potential passwords) will be unencrypted
+*.pubxml
+*.publishproj
+
+# Microsoft Azure Web App publish settings. Comment the next line if you want to
+# checkin your Azure Web App publish settings, but sensitive information contained
+# in these scripts will be unencrypted
+PublishScripts/
+
+# NuGet Packages
+*.nupkg
+# NuGet Symbol Packages
+*.snupkg
+# The packages folder can be ignored because of Package Restore
+**/[Pp]ackages/*
+# except build/, which is used as an MSBuild target.
+!**/[Pp]ackages/build/
+# Uncomment if necessary however generally it will be regenerated when needed
+#!**/[Pp]ackages/repositories.config
+# NuGet v3's project.json files produces more ignorable files
+*.nuget.props
+*.nuget.targets
+
+# Microsoft Azure Build Output
+csx/
+*.build.csdef
+
+# Microsoft Azure Emulator
+ecf/
+rcf/
+
+# Windows Store app package directories and files
+AppPackages/
+BundleArtifacts/
+Package.StoreAssociation.xml
+_pkginfo.txt
+*.appx
+*.appxbundle
+*.appxupload
+
+# Visual Studio cache files
+# files ending in .cache can be ignored
+*.[Cc]ache
+# but keep track of directories ending in .cache
+!?*.[Cc]ache/
+
+# Others
+ClientBin/
+~$*
+*~
+*.dbmdl
+*.dbproj.schemaview
+*.jfm
+*.pfx
+*.publishsettings
+orleans.codegen.cs
+
+# Including strong name files can present a security risk
+# (https://github.com/github/gitignore/pull/2483#issue-259490424)
+#*.snk
+
+# Since there are multiple workflows, uncomment next line to ignore bower_components
+# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
+#bower_components/
+
+# RIA/Silverlight projects
+Generated_Code/
+
+# Backup & report files from converting an old project file
+# to a newer Visual Studio version. Backup files are not needed,
+# because we have git ;-)
+_UpgradeReport_Files/
+Backup*/
+UpgradeLog*.XML
+UpgradeLog*.htm
+ServiceFabricBackup/
+*.rptproj.bak
+
+# SQL Server files
+*.mdf
+*.ldf
+*.ndf
+
+# Business Intelligence projects
+*.rdl.data
+*.bim.layout
+*.bim_*.settings
+*.rptproj.rsuser
+*- [Bb]ackup.rdl
+*- [Bb]ackup ([0-9]).rdl
+*- [Bb]ackup ([0-9][0-9]).rdl
+
+# Microsoft Fakes
+FakesAssemblies/
+
+# GhostDoc plugin setting file
+*.GhostDoc.xml
+
+# Node.js Tools for Visual Studio
+.ntvs_analysis.dat
+node_modules/
+
+# Visual Studio 6 build log
+*.plg
+
+# Visual Studio 6 workspace options file
+*.opt
+
+# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
+*.vbw
+
+# Visual Studio 6 auto-generated project file (contains which files were open etc.)
+*.vbp
+
+# Visual Studio 6 workspace and project file (working project files containing files to include in project)
+*.dsw
+*.dsp
+
+# Visual Studio LightSwitch build output
+**/*.HTMLClient/GeneratedArtifacts
+**/*.DesktopClient/GeneratedArtifacts
+**/*.DesktopClient/ModelManifest.xml
+**/*.Server/GeneratedArtifacts
+**/*.Server/ModelManifest.xml
+_Pvt_Extensions
+
+# Paket dependency manager
+.paket/paket.exe
+paket-files/
+
+# FAKE - F# Make
+.fake/
+
+# CodeRush personal settings
+.cr/personal
+
+# Python Tools for Visual Studio (PTVS)
+*.pyc
+
+# Cake - Uncomment if you are using it
+# tools/**
+# !tools/packages.config
+
+# Tabs Studio
+*.tss
+
+# Telerik's JustMock configuration file
+*.jmconfig
+
+# BizTalk build output
+*.btp.cs
+*.btm.cs
+*.odx.cs
+*.xsd.cs
+
+# OpenCover UI analysis results
+OpenCover/
+
+# Azure Stream Analytics local run output
+ASALocalRun/
+
+# MSBuild Binary and Structured Log
+*.binlog
+
+# NVidia Nsight GPU debugger configuration file
+*.nvuser
+
+# MFractors (Xamarin productivity tool) working folder
+.mfractor/
+
+# Local History for Visual Studio
+.localhistory/
+
+# Visual Studio History (VSHistory) files
+.vshistory/
+
+# BeatPulse healthcheck temp database
+healthchecksdb
+
+# Backup folder for Package Reference Convert tool in Visual Studio 2017
+MigrationBackup/
+
+# Ionide (cross platform F# VS Code tools) working folder
+.ionide/
+
+# Fody - auto-generated XML schema
+FodyWeavers.xsd
+
+# VS Code files for those working on multiple tools
+.vscode/*
+!.vscode/settings.json
+!.vscode/tasks.json
+!.vscode/launch.json
+!.vscode/extensions.json
+*.code-workspace
+
+# Local History for Visual Studio Code
+.history/
+
+# Windows Installer files from build outputs
+*.cab
+*.msi
+*.msix
+*.msm
+*.msp
+
+# JetBrains Rider
+*.sln.iml
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
new file mode 100644
index 00000000..f9ba8cf6
--- /dev/null
+++ b/CODE_OF_CONDUCT.md
@@ -0,0 +1,9 @@
+# Microsoft Open Source Code of Conduct
+
+This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
+
+Resources:
+
+- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/)
+- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
+- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns
diff --git a/README.md b/README.md
index 78d53ade..cbb3a961 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,3 @@
-
# Azure AI Samples
[](LICENSE)
@@ -7,9 +6,66 @@ Welcome to the Azure AI Samples repository!
This repository acts as the top-level directory for official Azure AI sample code and examples. It includes notebooks and sample code that contain end-to-end samples as well as smaller code snippets for common developer tasks.
-This repository is entirely open source, guidance on how to contribute and links to additional repositories are provided below.
+This repository is entirely open source, and guidance on how to contribute and links to additional repositories are provided below. Use the samples in this repository to try out Azure AI scenarios on your local machine!
+
+---
+
+# 🤖 Azure AI Agent Service 🤖
+
+| [**Get started**](./quickstart.md) | [**Samples**](./samples/) |
+
+Build fast, secure enterprise AI Agents to automate any business workflow.
+
+---
+
+## What is the Azure AI Agent Service?
+
+Azure AI Agent Service is a fully-managed service designed to empower developers to securely build, deploy, and scale high-quality, extensible AI agents. Leveraging an extensive ecosystem of models, tools, and capabilities from OpenAI, Microsoft, and third-party providers, Azure AI Agent Service enables building agents for a wide range of generative AI use cases.
+
+## Highlights
+
+### Enterprise-grade security
+
+Ensure data privacy and compliance with secure data handling and no public egress. Azure AI Agent Service provides features like:
+
+- Bring your own Azure Storage Account
+- Bring your own VNET (coming soon)
+- Keyless setup and authentication
+- No public egress
+- Built-in conversation state management
+- On-behalf-of authentication support for agents (coming soon)
+- Monitor agent performance with OpenTelemetry-based tracing (coming soon)
+- Build responsibly with content filters and XPIA (Cross Prompt Injection Attack) mitigation
+
+### Rapid development and automation
+
+Quickly build enterprise-grade AI agents with a user-friendly interface and comprehensive toolset, including:
+
+- Pre-built tools for advanced data analysis and RAG
+- Integration with Azure Logic Apps (1400+ built-in connectors)
+- Custom tools with OpenAPI 3.0 specifications (managed identity support)
+- Stateless or stateful code-based actions with Azure Functions (coming soon)
+- Advanced data analysis, code creation, and rich data visualization with Code Interpreter
+- Wire-compatible with Azure OpenAI Assistants API
+
+### Extensive data connections
+
+Ground your AI agents with secure enterprise knowledge from a variety of data sources:
+
+- Bing Search
+- SharePoint (coming soon)
+- Local Files
+- Microsoft Fabric (coming soon)
+- Azure Blob Storage (coming soon)
-Use the samples in this repository to try out Azure AI scenarios on your local machine!
+### Flexible model selection
+
+Leverage the best model for the job, including GPT-4o, Llama 3, and more, allowing developers to optimize AI agent performance. Supported features:
+
+- Models from the Azure AI model catalog (OpenAI, Meta, and more)
+- Full parity with Azure OpenAI Service regional availability
+
+---
## Supplementary Documentation
@@ -17,70 +73,65 @@ Use the samples in this repository to try out Azure AI scenarios on your local m
#### Azure AI Studio
-* **[Azure/aistudio-copilot-sample]** - Quickstart repo for building an enterprise chat copilot in Azure AI Studio.
-* **[Azure-Samples/contoso-chat](https://github.com/Azure-Samples/contoso-chat)** - End-to-end solution sample for a custom RAG-based retail copilot built code-first with Prompty & Azure AI Studio.
-* **[Azure-Samples/contoso-creative-writer](https://github.com/Azure-Samples/contoso-creative-writer)** - End-to-end solution sample for a custom multi-agent creative writer solution built code-first with Prompty & Azure AI Studio.
+- **[Azure/aistudio-copilot-sample](https://github.com/Azure/aistudio-copilot-sample)**: Quickstart repo for building an enterprise chat copilot in Azure AI Studio.
+- **[Azure-Samples/contoso-chat](https://github.com/Azure-Samples/contoso-chat)**: Custom RAG-based retail copilot built code-first with Prompty & Azure AI Studio.
+- **[Azure-Samples/contoso-creative-writer](https://github.com/Azure-Samples/contoso-creative-writer)**: Custom multi-agent creative writer solution built code-first with Prompty & Azure AI Studio.
#### Azure AI Search
-* **[Azure-Samples/azure-search-openai-demo]** - Repo containing end to end samples for running the Retrieval
- Augmented Generation pattern across data using Python.
-* **[Azure-Samples/azure-search-openai-javascript]** - Repo containing end to end samples for running the Retrieval
- Augmented Generation pattern across data using JavaScript.
-* **[Azure-Samples/azure-search-openai-demo-csharp]** - Repo containing end to end samples for running the Retrieval
- Augmented Generation pattern across data using .NET.
-* **[Azure-Samples/azure-search-openai-demo-java]** - Repo containing end to end samples for running the Retrieval
- Augmented Generation pattern across data using Java.
-* **[Azure-Samples/langchainjs-quickstart-demo]** - Sample showing how to quickly develop generative AI apps using LangChain.js, starting with Ollama and local models and transition to Azure for production.
-* **[Azure-Samples/azure-openai-rag-workshop]** - Repo contains both a sample and a step-by-step workshop on how to build a custom chatbot with Retrieval
- Augmented Generation using JavaScript.
+- **[Azure-Samples/azure-search-openai-demo](https://github.com/Azure-Samples/azure-search-openai-demo)**: Python-based RAG samples.
+- **[Azure-Samples/azure-search-openai-javascript](https://github.com/Azure-Samples/azure-search-openai-javascript)**: JavaScript-based RAG samples.
+- **[Azure-Samples/azure-search-openai-demo-csharp](https://github.com/Azure-Samples/azure-search-openai-demo-csharp)**: .NET-based RAG samples.
+- **[Azure-Samples/azure-search-openai-demo-java](https://github.com/Azure-Samples/azure-search-openai-demo-java)**: Java-based RAG samples.
+- **[Azure-Samples/langchainjs-quickstart-demo](https://github.com/Azure-Samples/langchainjs-quickstart-demo)**: Build generative AI apps using LangChain.js.
+- **[Azure-Samples/azure-openai-rag-workshop](https://github.com/Azure-Samples/azure-openai-rag-workshop/tree/base)**: Custom chatbot workshop using RAG.
#### Azure AI Assistant
-* **[Azure-Samples/azure-ai-assistant-tool]** - Repo containing the Azure AI Assistant Tool and Python middleware libraries for quick experimentation, testing, and debugging of Azure OpenAI assistants in your local environment.
+
+- **[Azure-Samples/azure-ai-assistant-tool](https://github.com/Azure-Samples/azureai-assistant-tool)**: Tools and libraries for Azure OpenAI assistants.
#### Copilot
-* **[microsoft/chat-copilot]** - Sample showing how to build LLM chat copilot.
+- **[microsoft/chat-copilot](https://github.com/microsoft/chat-copilot)**: Build LLM chat copilots.
#### OpenAI
-* **[openai/openai-cookbook]** - Example code for common tasks within OpenAI.
-* **[Azure-Samples/serverless-chat-langchainjs](https://github.com/Azure-Samples/serverless-chat-langchainjs)** - Sample implementing a serverless ChatGPT with Retrieval-Augmented-Generation using LangChain.js, that can run locally with Ollama and Mistral 7B.
+- **[openai/openai-cookbook](https://github.com/openai/openai-cookbook/tree/main/examples)**: Common OpenAI task examples.
+- **[Azure-Samples/serverless-chat-langchainjs](https://github.com/Azure-Samples/serverless-chat-langchainjs)**: Serverless ChatGPT with RAG using LangChain.js.
-#### Phi
-* **[https://aka.ms/phi-3cookbook]** - Examples and code for common tasks using the Phi Family of Small Language Models.
-
-## Contributing
+#### Phi
-We welcome contributions and suggestions! Please see the [contributing guidelines] for details.
+- **[Phi 3 Cookbook](https://aka.ms/phi-3cookbook)**: Examples for Phi Family models.
-## Code of Conduct
-
-This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). Please see the [code of conduct](CODE_OF_CONDUCT.md) for details.
+---
## Getting Help
### Issues
-If you find a bug in the source code or a mistake in the documentation, feel free to [submit bug report][new issue page]
-. Or you could submit a pull request with a fix.
+If you find a bug in the source code or a mistake in the documentation, feel free to [submit a bug report](https://github.com/Azure-Samples/azureai-samples/issues/new/choose). You can also submit a pull request with a fix.
### Feature Requests
-If there's an sample that you'd like to see added, feel free to file a [Feature Request][new issue page].
-
-If you'd like to implement it yourself, please refer to our [contributing guidelines].
-
-[Azure/aistudio-copilot-sample]: https://github.com/Azure/aistudio-copilot-sample
-[Azure-Samples/azure-search-openai-demo]: https://github.com/Azure-Samples/azure-search-openai-demo
-[Azure-Samples/azure-search-openai-javascript]: https://github.com/Azure-Samples/azure-search-openai-javascript
-[Azure-Samples/azure-search-openai-demo-csharp]: https://github.com/Azure-Samples/azure-search-openai-demo-csharp
-[Azure-Samples/azure-search-openai-demo-java]: https://github.com/Azure-Samples/azure-search-openai-demo-java
-[Azure-Samples/langchainjs-quickstart-demo]: https://github.com/Azure-Samples/langchainjs-quickstart-demo
-[Azure-Samples/azure-openai-rag-workshop]: https://github.com/Azure-Samples/azure-openai-rag-workshop/tree/base
-[Azure-Samples/azure-ai-assistant-tool]: https://github.com/Azure-Samples/azureai-assistant-tool
-[contributing guidelines]: ./CONTRIBUTING.md
-[microsoft/chat-copilot]: https://github.com/microsoft/chat-copilot
-[new issue page]: https://github.com/Azure-Samples/azureai-samples/issues/new/choose
-[openai/openai-cookbook]: https://github.com/openai/openai-cookbook/tree/main/examples
-[Azure-Samples/serverless-chat-langchainjs]: https://github.com/Azure-Samples/serverless-chat-langchainjs
+If there’s a sample you’d like to see added, file a [Feature Request](https://github.com/Azure-Samples/azureai-samples/issues/new/choose).
+
+---
+
+## Feedback
+
+Send us your feedback at: [https://aka.ms/azureagents-feedback](https://aka.ms/azureagents-feedback).
+
+## Contributing
+
+We welcome contributions and suggestions! Please see the [contributing guidelines](./CONTRIBUTING.md) for details.
+
+This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information, see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or comments.
+
+---
+
+## Trademarks
+
+This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to [Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general). Use of third-party trademarks or logos is subject to those third-party's policies.
+
+---
+
diff --git a/SECURITY.md b/SECURITY.md
new file mode 100644
index 00000000..b3c89efc
--- /dev/null
+++ b/SECURITY.md
@@ -0,0 +1,41 @@
+
+
+## Security
+
+Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet) and [Xamarin](https://github.com/xamarin).
+
+If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/security.md/definition), please report it to us as described below.
+
+## Reporting Security Issues
+
+**Please do not report security vulnerabilities through public GitHub issues.**
+
+Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/security.md/msrc/create-report).
+
+If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/security.md/msrc/pgp).
+
+You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc).
+
+Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
+
+ * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
+ * Full paths of source file(s) related to the manifestation of the issue
+ * The location of the affected source code (tag/branch/commit or direct URL)
+ * Any special configuration required to reproduce the issue
+ * Step-by-step instructions to reproduce the issue
+ * Proof-of-concept or exploit code (if possible)
+ * Impact of the issue, including how an attacker might exploit the issue
+
+This information will help us triage your report more quickly.
+
+If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/security.md/msrc/bounty) page for more details about our active programs.
+
+## Preferred Languages
+
+We prefer all communications to be in English.
+
+## Policy
+
+Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/security.md/cvd).
+
+
diff --git a/SUPPORT.md b/SUPPORT.md
new file mode 100644
index 00000000..291d4d43
--- /dev/null
+++ b/SUPPORT.md
@@ -0,0 +1,25 @@
+# TODO: The maintainer of this repo has not yet edited this file
+
+**REPO OWNER**: Do you want Customer Service & Support (CSS) support for this product/project?
+
+- **No CSS support:** Fill out this template with information about how to file issues and get help.
+- **Yes CSS support:** Fill out an intake form at [aka.ms/onboardsupport](https://aka.ms/onboardsupport). CSS will work with/help you to determine next steps.
+- **Not sure?** Fill out an intake as though the answer were "Yes". CSS will help you decide.
+
+*Then remove this first heading from this SUPPORT.MD file before publishing your repo.*
+
+# Support
+
+## How to file issues and get help
+
+This project uses GitHub Issues to track bugs and feature requests. Please search the existing
+issues before filing new issues to avoid duplicates. For new issues, file your bug or
+feature request as a new Issue.
+
+For help and questions about using this project, please **REPO MAINTAINER: INSERT INSTRUCTIONS HERE
+FOR HOW TO ENGAGE REPO OWNERS OR COMMUNITY FOR HELP. COULD BE A STACK OVERFLOW TAG OR OTHER
+CHANNEL. WHERE WILL YOU HELP PEOPLE?**.
+
+## Microsoft Support Policy
+
+Support for this **PROJECT or PRODUCT** is limited to the resources listed above.
diff --git a/basic-agent-identity.bicep b/basic-agent-identity.bicep
new file mode 100644
index 00000000..4f846716
--- /dev/null
+++ b/basic-agent-identity.bicep
@@ -0,0 +1,115 @@
+// Execute this main file to depoy Azure AI studio resources in the standard agent configuraiton wit Managed Identity
+
+// Parameters
+@minLength(2)
+@maxLength(12)
+@description('Name for the AI resource and used to derive name of dependent resources.')
+param aiHubName string = 'standard-hub'
+
+@description('Friendly name for your Azure AI resource')
+param aiHubFriendlyName string = 'Agents standard hub resource'
+
+@description('Description of your Azure AI resource dispayed in AI studio')
+param aiHubDescription string = 'A standard hub resource required for the agent setup.'
+
+@description('Name for the project')
+param aiProjectName string = 'standard-project'
+
+@description('Friendly name for your Azure AI project resource')
+param aiProjectFriendlyName string = 'Agents standard project resource'
+
+@description('Description of your Azure AI project resource dispayed in AI studio')
+param aiProjectDescription string = 'A standard project resource required for the agent setup.'
+
+@description('Azure region used for the deployment of all resources.')
+param location string = resourceGroup().location
+
+@description('Set of tags to apply to all resources.')
+param tags object = {}
+
+@description('Model name for deployment')
+param modelName string = 'gpt-4o-mini'
+
+@description('Model format for deployment')
+param modelFormat string = 'OpenAI'
+
+@description('Model version for deployment')
+param modelVersion string = '2024-07-18'
+
+@description('Model deployment SKU name')
+param modelSkuName string = 'GlobalStandard'
+
+@description('Model deployment capacity')
+param modelCapacity int = 50
+
+@description('Model deployment location. If you want to deploy an Azure AI resource/model in different location than the rest of the resources created.')
+param modelLocation string = 'eastus'
+
+// Variables
+var name = toLower('${aiHubName}')
+var projectName = toLower('${aiProjectName}')
+
+@description('Name of the storage account')
+param storageName string = 'agent-storage'
+
+@description('Name of the Azure AI Services account')
+param aiServicesName string = 'agent-ai-services'
+
+
+// Create a short, unique suffix, that will be unique to each resource group
+// var uniqueSuffix = substring(uniqueString(resourceGroup().id), 0, 4)
+param deploymentTimestamp string = utcNow('yyyyMMddHHmmss')
+var uniqueSuffix = substring(uniqueString('${resourceGroup().id}-${deploymentTimestamp}'), 0, 4)
+
+// Dependent resources for the Azure Machine Learning workspace
+module aiDependencies 'modules-basic/basic-dependent-resources.bicep' = {
+ name: 'dependencies-${name}-${uniqueSuffix}-deployment'
+ params: {
+ aiServicesName: '${aiServicesName}${uniqueSuffix}'
+ storageName: '${storageName}${uniqueSuffix}'
+ location: location
+ tags: tags
+
+ // Model deployment parameters
+ modelName: modelName
+ modelFormat: modelFormat
+ modelVersion: modelVersion
+ modelSkuName: modelSkuName
+ modelCapacity: modelCapacity
+ modelLocation: modelLocation
+ }
+}
+
+module aiHub 'modules-basic/basic-ai-hub-identity.bicep' = {
+ name: 'ai-${name}-${uniqueSuffix}-deployment'
+ params: {
+ // workspace organization
+ aiHubName: 'ai-${name}-${uniqueSuffix}'
+ aiHubFriendlyName: aiHubFriendlyName
+ aiHubDescription: aiHubDescription
+ location: location
+ tags: tags
+
+ // dependent resources
+ modelLocation: modelLocation
+ storageAccountId: aiDependencies.outputs.storageId
+ aiServicesId: aiDependencies.outputs.aiservicesID
+ aiServicesTarget: aiDependencies.outputs.aiservicesTarget
+ }
+}
+
+module aiProject 'modules-basic/basic-ai-project-identity.bicep' = {
+ name: 'ai-${projectName}-${uniqueSuffix}-deployment'
+ params: {
+ // workspace organization
+ aiProjectName: 'ai-${projectName}-${uniqueSuffix}'
+ aiProjectFriendlyName: aiProjectFriendlyName
+ aiProjectDescription: aiProjectDescription
+ location: location
+ tags: tags
+
+ // dependent resources
+ aiServicesName: '${aiServicesName}${uniqueSuffix}'
+ aiHubId: aiHub.outputs.aiHubID
+ }
+}
diff --git a/basic-agent-identity.json b/basic-agent-identity.json
new file mode 100644
index 00000000..a22f97b6
--- /dev/null
+++ b/basic-agent-identity.json
@@ -0,0 +1,692 @@
+{
+ "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
+ "contentVersion": "1.0.0.0",
+ "metadata": {
+ "_generator": {
+ "name": "bicep",
+ "version": "0.31.92.45157",
+ "templateHash": "3607113709869687219"
+ }
+ },
+ "parameters": {
+ "aiHubName": {
+ "type": "string",
+ "defaultValue": "standard-hub",
+ "minLength": 2,
+ "maxLength": 12,
+ "metadata": {
+ "description": "Name for the AI resource and used to derive name of dependent resources."
+ }
+ },
+ "aiHubFriendlyName": {
+ "type": "string",
+ "defaultValue": "Agents standard hub resource",
+ "metadata": {
+ "description": "Friendly name for your Azure AI resource"
+ }
+ },
+ "aiHubDescription": {
+ "type": "string",
+ "defaultValue": "A standard hub resource required for the agent setup.",
+ "metadata": {
+ "description": "Description of your Azure AI resource dispayed in AI studio"
+ }
+ },
+ "aiProjectName": {
+ "type": "string",
+ "defaultValue": "standard-project",
+ "metadata": {
+ "description": "Name for the project"
+ }
+ },
+ "aiProjectFriendlyName": {
+ "type": "string",
+ "defaultValue": "Agents standard project resource",
+ "metadata": {
+ "description": "Friendly name for your Azure AI project resource"
+ }
+ },
+ "aiProjectDescription": {
+ "type": "string",
+ "defaultValue": "A standard project resource required for the agent setup.",
+ "metadata": {
+ "description": "Description of your Azure AI project resource dispayed in AI studio"
+ }
+ },
+ "location": {
+ "type": "string",
+ "defaultValue": "[resourceGroup().location]",
+ "metadata": {
+ "description": "Azure region used for the deployment of all resources."
+ }
+ },
+ "tags": {
+ "type": "object",
+ "defaultValue": {},
+ "metadata": {
+ "description": "Set of tags to apply to all resources."
+ }
+ },
+ "modelName": {
+ "type": "string",
+ "defaultValue": "gpt-4o-mini",
+ "metadata": {
+ "description": "Model name for deployment"
+ }
+ },
+ "modelFormat": {
+ "type": "string",
+ "defaultValue": "OpenAI",
+ "metadata": {
+ "description": "Model format for deployment"
+ }
+ },
+ "modelVersion": {
+ "type": "string",
+ "defaultValue": "2024-07-18",
+ "metadata": {
+ "description": "Model version for deployment"
+ }
+ },
+ "modelSkuName": {
+ "type": "string",
+ "defaultValue": "GlobalStandard",
+ "metadata": {
+ "description": "Model deployment SKU name"
+ }
+ },
+ "modelCapacity": {
+ "type": "int",
+ "defaultValue": 50,
+ "metadata": {
+ "description": "Model deployment capacity"
+ }
+ },
+ "modelLocation": {
+ "type": "string",
+ "defaultValue": "eastus",
+ "metadata": {
+ "description": "Model deployment location. If you want to deploy an Azure AI resource/model in different location than the rest of the resources created."
+ }
+ },
+ "storageName": {
+ "type": "string",
+ "defaultValue": "agent-storage",
+ "metadata": {
+ "description": "Name of the storage account"
+ }
+ },
+ "aiServicesName": {
+ "type": "string",
+ "defaultValue": "agent-ai-services",
+ "metadata": {
+ "description": "Name of the Azure AI Services account"
+ }
+ },
+ "deploymentTimestamp": {
+ "type": "string",
+ "defaultValue": "[utcNow('yyyyMMddHHmmss')]"
+ }
+ },
+ "variables": {
+ "name": "[toLower(format('{0}', parameters('aiHubName')))]",
+ "projectName": "[toLower(format('{0}', parameters('aiProjectName')))]",
+ "uniqueSuffix": "[substring(uniqueString(format('{0}-{1}', resourceGroup().id, parameters('deploymentTimestamp'))), 0, 4)]"
+ },
+ "resources": [
+ {
+ "type": "Microsoft.Resources/deployments",
+ "apiVersion": "2022-09-01",
+ "name": "[format('dependencies-{0}-{1}-deployment', variables('name'), variables('uniqueSuffix'))]",
+ "properties": {
+ "expressionEvaluationOptions": {
+ "scope": "inner"
+ },
+ "mode": "Incremental",
+ "parameters": {
+ "aiServicesName": {
+ "value": "[format('{0}{1}', parameters('aiServicesName'), variables('uniqueSuffix'))]"
+ },
+ "storageName": {
+ "value": "[format('{0}{1}', parameters('storageName'), variables('uniqueSuffix'))]"
+ },
+ "location": {
+ "value": "[parameters('location')]"
+ },
+ "tags": {
+ "value": "[parameters('tags')]"
+ },
+ "modelName": {
+ "value": "[parameters('modelName')]"
+ },
+ "modelFormat": {
+ "value": "[parameters('modelFormat')]"
+ },
+ "modelVersion": {
+ "value": "[parameters('modelVersion')]"
+ },
+ "modelSkuName": {
+ "value": "[parameters('modelSkuName')]"
+ },
+ "modelCapacity": {
+ "value": "[parameters('modelCapacity')]"
+ },
+ "modelLocation": {
+ "value": "[parameters('modelLocation')]"
+ }
+ },
+ "template": {
+ "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
+ "contentVersion": "1.0.0.0",
+ "metadata": {
+ "_generator": {
+ "name": "bicep",
+ "version": "0.31.92.45157",
+ "templateHash": "8251659815924226998"
+ }
+ },
+ "parameters": {
+ "location": {
+ "type": "string",
+ "defaultValue": "[resourceGroup().location]",
+ "metadata": {
+ "description": "Azure region of the deployment"
+ }
+ },
+ "tags": {
+ "type": "object",
+ "defaultValue": {},
+ "metadata": {
+ "description": "Tags to add to the resources"
+ }
+ },
+ "aiServicesName": {
+ "type": "string",
+ "metadata": {
+ "description": "AI services name"
+ }
+ },
+ "modelName": {
+ "type": "string",
+ "metadata": {
+ "description": "Model name for deployment"
+ }
+ },
+ "modelFormat": {
+ "type": "string",
+ "metadata": {
+ "description": "Model format for deployment"
+ }
+ },
+ "modelVersion": {
+ "type": "string",
+ "metadata": {
+ "description": "Model version for deployment"
+ }
+ },
+ "modelSkuName": {
+ "type": "string",
+ "metadata": {
+ "description": "Model deployment SKU name"
+ }
+ },
+ "modelCapacity": {
+ "type": "int",
+ "metadata": {
+ "description": "Model deployment capacity"
+ }
+ },
+ "modelLocation": {
+ "type": "string",
+ "metadata": {
+ "description": "Model/AI Resource deployment location"
+ }
+ },
+ "storageName": {
+ "type": "string",
+ "metadata": {
+ "description": "Name of the storage account"
+ }
+ },
+ "storageSkuName": {
+ "type": "string",
+ "defaultValue": "Standard_LRS",
+ "allowedValues": [
+ "Standard_LRS",
+ "Standard_ZRS",
+ "Standard_GRS",
+ "Standard_GZRS",
+ "Standard_RAGRS",
+ "Standard_RAGZRS",
+ "Premium_LRS",
+ "Premium_ZRS"
+ ],
+ "metadata": {
+ "description": "Storage SKU"
+ }
+ }
+ },
+ "variables": {
+ "storageNameCleaned": "[replace(parameters('storageName'), '-', '')]"
+ },
+ "resources": [
+ {
+ "type": "Microsoft.CognitiveServices/accounts",
+ "apiVersion": "2024-06-01-preview",
+ "name": "[parameters('aiServicesName')]",
+ "location": "[parameters('modelLocation')]",
+ "sku": {
+ "name": "S0"
+ },
+ "kind": "AIServices",
+ "identity": {
+ "type": "SystemAssigned"
+ },
+ "properties": {
+ "customSubDomainName": "[toLower(format('{0}', toLower(parameters('aiServicesName'))))]",
+ "apiProperties": {
+ "statisticsEnabled": false
+ },
+ "publicNetworkAccess": "Enabled"
+ }
+ },
+ {
+ "type": "Microsoft.CognitiveServices/accounts/deployments",
+ "apiVersion": "2024-06-01-preview",
+ "name": "[format('{0}/{1}', parameters('aiServicesName'), parameters('modelName'))]",
+ "sku": {
+ "capacity": "[parameters('modelCapacity')]",
+ "name": "[parameters('modelSkuName')]"
+ },
+ "properties": {
+ "model": {
+ "name": "[parameters('modelName')]",
+ "format": "[parameters('modelFormat')]",
+ "version": "[parameters('modelVersion')]"
+ }
+ },
+ "dependsOn": [
+ "[resourceId('Microsoft.CognitiveServices/accounts', parameters('aiServicesName'))]"
+ ]
+ },
+ {
+ "type": "Microsoft.Storage/storageAccounts",
+ "apiVersion": "2023-05-01",
+ "name": "[variables('storageNameCleaned')]",
+ "location": "[parameters('location')]",
+ "tags": "[parameters('tags')]",
+ "sku": {
+ "name": "[parameters('storageSkuName')]"
+ },
+ "kind": "StorageV2",
+ "properties": {
+ "accessTier": "Hot",
+ "allowBlobPublicAccess": false,
+ "allowCrossTenantReplication": false,
+ "allowSharedKeyAccess": true,
+ "encryption": {
+ "keySource": "Microsoft.Storage",
+ "requireInfrastructureEncryption": false,
+ "services": {
+ "blob": {
+ "enabled": true,
+ "keyType": "Account"
+ },
+ "file": {
+ "enabled": true,
+ "keyType": "Account"
+ },
+ "queue": {
+ "enabled": true,
+ "keyType": "Service"
+ },
+ "table": {
+ "enabled": true,
+ "keyType": "Service"
+ }
+ }
+ },
+ "isHnsEnabled": false,
+ "isNfsV3Enabled": false,
+ "keyPolicy": {
+ "keyExpirationPeriodInDays": 7
+ },
+ "largeFileSharesState": "Disabled",
+ "minimumTlsVersion": "TLS1_2",
+ "networkAcls": {
+ "bypass": "AzureServices",
+ "defaultAction": "Deny"
+ },
+ "supportsHttpsTrafficOnly": true
+ }
+ }
+ ],
+ "outputs": {
+ "aiservicesID": {
+ "type": "string",
+ "value": "[resourceId('Microsoft.CognitiveServices/accounts', parameters('aiServicesName'))]"
+ },
+ "aiservicesTarget": {
+ "type": "string",
+ "value": "[reference(resourceId('Microsoft.CognitiveServices/accounts', parameters('aiServicesName')), '2024-06-01-preview').endpoint]"
+ },
+ "storageId": {
+ "type": "string",
+ "value": "[resourceId('Microsoft.Storage/storageAccounts', variables('storageNameCleaned'))]"
+ }
+ }
+ }
+ }
+ },
+ {
+ "type": "Microsoft.Resources/deployments",
+ "apiVersion": "2022-09-01",
+ "name": "[format('ai-{0}-{1}-deployment', variables('name'), variables('uniqueSuffix'))]",
+ "properties": {
+ "expressionEvaluationOptions": {
+ "scope": "inner"
+ },
+ "mode": "Incremental",
+ "parameters": {
+ "aiHubName": {
+ "value": "[format('ai-{0}-{1}', variables('name'), variables('uniqueSuffix'))]"
+ },
+ "aiHubFriendlyName": {
+ "value": "[parameters('aiHubFriendlyName')]"
+ },
+ "aiHubDescription": {
+ "value": "[parameters('aiHubDescription')]"
+ },
+ "location": {
+ "value": "[parameters('location')]"
+ },
+ "tags": {
+ "value": "[parameters('tags')]"
+ },
+ "modelLocation": {
+ "value": "[parameters('modelLocation')]"
+ },
+ "storageAccountId": {
+ "value": "[reference(resourceId('Microsoft.Resources/deployments', format('dependencies-{0}-{1}-deployment', variables('name'), variables('uniqueSuffix'))), '2022-09-01').outputs.storageId.value]"
+ },
+ "aiServicesId": {
+ "value": "[reference(resourceId('Microsoft.Resources/deployments', format('dependencies-{0}-{1}-deployment', variables('name'), variables('uniqueSuffix'))), '2022-09-01').outputs.aiservicesID.value]"
+ },
+ "aiServicesTarget": {
+ "value": "[reference(resourceId('Microsoft.Resources/deployments', format('dependencies-{0}-{1}-deployment', variables('name'), variables('uniqueSuffix'))), '2022-09-01').outputs.aiservicesTarget.value]"
+ }
+ },
+ "template": {
+ "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
+ "contentVersion": "1.0.0.0",
+ "metadata": {
+ "_generator": {
+ "name": "bicep",
+ "version": "0.31.92.45157",
+ "templateHash": "5580448247188524490"
+ }
+ },
+ "parameters": {
+ "location": {
+ "type": "string",
+ "metadata": {
+ "description": "Azure region of the deployment"
+ }
+ },
+ "tags": {
+ "type": "object",
+ "metadata": {
+ "description": "Tags to add to the resources"
+ }
+ },
+ "aiHubName": {
+ "type": "string",
+ "metadata": {
+ "description": "AI hub name"
+ }
+ },
+ "aiHubFriendlyName": {
+ "type": "string",
+ "defaultValue": "[parameters('aiHubName')]",
+ "metadata": {
+ "description": "AI hub display name"
+ }
+ },
+ "aiHubDescription": {
+ "type": "string",
+ "metadata": {
+ "description": "AI hub description"
+ }
+ },
+ "storageAccountId": {
+ "type": "string",
+ "metadata": {
+ "description": "Resource ID of the storage account resource for storing experimentation outputs"
+ }
+ },
+ "aiServicesId": {
+ "type": "string",
+ "metadata": {
+ "description": "Resource ID of the AI Services resource"
+ }
+ },
+ "aiServicesTarget": {
+ "type": "string",
+ "metadata": {
+ "description": "Resource ID of the AI Services endpoint"
+ }
+ },
+ "modelLocation": {
+ "type": "string",
+ "metadata": {
+ "description": "Model/AI Resource deployment location"
+ }
+ }
+ },
+ "resources": [
+ {
+ "type": "Microsoft.MachineLearningServices/workspaces/connections",
+ "apiVersion": "2024-07-01-preview",
+ "name": "[format('{0}/{1}', parameters('aiHubName'), format('{0}-connection-AIServices', parameters('aiHubName')))]",
+ "properties": {
+ "category": "AIServices",
+ "target": "[parameters('aiServicesTarget')]",
+ "authType": "AAD",
+ "isSharedToAll": true,
+ "metadata": {
+ "ApiType": "Azure",
+ "ResourceId": "[parameters('aiServicesId')]",
+ "Location": "[parameters('modelLocation')]"
+ }
+ },
+ "dependsOn": [
+ "[resourceId('Microsoft.MachineLearningServices/workspaces', parameters('aiHubName'))]"
+ ]
+ },
+ {
+ "type": "Microsoft.MachineLearningServices/workspaces",
+ "apiVersion": "2024-07-01-preview",
+ "name": "[parameters('aiHubName')]",
+ "location": "[parameters('location')]",
+ "tags": "[parameters('tags')]",
+ "identity": {
+ "type": "SystemAssigned"
+ },
+ "properties": {
+ "friendlyName": "[parameters('aiHubFriendlyName')]",
+ "description": "[parameters('aiHubDescription')]",
+ "storageAccount": "[parameters('storageAccountId')]"
+ },
+ "kind": "hub"
+ }
+ ],
+ "outputs": {
+ "aiHubID": {
+ "type": "string",
+ "value": "[resourceId('Microsoft.MachineLearningServices/workspaces', parameters('aiHubName'))]"
+ }
+ }
+ }
+ },
+ "dependsOn": [
+ "[resourceId('Microsoft.Resources/deployments', format('dependencies-{0}-{1}-deployment', variables('name'), variables('uniqueSuffix')))]"
+ ]
+ },
+ {
+ "type": "Microsoft.Resources/deployments",
+ "apiVersion": "2022-09-01",
+ "name": "[format('ai-{0}-{1}-deployment', variables('projectName'), variables('uniqueSuffix'))]",
+ "properties": {
+ "expressionEvaluationOptions": {
+ "scope": "inner"
+ },
+ "mode": "Incremental",
+ "parameters": {
+ "aiProjectName": {
+ "value": "[format('ai-{0}-{1}', variables('projectName'), variables('uniqueSuffix'))]"
+ },
+ "aiProjectFriendlyName": {
+ "value": "[parameters('aiProjectFriendlyName')]"
+ },
+ "aiProjectDescription": {
+ "value": "[parameters('aiProjectDescription')]"
+ },
+ "location": {
+ "value": "[parameters('location')]"
+ },
+ "tags": {
+ "value": "[parameters('tags')]"
+ },
+ "aiServicesName": {
+ "value": "[format('{0}{1}', parameters('aiServicesName'), variables('uniqueSuffix'))]"
+ },
+ "aiHubId": {
+ "value": "[reference(resourceId('Microsoft.Resources/deployments', format('ai-{0}-{1}-deployment', variables('name'), variables('uniqueSuffix'))), '2022-09-01').outputs.aiHubID.value]"
+ }
+ },
+ "template": {
+ "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
+ "contentVersion": "1.0.0.0",
+ "metadata": {
+ "_generator": {
+ "name": "bicep",
+ "version": "0.31.92.45157",
+ "templateHash": "18235459759430841665"
+ }
+ },
+ "parameters": {
+ "location": {
+ "type": "string",
+ "metadata": {
+ "description": "Azure region of the deployment"
+ }
+ },
+ "tags": {
+ "type": "object",
+ "metadata": {
+ "description": "Tags to add to the resources"
+ }
+ },
+ "aiProjectName": {
+ "type": "string",
+ "metadata": {
+ "description": "AI Project name"
+ }
+ },
+ "aiProjectFriendlyName": {
+ "type": "string",
+ "defaultValue": "[parameters('aiProjectName')]",
+ "metadata": {
+ "description": "AI Project display name"
+ }
+ },
+ "aiProjectDescription": {
+ "type": "string",
+ "metadata": {
+ "description": "AI Project description"
+ }
+ },
+ "aiHubId": {
+ "type": "string",
+ "metadata": {
+ "description": "Resource ID of the AI Hub resource"
+ }
+ },
+ "aiServicesName": {
+ "type": "string"
+ }
+ },
+ "resources": [
+ {
+ "type": "Microsoft.MachineLearningServices/workspaces",
+ "apiVersion": "2023-08-01-preview",
+ "name": "[parameters('aiProjectName')]",
+ "location": "[parameters('location')]",
+ "tags": "[parameters('tags')]",
+ "identity": {
+ "type": "SystemAssigned"
+ },
+ "properties": {
+ "friendlyName": "[parameters('aiProjectFriendlyName')]",
+ "description": "[parameters('aiProjectDescription')]",
+ "hubResourceId": "[parameters('aiHubId')]"
+ },
+ "kind": "project"
+ },
+ {
+ "type": "Microsoft.Authorization/roleAssignments",
+ "apiVersion": "2022-04-01",
+ "scope": "[format('Microsoft.CognitiveServices/accounts/{0}', parameters('aiServicesName'))]",
+ "name": "[guid(resourceId('Microsoft.MachineLearningServices/workspaces', parameters('aiProjectName')), resourceId('Microsoft.Authorization/roleDefinitions', '25fbc0a9-bd7c-42a3-aa1a-3b75d497ee68'), resourceId('Microsoft.CognitiveServices/accounts', parameters('aiServicesName')))]",
+ "properties": {
+ "principalId": "[reference(resourceId('Microsoft.MachineLearningServices/workspaces', parameters('aiProjectName')), '2023-08-01-preview', 'full').identity.principalId]",
+ "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', '25fbc0a9-bd7c-42a3-aa1a-3b75d497ee68')]",
+ "principalType": "ServicePrincipal"
+ },
+ "dependsOn": [
+ "[resourceId('Microsoft.MachineLearningServices/workspaces', parameters('aiProjectName'))]"
+ ]
+ },
+ {
+ "type": "Microsoft.Authorization/roleAssignments",
+ "apiVersion": "2022-04-01",
+ "scope": "[format('Microsoft.CognitiveServices/accounts/{0}', parameters('aiServicesName'))]",
+ "name": "[guid(resourceId('Microsoft.MachineLearningServices/workspaces', parameters('aiProjectName')), resourceId('Microsoft.Authorization/roleDefinitions', '5e0bd9bd-7b93-4f28-af87-19fc36ad61bd'), resourceId('Microsoft.CognitiveServices/accounts', parameters('aiServicesName')))]",
+ "properties": {
+ "principalId": "[reference(resourceId('Microsoft.MachineLearningServices/workspaces', parameters('aiProjectName')), '2023-08-01-preview', 'full').identity.principalId]",
+ "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', '5e0bd9bd-7b93-4f28-af87-19fc36ad61bd')]",
+ "principalType": "ServicePrincipal"
+ },
+ "dependsOn": [
+ "[resourceId('Microsoft.MachineLearningServices/workspaces', parameters('aiProjectName'))]"
+ ]
+ },
+ {
+ "type": "Microsoft.Authorization/roleAssignments",
+ "apiVersion": "2022-04-01",
+ "scope": "[format('Microsoft.CognitiveServices/accounts/{0}', parameters('aiServicesName'))]",
+ "name": "[guid(resourceId('Microsoft.MachineLearningServices/workspaces', parameters('aiProjectName')), resourceId('Microsoft.Authorization/roleDefinitions', 'a97b65f3-24c7-4388-baec-2e87135dc908'), resourceId('Microsoft.CognitiveServices/accounts', parameters('aiServicesName')))]",
+ "properties": {
+ "principalId": "[reference(resourceId('Microsoft.MachineLearningServices/workspaces', parameters('aiProjectName')), '2023-08-01-preview', 'full').identity.principalId]",
+ "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', 'a97b65f3-24c7-4388-baec-2e87135dc908')]",
+ "principalType": "ServicePrincipal"
+ },
+ "dependsOn": [
+ "[resourceId('Microsoft.MachineLearningServices/workspaces', parameters('aiProjectName'))]"
+ ]
+ }
+ ],
+ "outputs": {
+ "aiProjectID": {
+ "type": "string",
+ "value": "[resourceId('Microsoft.MachineLearningServices/workspaces', parameters('aiProjectName'))]"
+ }
+ }
+ }
+ },
+ "dependsOn": [
+ "[resourceId('Microsoft.Resources/deployments', format('ai-{0}-{1}-deployment', variables('name'), variables('uniqueSuffix')))]"
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/basic-agent-keys.bicep b/basic-agent-keys.bicep
new file mode 100644
index 00000000..65a43185
--- /dev/null
+++ b/basic-agent-keys.bicep
@@ -0,0 +1,113 @@
+// Execute this main file to depoy Azure AI studio resources in the basic security configuraiton
+
+// Parameters
+@minLength(2)
+@maxLength(12)
+@description('Name for the AI resource and used to derive name of dependent resources.')
+param aiHubName string = 'standard-hub'
+
+@description('Friendly name for your Azure AI resource')
+param aiHubFriendlyName string = 'Agents standard hub resource'
+
+@description('Description of your Azure AI resource dispayed in AI studio')
+param aiHubDescription string = 'A standard hub resource required for the agent setup.'
+
+@description('Name for the project')
+param aiProjectName string = 'standard-project'
+
+@description('Friendly name for your Azure AI resource')
+param aiProjectFriendlyName string = 'Agents standard project resource'
+
+@description('Description of your Azure AI resource dispayed in AI studio')
+param aiProjectDescription string = 'A standard project resource required for the agent setup.'
+
+@description('Azure region used for the deployment of all resources.')
+param location string = resourceGroup().location
+
+@description('Set of tags to apply to all resources.')
+param tags object = {}
+
+@description('Model name for deployment')
+param modelName string = 'gpt-4o-mini'
+
+@description('Model format for deployment')
+param modelFormat string = 'OpenAI'
+
+@description('Model version for deployment')
+param modelVersion string = '2024-07-18'
+
+@description('Model deployment SKU name')
+param modelSkuName string = 'GlobalStandard'
+
+@description('Model deployment capacity')
+param modelCapacity int = 50
+
+@description('Model deployment location. If you want to deploy an Azure AI resource/model in different location than the rest of the resources created.')
+param modelLocation string = 'eastus'
+
+// Variables
+var name = toLower('${aiHubName}')
+var projectName = toLower('${aiProjectName}')
+
+@description('Name of the storage account')
+param storageName string = 'agent-storage'
+
+@description('Name of the Azure AI Services account')
+param aiServicesName string = 'agent-ai-services'
+
+// Create a short, unique suffix, that will be unique to each resource group
+// var uniqueSuffix = substring(uniqueString(resourceGroup().id), 0, 4)
+param deploymentTimestamp string = utcNow('yyyyMMddHHmmss')
+var uniqueSuffix = substring(uniqueString('${resourceGroup().id}-${deploymentTimestamp}'), 0, 4)
+
+// Dependent resources for the Azure Machine Learning workspace
+module aiDependencies 'modules-basic/basic-dependent-resources.bicep' = {
+ name: 'dependencies-${name}-${uniqueSuffix}-deployment'
+ params: {
+ aiServicesName: '${aiServicesName}${uniqueSuffix}'
+ storageName: '${storageName}${uniqueSuffix}'
+ location: location
+ tags: tags
+
+ // Model deployment parameters
+ modelName: modelName
+ modelFormat: modelFormat
+ modelVersion: modelVersion
+ modelSkuName: modelSkuName
+ modelCapacity: modelCapacity
+ modelLocation: modelLocation
+ }
+}
+
+module aiHub 'modules-basic/basic-ai-hub-keys.bicep' = {
+ name: 'ai-${name}-${uniqueSuffix}-deployment'
+ params: {
+ // workspace organization
+ aiHubName: 'ai-${name}-${uniqueSuffix}'
+ aiHubFriendlyName: aiHubFriendlyName
+ aiHubDescription: aiHubDescription
+ location: location
+ tags: tags
+
+ // dependent resources
+ modelLocation: modelLocation
+ storageAccountId: aiDependencies.outputs.storageId
+ aiServicesId: aiDependencies.outputs.aiservicesID
+ aiServicesTarget: aiDependencies.outputs.aiservicesTarget
+ }
+}
+
+module aiProject 'modules-basic/basic-ai-project-keys.bicep' = {
+ name: 'ai-${projectName}-${uniqueSuffix}-deployment'
+ params: {
+ // workspace organization
+ aiProjectName: 'ai-${projectName}-${uniqueSuffix}'
+ aiProjectFriendlyName: aiProjectFriendlyName
+ aiProjectDescription: aiProjectDescription
+ location: location
+ tags: tags
+
+ // dependent resources
+ aiHubId: aiHub.outputs.aiHubID
+ }
+}
diff --git a/basic-agent-keys.json b/basic-agent-keys.json
new file mode 100644
index 00000000..30c980a4
--- /dev/null
+++ b/basic-agent-keys.json
@@ -0,0 +1,647 @@
+{
+ "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
+ "contentVersion": "1.0.0.0",
+ "metadata": {
+ "_generator": {
+ "name": "bicep",
+ "version": "0.31.92.45157",
+ "templateHash": "16944875249252966269"
+ }
+ },
+ "parameters": {
+ "aiHubName": {
+ "type": "string",
+ "defaultValue": "standard-hub",
+ "minLength": 2,
+ "maxLength": 12,
+ "metadata": {
+ "description": "Name for the AI resource and used to derive name of dependent resources."
+ }
+ },
+ "aiHubFriendlyName": {
+ "type": "string",
+ "defaultValue": "Agents standard hub resource",
+ "metadata": {
+ "description": "Friendly name for your Azure AI resource"
+ }
+ },
+ "aiHubDescription": {
+ "type": "string",
+ "defaultValue": "A standard hub resource required for the agent setup.",
+ "metadata": {
+ "description": "Description of your Azure AI resource dispayed in AI studio"
+ }
+ },
+ "aiProjectName": {
+ "type": "string",
+ "defaultValue": "standard-project",
+ "metadata": {
+ "description": "Name for the project"
+ }
+ },
+ "aiProjectFriendlyName": {
+ "type": "string",
+ "defaultValue": "Agents standard project resource",
+ "metadata": {
+ "description": "Friendly name for your Azure AI resource"
+ }
+ },
+ "aiProjectDescription": {
+ "type": "string",
+ "defaultValue": "A standard project resource required for the agent setup.",
+ "metadata": {
+ "description": "Description of your Azure AI resource dispayed in AI studio"
+ }
+ },
+ "location": {
+ "type": "string",
+ "defaultValue": "[resourceGroup().location]",
+ "metadata": {
+ "description": "Azure region used for the deployment of all resources."
+ }
+ },
+ "tags": {
+ "type": "object",
+ "defaultValue": {},
+ "metadata": {
+ "description": "Set of tags to apply to all resources."
+ }
+ },
+ "modelName": {
+ "type": "string",
+ "defaultValue": "gpt-4o-mini",
+ "metadata": {
+ "description": "Model name for deployment"
+ }
+ },
+ "modelFormat": {
+ "type": "string",
+ "defaultValue": "OpenAI",
+ "metadata": {
+ "description": "Model format for deployment"
+ }
+ },
+ "modelVersion": {
+ "type": "string",
+ "defaultValue": "2024-07-18",
+ "metadata": {
+ "description": "Model version for deployment"
+ }
+ },
+ "modelSkuName": {
+ "type": "string",
+ "defaultValue": "GlobalStandard",
+ "metadata": {
+ "description": "Model deployment SKU name"
+ }
+ },
+ "modelCapacity": {
+ "type": "int",
+ "defaultValue": 50,
+ "metadata": {
+ "description": "Model deployment capacity"
+ }
+ },
+ "modelLocation": {
+ "type": "string",
+ "defaultValue": "eastus",
+ "metadata": {
+ "description": "Model deployment location. If you want to deploy an Azure AI resource/model in different location than the rest of the resources created."
+ }
+ },
+ "storageName": {
+ "type": "string",
+ "defaultValue": "agent-storage",
+ "metadata": {
+ "description": "Name of the storage account"
+ }
+ },
+ "aiServicesName": {
+ "type": "string",
+ "defaultValue": "agent-ai-services",
+ "metadata": {
+ "description": "Name of the Azure AI Services account"
+ }
+ },
+ "deploymentTimestamp": {
+ "type": "string",
+ "defaultValue": "[utcNow('yyyyMMddHHmmss')]"
+ }
+ },
+ "variables": {
+ "name": "[toLower(format('{0}', parameters('aiHubName')))]",
+ "projectName": "[toLower(format('{0}', parameters('aiProjectName')))]",
+ "uniqueSuffix": "[substring(uniqueString(format('{0}-{1}', resourceGroup().id, parameters('deploymentTimestamp'))), 0, 4)]"
+ },
+ "resources": [
+ {
+ "type": "Microsoft.Resources/deployments",
+ "apiVersion": "2022-09-01",
+ "name": "[format('dependencies-{0}-{1}-deployment', variables('name'), variables('uniqueSuffix'))]",
+ "properties": {
+ "expressionEvaluationOptions": {
+ "scope": "inner"
+ },
+ "mode": "Incremental",
+ "parameters": {
+ "aiServicesName": {
+ "value": "[format('{0}{1}', parameters('aiServicesName'), variables('uniqueSuffix'))]"
+ },
+ "storageName": {
+ "value": "[format('{0}{1}', parameters('storageName'), variables('uniqueSuffix'))]"
+ },
+ "location": {
+ "value": "[parameters('location')]"
+ },
+ "tags": {
+ "value": "[parameters('tags')]"
+ },
+ "modelName": {
+ "value": "[parameters('modelName')]"
+ },
+ "modelFormat": {
+ "value": "[parameters('modelFormat')]"
+ },
+ "modelVersion": {
+ "value": "[parameters('modelVersion')]"
+ },
+ "modelSkuName": {
+ "value": "[parameters('modelSkuName')]"
+ },
+ "modelCapacity": {
+ "value": "[parameters('modelCapacity')]"
+ },
+ "modelLocation": {
+ "value": "[parameters('modelLocation')]"
+ }
+ },
+ "template": {
+ "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
+ "contentVersion": "1.0.0.0",
+ "metadata": {
+ "_generator": {
+ "name": "bicep",
+ "version": "0.31.92.45157",
+ "templateHash": "8251659815924226998"
+ }
+ },
+ "parameters": {
+ "location": {
+ "type": "string",
+ "defaultValue": "[resourceGroup().location]",
+ "metadata": {
+ "description": "Azure region of the deployment"
+ }
+ },
+ "tags": {
+ "type": "object",
+ "defaultValue": {},
+ "metadata": {
+ "description": "Tags to add to the resources"
+ }
+ },
+ "aiServicesName": {
+ "type": "string",
+ "metadata": {
+ "description": "AI services name"
+ }
+ },
+ "modelName": {
+ "type": "string",
+ "metadata": {
+ "description": "Model name for deployment"
+ }
+ },
+ "modelFormat": {
+ "type": "string",
+ "metadata": {
+ "description": "Model format for deployment"
+ }
+ },
+ "modelVersion": {
+ "type": "string",
+ "metadata": {
+ "description": "Model version for deployment"
+ }
+ },
+ "modelSkuName": {
+ "type": "string",
+ "metadata": {
+ "description": "Model deployment SKU name"
+ }
+ },
+ "modelCapacity": {
+ "type": "int",
+ "metadata": {
+ "description": "Model deployment capacity"
+ }
+ },
+ "modelLocation": {
+ "type": "string",
+ "metadata": {
+ "description": "Model/AI Resource deployment location"
+ }
+ },
+ "storageName": {
+ "type": "string",
+ "metadata": {
+ "description": "Name of the storage account"
+ }
+ },
+ "storageSkuName": {
+ "type": "string",
+ "defaultValue": "Standard_LRS",
+ "allowedValues": [
+ "Standard_LRS",
+ "Standard_ZRS",
+ "Standard_GRS",
+ "Standard_GZRS",
+ "Standard_RAGRS",
+ "Standard_RAGZRS",
+ "Premium_LRS",
+ "Premium_ZRS"
+ ],
+ "metadata": {
+ "description": "Storage SKU"
+ }
+ }
+ },
+ "variables": {
+ "storageNameCleaned": "[replace(parameters('storageName'), '-', '')]"
+ },
+ "resources": [
+ {
+ "type": "Microsoft.CognitiveServices/accounts",
+ "apiVersion": "2024-06-01-preview",
+ "name": "[parameters('aiServicesName')]",
+ "location": "[parameters('modelLocation')]",
+ "sku": {
+ "name": "S0"
+ },
+ "kind": "AIServices",
+ "identity": {
+ "type": "SystemAssigned"
+ },
+ "properties": {
+ "customSubDomainName": "[toLower(format('{0}', toLower(parameters('aiServicesName'))))]",
+ "apiProperties": {
+ "statisticsEnabled": false
+ },
+ "publicNetworkAccess": "Enabled"
+ }
+ },
+ {
+ "type": "Microsoft.CognitiveServices/accounts/deployments",
+ "apiVersion": "2024-06-01-preview",
+ "name": "[format('{0}/{1}', parameters('aiServicesName'), parameters('modelName'))]",
+ "sku": {
+ "capacity": "[parameters('modelCapacity')]",
+ "name": "[parameters('modelSkuName')]"
+ },
+ "properties": {
+ "model": {
+ "name": "[parameters('modelName')]",
+ "format": "[parameters('modelFormat')]",
+ "version": "[parameters('modelVersion')]"
+ }
+ },
+ "dependsOn": [
+ "[resourceId('Microsoft.CognitiveServices/accounts', parameters('aiServicesName'))]"
+ ]
+ },
+ {
+ "type": "Microsoft.Storage/storageAccounts",
+ "apiVersion": "2023-05-01",
+ "name": "[variables('storageNameCleaned')]",
+ "location": "[parameters('location')]",
+ "tags": "[parameters('tags')]",
+ "sku": {
+ "name": "[parameters('storageSkuName')]"
+ },
+ "kind": "StorageV2",
+ "properties": {
+ "accessTier": "Hot",
+ "allowBlobPublicAccess": false,
+ "allowCrossTenantReplication": false,
+ "allowSharedKeyAccess": true,
+ "encryption": {
+ "keySource": "Microsoft.Storage",
+ "requireInfrastructureEncryption": false,
+ "services": {
+ "blob": {
+ "enabled": true,
+ "keyType": "Account"
+ },
+ "file": {
+ "enabled": true,
+ "keyType": "Account"
+ },
+ "queue": {
+ "enabled": true,
+ "keyType": "Service"
+ },
+ "table": {
+ "enabled": true,
+ "keyType": "Service"
+ }
+ }
+ },
+ "isHnsEnabled": false,
+ "isNfsV3Enabled": false,
+ "keyPolicy": {
+ "keyExpirationPeriodInDays": 7
+ },
+ "largeFileSharesState": "Disabled",
+ "minimumTlsVersion": "TLS1_2",
+ "networkAcls": {
+ "bypass": "AzureServices",
+ "defaultAction": "Deny"
+ },
+ "supportsHttpsTrafficOnly": true
+ }
+ }
+ ],
+ "outputs": {
+ "aiservicesID": {
+ "type": "string",
+ "value": "[resourceId('Microsoft.CognitiveServices/accounts', parameters('aiServicesName'))]"
+ },
+ "aiservicesTarget": {
+ "type": "string",
+ "value": "[reference(resourceId('Microsoft.CognitiveServices/accounts', parameters('aiServicesName')), '2024-06-01-preview').endpoint]"
+ },
+ "storageId": {
+ "type": "string",
+ "value": "[resourceId('Microsoft.Storage/storageAccounts', variables('storageNameCleaned'))]"
+ }
+ }
+ }
+ }
+ },
+ {
+ "type": "Microsoft.Resources/deployments",
+ "apiVersion": "2022-09-01",
+ "name": "[format('ai-{0}-{1}-deployment', variables('name'), variables('uniqueSuffix'))]",
+ "properties": {
+ "expressionEvaluationOptions": {
+ "scope": "inner"
+ },
+ "mode": "Incremental",
+ "parameters": {
+ "aiHubName": {
+ "value": "[format('ai-{0}-{1}', variables('name'), variables('uniqueSuffix'))]"
+ },
+ "aiHubFriendlyName": {
+ "value": "[parameters('aiHubFriendlyName')]"
+ },
+ "aiHubDescription": {
+ "value": "[parameters('aiHubDescription')]"
+ },
+ "location": {
+ "value": "[parameters('location')]"
+ },
+ "tags": {
+ "value": "[parameters('tags')]"
+ },
+ "modelLocation": {
+ "value": "[parameters('modelLocation')]"
+ },
+ "storageAccountId": {
+ "value": "[reference(resourceId('Microsoft.Resources/deployments', format('dependencies-{0}-{1}-deployment', variables('name'), variables('uniqueSuffix'))), '2022-09-01').outputs.storageId.value]"
+ },
+ "aiServicesId": {
+ "value": "[reference(resourceId('Microsoft.Resources/deployments', format('dependencies-{0}-{1}-deployment', variables('name'), variables('uniqueSuffix'))), '2022-09-01').outputs.aiservicesID.value]"
+ },
+ "aiServicesTarget": {
+ "value": "[reference(resourceId('Microsoft.Resources/deployments', format('dependencies-{0}-{1}-deployment', variables('name'), variables('uniqueSuffix'))), '2022-09-01').outputs.aiservicesTarget.value]"
+ }
+ },
+ "template": {
+ "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
+ "contentVersion": "1.0.0.0",
+ "metadata": {
+ "_generator": {
+ "name": "bicep",
+ "version": "0.31.92.45157",
+ "templateHash": "6462883308359606930"
+ }
+ },
+ "parameters": {
+ "location": {
+ "type": "string",
+ "metadata": {
+ "description": "Azure region of the deployment"
+ }
+ },
+ "tags": {
+ "type": "object",
+ "metadata": {
+ "description": "Tags to add to the resources"
+ }
+ },
+ "aiHubName": {
+ "type": "string",
+ "metadata": {
+ "description": "AI hub name"
+ }
+ },
+ "aiHubFriendlyName": {
+ "type": "string",
+ "defaultValue": "[parameters('aiHubName')]",
+ "metadata": {
+ "description": "AI hub display name"
+ }
+ },
+ "aiHubDescription": {
+ "type": "string",
+ "metadata": {
+ "description": "AI hub description"
+ }
+ },
+ "storageAccountId": {
+ "type": "string",
+ "metadata": {
+ "description": "Resource ID of the storage account resource for storing experimentation outputs"
+ }
+ },
+ "aiServicesId": {
+ "type": "string",
+ "metadata": {
+ "description": "Resource ID of the AI Services resource"
+ }
+ },
+ "aiServicesTarget": {
+ "type": "string",
+ "metadata": {
+ "description": "Resource ID of the AI Services endpoint"
+ }
+ },
+ "modelLocation": {
+ "type": "string",
+ "metadata": {
+ "description": "Model/AI Resource deployment location"
+ }
+ }
+ },
+ "resources": [
+ {
+ "type": "Microsoft.MachineLearningServices/workspaces/connections",
+ "apiVersion": "2024-07-01-preview",
+ "name": "[format('{0}/{1}', parameters('aiHubName'), format('{0}-connection-AIServices', parameters('aiHubName')))]",
+ "properties": {
+ "category": "AIServices",
+ "target": "[parameters('aiServicesTarget')]",
+ "authType": "ApiKey",
+ "isSharedToAll": true,
+ "credentials": {
+ "key": "[format('{0}', listKeys(parameters('aiServicesId'), '2022-10-01').key1)]"
+ },
+ "metadata": {
+ "ApiType": "Azure",
+ "ResourceId": "[parameters('aiServicesId')]",
+ "Location": "[parameters('modelLocation')]"
+ }
+ },
+ "dependsOn": [
+ "[resourceId('Microsoft.MachineLearningServices/workspaces', parameters('aiHubName'))]"
+ ]
+ },
+ {
+ "type": "Microsoft.MachineLearningServices/workspaces",
+ "apiVersion": "2024-07-01-preview",
+ "name": "[parameters('aiHubName')]",
+ "location": "[parameters('location')]",
+ "tags": "[parameters('tags')]",
+ "identity": {
+ "type": "SystemAssigned"
+ },
+ "properties": {
+ "friendlyName": "[parameters('aiHubFriendlyName')]",
+ "description": "[parameters('aiHubDescription')]",
+ "storageAccount": "[parameters('storageAccountId')]"
+ },
+ "kind": "hub"
+ }
+ ],
+ "outputs": {
+ "aiHubID": {
+ "type": "string",
+ "value": "[resourceId('Microsoft.MachineLearningServices/workspaces', parameters('aiHubName'))]"
+ }
+ }
+ }
+ },
+ "dependsOn": [
+ "[resourceId('Microsoft.Resources/deployments', format('dependencies-{0}-{1}-deployment', variables('name'), variables('uniqueSuffix')))]"
+ ]
+ },
+ {
+ "type": "Microsoft.Resources/deployments",
+ "apiVersion": "2022-09-01",
+ "name": "[format('ai-{0}-{1}-deployment', variables('projectName'), variables('uniqueSuffix'))]",
+ "properties": {
+ "expressionEvaluationOptions": {
+ "scope": "inner"
+ },
+ "mode": "Incremental",
+ "parameters": {
+ "aiProjectName": {
+ "value": "[format('ai-{0}-{1}', variables('projectName'), variables('uniqueSuffix'))]"
+ },
+ "aiProjectFriendlyName": {
+ "value": "[parameters('aiProjectFriendlyName')]"
+ },
+ "aiProjectDescription": {
+ "value": "[parameters('aiProjectDescription')]"
+ },
+ "location": {
+ "value": "[parameters('location')]"
+ },
+ "tags": {
+ "value": "[parameters('tags')]"
+ },
+ "aiHubId": {
+ "value": "[reference(resourceId('Microsoft.Resources/deployments', format('ai-{0}-{1}-deployment', variables('name'), variables('uniqueSuffix'))), '2022-09-01').outputs.aiHubID.value]"
+ }
+ },
+ "template": {
+ "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
+ "contentVersion": "1.0.0.0",
+ "metadata": {
+ "_generator": {
+ "name": "bicep",
+ "version": "0.31.92.45157",
+ "templateHash": "14604927427609317320"
+ }
+ },
+ "parameters": {
+ "location": {
+ "type": "string",
+ "metadata": {
+ "description": "Azure region of the deployment"
+ }
+ },
+ "tags": {
+ "type": "object",
+ "metadata": {
+ "description": "Tags to add to the resources"
+ }
+ },
+ "aiProjectName": {
+ "type": "string",
+ "metadata": {
+ "description": "AI Project name"
+ }
+ },
+ "aiProjectFriendlyName": {
+ "type": "string",
+ "defaultValue": "[parameters('aiProjectName')]",
+ "metadata": {
+ "description": "AI Project display name"
+ }
+ },
+ "aiProjectDescription": {
+ "type": "string",
+ "metadata": {
+ "description": "AI Project description"
+ }
+ },
+ "aiHubId": {
+ "type": "string",
+ "metadata": {
+ "description": "Resource ID of the AI Hub resource"
+ }
+ }
+ },
+ "resources": [
+ {
+ "type": "Microsoft.MachineLearningServices/workspaces",
+ "apiVersion": "2023-08-01-preview",
+ "name": "[parameters('aiProjectName')]",
+ "location": "[parameters('location')]",
+ "tags": "[parameters('tags')]",
+ "identity": {
+ "type": "SystemAssigned"
+ },
+ "properties": {
+ "friendlyName": "[parameters('aiProjectFriendlyName')]",
+ "description": "[parameters('aiProjectDescription')]",
+ "hubResourceId": "[parameters('aiHubId')]"
+ },
+ "kind": "project"
+ }
+ ],
+ "outputs": {
+ "aiProjectID": {
+ "type": "string",
+ "value": "[resourceId('Microsoft.MachineLearningServices/workspaces', parameters('aiProjectName'))]"
+ }
+ }
+ }
+ },
+ "dependsOn": [
+ "[resourceId('Microsoft.Resources/deployments', format('ai-{0}-{1}-deployment', variables('name'), variables('uniqueSuffix')))]"
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/basic-agent.parameters.json b/basic-agent.parameters.json
new file mode 100644
index 00000000..1bbb3a73
--- /dev/null
+++ b/basic-agent.parameters.json
@@ -0,0 +1,36 @@
+{
+ "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
+ "contentVersion": "1.0.0.0",
+ "parameters": {
+ "aiHubName": {
+ "value": "standard-hub"
+ },
+ "aiProjectName": {
+ "value": "standard-project"
+ },
+ "modelName": {
+ "value": "gpt-4o-mini"
+ },
+ "modelFormat": {
+ "value": "OpenAI"
+ },
+ "modelVersion": {
+ "value": "2024-07-18"
+ },
+ "modelSkuName": {
+ "value": "GlobalStandard"
+ },
+ "modelCapacity": {
+ "value": 50
+ },
+ "modelLocation": {
+ "value": "eastus"
+ },
+ "storageName": {
+ "value": "agent-storage"
+ },
+ "aiServicesName": {
+ "value": "agent-ai-services"
+ }
+ }
+}
diff --git a/data/nifty_500_quarterly_results.csv b/data/nifty_500_quarterly_results.csv
new file mode 100644
index 00000000..e02068e0
--- /dev/null
+++ b/data/nifty_500_quarterly_results.csv
@@ -0,0 +1,502 @@
+name,NSE_code,BSE_code,sector,industry,revenue,operating_expenses,operating_profit,operating_profit_margin,depreciation,interest,profit_before_tax,tax,net_profit,EPS,profit_TTM,EPS_TTM
+3M India Ltd.,3MINDIA,523395,GENERAL INDUSTRIALS,INDUSTRIAL MACHINERY,"1,057",847.4,192.1,18.48%,12.9,0.7,195.9,49.8,146.1,129.7,535.9,475.7
+ACC Ltd.,ACC,500410,CEMENT AND CONSTRUCTION,CEMENT & CEMENT PRODUCTS,"4,644.8","3,885.4",549.3,12.39%,212.8,28.9,517.7,131.5,387.9,20.7,"1,202.7",64
+AIA Engineering Ltd.,AIAENG,532683,GENERAL INDUSTRIALS,OTHER INDUSTRIAL GOODS,"1,357.1",912.7,382.1,29.51%,24.5,7.4,412.5,88.4,323.1,34.3,"1,216.1",128.9
+APL Apollo Tubes Ltd.,APLAPOLLO,533758,METALS & MINING,IRON & STEEL PRODUCTS,"4,65","4,305.4",325,7.02%,41.3,26.6,276.7,73.8,202.9,7.3,767.5,27.7
+Au Small Finance Bank Ltd.,AUBANK,540611,BANKING AND FINANCE,BANKS,"2,956.5","1,026.7",647.7,25.59%,0,"1,282.1",533.4,131.5,401.8,6,"1,606.2",24
+Adani Ports & Special Economic Zone Ltd.,ADANIPORTS,532921,TRANSPORTATION,MARINE PORT & SERVICES,"6,951.9","2,982.4","3,664",55.13%,974.5,520.1,"2,474.9",759,"1,747.8",8.1,"6,337",29.3
+Adani Energy Solutions Ltd.,ADANIENSOL,ASM,UTILITIES,ELECTRIC UTILITIES,"3,766.5","2,169.3","1,504.6",40.95%,432.1,640.8,369.9,84.9,275.9,2.5,"1,315.1",11.8
+Aditya Birla Fashion and Retail Ltd.,ABFRL,535755,RETAILING,DEPARTMENT STORES,"3,272.2","2,903.6",322.9,10.01%,388.8,208.4,-228.6,-28.2,-179.2,-1.9,-491.7,-5.2
+Aegis Logistics Ltd.,AEGISCHEM,500003,OIL & GAS,OIL MARKETING & DISTRIBUTION,"1,279.3","1,026.5",208.3,16.87%,34.1,26.6,192,42,127,3.6,509,14.5
+Ajanta Pharma Ltd.,AJANTPHARM,532331,PHARMACEUTICALS & BIOTECHNOLOGY,PHARMACEUTICALS,"1,049.8",737.8,290.7,28.26%,33.7,2.3,275.9,80.6,195.3,15.5,660.2,52.3
+Alembic Pharmaceuticals Ltd.,APLLTD,533573,PHARMACEUTICALS & BIOTECHNOLOGY,PHARMACEUTICALS,"1,605.1","1,386.7",208.2,13.06%,67.6,15.7,135.1,-1.9,136.6,7,531.7,27
+Alkem Laboratories Ltd.,ALKEM,539523,PHARMACEUTICALS & BIOTECHNOLOGY,PHARMACEUTICALS,"3,503.4","2,693.4",746.7,21.71%,73.9,30.3,648,33.1,620.5,51.9,"1,432.9",119.9
+Amara Raja Energy & Mobility Ltd.,ARE&M,500008,AUTOMOBILES & AUTO COMPONENTS,AUTO PARTS & EQUIPMENT,"2,988.6","2,556.9",402.5,13.60%,115.7,6.2,309.8,83.5,226.3,13.2,779.8,45.7
+Ambuja Cements Ltd.,AMBUJACEM,500425,CEMENT AND CONSTRUCTION,CEMENT & CEMENT PRODUCTS,"7,9","6,122.1","1,301.8",17.54%,380.9,61.2,"1,335.7",352.5,793,4,"2,777.9",14
+Apollo Hospitals Enterprise Ltd.,APOLLOHOSP,508869,DIVERSIFIED CONSUMER SERVICES,HEALTHCARE FACILITIES,"4,869.1","4,219.4",627.5,12.95%,163.4,111.3,376.9,130.2,232.9,16.2,697.5,48.5
+Apollo Tyres Ltd.,APOLLOTYRE,500877,AUTOMOBILES & AUTO COMPONENTS,AUTO TYRES & RUBBER PRODUCTS,"6,304.9","5,119.8","1,159.8",18.47%,360.3,132.8,679.9,205.8,474.3,7.5,"1,590.7",25
+Ashok Leyland Ltd.,ASHOKLEY,500477,AUTOMOBILES & AUTO COMPONENTS,COMMERCIAL VEHICLES,"11,463","9,558.6","1,870.4",16.37%,226.6,715.1,924.4,358,526,1.8,"2,141.5",7.3
+Asian Paints Ltd.,ASIANPAINT,500820,DIVERSIFIED CONSUMER SERVICES,FURNITURE-FURNISHING-PAINTS,"8,643.8","6,762.3","1,716.2",20.24%,208.7,50.9,"1,621.8",418.6,"1,205.4",12.6,"5,062.6",52.8
+Astral Ltd.,ASTRAL,532830,GENERAL INDUSTRIALS,PLASTIC PRODUCTS,"1,376.4","1,142.9",220.1,16.15%,48.7,8,176.8,45.1,131.2,4.9,549.7,20.4
+Atul Ltd.,ATUL,500027,CHEMICALS & PETROCHEMICALS,SPECIALTY CHEMICALS,"1,215.8","1,038.5",155.2,13.00%,54,1.9,121.5,32.5,90.3,30.6,392.3,132.9
+Aurobindo Pharma Ltd.,AUROPHARMA,524804,PHARMACEUTICALS & BIOTECHNOLOGY,PHARMACEUTICALS,"7,406.4","5,846","1,373.4",19.02%,417.5,68.2,"1,074.7",323.7,757.2,12.8,"2,325.5",39.7
+Avanti Feeds Ltd.,AVANTIFEED,512573,FOOD BEVERAGES & TOBACCO,OTHER FOOD PRODUCTS,"1,312","1,184.5",94,7.35%,14.3,0.2,113,30.5,74.2,5.5,336.4,24.7
+Avenue Supermarts Ltd.,DMART,540376,RETAILING,DEPARTMENT STORES,"12,661.3","11,619.4","1,005",7.96%,174.4,15.6,851.9,228.6,623.6,9.6,"2,332.1",35.8
+Axis Bank Ltd.,AXISBANK,532215,BANKING AND FINANCE,BANKS,"33,122.2","9,207.3","9,166",33.43%,0,"14,749","8,313.8","2,096.1","6,204.1",20.1,"13,121",42.6
+Bajaj Auto Ltd.,BAJAJ-AUTO,532977,AUTOMOBILES & AUTO COMPONENTS,2/3 WHEELERS,"11,206.8","8,708.1","2,130.1",19.65%,91.8,6.5,"2,400.4",564,"2,02",71.4,"6,841.6",241.8
+Bajaj Finance Ltd.,BAJFINANCE,500034,BANKING AND FINANCE,FINANCE (INCLUDING NBFCS),"13,381.8","2,851.5","9,449.7",70.63%,158.5,"4,537.1","4,757.6","1,207","3,550.8",58.7,"13,118.5",216.7
+Bajaj Finserv Ltd.,BAJAJFINSV,532978,DIVERSIFIED,HOLDING COMPANIES,"26,022.7","14,992.2","9,949.9",38.24%,208.8,"4,449.1","5,292","1,536.5","1,929",12.1,"7,422.6",46.6
+Bajaj Holdings & Investment Ltd.,BAJAJHLDNG,500490,DIVERSIFIED,HOLDING COMPANIES,240.1,33.5,191.2,85.08%,8.4,0.2,197.9,73.9,"1,491.2",134,"5,545.1",498.3
+Balkrishna Industries Ltd.,BALKRISIND,502355,AUTOMOBILES & AUTO COMPONENTS,AUTO TYRES & RUBBER PRODUCTS,"2,360.3","1,720.5",532.7,23.64%,160.4,23.9,455.5,108.1,347.4,18,"1,047.5",54.2
+Balrampur Chini Mills Ltd.,BALRAMCHIN,500038,FOOD BEVERAGES & TOBACCO,SUGAR,"1,649","1,374.6",164.9,10.71%,41.2,17.2,215.9,56.6,166.3,8.2,540.5,26.8
+Bank of Baroda,BANKBARODA,532134,BANKING AND FINANCE,BANKS,"35,766","8,430.4","9,807.9",33.52%,0,"17,527.7","6,022.8","1,679.7","4,458.4",8.5,"18,602.9",35.9
+Bank of India,BANKINDIA,532149,BANKING AND FINANCE,BANKS,"16,779.4","3,704.9","3,818.8",25.35%,0,"9,255.7","2,977.4","1,488.6","1,498.5",3.6,"5,388.7",13.1
+Bata India Ltd.,BATAINDIA,500043,RETAILING,FOOTWEAR,834.6,637.5,181.7,22.18%,81.7,28.4,46.1,12.1,34,2.6,289.7,22.5
+Berger Paints (India) Ltd.,BERGEPAINT,509480,DIVERSIFIED CONSUMER SERVICES,FURNITURE-FURNISHING-PAINTS,"2,782.6","2,293.7",473.6,17.12%,82.9,21.1,385,96.7,291.6,2.5,"1,032.6",8.9
+Bharat Electronics Ltd.,BEL,500049,GENERAL INDUSTRIALS,DEFENCE,"4,146.1","2,994.9","1,014.2",25.30%,108.3,1.5,"1,041.5",260.7,789.4,1.1,"3,323",4.5
+Bharat Forge Ltd.,BHARATFORG,500493,GENERAL INDUSTRIALS,OTHER INDUSTRIAL PRODUCTS,"3,826.7","3,152.8",621.4,16.47%,211.3,124.3,336.1,121.8,227.2,4.9,783.7,16.8
+Bharat Heavy Electricals Ltd.,BHEL,500103,GENERAL INDUSTRIALS,HEAVY ELECTRICAL EQUIPMENT,"5,305.4","5,513",-387.7,-7.56%,59.9,180.4,-447.9,-197.9,-238.1,-0.7,71.3,0.2
+Bharat Petroleum Corporation Ltd.,BPCL,500547,OIL & GAS,REFINERIES/PETRO-PRODUCTS,"103,72","90,103.9","12,940.5",12.56%,"1,605.3",973.2,"10,755.7","2,812.2","8,243.5",38.7,"27,505.3",129.2
+Bharti Airtel Ltd.,BHARTIARTL,532454,TELECOM SERVICES,TELECOM SERVICES,"37,374.2","17,530.1","19,513.7",52.68%,"9,734.3","5,185.8","3,353.7","1,846.5","1,340.7",2.4,"7,547",13.2
+Indus Towers Ltd.,INDUSTOWER,534816,TELECOM SERVICES,OTHER TELECOM SERVICES,"7,229.7","3,498.8","3,633.7",50.95%,"1,525.6",458.6,"1,746.7",452,"1,294.7",4.8,"3,333.5",12.4
+Biocon Ltd.,BIOCON,532523,PHARMACEUTICALS & BIOTECHNOLOGY,BIOTECHNOLOGY,"3,620.2","2,720.7",741.6,21.42%,389.3,247.7,238.5,41.6,125.6,1.1,498.4,4.2
+Birla Corporation Ltd.,BIRLACORPN,500335,CEMENT AND CONSTRUCTION,CEMENT & CEMENT PRODUCTS,"2,313.2","1,997",288.9,12.64%,143.5,95.4,77.1,18.8,58.4,7.6,153.1,19.9
+Blue Dart Express Ltd.,BLUEDART,526612,TRANSPORTATION,TRANSPORTATION - LOGISTICS,"1,329.7","1,101.8",222.7,16.82%,110.6,19.5,97.9,24.8,73.1,30.8,292.4,123.2
+Blue Star Ltd.,BLUESTARCO,500067,CONSUMER DURABLES,CONSUMER ELECTRONICS,"1,903.4","1,767.7",122.7,6.49%,23,17.6,95,24.3,70.7,3.6,437.7,21.3
+Bombay Burmah Trading Corporation Ltd.,BBTC,501425,FOOD BEVERAGES & TOBACCO,TEA & COFFEE,"4,643.5","3,664.7",859.2,18.99%,74.7,154.6,697.1,212.6,122,17.5,"-1,499.5",-214.8
+Bosch Ltd.,BOSCHLTD,500530,AUTOMOBILES & AUTO COMPONENTS,AUTO PARTS & EQUIPMENT,"4,284.3","3,638.8",491.3,11.90%,101.3,12.2,"1,317",318.1,999.8,339,"2,126.9",721
+Brigade Enterprises Ltd.,BRIGADE,532929,REALTY,REALTY,"1,407.9","1,041.8",324.8,23.77%,75.7,110,180.3,67.8,133.5,5.8,298.2,12.9
+Britannia Industries Ltd.,BRITANNIA,500825,FMCG,PACKAGED FOODS,"4,485.2","3,560.5",872.4,19.68%,71.7,53.4,799.7,212.1,587.6,24.4,"2,536.2",105.3
+CCL Products India Ltd.,CCL,519600,FOOD BEVERAGES & TOBACCO,TEA & COFFEE,608.3,497.7,109.9,18.09%,22.6,18.4,69.7,8.8,60.9,4.6,279.9,21
+Crisil Ltd.,CRISIL,500092,BANKING AND FINANCE,OTHER FINANCIAL SERVICES,771.8,544.2,191.7,26.05%,26.5,0.8,200.3,48.3,152,20.8,606.3,82.9
+Zydus Lifesciences Ltd.,ZYDUSLIFE,532321,PHARMACEUTICALS & BIOTECHNOLOGY,PHARMACEUTICALS,"4,422.8","3,222.7","1,146.1",26.23%,184.2,8.7,"1,007.2",226.4,800.7,7.9,"2,807.1",27.7
+Can Fin Homes Ltd.,CANFINHOME,511196,BANKING AND FINANCE,HOUSING FINANCE,871,49.7,749.2,86.01%,2.8,548.4,198,39.9,158.1,11.9,658.8,49.5
+Canara Bank,CANBK,532483,BANKING AND FINANCE,BANKS,"33,891.2","8,250.3","7,706.6",28.24%,0,"17,934.3","5,098","1,420.6","3,86",20.9,"13,968.4",77
+Carborundum Universal Ltd.,CARBORUNIV,513375,GENERAL INDUSTRIALS,OTHER INDUSTRIAL PRODUCTS,"1,166",978.8,167.5,14.61%,45.9,4.9,136.4,43.7,101.9,5.4,461.3,24.3
+Castrol India Ltd.,CASTROLIND,500870,OIL & GAS,OIL MARKETING & DISTRIBUTION,"1,203.2",914.4,268.6,22.70%,22.9,2.4,263.5,69.1,194.4,2,815.5,8.2
+Ceat Ltd.,CEATLTD,500878,AUTOMOBILES & AUTO COMPONENTS,AUTO TYRES & RUBBER PRODUCTS,"3,063.8","2,597.2",456.1,14.94%,124.5,71.7,270.4,68.3,208,51.4,521.7,129
+Central Bank of India,CENTRALBK,532885,BANKING AND FINANCE,BANKS,"8,438.5","2,565.4","1,535.4",20.81%,0,"4,337.7",567.2,-41.5,622,0.7,"2,181.4",2.5
+Century Plyboards (India) Ltd.,CENTURYPLY,532548,FOREST MATERIALS,FOREST PRODUCTS,"1,011.4",852.5,144.3,14.47%,23.4,6.1,129.4,32.2,96.9,4.4,380.7,17.1
+Cera Sanitaryware Ltd.,CERA,532443,DIVERSIFIED CONSUMER SERVICES,FURNITURE-FURNISHING-PAINTS,476.2,387.2,76.5,16.49%,8.9,1.4,77.2,19.8,56.9,43.8,232.4,178.7
+Chambal Fertilisers & Chemicals Ltd.,CHAMBLFERT,500085,FERTILIZERS,FERTILIZERS,"5,467.3","4,770.5",615,11.42%,78.4,45.8,572.6,200.2,381,9.2,"1,137.7",27.3
+Cholamandalam Investment & Finance Company Ltd.,CHOLAFIN,511243,BANKING AND FINANCE,FINANCE (INCLUDING NBFCS),"4,695.2",987.6,"3,235.1",69.99%,38.5,"2,204.2","1,065",288.8,772.9,9.4,"3,022.8",36.7
+Cipla Ltd.,CIPLA,500087,PHARMACEUTICALS & BIOTECHNOLOGY,PHARMACEUTICALS,"6,854.5","4,944.4","1,733.8",25.96%,290,25.8,"1,594.2",438.4,"1,130.9",14,"3,449.1",42.7
+City Union Bank Ltd.,CUB,532210,BANKING AND FINANCE,BANKS,"1,486.1",333.9,386.6,29.65%,0,765.6,330.6,50,280.6,3.8,943.8,12.7
+Coal India Ltd.,COALINDIA,533278,METALS & MINING,COAL,"34,760.3","24,639.4","8,137",24.83%,"1,178.2",182.5,"8,760.2","2,036.5","6,799.8",11,"28,059.6",45.5
+Colgate-Palmolive (India) Ltd.,COLPAL,500830,FMCG,PERSONAL PRODUCTS,"1,492.1",989,482.1,32.77%,44.3,1.1,457.8,117.8,340.1,12.5,"1,173.2",43.1
+Container Corporation of India Ltd.,CONCOR,531344,COMMERCIAL SERVICES & SUPPLIES,WAREHOUSING AND LOGISTICS,"2,299.8","1,648.4",546.5,24.90%,153.1,16.5,481.8,119,367.4,6,"1,186.2",19.5
+Coromandel International Ltd.,COROMANDEL,506395,FERTILIZERS,FERTILIZERS,"7,032.9","5,929.4","1,058.7",15.15%,54,46.2,"1,003.3",245,756.9,25.7,"2,024.2",68.8
+Crompton Greaves Consumer Electricals Ltd.,CROMPTON,539876,CONSUMER DURABLES,HOUSEHOLD APPLIANCES,"1,797.2","1,607.8",174.5,9.79%,32.1,21.5,135.8,34.9,97.2,1.5,432,6.7
+Cummins India Ltd.,CUMMINSIND,500480,GENERAL INDUSTRIALS,INDUSTRIAL MACHINERY,"2,011.3","1,575.4",346.2,18.02%,38.3,6.8,390.9,99.6,329.1,11.9,"1,445.5",52.1
+Cyient Ltd.,CYIENT,532175,SOFTWARE & SERVICES,IT CONSULTING & SOFTWARE,"1,792","1,452.7",325.8,18.32%,65.8,27,240.3,56.7,178.3,16.3,665.6,60.1
+DCM Shriram Ltd.,DCMSHRIRAM,523367,CHEMICALS & PETROCHEMICALS,SPECIALTY CHEMICALS,"2,73","2,593.9",114.1,4.21%,74,14.7,47.5,15.2,32.2,2.1,617.6,39.4
+DLF Ltd.,DLF,532868,REALTY,REALTY,"1,476.4",885.3,462.4,34.31%,37,90.2,464,112.2,622.8,2.5,"2,239",9
+Dabur India Ltd.,DABUR,500096,FMCG,PERSONAL PRODUCTS,"3,320.2","2,543",660.9,20.63%,98.3,28.1,650.8,144.3,515,2.9,"1,755.7",9.9
+Delta Corp Ltd.,DELTACORP,532848,COMMERCIAL SERVICES & SUPPLIES,MISC. COMMERCIAL SERVICES,282.6,170.5,100.1,36.99%,16.9,2.7,92.4,23,69.4,2.6,273.3,10.2
+Divi's Laboratories Ltd.,DIVISLAB,532488,PHARMACEUTICALS & BIOTECHNOLOGY,PHARMACEUTICALS,"1,995","1,43",479,25.09%,95,1,469,121,348,13.1,"1,331.8",50.3
+Dr. Lal Pathlabs Ltd.,LALPATHLAB,539524,DIVERSIFIED CONSUMER SERVICES,HEALTHCARE SERVICES,619.4,423.5,177.8,29.57%,35.9,7.8,152.2,41.5,109.3,13.2,301.4,36.1
+Dr. Reddy's Laboratories Ltd.,DRREDDY,500124,PHARMACEUTICALS & BIOTECHNOLOGY,PHARMACEUTICALS,"7,217.6","4,888.8","2,008.3",29.09%,375.5,35.3,"1,912.5",434.5,"1,482.2",89.1,"5,091.2",305.2
+EID Parry (India) Ltd.,EIDPARRY,500125,FOOD BEVERAGES & TOBACCO,OTHER FOOD PRODUCTS,"9,210.3","8,002","1,057.5",11.67%,101.2,74.2,"1,032.8",246.8,452.3,25.5,991,55.8
+Eicher Motors Ltd.,EICHERMOT,505200,AUTOMOBILES & AUTO COMPONENTS,2/3 WHEELERS,"4,388.3","3,027.4","1,087.2",26.42%,142.5,12.7,"1,205.7",291.1,"1,016.2",37.1,"3,581",130.8
+Emami Ltd.,EMAMILTD,531162,FMCG,PERSONAL PRODUCTS,876,631.2,233.7,27.02%,46.1,2.2,196.4,15.8,178.5,4.1,697.8,16
+Endurance Technologies Ltd.,ENDURANCE,540153,AUTOMOBILES & AUTO COMPONENTS,AUTO PARTS & EQUIPMENT,"2,560.5","2,226.7",318.3,12.51%,118.4,9.8,205.6,51.1,154.6,11,562.8,40
+Engineers India Ltd.,ENGINERSIN,532178,COMMERCIAL SERVICES & SUPPLIES,CONSULTING SERVICES,833.6,691.3,98.5,12.47%,8.3,0.4,133.6,32.2,127.5,2.3,472.7,8.4
+Escorts Kubota Ltd.,ESCORTS,500495,AUTOMOBILES & AUTO COMPONENTS,COMMERCIAL VEHICLES,"2,154.4","1,798.6",260.7,12.66%,40.8,3.1,311.9,79.7,223.3,20.6,910.5,82.4
+Exide Industries Ltd.,EXIDEIND,500086,AUTOMOBILES & AUTO COMPONENTS,AUTO PARTS & EQUIPMENT,"4,408.9","3,872.4",499.1,11.42%,141.5,29.7,365.3,95.2,269.4,3.2,872.7,10.3
+Federal Bank Ltd.,FEDERALBNK,500469,BANKING AND FINANCE,BANKS,"6,548.2","1,603.8","1,400.3",24.18%,0,"3,544.1","1,342.7",342.6,994.1,4.3,"3,671.4",15.6
+Finolex Cables Ltd.,FINCABLES,500144,CONSUMER DURABLES,OTHER ELECTRICAL EQUIPMENT/PRODUCTS,"1,229.3","1,041.3",146.1,12.30%,10.8,0.4,176.7,52.3,154.2,10.1,643.9,42.1
+Finolex Industries Ltd.,FINPIPE,500940,GENERAL INDUSTRIALS,PLASTIC PRODUCTS,944.5,780.2,103,11.66%,27.4,12.5,124.5,35.4,98,1.6,459.3,7.4
+Firstsource Solutions Ltd.,FSL,532809,SOFTWARE & SERVICES,BPO/KPO,"1,556.9","1,311.2",228.8,14.86%,65.4,26.1,154.3,27.8,126.5,1.9,551.7,7.9
+GAIL (India) Ltd.,GAIL,532155,UTILITIES,UTILITIES,"33,191","29,405.5","3,580.2",10.85%,837.3,199.6,"2,748.7",696.3,"2,444.1",3.7,"5,283.8",8
+GlaxoSmithKline Pharmaceuticals Ltd.,GLAXO,500660,PHARMACEUTICALS & BIOTECHNOLOGY,PHARMACEUTICALS,985.2,667.5,289.5,30.25%,18.1,0.4,299.2,81.7,217.5,12.8,647.8,38.2
+Glenmark Pharmaceuticals Ltd.,GLENMARK,532296,PHARMACEUTICALS & BIOTECHNOLOGY,PHARMACEUTICALS,"3,209.1","2,745.1",462.3,14.41%,141.5,121.5,-124.4,55.9,-81.9,-2.9,-196.3,-7
+Godrej Consumer Products Ltd.,GODREJCP,532424,FMCG,PERSONAL PRODUCTS,"3,667.9","2,897.8",704.2,19.55%,60.9,77.3,619.4,186.6,432.8,4.2,"1,750.1",17.1
+Godrej Industries Ltd.,GODREJIND,500164,DIVERSIFIED,DIVERSIFIED,"4,256.9","3,672.1",265.5,6.74%,89.3,333.1,162.4,75.9,87.3,2.6,880,26.1
+Godrej Properties Ltd.,GODREJPROP,533150,REALTY,REALTY,605.1,404.7,-61.7,-17.98%,7.4,48,145.1,38.8,66.8,2.4,662.6,23.8
+Granules India Ltd.,GRANULES,532482,PHARMACEUTICALS & BIOTECHNOLOGY,PHARMACEUTICALS,"1,191",976.5,213,17.90%,52.5,26,136,33.9,102.1,4.2,393.9,16.3
+Great Eastern Shipping Company Ltd.,GESHIP,500620,TRANSPORTATION,SHIPPING,"1,461.5",585.6,643.4,52.35%,186.7,77.1,611.9,17.3,594.7,41.6,"2,520.1",176.5
+Gujarat Alkalies & Chemicals Ltd.,GUJALKALI,530001,CHEMICALS & PETROCHEMICALS,COMMODITY CHEMICALS,"1,042.3",926.1,45.2,4.65%,95.2,10.8,10.2,-0.1,-18.4,-2.5,82.7,11.3
+Gujarat Gas Ltd.,GUJGASLTD,539336,UTILITIES,UTILITIES,"4,019.3","3,494.5",496.6,12.44%,117.9,7.8,399.1,102.9,296.2,4.3,"1,254.3",18.2
+Gujarat Narmada Valley Fertilizers & Chemicals Ltd.,GNFC,500670,FERTILIZERS,FERTILIZERS,"2,232","1,911",169,8.12%,78,1,242,64,182,11.7,932,60.1
+Gujarat Pipavav Port Ltd.,GPPL,533248,TRANSPORTATION,MARINE PORT & SERVICES,270.4,102,150.6,59.64%,28.8,2.2,141.1,53.4,92.3,1.9,341.8,7.1
+Gujarat State Fertilizer & Chemicals Ltd.,GSFC,500690,FERTILIZERS,FERTILIZERS,"3,313.2","2,881.4",237.3,7.61%,45.7,1.6,387,78.1,308.9,7.8,"1,056.2",26.5
+Gujarat State Petronet Ltd.,GSPL,532702,UTILITIES,UTILITIES,"4,455.9","3,497.2",913.7,20.72%,165,14.5,779.2,198.7,454.6,8.1,"1,522",27
+HCL Technologies Ltd.,HCLTECH,532281,SOFTWARE & SERVICES,IT CONSULTING & SOFTWARE,"27,037","20,743","5,929",22.23%,"1,01",156,"5,128","1,295","3,832",14.2,"15,445",56.9
+HDFC Bank Ltd.,HDFCBANK,500180,BANKING AND FINANCE,BANKS,"107,566.6","42,037.6","24,279.1",32.36%,0,"41,249.9","20,967.4","3,655","16,811.4",22.2,"54,474.6",71.8
+Havells India Ltd.,HAVELLS,517354,CONSUMER DURABLES,OTHER ELECTRICAL EQUIPMENT/PRODUCTS,"3,952.8","3,527",373.4,9.57%,81.2,9.3,335.3,86.2,249.1,4,"1,177.7",18.8
+Hero MotoCorp Ltd.,HEROMOTOCO,500182,AUTOMOBILES & AUTO COMPONENTS,2/3 WHEELERS,"9,741.2","8,173.5","1,359.5",14.26%,187.1,25,"1,355.6",353.1,"1,006.3",50.3,"3,247.6",162.5
+HFCL Ltd.,HFCL,500183,TELECOMMUNICATIONS EQUIPMENT,TELECOM CABLES,"1,128.7",978.9,132.6,11.93%,21.4,34.8,93.5,24,69.4,0.5,305.5,2.1
+Hindalco Industries Ltd.,HINDALCO,500440,METALS & MINING,ALUMINIUM AND ALUMINIUM PRODUCTS,"54,632","48,557","5,612",10.36%,"1,843","1,034","3,231","1,035","2,196",9.9,"8,423",37.9
+Hindustan Copper Ltd.,HINDCOPPER,513599,METALS & MINING,COPPER,392.6,260.2,121.2,31.77%,45.6,4.1,82.6,21.9,60.7,0.6,320.5,3.3
+Hindustan Petroleum Corporation Ltd.,HINDPETRO,500104,OIL & GAS,REFINERIES/PETRO-PRODUCTS,"96,093.4","87,512","8,24",8.61%,"1,247.3",590,"6,744.1","1,616","5,827",41.1,"16,645",117.3
+Hindustan Unilever Ltd.,HINDUNILVR,500696,FMCG,PERSONAL PRODUCTS,"15,806","11,826","3,797",24.30%,297,88,"3,59",931,"2,656",11.3,"10,284",43.8
+Hindustan Zinc Ltd.,HINDZINC,500188,METALS & MINING,ZINC,"7,014","3,652","3,139",46.22%,825,232,"2,305",576,"1,729",4.1,"8,432",20
+Housing and Urban Development Corporation Ltd.,HUDCO,540530,BANKING AND FINANCE,HOUSING FINANCE,"1,880.8",82.7,"1,809.6",97.04%,2.4,"1,216.8",606.4,154.7,451.6,2.3,"1,790.7",8.9
+ITC Ltd.,ITC,500875,FOOD BEVERAGES & TOBACCO,CIGARETTES-TOBACCO PRODUCTS,"18,439.3","11,320.2","6,454.2",36.31%,453,9.9,"6,656.2","1,700.3","4,898.1",3.9,"20,185.1",16.2
+ICICI Bank Ltd.,ICICIBANK,532174,BANKING AND FINANCE,BANKS,"57,292.3","23,911","15,473.2",39.74%,0,"17,908","14,824.2","3,808.8","11,805.6",15.6,"41,086.8",58.7
+ICICI Prudential Life Insurance Company Ltd.,ICICIPRULI,540133,BANKING AND FINANCE,LIFE INSURANCE,"17,958.1","17,612.3",-229.6,-1.32%,0,0,340.2,32.5,243.9,1.7,906.9,6.3
+IDBI Bank Ltd.,IDBI,500116,BANKING AND FINANCE,BANKS,"7,063.7","1,922.3","2,175.3",36.02%,0,"2,966.1","2,396.9","1,003.7","1,385.4",1.3,"4,776.3",4.4
+IDFC First Bank Ltd.,IDFCFIRSTB,539437,BANKING AND FINANCE,BANKS,"8,765.8","3,849","1,511.2",20.54%,0,"3,405.6",982.8,236,746.9,1.1,"2,911.1",4.3
+IDFC Ltd.,IDFC,532659,BANKING AND FINANCE,FINANCE (INCLUDING NBFCS),36.7,6,30.6,83.56%,0,0,30.6,6.6,223.5,1.4,"4,147.1",25.9
+IRB Infrastructure Developers Ltd.,IRB,532947,CEMENT AND CONSTRUCTION,ROADS & HIGHWAYS,"1,874.5",950.4,794.6,45.54%,232.7,434.6,256.9,85.8,95.7,0.2,501,0.8
+ITI Ltd.,ITI,523610,TELECOMMUNICATIONS EQUIPMENT,TELECOM EQUIPMENT,256.1,299.3,-52.8,-21.42%,13.3,69.3,-125.8,0,-126,-1.3,-388.4,-4
+Vodafone Idea Ltd.,IDEA,532822,TELECOM SERVICES,TELECOM SERVICES,"10,750.8","6,433.5","4,282.8",39.97%,"5,667.3","6,569","-7,919",817.7,"-8,737.9",-1.8,"-30,986.8",-6.4
+India Cements Ltd.,INDIACEM,530005,CEMENT AND CONSTRUCTION,CEMENT & CEMENT PRODUCTS,"1,272.4","1,26",4.4,0.35%,55,60.4,-103,-17.4,-80.1,-2.6,-261.1,-8.4
+Indiabulls Housing Finance Ltd.,IBULHSGFIN,535789,BANKING AND FINANCE,HOUSING FINANCE,"2,242.3",190.6,"1,779.2",79.88%,22.9,"1,349.8",421.6,123.6,298,6.5,"1,146",24.3
+Indian Bank,INDIANB,532814,BANKING AND FINANCE,BANKS,"15,929.4","3,599.1","4,327.7",31.44%,0,"8,002.6","2,776.7",768.6,"2,068.5",16.6,"6,893.3",55.3
+Indian Hotels Company Ltd.,INDHOTEL,500850,HOTELS RESTAURANTS & TOURISM,HOTELS,"1,480.9","1,078.4",354.8,24.75%,111.2,59,232.2,72.3,166.9,1.2,"1,100.3",7.7
+Indian Oil Corporation Ltd.,IOC,530965,OIL & GAS,OIL MARKETING & DISTRIBUTION,"179,752.1","156,013.1","23,328.4",13.01%,"3,609.6","2,135","18,090.2","4,699.7","13,114.3",9.5,"38,614.3",27.3
+Indian Overseas Bank,IOB,532388,BANKING AND FINANCE,BANKS,"6,941.5","1,785.1","1,679.8",28.84%,0,"3,476.6",635.5,8.3,627.2,0.3,"2,341.9",1.2
+Indraprastha Gas Ltd.,IGL,532514,UTILITIES,UTILITIES,"3,520.2","2,801.6",656.9,18.99%,102.2,2.5,613.9,151.4,552.7,7.9,"1,806.2",25.8
+IndusInd Bank Ltd.,INDUSINDBK,532187,BANKING AND FINANCE,BANKS,"13,529.7","3,449.9","3,908.7",34.75%,0,"6,171.1","2,934.9",732.9,"2,202.2",28.4,"8,333.7",107.2
+Info Edge (India) Ltd.,NAUKRI,532777,SOFTWARE & SERVICES,INTERNET SOFTWARE & SERVICES,792,421.2,204.7,32.70%,25.9,8.2,382.8,68.7,205.1,15.9,-25.6,-2
+InterGlobe Aviation Ltd.,INDIGO,539448,TRANSPORTATION,AIRLINES,"15,502.9","12,743.6","2,200.3",14.72%,"1,549","1,021.3",189.1,0.2,188.9,4.9,"5,621.3",145.7
+Ipca Laboratories Ltd.,IPCALAB,524494,PHARMACEUTICALS & BIOTECHNOLOGY,PHARMACEUTICALS,"2,072.5","1,712.7",321.3,15.80%,90.3,44.1,225.4,87.9,145.1,5.7,492.2,19.4
+J B Chemicals & Pharmaceuticals Ltd.,JBCHEPHARM,506943,PHARMACEUTICALS & BIOTECHNOLOGY,PHARMACEUTICALS,889.4,638.2,243.5,27.62%,32.2,10.4,208.7,58.1,150.6,9.7,486.6,31.4
+JK Cement Ltd.,JKCEMENT,532644,CEMENT AND CONSTRUCTION,CEMENT & CEMENT PRODUCTS,"2,782.1","2,285.8",467,16.96%,137.1,115,244.2,65.7,178.1,23.1,444,57.5
+JK Lakshmi Cement Ltd.,JKLAKSHMI,500380,CEMENT AND CONSTRUCTION,CEMENT & CEMENT PRODUCTS,"1,588.5","1,357.3",217.3,13.80%,56.6,33.6,141,45.1,92.7,7.9,357.6,30.4
+JM Financial Ltd.,JMFINANCIL,523405,DIVERSIFIED,HOLDING COMPANIES,"1,214",407.9,662.6,55.34%,13.2,388.1,277.9,72.4,194.9,2,608.1,6.4
+JSW Energy Ltd.,JSWENERGY,533148,UTILITIES,ELECTRIC UTILITIES,"3,387.4","1,379","1,880.4",57.69%,408.7,513.7,"1,085.9",235.1,850.2,5.2,"1,591.7",9.7
+JSW Steel Ltd.,JSWSTEEL,500228,METALS & MINING,IRON & STEEL/INTERM.PRODUCTS,"44,821","36,698","7,886",17.69%,"2,019","2,084","4,609","1,812","2,76",11.4,"9,252",38.1
+Jindal Stainless Ltd.,JSL,532508,METALS & MINING,IRON & STEEL/INTERM.PRODUCTS,"9,829","8,566.5","1,230.6",12.56%,221.9,155.6,985.7,229.1,774.3,9.4,"2,600.2",31.6
+Jindal Steel & Power Ltd.,JINDALSTEL,532286,METALS & MINING,IRON & STEEL/INTERM.PRODUCTS,"12,282","9,964.5","2,285.7",18.66%,603.7,329.4,"1,384.5",-5.8,"1,387.8",13.8,"4,056",40.4
+Jubilant Foodworks Ltd.,JUBLFOOD,533155,HOTELS RESTAURANTS & TOURISM,RESTAURANTS,"1,375.7","1,091.4",277.2,20.25%,141.9,56.8,85.5,23.3,97.2,1.5,235,3.6
+Just Dial Ltd.,JUSTDIAL,535648,SOFTWARE & SERVICES,INTERNET SOFTWARE & SERVICES,318.5,211.8,48.8,18.71%,12.2,2.4,92.1,20.3,71.8,8.4,314.1,36.9
+Jyothy Labs Ltd.,JYOTHYLAB,532926,FMCG,PERSONAL PRODUCTS,745.6,597,135.4,18.48%,12.3,1.2,135.1,31.1,104.2,2.8,326.9,8.9
+KRBL Ltd.,KRBL,530813,FMCG,PACKAGED FOODS,"1,246.5","1,018.9",194.5,16.03%,19.9,0.8,206.8,53.6,153.3,6.5,671.4,29.3
+Kajaria Ceramics Ltd.,KAJARIACER,500233,DIVERSIFIED CONSUMER SERVICES,FURNITURE-FURNISHING-PAINTS,"1,129.9",941.9,179.7,16.02%,36.1,4.3,147.7,36.6,108,6.8,397.8,25
+Kalpataru Projects International Ltd.,KPIL,522287,UTILITIES,ELECTRIC UTILITIES,"4,53","4,148",370,8.19%,113,137,132,42,89,5.5,478,29.9
+Kansai Nerolac Paints Ltd.,KANSAINER,500165,DIVERSIFIED CONSUMER SERVICES,FURNITURE-FURNISHING-PAINTS,"1,978.6","1,683.3",273.2,13.97%,47.4,7.6,240.3,64.8,177.2,2.2,"1,118.8",13.8
+Karur Vysya Bank Ltd.,KARURVYSYA,590003,BANKING AND FINANCE,BANKS,"2,336",616.4,637.9,31.94%,0,"1,081.7",511.5,133.1,378.4,4.7,"1,364.2",17
+KEC International Ltd.,KEC,532714,GENERAL INDUSTRIALS,HEAVY ELECTRICAL EQUIPMENT,"4,514.9","4,224.7",274.3,6.10%,46.5,177.8,65.8,9.9,55.8,2.2,187.9,7.3
+Kotak Mahindra Bank Ltd.,KOTAKBANK,500247,BANKING AND FINANCE,BANKS,"21,559.5","9,681","6,343",46.24%,0,"5,535.5","5,888.3","1,465.5","4,461",22.4,"17,172.7",86.4
+L&T Finance Holdings Ltd.,L&TFH,533519,DIVERSIFIED,HOLDING COMPANIES,"3,482.1",935.3,"1,882.4",58.57%,28.3,"1,324.9",797.4,203.2,595.1,2.4,"2,080.8",8.4
+L&T Technology Services Ltd.,LTTS,540115,SOFTWARE & SERVICES,IT CONSULTING & SOFTWARE,"2,427.7","1,910.9",475.6,19.93%,68.1,12.6,436.1,120.2,315.4,29.8,"1,239.7",117.5
+LIC Housing Finance Ltd.,LICHSGFIN,500253,BANKING AND FINANCE,HOUSING FINANCE,"6,765.9",250.6,"6,095.7",90.10%,13.2,"4,599.9","1,483",291.2,"1,193.5",21.7,"4,164.5",75.7
+Lakshmi Machine Works Ltd.,LAXMIMACH,500252,GENERAL INDUSTRIALS,INDUSTRIAL MACHINERY,"1,355.5","1,184.5",136,10.30%,23.6,0,147.4,32.3,115.1,107.8,416,389.5
+Laurus Labs Ltd.,LAURUSLABS,540222,PHARMACEUTICALS & BIOTECHNOLOGY,PHARMACEUTICALS,"1,226.2","1,036.6",187.9,15.34%,93.4,42.4,53.9,14.6,37,0.7,367.8,6.8
+Lupin Ltd.,LUPIN,500257,PHARMACEUTICALS & BIOTECHNOLOGY,PHARMACEUTICALS,"5,079","4,120.8",917.8,18.21%,247.8,80.6,629.7,134.3,489.5,10.8,"1,331.2",29.2
+MMTC Ltd.,MMTC,513377,COMMERCIAL SERVICES & SUPPLIES,COMMODITY TRADING & DISTRIBUTION,-167.2,-180.1,-30.4,14.42%,0.8,1.1,12.1,1.5,52,0.3,174.1,1.2
+MRF Ltd.,MRF,500290,AUTOMOBILES & AUTO COMPONENTS,AUTO TYRES & RUBBER PRODUCTS,"6,287.8","5,060.2","1,156.9",18.61%,351.5,85.5,790.6,203.9,586.7,1383.3,"1,690.9",3988
+Mahanagar Gas Ltd.,MGL,539957,UTILITIES,UTILITIES,"1,772.7","1,250.1",478.9,27.70%,65.8,2.5,454.3,115.8,338.5,34.3,"1,147.8",116.2
+Mahindra & Mahindra Financial Services Ltd.,M&MFIN,532720,BANKING AND FINANCE,FINANCE (INCLUDING NBFCS),"3,863.5","1,077.5","2,109.3",55.03%,67.1,"1,703.4",369.1,96,281.1,2.3,"1,982.5",16
+Mahindra & Mahindra Ltd.,M&M,500520,AUTOMOBILES & AUTO COMPONENTS,CARS & UTILITY VEHICLES,"35,027.2","28,705.9","5,729.6",16.64%,"1,138.6","1,835.2","3,347.5","1,083.7","2,347.8",21.1,"11,169.4",100.2
+Mahindra Holidays & Resorts India Ltd.,MHRIL,533088,HOTELS RESTAURANTS & TOURISM,HOTELS,672.2,519.3,136,20.76%,83.8,33.3,35.8,14,21.3,1.1,66,3.3
+Manappuram Finance Ltd.,MANAPPURAM,531213,BANKING AND FINANCE,FINANCE (INCLUDING NBFCS),"2,174",555.6,"1,481.3",68.68%,62.5,689.4,746.7,186.1,558.4,6.6,"1,859.8",22
+Mangalore Refinery And Petrochemicals Ltd.,MRPL,500109,OIL & GAS,REFINERIES/PETRO-PRODUCTS,"22,904.7","20,705.6","2,138.2",9.36%,296,311.2,"1,592",546.2,"1,051.7",6,"3,784.9",21.6
+Marico Ltd.,MARICO,531642,FMCG,PERSONAL PRODUCTS,"2,514","1,979",497,20.07%,39,20,476,116,353,2.7,"1,41",10.9
+Maruti Suzuki India Ltd.,MARUTI,532500,AUTOMOBILES & AUTO COMPONENTS,CARS & UTILITY VEHICLES,"37,902.1","32,282.5","4,790.3",12.92%,794.4,35.1,"4,790.1","1,083.8","3,764.3",124.6,"11,351.8",375.9
+Max Financial Services Ltd.,MFSL,500271,BANKING AND FINANCE,LIFE INSURANCE,"10,189.1","10,024.6",143.9,1.42%,0.8,9.4,158.2,-12.1,147.9,4.3,506.4,14.7
+UNO Minda Ltd.,UNOMINDA,532539,AUTOMOBILES & AUTO COMPONENTS,AUTO PARTS & EQUIPMENT,"3,630.2","3,219.8",401.6,11.09%,125.4,27.2,257.9,73.3,225,3.9,742.4,13
+Motilal Oswal Financial Services Ltd.,MOTILALOFS,532892,BANKING AND FINANCE,OTHER FINANCIAL SERVICES,"1,650.7",724.1,904.5,55.18%,17.3,241.1,657.6,124.2,531.2,35.9,"1,449.3",97.8
+MphasiS Ltd.,MPHASIS,526299,SOFTWARE & SERVICES,IT CONSULTING & SOFTWARE,"3,325.5","2,680.9",595.6,18.18%,89,34,521.7,129.7,391.9,20.8,"1,605.6",85.1
+Muthoot Finance Ltd.,MUTHOOTFIN,533398,BANKING AND FINANCE,FINANCE (INCLUDING NBFCS),"3,631.9",723.4,"2,801.6",77.69%,22.2,"1,335","1,470.2",374.9,"1,059.6",26.4,"3,982.9",99.2
+Natco Pharma Ltd.,NATCOPHARM,524816,PHARMACEUTICALS & BIOTECHNOLOGY,PHARMACEUTICALS,"1,060.8",573.4,458,44.41%,43.6,4.2,439.6,70.6,369,20.6,"1,127.4",63
+NBCC (India) Ltd.,NBCC,534309,CEMENT AND CONSTRUCTION,CONSTRUCTION & ENGINEERING,"2,129.1","1,957.7",95.5,4.65%,1.3,0,104.6,22.9,79.6,0.4,332.2,1.8
+NCC Ltd.,NCC,500294,CEMENT AND CONSTRUCTION,CONSTRUCTION & ENGINEERING,"4,746.4","4,415.9",303.7,6.44%,53.2,153.5,123.8,38.8,77.3,1.2,599.4,9.5
+NHPC Ltd.,NHPC,533098,UTILITIES,ELECTRIC UTILITIES,"3,113.8","1,173.9","1,757.4",59.95%,294.9,104.8,"1,618.3",-75,"1,545.8",1.5,"3,897.8",3.9
+Coforge Ltd.,COFORGE,532541,SOFTWARE & SERVICES,IT CONSULTING & SOFTWARE,"2,285.1","1,935.3",340.9,14.98%,77.2,31.9,240.7,52.8,187.9,29.6,696.2,113.2
+NLC India Ltd.,NLCINDIA,513683,UTILITIES,ELECTRIC UTILITIES,"3,234","2,143",834.6,28.03%,455.1,213.9,"1,700.6",614.7,"1,084.7",7.8,"1,912.3",13.8
+NTPC Ltd.,NTPC,532555,UTILITIES,ELECTRIC UTILITIES,"45,384.6","32,303.2","12,680.2",28.19%,"4,037.7","2,920.5","6,342.9","2,019.7","4,614.6",4.8,"19,125.2",19.7
+Narayana Hrudayalaya Ltd.,NH,539551,DIVERSIFIED CONSUMER SERVICES,HEALTHCARE FACILITIES,"1,323.6",997.1,308.1,23.61%,55.3,22.9,248.4,21.7,226.6,11.2,737.5,36.1
+National Aluminium Company Ltd.,NATIONALUM,532234,METALS & MINING,ALUMINIUM AND ALUMINIUM PRODUCTS,"3,112","2,646.9",396.5,13.03%,186.2,4,275,68.7,187.3,1,"1,272.4",6.9
+Navin Fluorine International Ltd.,NAVINFLUOR,532504,CHEMICALS & PETROCHEMICALS,COMMODITY CHEMICALS,494.9,373.4,98.3,20.84%,24.2,20,77.2,16.6,60.6,12.2,365,73.7
+Oberoi Realty Ltd.,OBEROIRLTY,533273,REALTY,REALTY,"1,243.8",579.2,638.2,52.42%,11.3,56.5,596.8,142.1,456.8,12.6,"1,961.3",53.9
+Oil And Natural Gas Corporation Ltd.,ONGC,500312,OIL & GAS,EXPLORATION & PRODUCTION,"149,388.5","118,618.4","28,255.3",19.24%,"6,698.1","2,603.3","21,564.9","5,633.6","13,734.1",10.9,"43,072.5",34.2
+Oil India Ltd.,OIL,533106,OIL & GAS,EXPLORATION & PRODUCTION,"9,200.1","5,293.3","3,523.2",39.96%,499,278.9,762,67.6,420.7,3.9,"5,874.5",54.2
+Oracle Financial Services Software Ltd.,OFSS,532466,SOFTWARE & SERVICES,IT CONSULTING & SOFTWARE,"1,509.6",886.4,558.1,38.64%,19,8,596.2,178.8,417.4,48.2,"1,835.1",211.9
+PI Industries Ltd.,PIIND,523642,CHEMICALS & PETROCHEMICALS,AGROCHEMICALS,"2,163.8","1,565.5",551.4,26.05%,80.3,7.8,510.2,31.7,480.5,31.7,"1,495.8",98.4
+PNB Housing Finance Ltd.,PNBHOUSING,540173,BANKING AND FINANCE,HOUSING FINANCE,"1,779.4",158.8,"1,574.1",88.54%,11.3,"1,057.3",507.1,124.1,383,14.8,"1,278.7",49.3
+PNC Infratech Ltd.,PNCINFRA,539150,CEMENT AND CONSTRUCTION,ROADS & HIGHWAYS,"1,932.4","1,511.6",399.8,20.92%,40.9,161.3,218.6,70.7,147.9,5.8,614.3,23.9
+PVR INOX Ltd.,PVRINOX,532689,RETAILING,SPECIALTY RETAIL,"2,023.7","1,293.1",706.8,35.34%,308.6,200.3,221.7,55.5,166.3,17,-232.5,-23.7
+Page Industries Ltd.,PAGEIND,532827,TEXTILES APPARELS & ACCESSORIES,OTHER APPARELS & ACCESSORIES,"1,126.8",891.6,233.5,20.76%,24.6,11.2,199.4,49.1,150.3,134.7,510.7,457.9
+Persistent Systems Ltd.,PERSISTENT,533179,SOFTWARE & SERVICES,IT CONSULTING & SOFTWARE,"2,449","2,006.5",405.2,16.80%,74.4,12.3,355.8,92.5,263.3,35,981.5,127.6
+Petronet LNG Ltd.,PETRONET,532522,OIL & GAS,OIL MARKETING & DISTRIBUTION,"12,686.2","11,317.9","1,214.7",9.69%,194.8,74.7,"1,098.8",283.9,855.7,5.7,"3,490.3",23.3
+Pfizer Ltd.,PFIZER,500680,PHARMACEUTICALS & BIOTECHNOLOGY,PHARMACEUTICALS,611.3,392.6,182.6,31.75%,15.4,2.7,200.5,51.6,149,32.6,522.8,114.3
+Phoenix Mills Ltd.,PHOENIXLTD,503100,REALTY,REALTY,906.6,361.2,506,57.82%,65.9,96.5,375.2,71.4,252.6,14.2,923.6,51.7
+Pidilite Industries Ltd.,PIDILITIND,500331,CHEMICALS & PETROCHEMICALS,SPECIALTY CHEMICALS,"3,107.6","2,396.3",679.7,22.10%,75.2,13.1,623,163.1,450.1,8.8,"1,505.5",29.6
+Power Finance Corporation Ltd.,PFC,532810,BANKING AND FINANCE,FINANCE (INCLUDING NBFCS),"22,403.7",315.4,"22,941.9",102.46%,12.7,"14,313.1","8,628.8","2,000.6","4,833.1",14.7,"17,946.4",54.4
+Power Grid Corporation of India Ltd.,POWERGRID,532898,UTILITIES,ELECTRIC UTILITIES,"11,530.4","1,358.7","9,908.4",87.94%,"3,277","2,341.3","4,393.4",573.7,"3,781.4",4.1,"15,344.4",16.5
+Prestige Estates Projects Ltd.,PRESTIGE,ASM,REALTY,REALTY,"3,256","1,643.9",592.5,26.49%,174.1,263.9,"1,174.1",256.4,850.9,21.2,"1,714",42.8
+Prism Johnson Ltd.,PRSMJOHNSN,500338,CEMENT AND CONSTRUCTION,CEMENT & CEMENT PRODUCTS,"1,846","1,745.4",92.4,5.03%,95.2,43.5,210,30.4,182.7,3.6,154.2,3.1
+Procter & Gamble Hygiene & Healthcare Ltd.,PGHH,500459,FMCG,PERSONAL PRODUCTS,"1,154.1",853.5,284.9,25.03%,14.3,1.9,284.5,73.8,210.7,64.9,734.4,226.3
+Punjab National Bank,PNB,532461,BANKING AND FINANCE,BANKS,"29,857","6,798.1","6,239.1",23.23%,0,"16,819.8","2,778.3","1,013.8","1,990.2",1.8,"5,904.8",5.4
+Quess Corp Ltd.,QUESS,539978,SOFTWARE & SERVICES,BPO/KPO,"4,763.5","4,584.8",163.6,3.44%,69.7,28.1,79.3,8.3,71.9,4.8,240.9,16.2
+RBL Bank Ltd.,RBLBANK,540065,BANKING AND FINANCE,BANKS,"3,720.6","1,422.6",765.4,25.45%,0,"1,532.6",125,-206.1,331.1,5.5,"1,173.9",19.5
+Radico Khaitan Ltd.,RADICO,532497,FOOD BEVERAGES & TOBACCO,BREWERIES & DISTILLERIES,925.7,803.8,121.2,13.10%,26.1,12.5,83.3,21.4,64.8,4.8,237,17.7
+Rain Industries Ltd.,RAIN,500339,CHEMICALS & PETROCHEMICALS,PETROCHEMICALS,"4,208.9","3,794.3",366,8.80%,192.5,241.7,-19.5,46.2,-90.2,-2.7,270.4,8
+Rajesh Exports Ltd.,RAJESHEXPO,531500,TEXTILES APPARELS & ACCESSORIES,GEMS & JEWELLERY,"38,079.4","38,015.8",50.1,0.13%,10.7,0,53,7.7,45.3,1.5,"1,142.2",38.7
+Rallis India Ltd.,RALLIS,500355,CHEMICALS & PETROCHEMICALS,AGROCHEMICALS,837,699,133,15.99%,26,3,110,28,82,4.2,98.4,5.2
+Rashtriya Chemicals & Fertilizers Ltd.,RCF,524230,FERTILIZERS,FERTILIZERS,"4,222.1","4,049.3",105.9,2.55%,56.1,44,72.8,21.1,51,0.9,523.6,9.5
+Redington Ltd.,REDINGTON,532805,COMMERCIAL SERVICES & SUPPLIES,COMMODITY TRADING & DISTRIBUTION,"22,296.6","21,738.7",481.4,2.17%,43.7,105.8,408.3,96.7,303.5,3.9,"1,242",15.9
+Relaxo Footwears Ltd.,RELAXO,530517,RETAILING,FOOTWEAR,725.9,623.8,91.5,12.79%,36.9,4.7,60.4,16.2,44.2,1.8,193.9,7.8
+Reliance Industries Ltd.,RELIANCE,500325,OIL & GAS,REFINERIES/PETRO-PRODUCTS,"238,797","193,988","40,968",17.44%,"12,585","5,731","26,493","6,673","17,394",25.7,"68,496",101.2
+REC Ltd.,RECLTD,532955,BANKING AND FINANCE,FINANCE (INCLUDING NBFCS),"11,701.3",275.1,"12,180.5",104.21%,6.1,"7,349.8","4,837.6","1,047.7","3,789.9",14.4,"12,738.6",48.4
+SJVN Ltd.,SJVN,533206,UTILITIES,ELECTRIC UTILITIES,951.6,172.2,706.2,80.40%,101.9,124.2,567.7,129.2,439.6,1.1,"1,016",2.6
+SKF India Ltd.,SKFINDIA,500472,GENERAL INDUSTRIALS,OTHER INDUSTRIAL GOODS,"1,145.5","1,003.7",121.5,10.80%,19.3,0.5,122,31.7,90,18.2,484,97.9
+SRF Ltd.,SRF,503806,CHEMICALS & PETROCHEMICALS,SPECIALTY CHEMICALS,"3,206.5","2,551.2",626.2,19.71%,161.2,79.3,414.8,114,300.8,10.2,"1,733.4",58.5
+Sanofi India Ltd.,SANOFI,500674,PHARMACEUTICALS & BIOTECHNOLOGY,PHARMACEUTICALS,726.4,506.1,208.5,29.17%,9.9,0.3,210.1,57.9,152.1,66.1,596.3,259.3
+Schaeffler India Ltd.,SCHAEFFLER,505790,AUTOMOBILES & AUTO COMPONENTS,AUTO PARTS & EQUIPMENT,"1,879.2","1,506.3",342,18.50%,55.6,1.6,315.7,80.7,235,15,922.6,59
+Shree Cements Ltd.,SHREECEM,500387,CEMENT AND CONSTRUCTION,CEMENT & CEMENT PRODUCTS,"4,932.1","3,914.1",886,18.46%,411.7,67,539.2,92.6,446.6,123.8,"1,826.8",506.3
+Shriram Finance Ltd.,SHRIRAMFIN,511218,BANKING AND FINANCE,FINANCE (INCLUDING NBFCS),"8,893","1,409.4","6,334.3",71.30%,141.4,"3,798","2,404.2",614.9,"1,786.1",47.6,"6,575.4",175.2
+Siemens Ltd.,SIEMENS,500550,GENERAL INDUSTRIALS,HEAVY ELECTRICAL EQUIPMENT,"5,953.2","5,107.5",700.2,12.06%,78.6,4.9,762.2,190.5,571.3,16.1,"1,960.9",55.1
+Sobha Ltd.,SOBHA,532784,REALTY,REALTY,773.6,665.8,75.4,10.18%,19.3,63.9,24.7,9.7,14.9,1.6,107.4,11.3
+Solar Industries India Ltd.,SOLARINDS,532725,GENERAL INDUSTRIALS,OTHER INDUSTRIAL PRODUCTS,"1,355.2","1,011.3",336.1,24.95%,33.7,24.9,285.3,75.5,200.1,22.1,808.2,89.3
+Sonata Software Ltd.,SONATSOFTW,532221,SOFTWARE & SERVICES,IT CONSULTING & SOFTWARE,"1,935.8","1,715.2",197.3,10.32%,33.3,20.7,166.5,42.3,124.2,9,475.7,34.3
+State Bank of India,SBIN,500112,BANKING AND FINANCE,BANKS,"144,256.1","58,597.6","22,703.3",21.14%,0,"62,955.2","21,935.7","5,552.5","17,196.2",18,"69,304.1",77.7
+Steel Authority of India (SAIL) Ltd.,SAIL,500113,METALS & MINING,IRON & STEEL/INTERM.PRODUCTS,"29,858.2","25,836.7","3,875.4",13.04%,"1,326.6",605.2,"1,674.7",464.2,"1,305.6",3.2,"3,219.5",7.8
+Sun Pharma Advanced Research Company Ltd.,SPARC,532872,PHARMACEUTICALS & BIOTECHNOLOGY,PHARMACEUTICALS,29.7,112.7,-91.5,-431.87%,3.2,0.3,-86.4,0,-86.4,-2.7,-253.6,-7.8
+Sun Pharmaceutical Industries Ltd.,SUNPHARMA,524715,PHARMACEUTICALS & BIOTECHNOLOGY,PHARMACEUTICALS,"12,486","9,013","3,179.4",26.08%,632.8,49.3,"2,790.9",390.1,"2,375.5",9.9,"8,548.5",35.6
+Sun TV Network Ltd.,SUNTV,532733,MEDIA,BROADCASTING & CABLE TV,"1,160.2",320.6,727.8,69.42%,218.8,1.7,619.1,154.4,464.7,11.8,"1,861.8",47.2
+Sundram Fasteners Ltd.,SUNDRMFAST,500403,AUTOMOBILES & AUTO COMPONENTS,AUTO PARTS & EQUIPMENT,"1,429.1","1,191.1",230.7,16.23%,54.5,7.4,176.2,43.1,131.9,6.3,502.9,23.9
+Sunteck Realty Ltd.,SUNTECK,512179,REALTY,REALTY,36.2,39.1,-14.1,-56.70%,2.2,15.8,-20.9,-6.4,-13.9,-1,-46.5,-3.3
+Supreme Industries Ltd.,SUPREMEIND,509930,GENERAL INDUSTRIALS,PLASTIC PRODUCTS,"2,321.4","1,952.5",356.2,15.43%,71.9,1.6,295.4,76.3,243.2,19.1,"1,028.2",80.9
+Suzlon Energy Ltd.,SUZLON,ASM,GENERAL INDUSTRIALS,HEAVY ELECTRICAL EQUIPMENT,"1,428.7","1,196.4",225,15.83%,51.2,43.7,102.4,0.1,102.3,0.1,561.4,0.4
+Syngene International Ltd.,SYNGENE,539268,PHARMACEUTICALS & BIOTECHNOLOGY,PHARMACEUTICALS,931.7,656,254.1,27.92%,104.6,13,150.7,34.2,116.5,2.9,498.3,12.4
+TTK Prestige Ltd.,TTKPRESTIG,517506,CONSUMER DURABLES,HOUSEWARE,747.2,648.6,80.8,11.08%,15.9,3.1,79.5,20.5,59.3,4.3,224.3,16.2
+TV18 Broadcast Ltd.,TV18BRDCST,532800,MEDIA,BROADCASTING & CABLE TV,"1,989","1,992.2",-198.1,-11.04%,50.1,33.8,-87.1,-6.5,-28.9,-0.2,92.2,0.5
+TVS Motor Company Ltd.,TVSMOTOR,532343,AUTOMOBILES & AUTO COMPONENTS,2/3 WHEELERS,"9,983.8","8,576.9","1,355.9",13.65%,237.1,483.3,686.4,259.8,386.3,8.1,"1,457.6",30.7
+Tata Consultancy Services Ltd.,TCS,532540,SOFTWARE & SERVICES,IT CONSULTING & SOFTWARE,"60,698","43,946","15,746",26.38%,"1,263",159,"15,33","3,95","11,342",31,"44,654",122
+Tata Elxsi Ltd.,TATAELXSI,500408,SOFTWARE & SERVICES,IT CONSULTING & SOFTWARE,912.8,618.2,263.5,29.89%,25,5.8,263.9,63.8,200,32.1,785.1,126.1
+Tata Consumer Products Ltd.,TATACONSUM,500800,FMCG,PACKAGED FOODS,"3,823.6","3,196.7",537.1,14.38%,93.9,27.6,490.9,131.7,338.2,3.6,"1,275.2",13.7
+Tata Motors Limited (DVR),TATAMTRDVR,570001,AUTOMOBILES & AUTO COMPONENTS,COMMERCIAL VEHICLES,,,,,,,,,,,,
+Tata Motors Ltd.,TATAMOTORS,500570,AUTOMOBILES & AUTO COMPONENTS,COMMERCIAL VEHICLES,"106,759","91,361.3","13,766.9",13.10%,"6,636.4","2,651.7","5,985.9","2,202.8","3,764",9.8,"15,332.3",40
+Tata Power Company Ltd.,TATAPOWER,500400,UTILITIES,ELECTRIC UTILITIES,"16,029.5","12,647","3,091",19.64%,925.9,"1,181.8",979.2,213.3,875.5,2.7,"3,570.8",11.2
+Tata Steel Ltd.,TATASTEEL,500470,METALS & MINING,IRON & STEEL/INTERM.PRODUCTS,"55,910.2","51,414.1","4,267.8",7.66%,"2,479.8","1,959.4","-6,842.1",-228,"-6,196.2",-5.1,"-6,081.3",-5
+Tech Mahindra Ltd.,TECHM,532755,SOFTWARE & SERVICES,IT CONSULTING & SOFTWARE,"13,128.1","11,941.1",922.8,7.17%,465.7,97.5,623.8,110,493.9,5.6,"3,600.7",40.9
+The Ramco Cements Ltd.,RAMCOCEM,500260,CEMENT AND CONSTRUCTION,CEMENT & CEMENT PRODUCTS,"2,352.1","1,935",405.6,17.33%,162.8,116.5,137.8,37,72,3.1,348.9,14.8
+Thermax Ltd.,THERMAX,500411,GENERAL INDUSTRIALS,HEAVY ELECTRICAL EQUIPMENT,"2,368.3","2,097.8",204.6,8.89%,33,19.8,217.7,58.9,157.7,14,498.8,44.3
+Timken India Ltd.,TIMKEN,522113,GENERAL INDUSTRIALS,OTHER INDUSTRIAL PRODUCTS,692.1,546.5,135.5,19.87%,21.1,0.9,123.6,30.6,93,12.4,358.3,47.6
+Titan Company Ltd.,TITAN,500114,TEXTILES APPARELS & ACCESSORIES,GEMS & JEWELLERY,"12,653","11,118","1,411",11.26%,144,140,"1,251",336,915,10.3,"3,302",37.1
+Torrent Pharmaceuticals Ltd.,TORNTPHARM,500420,PHARMACEUTICALS & BIOTECHNOLOGY,PHARMACEUTICALS,"2,686","1,835",825,31.02%,201,91,559,173,386,11.4,"1,334",39.4
+Torrent Power Ltd.,TORNTPOWER,532779,UTILITIES,ELECTRIC UTILITIES,"7,069.1","5,739.5","1,221.4",17.55%,341.7,247.2,740.7,198.1,525.9,10.9,"2,176.8",45.3
+Trent Ltd.,TRENT,500251,RETAILING,DEPARTMENT STORES,"3,062.5","2,525.8",456.6,15.31%,152.2,95.5,288.9,86.3,234.7,6.6,629.4,17.7
+Trident Ltd.,TRIDENT,521064,TEXTILES APPARELS & ACCESSORIES,TEXTILES,"1,812","1,557.3",240.3,13.37%,89.4,35,130.4,40.1,90.7,0.2,458.1,0.9
+UPL Ltd.,UPL,512070,CHEMICALS & PETROCHEMICALS,AGROCHEMICALS,"10,275","8,807","1,325",13.03%,657,871,-185,-96,-189,-2.5,"1,856",24.7
+UltraTech Cement Ltd.,ULTRACEMCO,532538,CEMENT AND CONSTRUCTION,CEMENT & CEMENT PRODUCTS,"16,179.3","13,461.2","2,550.9",15.93%,797.8,233.9,"1,686.2",409.4,"1,281.5",44.5,"5,694.1",197.2
+Union Bank of India,UNIONBANK,532477,BANKING AND FINANCE,BANKS,"28,952.5","6,189.3","7,265",29.38%,0,"15,498.2","5,492.3","1,944","3,571.8",5.1,"11,918.9",16.1
+United Breweries Ltd.,UBL,532478,FOOD BEVERAGES & TOBACCO,BREWERIES & DISTILLERIES,"1,902.1","1,705.8",184.3,9.75%,50.9,1.4,144,36.9,107.3,4.1,251.3,9.5
+United Spirits Ltd.,MCDOWELL-N,532432,FOOD BEVERAGES & TOBACCO,BREWERIES & DISTILLERIES,"6,776.6","6,269.8",466.7,6.93%,65.3,26.2,446,106.3,339.3,4.8,"1,133",15.6
+V-Guard Industries Ltd.,VGUARD,532953,CONSUMER DURABLES,OTHER ELECTRICAL EQUIPMENT/PRODUCTS,"1,147.9","1,041.3",92.5,8.16%,19.8,9.3,77.5,18.6,59,1.4,215.2,5
+Vardhman Textiles Ltd.,VTL,502986,TEXTILES APPARELS & ACCESSORIES,TEXTILES,"2,487","2,192.1",205.4,8.57%,103.7,22,169.2,41.7,134.3,4.7,531.9,18.7
+Varun Beverages Ltd.,VBL,540180,FOOD BEVERAGES & TOBACCO,NON-ALCOHOLIC BEVERAGES,"3,889","2,988.4",882.1,22.79%,170.8,62.5,667.3,152.9,501.1,3.9,"1,998.7",15.4
+Vinati Organics Ltd.,VINATIORGA,524200,CHEMICALS & PETROCHEMICALS,SPECIALTY CHEMICALS,464.4,337.3,110.8,24.73%,13.7,0.3,113,28.9,84.2,8.2,408.2,39.7
+Voltas Ltd.,VOLTAS,500575,CONSUMER DURABLES,CONSUMER ELECTRONICS,"2,363.7","2,222.5",70.3,3.06%,11.7,11.4,118.1,49.3,36.7,1.1,199.5,6
+ZF Commercial Vehicle Control Systems India Ltd.,ZFCVINDIA,533023,AUTOMOBILES & AUTO COMPONENTS,AUTO PARTS & EQUIPMENT,"1,015.8",846.2,145.5,14.67%,27.1,1.3,141.2,35.5,105.7,55.7,392,206.7
+Welspun Corp Ltd.,WELCORP,ASM,METALS & MINING,IRON & STEEL PRODUCTS,"4,161.4","3,659.9",399.5,9.84%,85.7,75,340.8,79,384.7,14.7,809.2,30.9
+Welspun Living Ltd.,WELSPUNLIV,514162,TEXTILES APPARELS & ACCESSORIES,TEXTILES,"2,542.4","2,151.1",358,14.27%,98.5,33.8,258.9,58.7,196.7,2,526.1,5.4
+Whirlpool of India Ltd.,WHIRLPOOL,500238,CONSUMER DURABLES,CONSUMER ELECTRONICS,"1,555.5","1,448.4",73.2,4.81%,49.2,5.6,52.3,14.1,36.6,2.9,198.8,15.7
+Wipro Ltd.,WIPRO,507685,SOFTWARE & SERVICES,IT CONSULTING & SOFTWARE,"23,255.7","18,543.2","3,972.7",17.64%,897,303.3,"3,512.2",841.9,"2,646.3",5.1,"11,643.8",22.3
+Zee Entertainment Enterprises Ltd.,ZEEL,505537,MEDIA,BROADCASTING & CABLE TV,"2,509.6","2,105",332.8,13.65%,77.2,23.4,184.2,54.4,123,1.3,-102.2,-1.1
+eClerx Services Ltd.,ECLERX,532927,SOFTWARE & SERVICES,BPO/KPO,735.9,517,204.7,28.37%,30.3,6.1,182.4,46.3,136,28.2,506,105
+Sterlite Technologies Ltd.,STLTECH,532374,TELECOMMUNICATIONS EQUIPMENT,TELECOM CABLES,"1,497","1,281",213,14.26%,85,95,36,12,34,0.9,203,5.1
+HEG Ltd.,HEG,509631,GENERAL INDUSTRIALS,OTHER INDUSTRIAL GOODS,642.2,512.3,101.9,16.58%,38.5,8.5,82.9,21.7,96,24.9,439.5,113.9
+SBI Life Insurance Company Ltd.,SBILIFE,540719,BANKING AND FINANCE,LIFE INSURANCE,"28,816.2","28,183.8",609.9,2.12%,0,0,621.5,43.9,380.2,3.8,"1,842.2",18.4
+General Insurance Corporation of India,GICRE,540755,BANKING AND FINANCE,GENERAL INSURANCE,"13,465.9","11,574","1,464.6",11.20%,0,0,"1,855.4",243.7,"1,689",15.2,"6,628",37.8
+Tube Investments of India Ltd.,TIINDIA,540762,AUTOMOBILES & AUTO COMPONENTS,AUTO PARTS & EQUIPMENT,"2,005.4","1,718.2",251.4,12.76%,34.6,7.7,244.8,63.4,181.4,9.4,717.5,37.1
+Honeywell Automation India Ltd.,HONAUT,517174,CONSUMER DURABLES,OTHER ELECTRICAL EQUIPMENT/PRODUCTS,"1,144.3",965.9,138.3,12.52%,13.8,0.7,163.9,42,121.9,137.8,443.4,503.9
+Indian Energy Exchange Ltd.,IEX,540750,BANKING AND FINANCE,EXCHANGE,133,16.6,92,84.73%,5.1,0.7,110.6,27.9,86.5,1,327.8,3.7
+ICICI Lombard General Insurance Company Ltd.,ICICIGI,540716,BANKING AND FINANCE,GENERAL INSURANCE,"5,271.1","4,612.4",743.5,14.16%,0,0,763.6,186.4,577.3,11.8,"1,757.1",35.8
+Aster DM Healthcare Ltd.,ASTERDM,540975,DIVERSIFIED CONSUMER SERVICES,HEALTHCARE FACILITIES,"3,325.2","2,939.4",377.3,11.38%,227.2,101.9,2.1,10.2,-30.8,-0.6,284.3,5.7
+Central Depository Services (India) Ltd.,CDSL,CDSL,OTHERS,INVESTMENT COMPANIES,230.1,77.9,129.4,62.40%,6.5,0,145.6,35.8,108.9,10.4,320.2,30.6
+Graphite India Ltd.,GRAPHITE,509488,GENERAL INDUSTRIALS,OTHER INDUSTRIAL GOODS,884,823,-30,-3.78%,19,4,992,190,804,41.1,856,43.9
+Grasim Industries Ltd.,GRASIM,500300,CEMENT AND CONSTRUCTION,CEMENT & CEMENT PRODUCTS,"30,505.3","25,995.9","4,224.8",13.98%,"1,245.2",397.8,"2,866.4",837.7,"1,163.8",17.7,"6,624.9",100.6
+KNR Constructions Ltd.,KNRCON,532942,CEMENT AND CONSTRUCTION,CONSTRUCTION & ENGINEERING,"1,043.8",806.9,231.6,22.30%,39.2,20.6,177.1,34.6,147.4,5.2,537.5,19.1
+Aditya Birla Capital Ltd.,ABCAPITAL,540691,DIVERSIFIED,HOLDING COMPANIES,"7,730.4","4,550.1","2,821.9",36.55%,48,"1,827",956.8,284.1,705,2.7,"5,231.9",20.1
+Dixon Technologies (India) Ltd.,DIXON,540699,CONSUMER DURABLES,CONSUMER ELECTRONICS,"4,943.9","4,744.3",198.9,4.02%,36.4,17.1,146.1,35.2,107.3,19,308.7,51.8
+Cholamandalam Financial Holdings Ltd.,CHOLAHLDNG,504973,DIVERSIFIED,HOLDING COMPANIES,"6,372.2","2,495.1","3,404.8",54.05%,52.1,"2,209.4","1,215.8",324.6,420.9,22.4,"1,532.3",81.6
+Cochin Shipyard Ltd.,COCHINSHIP,540678,TRANSPORTATION,MARINE PORT & SERVICES,"1,100.4",820.5,191.2,18.90%,18.9,9.6,251.4,69.9,181.5,13.8,429.9,32.7
+Bharat Dynamics Ltd.,BDL,541143,GENERAL INDUSTRIALS,DEFENCE,694.1,481.8,134,21.77%,17.4,0.8,194.1,47,147.1,8,425.4,23.2
+Lux Industries Ltd.,LUXIND,539542,TEXTILES APPARELS & ACCESSORIES,OTHER APPARELS & ACCESSORIES,643.6,584.2,55,8.61%,5.9,5.4,48,12.1,37.1,12.3,103.1,32.9
+Zensar Technologies Ltd.,ZENSARTECH,504067,SOFTWARE & SERVICES,IT CONSULTING & SOFTWARE,"1,277.1","1,009.9",230.9,18.61%,36.6,5.7,224.9,51,173.9,7.7,525.8,23.2
+PCBL Ltd.,PCBL,506590,CHEMICALS & PETROCHEMICALS,CARBON BLACK,"1,489.4","1,248.6",238.1,16.02%,48.2,21,171.6,48.8,122.6,3.2,431.6,11.4
+Zydus Wellness Ltd.,ZYDUSWELL,531335,FMCG,PACKAGED FOODS,444,423.1,16.8,3.82%,5.8,6.5,8.6,2.7,5.9,0.9,281.2,44.2
+Linde India Ltd.,LINDEINDIA,523457,GENERAL INDUSTRIALS,INDUSTRIAL GASES,729.9,537.7,173.6,24.41%,49.7,1.2,141.3,34.6,108.7,12.8,417.9,49
+FDC Ltd.,FDC,531599,PHARMACEUTICALS & BIOTECHNOLOGY,PHARMACEUTICALS,513.6,409.9,76.4,15.71%,9.9,1.1,92.7,22.9,69.8,4.2,251.2,15.4
+The New India Assurance Company Ltd.,NIACL,540769,BANKING AND FINANCE,GENERAL INSURANCE,"10,571","10,773.4",-246.5,-2.33%,0,0,-242,-46.7,-176.1,-1.1,947,5.7
+Sundaram Finance Ltd.,SUNDARMFIN,590071,BANKING AND FINANCE,FINANCE (INCLUDING NBFCS),"1,710.6",322.5,"1,332.1",77.98%,43.6,820.3,470.6,142.8,365.4,33.2,"1,506.7",135.6
+TeamLease Services Ltd.,TEAMLEASE,539658,COMMERCIAL SERVICES & SUPPLIES,MISC. COMMERCIAL SERVICES,"2,285.6","2,240.8",31.8,1.40%,12.9,2.5,29.4,1.8,27.3,16.3,106.6,63.5
+Galaxy Surfactants Ltd.,GALAXYSURF,540935,CHEMICALS & PETROCHEMICALS,SPECIALTY CHEMICALS,985.8,858.2,124.9,12.70%,24.7,5.4,97.5,20.1,77.4,21.8,349.3,98.5
+Bandhan Bank Ltd.,BANDHANBNK,541153,BANKING AND FINANCE,BANKS,"5,032.2","1,400.2","1,583.4",35.25%,0,"2,048.6",947.2,226.1,721.2,4.5,"2,541.1",15.8
+ICICI Securities Ltd.,ISEC,541179,BANKING AND FINANCE,CAPITAL MARKETS,"1,249",433.5,810.2,64.87%,25.8,215.1,569.4,145.7,423.6,13.1,"1,238.1",38.3
+V-Mart Retail Ltd.,VMART,534976,RETAILING,DEPARTMENT STORES,551.4,548.8,0.7,0.12%,53.2,35.9,-86.4,-22.3,-64.1,-32.4,-103.1,-52.1
+Nippon Life India Asset Management Ltd.,NAM-INDIA,540767,BANKING AND FINANCE,ASSET MANAGEMENT COS.,475.4,156.1,241.4,60.73%,7.2,1.7,310.4,66.1,244.4,3.9,883.3,14.1
+Grindwell Norton Ltd.,GRINDWELL,506076,GENERAL INDUSTRIALS,OTHER INDUSTRIAL PRODUCTS,690,536,131.4,19.69%,16.9,1.8,135.3,33.1,101.9,9.2,378.3,34.2
+HDFC Life Insurance Company Ltd.,HDFCLIFE,540777,BANKING AND FINANCE,LIFE INSURANCE,"23,276.6","23,659.3",-508.1,-2.20%,0,0,-373.1,-657.5,378.2,1.8,"1,472.8",6.9
+Elgi Equipments Ltd.,ELGIEQUIP,522074,GENERAL INDUSTRIALS,INDUSTRIAL MACHINERY,817.8,663.4,142.7,17.71%,18.7,6.6,129.2,38.8,91.3,2.9,401.9,12.7
+Hindustan Aeronautics Ltd.,HAL,541154,GENERAL INDUSTRIALS,DEFENCE,"6,105.1","4,108.1","1,527.6",27.11%,349.6,0.3,"1,647",414.8,"1,236.7",18.5,"6,037.3",90.3
+BSE Ltd.,BSE,BSE,BANKING AND FINANCE,EXCHANGE,367,172.8,189.2,52.26%,22.7,8.5,163,63.6,120.5,8.8,706,52.1
+Rites Ltd.,RITES,541556,CEMENT AND CONSTRUCTION,CONSTRUCTION & ENGINEERING,608.8,444.5,137.8,23.67%,14.1,1.4,148.8,40.1,101.2,4.2,488.1,20.3
+Fortis Healthcare Ltd.,FORTIS,532843,DIVERSIFIED CONSUMER SERVICES,HEALTHCARE FACILITIES,"1,783.5","1,439.8",330.2,18.65%,84.1,31.8,231.4,48.8,173.7,2.3,547.6,7.3
+Varroc Engineering Ltd.,VARROC,541578,AUTOMOBILES & AUTO COMPONENTS,AUTO PARTS & EQUIPMENT,"1,893.5","1,692.6",194.3,10.30%,84.9,50.3,65.9,18.2,54.2,3.5,146.5,9.6
+Adani Green Energy Ltd.,ADANIGREEN,ASM,UTILITIES,ELECTRIC UTILITIES,"2,589",521,"1,699",76.53%,474,"1,165",413,119,372,2.2,"1,305",8.2
+VIP Industries Ltd.,VIPIND,507880,TEXTILES APPARELS & ACCESSORIES,OTHER APPARELS & ACCESSORIES,548.7,493.2,52.9,9.68%,23.8,12.4,19.3,6,13.3,0.9,110.9,7.8
+CreditAccess Grameen Ltd.,CREDITACC,541770,BANKING AND FINANCE,FINANCE (INCLUDING NBFCS),"1,247.6",248.8,902.3,72.36%,12.3,423.9,466.8,119.7,347,21.8,"1,204.2",75.7
+CESC Ltd.,CESC,500084,UTILITIES,ELECTRIC UTILITIES,"4,414","3,706",646,14.84%,303,305,461,98,348,2.6,"1,447",10.9
+Jamna Auto Industries Ltd.,JAMNAAUTO,520051,AUTOMOBILES & AUTO COMPONENTS,AUTO PARTS & EQUIPMENT,608.7,528.2,79.1,13.03%,10.9,0.8,68.7,18.6,50.1,2.4,189.3,4.7
+Suprajit Engineering Ltd.,SUPRAJIT,532509,AUTOMOBILES & AUTO COMPONENTS,AUTO PARTS & EQUIPMENT,727.6,639.1,69.8,9.85%,25.7,13.6,49.2,14.5,34.8,2.5,146.9,10.6
+JK Paper Ltd.,JKPAPER,532162,COMMERCIAL SERVICES & SUPPLIES,PAPER & PAPER PRODUCTS,"1,708.8","1,242.8",407.3,24.68%,83.5,42,340.6,34.9,302.4,17.9,"1,220.6",72.1
+Bank of Maharashtra,MAHABANK,532525,BANKING AND FINANCE,BANKS,"5,735.5","1,179.4","1,920.5",37.90%,0,"2,635.7",935.7,16,919.8,1.3,"3,420.8",4.8
+Aavas Financiers Ltd.,AAVAS,541988,BANKING AND FINANCE,HOUSING FINANCE,497.6,123.5,367.8,74.03%,7.6,203.6,157.4,35.7,121.7,15.4,465.4,58.8
+HDFC Asset Management Company Ltd.,HDFCAMC,541729,BANKING AND FINANCE,ASSET MANAGEMENT COS.,765.4,162,481.1,74.81%,13,2.3,588.1,151.6,436.5,20.4,"1,659.3",77.7
+KEI Industries Ltd.,KEI,517569,CONSUMER DURABLES,OTHER ELECTRICAL EQUIPMENT/PRODUCTS,"1,954.2","1,742.7",203.9,10.47%,15.6,7.5,188.4,48.2,140.2,15.5,528.3,58.5
+Orient Electric Ltd.,ORIENTELEC,541301,CONSUMER DURABLES,CONSUMER ELECTRONICS,570.3,546.2,20.7,3.65%,14.2,5.2,23.4,4.9,18.4,0.9,95.3,4.5
+Deepak Nitrite Ltd.,DEEPAKNTR,506401,CHEMICALS & PETROCHEMICALS,COMMODITY CHEMICALS,"1,795.1","1,475.8",302.3,17.00%,39.4,2.7,277.2,72.1,205.1,15,797.9,58.5
+Fine Organic Industries Ltd.,FINEORG,541557,CHEMICALS & PETROCHEMICALS,SPECIALTY CHEMICALS,557.6,409.4,131.1,24.25%,14.4,0.7,133.1,28.9,103.4,33.7,458.8,149.6
+LTIMindtree Ltd.,LTIM,540005,SOFTWARE & SERVICES,IT CONSULTING & SOFTWARE,"9,048.6","7,274.1","1,631.3",18.32%,208.2,47,"1,519.3",357,"1,161.8",39.3,"4,427.5",149.6
+Dalmia Bharat Ltd.,DALBHARAT,542216,CEMENT AND CONSTRUCTION,CEMENT & CEMENT PRODUCTS,"3,234","2,56",589,18.70%,401,101,172,48,118,6.3,"1,041",54.8
+Godfrey Phillips India Ltd.,GODFRYPHLP,500163,FOOD BEVERAGES & TOBACCO,CIGARETTES-TOBACCO PRODUCTS,"1,412.5","1,151",223.6,16.27%,36.5,6.6,218.5,55.5,202.1,38.9,802.9,154.4
+Vaibhav Global Ltd.,VAIBHAVGBL,532156,TEXTILES APPARELS & ACCESSORIES,OTHER APPARELS & ACCESSORIES,708.4,641.5,63.5,9.01%,22.6,2.9,41.4,12.4,29.4,1.8,121.3,7.3
+Abbott India Ltd.,ABBOTINDIA,500488,PHARMACEUTICALS & BIOTECHNOLOGY,PHARMACEUTICALS,"1,549.7","1,113.3",380.9,25.49%,17.8,3.1,415.4,102.5,312.9,147.3,"1,081.4",508.9
+Adani Total Gas Ltd.,ATGL,ASM,UTILITIES,UTILITIES,"1,104.8",815.7,279.9,25.55%,37.6,27.3,224.2,57.2,172.7,1.6,571,5.2
+Nestle India Ltd.,NESTLEIND,500790,FMCG,PACKAGED FOODS,"5,070.1","3,811.9","1,224.9",24.32%,111.2,31.4,"1,222",313.9,908.1,94.2,"2,971.1",308.2
+Bayer Cropscience Ltd.,BAYERCROP,506285,CHEMICALS & PETROCHEMICALS,AGROCHEMICALS,"1,633.3","1,312.3",304.9,18.85%,11.6,3.7,305.7,82.8,222.9,49.6,844.4,188.1
+Amber Enterprises India Ltd.,AMBER,540902,CONSUMER DURABLES,CONSUMER ELECTRONICS,939.8,867.5,59.6,6.43%,45.2,36.6,-9.5,-3.8,-6.9,-2.1,156.8,46.5
+Rail Vikas Nigam Ltd.,RVNL,542649,CEMENT AND CONSTRUCTION,CONSTRUCTION & ENGINEERING,"5,210.3","4,616",298.3,6.07%,6.2,132.7,455.4,85.2,394.3,1.9,"1,478.8",7.1
+Metropolis Healthcare Ltd.,METROPOLIS,542650,DIVERSIFIED CONSUMER SERVICES,HEALTHCARE SERVICES,309.7,233.7,74.8,24.25%,22.2,5.7,48.1,12.5,35.5,6.9,133.4,26
+Polycab India Ltd.,POLYCAB,542652,CONSUMER DURABLES,OTHER ELECTRICAL EQUIPMENT/PRODUCTS,"4,253","3,608.8",608.9,14.44%,60.3,26.8,557.2,127.4,425.6,28.4,"1,607.2",107.1
+Multi Commodity Exchange of India Ltd.,MCX,534091,BANKING AND FINANCE,EXCHANGE,184,193.8,-28.7,-17.38%,6.6,0.1,-16.4,1.6,-19.1,-3.7,44.8,8.8
+IIFL Finance Ltd.,IIFL,532636,BANKING AND FINANCE,OTHER FINANCIAL SERVICES,"2,533.7",788.3,"1,600.8",64.66%,43.3,932.1,683.5,158,474.3,12.4,"1,690.7",44.4
+Ratnamani Metals & Tubes Ltd.,RATNAMANI,520111,METALS & MINING,IRON & STEEL/INTERM.PRODUCTS,"1,141.9",886.3,244.9,21.65%,23.6,10.8,221.1,56.8,163.9,23.4,622.6,88.8
+RHI Magnesita India Ltd.,RHIM,534076,GENERAL INDUSTRIALS,OTHER INDUSTRIAL GOODS,989.7,839,147.9,14.98%,44.2,8.5,97.9,26.3,71.3,3.5,-502.2,-24.3
+Birlasoft Ltd.,BSOFT,532400,SOFTWARE & SERVICES,IT CONSULTING & SOFTWARE,"1,325.4","1,102.7",207.1,15.81%,21.5,5.7,195.5,50.4,145.1,5.2,378.4,13.7
+EIH Ltd.,EIHOTEL,500840,HOTELS RESTAURANTS & TOURISM,HOTELS,552.5,387.6,142.9,26.94%,33.2,5.6,126.1,36.2,93.1,1.5,424.1,6.8
+Affle (India) Ltd.,AFFLE,542752,SOFTWARE & SERVICES,INTERNET SOFTWARE & SERVICES,441.2,344.1,87.2,20.22%,18.4,5.5,73.2,6.4,66.8,5,264.3,19.8
+Westlife Foodworld Ltd.,WESTLIFE,505533,HOTELS RESTAURANTS & TOURISM,RESTAURANTS,618,516.5,98.2,15.98%,43.9,27.4,30.2,7.8,22.4,1.4,107.7,6.9
+IndiaMART InterMESH Ltd.,INDIAMART,542726,SOFTWARE & SERVICES,INTERNET SOFTWARE & SERVICES,329.3,214.7,80,27.15%,8,2.3,104.3,23.9,69.4,11.4,321.1,53.6
+Infosys Ltd.,INFY,500209,SOFTWARE & SERVICES,IT CONSULTING & SOFTWARE,"39,626","29,554","9,44",24.21%,"1,166",138,"8,768","2,553","6,212",15,"24,871",60.1
+Sterling and Wilson Renewable Energy Ltd.,SWSOLAR,542760,COMMERCIAL SERVICES & SUPPLIES,CONSULTING SERVICES,776.7,758,1.5,0.19%,4.3,64.3,-50,4.6,-54.2,-2.9,-668.4,-35.2
+ABB India Ltd.,ABB,500002,GENERAL INDUSTRIALS,HEAVY ELECTRICAL EQUIPMENT,"2,846","2,330.7",438.5,15.84%,30.3,0.9,484.2,122.2,362.9,17.1,"1,208.7",57
+Poly Medicure Ltd.,POLYMED,531768,HEALTHCARE EQUIPMENT & SUPPLIES,HEALTHCARE SUPPLIES,351.4,253.1,84.2,24.97%,16,2.2,80.9,18.8,62.2,6.5,233.7,24.4
+GMM Pfaudler Ltd.,GMMPFAUDLR,505255,GENERAL INDUSTRIALS,INDUSTRIAL MACHINERY,946,795.5,142,15.15%,32.2,21.5,96.8,26.5,71.1,15.8,183.2,40.8
+Gujarat Fluorochemicals Ltd.,FLUOROCHEM,542812,CHEMICALS & PETROCHEMICALS,SPECIALTY CHEMICALS,960.3,783.7,163.1,17.23%,67.5,34.2,74.8,22.1,52.7,4.8,915.2,83.3
+360 One Wam Ltd.,360ONE,542772,BANKING AND FINANCE,OTHER FINANCIAL SERVICES,617.1,235.6,317.8,57.31%,13.7,139.9,226.8,40.8,186,5.2,696.8,19.5
+Tata Communications Ltd.,TATACOMM,500483,TELECOM SERVICES,OTHER TELECOM SERVICES,"4,897.9","3,857.1","1,015.5",20.84%,605.1,137.4,298.3,77.9,220.7,7.7,"1,322.3",46.4
+Alkyl Amines Chemicals Ltd.,ALKYLAMINE,506767,CHEMICALS & PETROCHEMICALS,SPECIALTY CHEMICALS,354.5,303.9,48.3,13.71%,12.5,1.7,36.4,9.2,27.2,5.3,171.3,33.5
+CSB Bank Ltd.,CSBBANK,542867,BANKING AND FINANCE,BANKS,835.8,317.5,174.6,25.41%,0,343.6,178,44.8,133.2,7.7,577.7,33.3
+Indian Railway Catering & Tourism Corporation Ltd.,IRCTC,542830,DIVERSIFIED CONSUMER SERVICES,TRAVEL SUPPORT SERVICES,"1,042.4",628.8,366.6,36.83%,14,4.4,395.2,100.5,294.7,3.7,"1,061.2",13.3
+Sumitomo Chemical India Ltd.,SUMICHEM,542920,CHEMICALS & PETROCHEMICALS,AGROCHEMICALS,928,715.5,187.9,20.80%,15.8,1.2,195.5,52,143.4,2.9,367.7,7.4
+Century Textiles & Industries Ltd.,CENTURYTEX,500040,COMMERCIAL SERVICES & SUPPLIES,PAPER & PAPER PRODUCTS,"1,114.9","1,069.2",33.8,3.07%,59.2,17,-30.5,-3.3,-30.4,-2.8,117.7,10.5
+SBI Cards and Payment Services Ltd.,SBICARD,543066,BANKING AND FINANCE,FINANCE (INCLUDING NBFCS),"4,221.4","2,018.8","1,327",32.47%,46.8,604.9,809.4,206.4,603,6.4,"2,302.2",24.3
+Hitachi Energy India Ltd.,POWERINDIA,543187,GENERAL INDUSTRIALS,HEAVY ELECTRICAL EQUIPMENT,"1,228.2","1,162.6",65.3,5.32%,22.5,10.7,32.4,7.6,24.7,5.8,82.5,19.5
+Suven Pharmaceuticals Ltd.,SUVENPHAR,543064,PHARMACEUTICALS & BIOTECHNOLOGY,PHARMACEUTICALS,250.9,133.1,98,42.40%,11.9,0.5,105.4,25.8,79.6,3.1,431.8,17
+Tata Chemicals Ltd.,TATACHEM,500770,CHEMICALS & PETROCHEMICALS,COMMODITY CHEMICALS,"4,083","3,179",819,20.49%,234,145,627,120,428,16.8,"2,06",80.8
+Aarti Drugs Ltd.,AARTIDRUGS,524348,PHARMACEUTICALS & BIOTECHNOLOGY,PHARMACEUTICALS,642.2,565.1,76.4,11.92%,12.6,8.2,56.3,16.7,39.6,4.3,180.2,19.6
+Gujarat Ambuja Exports Ltd.,GAEL,524226,FMCG,EDIBLE OILS,"1,157.7","1,012.2",103.3,9.26%,30.5,5.9,109.1,26.3,82.8,3.6,305.1,13.3
+Polyplex Corporation Ltd.,POLYPLEX,524051,COMMERCIAL SERVICES & SUPPLIES,CONTAINERS & PACKAGING,"1,595.7","1,451.5",120.6,7.67%,75.1,9.9,59.1,10.9,27.9,8.9,71.1,22.6
+Chalet Hotels Ltd.,CHALET,542399,HOTELS RESTAURANTS & TOURISM,HOTELS,318.2,188.6,126,40.04%,35,50.1,44.5,8,36.4,1.8,266.7,13
+Adani Enterprises Ltd.,ADANIENT,512599,COMMERCIAL SERVICES & SUPPLIES,COMMODITY TRADING & DISTRIBUTION,"23,066","20,087.2","2,430.1",10.79%,757,"1,342.8",791,397.8,227.8,2,"2,444.3",21.4
+YES Bank Ltd.,YESBANK,532648,BANKING AND FINANCE,BANKS,"7,980.6","2,377.1",810,12.06%,0,"4,793.6",304.4,75.7,228.6,0.1,836.6,0.3
+EPL Ltd.,EPL,500135,COMMERCIAL SERVICES & SUPPLIES,CONTAINERS & PACKAGING,"1,011.2",820.6,181,18.07%,83.6,30.6,76.4,25.4,50.5,1.6,251.9,7.9
+Network18 Media & Investments Ltd.,NETWORK18,532798,MEDIA,BROADCASTING & CABLE TV,"2,052.2","2,083.8",-218.3,-11.70%,56.8,66.2,-154.5,-6.5,-61,-0.6,-144.2,-1.4
+CIE Automotive India Ltd.,CIEINDIA,532756,AUTOMOBILES & AUTO COMPONENTS,AUTO PARTS & EQUIPMENT,"2,299.4","1,934",345.4,15.15%,78.3,31,256.1,69.1,375.4,9.9,298.4,7.9
+Vedanta Ltd.,VEDL,500295,METALS & MINING,ALUMINIUM AND ALUMINIUM PRODUCTS,"39,585","27,466","11,479",29.47%,"2,642","2,523","8,177","9,092","-1,783",-4.8,"5,202",14
+Rossari Biotech Ltd.,ROSSARI,543213,CHEMICALS & PETROCHEMICALS,SPECIALTY CHEMICALS,484.8,419.9,63.6,13.15%,15.1,5,44.8,11.9,32.9,6,116.8,21.2
+KPIT Technologies Ltd.,KPITTECH,542651,SOFTWARE & SERVICES,IT CONSULTING & SOFTWARE,"1,208.6",959.2,239.9,20.01%,48.1,13.6,187.7,46.3,140.9,5.2,486.9,18
+Intellect Design Arena Ltd.,INTELLECT,538835,SOFTWARE & SERVICES,IT SOFTWARE PRODUCTS,631.7,497.2,121.9,19.69%,33.7,0.8,96.5,25.7,70.4,5.2,316.6,23.2
+Balaji Amines Ltd.,BALAMINES,530999,CHEMICALS & PETROCHEMICALS,SPECIALTY CHEMICALS,387.3,326.8,53.8,14.13%,10.8,1.8,48,11.6,34.7,10.7,197.3,60.9
+UTI Asset Management Company Ltd.,UTIAMC,543238,BANKING AND FINANCE,ASSET MANAGEMENT COS.,405.6,172.5,231.5,57.30%,10.4,2.8,219.8,37,182.8,14.4,562.9,44.3
+Mazagon Dock Shipbuilders Ltd.,MAZDOCK,543237,TRANSPORTATION,SHIPPING,"2,079.2","1,651.1",176.6,9.66%,20.2,1.3,406.6,102.8,332.9,16.5,"1,327.6",65.8
+Computer Age Management Services Ltd.,CAMS,543232,BANKING AND FINANCE,CAPITAL MARKETS,284.7,153,122.1,44.39%,17.4,2,112.4,28.6,84.5,17.2,309.2,62.9
+Happiest Minds Technologies Ltd.,HAPPSTMNDS,543227,SOFTWARE & SERVICES,IT CONSULTING & SOFTWARE,428.8,324,82.6,20.32%,14.6,11.2,79.1,20.7,58.5,3.9,232,15.6
+Triveni Turbine Ltd.,TRITURBINE,533655,GENERAL INDUSTRIALS,HEAVY ELECTRICAL EQUIPMENT,402.3,313.4,74.3,19.17%,5.1,0.6,83.2,19,64.2,2,233.1,7.3
+Angel One Ltd.,ANGELONE,ASM,BANKING AND FINANCE,CAPITAL MARKETS,"1,049.3",602.6,443.4,42.31%,11.2,26.4,407.2,102.7,304.5,36.3,"1,020.2",121.7
+Tanla Platforms Ltd.,TANLA,532790,SOFTWARE & SERVICES,INTERNET SOFTWARE & SERVICES,"1,014.9",811.8,196.8,19.51%,22.6,1.8,178.7,36.2,142.5,10.6,514.7,38.3
+Max Healthcare Institute Ltd.,MAXHEALTH,543220,DIVERSIFIED CONSUMER SERVICES,HEALTHCARE FACILITIES,"1,408.6",975.8,387.4,28.42%,57.9,8.5,366.4,89.7,276.7,2.9,990.1,10.2
+Asahi India Glass Ltd.,ASAHIINDIA,515030,AUTOMOBILES & AUTO COMPONENTS,AUTO PARTS & EQUIPMENT,"1,122.6",934,185.6,16.58%,43,34.4,111.3,30.2,86.9,3.6,343.5,14.1
+Prince Pipes & Fittings Ltd.,PRINCEPIPE,542907,GENERAL INDUSTRIALS,PLASTIC PRODUCTS,660.4,562.3,94.2,14.35%,22.5,0.7,92.8,22.2,70.6,5.2,219.8,19.9
+Route Mobile Ltd.,ROUTE,543228,SOFTWARE & SERVICES,INTERNET SOFTWARE & SERVICES,"1,018.3",886.5,128.1,12.63%,21.4,6.5,103.8,15.5,88.8,14.2,365.3,58.3
+KPR Mill Ltd.,KPRMILL,532889,TEXTILES APPARELS & ACCESSORIES,TEXTILES,"1,533","1,212.9",298,19.72%,46,18.1,256,54.2,201.8,5.9,788.8,23.1
+Infibeam Avenues Ltd.,INFIBEAM,539807,SOFTWARE & SERVICES,INTERNET SOFTWARE & SERVICES,792.6,719.7,70.2,8.89%,17.1,0.5,55.2,14.7,41,0.1,142.2,0.5
+Restaurant Brands Asia Ltd.,RBA,543248,HOTELS RESTAURANTS & TOURISM,RESTAURANTS,628.2,568.7,56.2,9.00%,78.6,31.5,-50.7,0,-46,-0.9,-220.3,-4.5
+Larsen & Toubro Ltd.,LT,500510,CEMENT AND CONSTRUCTION,CONSTRUCTION & ENGINEERING,"52,157","45,392.1","5,632",11.04%,909.9,864,"4,991.1","1,135.5","3,222.6",22.9,"12,255.3",89.2
+Gland Pharma Ltd.,GLAND,543245,PHARMACEUTICALS & BIOTECHNOLOGY,PHARMACEUTICALS,"1,426.6","1,049.3",324.1,23.60%,81.3,6,289.9,95.8,194.1,11.8,698.8,42.4
+Macrotech Developers Ltd.,LODHA,543287,REALTY,REALTY,"1,755.1","1,333.5",416.1,23.78%,29.3,123.1,269.2,62.4,201.9,2.1,"1,529.2",15.9
+Poonawalla Fincorp Ltd.,POONAWALLA,524000,BANKING AND FINANCE,FINANCE (INCLUDING NBFCS),745.3,178.9,531.7,71.98%,14.7,215.5,"1,124.6",270,860.2,11.2,"1,466.4",19.1
+The Fertilisers and Chemicals Travancore Ltd.,FACT,590024,FERTILIZERS,FERTILIZERS,"1,713.6","1,530.8",132.4,7.96%,5.3,61.2,105.2,0,105.2,1.6,508.4,7.9
+Home First Finance Company India Ltd.,HOMEFIRST,543259,BANKING AND FINANCE,HOUSING FINANCE,278,53.7,211.6,77.43%,2.8,117,96.4,22.1,74.3,8.4,266.2,30.2
+CG Power and Industrial Solutions Ltd.,CGPOWER,500093,GENERAL INDUSTRIALS,HEAVY ELECTRICAL EQUIPMENT,"2,019","1,692.9",308.6,15.42%,22.9,0.4,329.9,86.2,242.3,1.6,"1,1",7.2
+Laxmi Organic Industries Ltd.,LXCHEM,543277,CHEMICALS & PETROCHEMICALS,SPECIALTY CHEMICALS,660.5,613.3,38.9,5.97%,27.5,2.1,17.5,6.8,10.7,0.4,100.6,3.8
+Anupam Rasayan India Ltd.,ANURAS,543275,CHEMICALS & PETROCHEMICALS,AGROCHEMICALS,395.6,284.7,107.5,27.41%,19.8,20.4,70.7,22,40.7,3.8,178.9,16.6
+Kalyan Jewellers India Ltd.,KALYANKJIL,ASM,TEXTILES APPARELS & ACCESSORIES,GEMS & JEWELLERY,"4,427.7","4,100.9",313.7,7.11%,66.9,81.7,178.1,43.3,135.2,1.3,497.9,4.8
+Jubilant Pharmova Ltd.,JUBLPHARMA,530019,PHARMACEUTICALS & BIOTECHNOLOGY,PHARMACEUTICALS,"1,690.2","1,438.5",241.8,14.39%,96.6,66.1,89,35.9,62.5,3.9,-44.6,-2.8
+Indigo Paints Ltd.,INDIGOPNTS,543258,DIVERSIFIED CONSUMER SERVICES,FURNITURE-FURNISHING-PAINTS,273.4,228.7,41.8,15.45%,10,0.5,34.3,8.2,26.1,5.5,132.4,27.8
+Indian Railway Finance Corporation Ltd.,IRFC,543257,BANKING AND FINANCE,FINANCE (INCLUDING NBFCS),"6,767.5",33.5,"6,732.4",99.50%,2.1,"5,181.5","1,549.9",0,"1,549.9",1.2,"6,067.6",4.6
+Mastek Ltd.,MASTEK,523704,SOFTWARE & SERVICES,IT CONSULTING & SOFTWARE,770.4,642.5,123,16.07%,20.9,12.6,90.3,25,62.8,20.5,269.7,88
+Equitas Small Finance Bank Ltd.,EQUITASBNK,543243,BANKING AND FINANCE,BANKS,"1,540.4",616.8,330.2,24.30%,0,593.4,267,68.9,198.1,1.8,749.5,6.7
+Tata Teleservices (Maharashtra) Ltd.,TTML,532371,TELECOM SERVICES,TELECOM SERVICES,288.6,159.3,127.5,44.45%,36.3,403.2,-310.2,0,-310.2,-1.6,"-1,168.3",-6
+Praj Industries Ltd.,PRAJIND,522205,GENERAL INDUSTRIALS,INDUSTRIAL MACHINERY,893.3,798.4,84,9.52%,9.1,1,84.8,22.4,62.4,3.4,271.4,14.8
+Nazara Technologies Ltd.,NAZARA,543280,SOFTWARE & SERVICES,INTERNET SOFTWARE & SERVICES,309.5,269.4,26.7,8.98%,15.1,2.7,21.2,-1.3,19.8,3,60,9.1
+Jubilant Ingrevia Ltd.,JUBLINGREA,543271,CHEMICALS & PETROCHEMICALS,SPECIALTY CHEMICALS,"1,028.5",902.3,117.7,11.54%,33.9,12.5,79.8,22.4,57.5,3.6,258.9,16.4
+Sona BLW Precision Forgings Ltd.,SONACOMS,543300,AUTOMOBILES & AUTO COMPONENTS,AUTO PARTS & EQUIPMENT,796.9,567.5,223.3,28.24%,53.4,6,164.1,40.1,123.8,2.1,462.8,7.9
+Chemplast Sanmar Ltd.,CHEMPLASTS,543336,CHEMICALS & PETROCHEMICALS,SPECIALTY CHEMICALS,"1,025",941.8,46,4.65%,35.3,38.6,9.2,-16.8,26.1,1.6,35.3,2.2
+Aptus Value Housing Finance India Ltd.,APTUS,543335,BANKING AND FINANCE,HOUSING FINANCE,344.5,50.6,277.5,83.18%,2.6,96.1,189.6,41.5,148,3,551.1,11.1
+Clean Science & Technology Ltd.,CLEAN,543318,CHEMICALS & PETROCHEMICALS,SPECIALTY CHEMICALS,187.1,106.3,74.8,41.32%,11.1,0.3,69.5,17.3,52.2,4.9,275.5,25.9
+Medplus Health Services Ltd.,MEDPLUS,543427,HEALTHCARE EQUIPMENT & SUPPLIES,HEALTHCARE SUPPLIES,"1,419","1,323.5",85.1,6.04%,55.5,23.5,16.4,1.9,14.6,1.2,58.3,4.9
+Nuvoco Vistas Corporation Ltd.,NUVOCO,543334,CEMENT AND CONSTRUCTION,CEMENT & CEMENT PRODUCTS,"2,578.9","2,243",329.9,12.82%,225.6,139.9,-29.6,-31.1,1.5,0,141.8,4
+Star Health and Allied Insurance Company Ltd.,STARHEALTH,543412,BANKING AND FINANCE,GENERAL INSURANCE,"3,463.2","3,295.8",165.7,4.79%,0,0,167.1,41.8,125.3,2.1,725.4,12.4
+Go Fashion (India) Ltd.,GOCOLORS,543401,TEXTILES APPARELS & ACCESSORIES,OTHER APPARELS & ACCESSORIES,192.8,132.2,56.6,29.98%,25.8,8.9,25.8,5.7,20,3.7,85.4,15.8
+PB Fintech Ltd.,POLICYBZR,543390,SOFTWARE & SERVICES,INTERNET SOFTWARE & SERVICES,909.1,900.7,-89.1,-10.98%,22.3,7.2,-21.1,-0.3,-20.2,-0.5,-127.9,-2.8
+FSN E-Commerce Ventures Ltd.,NYKAA,543384,SOFTWARE & SERVICES,INTERNET & CATALOGUE RETAIL,"1,515.6","1,426.4",80.6,5.35%,54.6,21.3,13.3,4,5.8,0,19.8,0.1
+Krishna Institute of Medical Sciences Ltd.,KIMS,543308,DIVERSIFIED CONSUMER SERVICES,HEALTHCARE FACILITIES,655.4,475.2,177.3,27.17%,32.6,8.9,138.6,37.3,92,11.5,342.1,42.7
+Zomato Ltd.,ZOMATO,543320,SOFTWARE & SERVICES,INTERNET SOFTWARE & SERVICES,"3,06","2,895",-47,-1.65%,128,16,21,-15,36,0,-496.8,-0.6
+Brightcom Group Ltd.,BCG,532368,SOFTWARE & SERVICES,INTERNET SOFTWARE & SERVICES,"1,690.5","1,172.3",518,30.65%,72.3,0.1,445.8,124.3,321.5,1.6,"1,415.2",7
+Shyam Metalics and Energy Ltd.,SHYAMMETL,543299,METALS & MINING,IRON & STEEL/INTERM.PRODUCTS,"2,978.9","2,633.6",307.1,10.44%,176.5,35.4,133.4,-348.6,484.1,18.9,"1,049.9",41.2
+G R Infraprojects Ltd.,GRINFRA,543317,CEMENT AND CONSTRUCTION,ROADS & HIGHWAYS,"1,909.2","1,415.7",467.1,24.81%,61.7,144.6,287.1,69.9,217.2,22.5,"1,240.3",128.3
+RattanIndia Enterprises Ltd.,RTNINDIA,534597,UTILITIES,ELECTRIC UTILITIES,"1,618.1","1,392.8",1.5,0.11%,4.3,28.8,142.2,1.7,140.9,1,147.6,1.1
+Borosil Renewables Ltd.,BORORENEW,502219,CONSUMER DURABLES,HOUSEWARE,406.3,369.2,32.5,8.09%,31,9.6,28.9,-1.1,25.1,1.9,32.1,2.5
+HLE Glascoat Ltd.,HLEGLAS,522215,GENERAL INDUSTRIALS,INDUSTRIAL MACHINERY,227.8,198,26.5,11.79%,6.1,5.8,16.1,5.3,10,1.6,54.4,8
+Tata Investment Corporation Ltd.,TATAINVEST,501301,DIVERSIFIED,HOLDING COMPANIES,125,10.1,113.8,91.88%,0.2,4.7,110.1,-1.3,124.4,24.6,326.1,64.4
+Sapphire Foods India Ltd.,SAPPHIRE,543397,HOTELS RESTAURANTS & TOURISM,RESTAURANTS,650.1,527.5,115.1,17.91%,76.8,24.5,21.4,6.2,15.3,2.4,208.5,32.7
+Devyani International Ltd.,DEVYANI,543330,HOTELS RESTAURANTS & TOURISM,RESTAURANTS,826,665,154.4,18.84%,86.3,41.7,19,-16.8,33.4,0.3,177.5,1.5
+Vijaya Diagnostic Centre Ltd.,VIJAYA,543350,DIVERSIFIED CONSUMER SERVICES,HEALTHCARE SERVICES,145.6,81.5,57.4,41.31%,13.7,5.9,44.6,11,33.3,3.3,103.4,10.1
+C.E. Info Systems Ltd.,MAPMYINDIA,543425,SOFTWARE & SERVICES,INTERNET SOFTWARE & SERVICES,99.3,50.1,41,44.98%,3.7,0.7,44.7,11.1,33,6.1,122.9,22.7
+Latent View Analytics Ltd.,LATENTVIEW,543398,SOFTWARE & SERVICES,DATA PROCESSING SERVICES,172.7,124.9,30.8,19.78%,2.3,0.8,44.7,10.6,34,1.7,153.6,7.5
+Metro Brands Ltd.,METROBRAND,543426,RETAILING,FOOTWEAR,571.9,400.3,155.4,27.96%,57.2,19.7,94.7,27.5,66.7,2.5,340,12.5
+Easy Trip Planners Ltd.,EASEMYTRIP,543272,SOFTWARE & SERVICES,INTERNET SOFTWARE & SERVICES,144.6,76.9,64.8,45.71%,1,2,64.7,17.7,47.2,0.3,146,0.8
+Shree Renuka Sugars Ltd.,RENUKA,532670,FOOD BEVERAGES & TOBACCO,SUGAR,"2,564.7","2,491",63.7,2.49%,64.1,216.8,-207.2,-1.6,-204.9,-1,-286,-1.3
+One97 Communications Ltd.,PAYTM,543396,SOFTWARE & SERVICES,INTERNET SOFTWARE & SERVICES,"2,662.5","2,749.6",-231,-9.17%,180.1,7,-279.9,12.7,-290.5,-5,"-1,207.9",-19
+MTAR Technologies Ltd.,MTARTECH,543270,GENERAL INDUSTRIALS,DEFENCE,167.7,130.7,36.1,21.64%,5.8,5.5,25.7,5.2,20.5,6.7,103.3,33.6
+Capri Global Capital Ltd.,CGCL,531595,BANKING AND FINANCE,FINANCE (INCLUDING NBFCS),557.4,229.3,304.8,54.70%,23.1,195.8,86,20.8,65.2,3.2,231.2,11.2
+GMR Airports Infrastructure Ltd.,GMRINFRA,ASM,CEMENT AND CONSTRUCTION,CONSTRUCTION & ENGINEERING,"2,185","1,336.8",726.7,35.22%,373,695.8,-252,54.9,-91,-0.1,-370.9,-0.6
+Triveni Engineering & Industries Ltd.,TRIVENI,532356,FOOD BEVERAGES & TOBACCO,SUGAR,"1,629.7","1,554.5",62.9,3.89%,25.8,10.2,39.3,10.1,29.1,1.3,434.3,19.8
+Delhivery Ltd.,DELHIVERY,543529,TRANSPORTATION,TRANSPORTATION - LOGISTICS,"2,043","1,957.3",-15.6,-0.80%,171.2,19.6,-105.2,-2.1,-102.9,-1.4,-546.7,-7.5
+Life Insurance Corporation of India,LICI,543526,BANKING AND FINANCE,LIFE INSURANCE,"202,394.9","193,612.5","8,445",4.18%,0,0,"8,696.5","1,083.9","8,030.3",12.7,"37,204.8",58.8
+Campus Activewear Ltd.,CAMPUS,543523,RETAILING,FOOTWEAR,259.1,234.2,24.5,9.46%,18.1,6.5,0.4,0.1,0.3,0,103.1,3.4
+Motherson Sumi Wiring India Ltd.,MSUMI,543498,AUTOMOBILES & AUTO COMPONENTS,AUTO PARTS & EQUIPMENT,"2,110.2","1,856.5",248.1,11.79%,36.4,7.4,210,54.1,155.9,0.3,523.6,1.2
+Olectra Greentech Ltd.,OLECTRA,532439,AUTOMOBILES & AUTO COMPONENTS,COMMERCIAL VEHICLES,310.3,266.6,40.5,13.20%,8.8,9.7,25.2,8,18.6,2.2,78.5,9.6
+Patanjali Foods Ltd.,PATANJALI,500368,FMCG,EDIBLE OILS,"7,845.8","7,426.6",395.3,5.05%,60.1,24,335.1,80.5,254.5,7,875.2,24.2
+Raymond Ltd.,RAYMOND,500330,TEXTILES APPARELS & ACCESSORIES,TEXTILES,"2,320.7","1,938.8",314.6,13.96%,65.4,89.3,204.2,50.7,159.8,24,"1,514.2",227.5
+Swan Energy Ltd.,SWANENERGY,503310,REALTY,REALTY,"1,230.1",966.3,257,21.01%,27.1,58.3,178.4,12.8,84.6,6.7,308.4,11.7
+Samvardhana Motherson International Ltd.,MOTHERSON,517334,AUTOMOBILES & AUTO COMPONENTS,AUTO PARTS & EQUIPMENT,"23,639.2","21,585","1,888.8",8.05%,867.4,487.9,449.5,229.2,201.6,0.3,"1,910.3",2.8
+Vedant Fashions Ltd.,MANYAVAR,543463,RETAILING,SPECIALTY RETAIL,233.4,125.5,92.8,42.51%,32.5,10.7,64.8,16.1,48.7,2,399.9,16.5
+Adani Wilmar Ltd.,AWL,543458,FMCG,EDIBLE OILS,"12,331.2","12,123.5",143.7,1.17%,95.7,220.2,-161.8,-31.5,-130.7,-1,130.1,1
+Mahindra Lifespace Developers Ltd.,MAHLIFE,532313,REALTY,REALTY,25.7,52.7,-34.9,-196.45%,3.1,0.2,-30.3,-10.8,-18.9,-1.2,10.5,0.7
+Tejas Networks Ltd.,TEJASNET,540595,TELECOM SERVICES,OTHER TELECOM SERVICES,413.9,383,13,3.28%,41.7,7,-17.7,-5.1,-12.6,-0.7,-61.3,-3.5
+Aether Industries Ltd.,AETHER,543534,CHEMICALS & PETROCHEMICALS,SPECIALTY CHEMICALS,178.3,118.2,46,28.00%,9.7,1.6,48.7,12.1,36.7,2.8,139.1,10.5
+JBM Auto Ltd.,JBMA,ASM,AUTOMOBILES & AUTO COMPONENTS,AUTO PARTS & EQUIPMENT,"1,238.8","1,091.3",139.7,11.35%,41.2,47.9,58.3,11.3,44.2,3.7,136.8,11.6
+Deepak Fertilisers & Petrochemicals Corporation Ltd.,DEEPAKFERT,500645,CHEMICALS & PETROCHEMICALS,COMMODITY CHEMICALS,"2,443.2","2,138.1",286.1,11.80%,81.2,107.1,116.8,53.3,60.1,4.8,674.5,53.4
+Sharda Cropchem Ltd.,SHARDACROP,538666,CHEMICALS & PETROCHEMICALS,AGROCHEMICALS,604.3,559.6,21.2,3.65%,74,4.6,-33.8,-6.3,-27.6,-3.1,191,21.2
+Shoppers Stop Ltd.,SHOPERSTOP,532638,RETAILING,DEPARTMENT STORES,"1,049.7",878.2,160.9,15.49%,108.2,54.9,3.5,0.8,2.7,0.2,94.2,8.6
+BEML Ltd.,BEML,500048,AUTOMOBILES & AUTO COMPONENTS,COMMERCIAL VEHICLES,924,855.3,61.5,6.70%,15.8,10.8,42.2,-9.6,51.8,12.4,200.8,48.2
+Lemon Tree Hotels Ltd.,LEMONTREE,541233,HOTELS RESTAURANTS & TOURISM,HOTELS,230.1,125.3,101.9,44.84%,22.6,47.3,34.8,8.6,22.6,0.3,130.1,1.6
+Rainbow Childrens Medicare Ltd.,RAINBOW,543524,DIVERSIFIED CONSUMER SERVICES,HEALTHCARE FACILITIES,340.5,215.1,117.6,35.34%,26.8,13.3,85.2,22.1,62.9,6.2,215.4,21.2
+UCO Bank,UCOBANK,532505,BANKING AND FINANCE,BANKS,"5,865.6","1,581.5",981.9,18.81%,0,"3,302.3",639.8,238.1,403.5,0.3,"1,84",1.5
+Piramal Pharma Ltd.,PPLPHARMA,543635,PHARMACEUTICALS & BIOTECHNOLOGY,PHARMACEUTICALS,"1,960.6","1,645.7",265.6,13.90%,184.5,109.9,20.4,34.5,5,0,-133.6,-1
+KSB Ltd.,KSB,500249,GENERAL INDUSTRIALS,INDUSTRIAL MACHINERY,572.2,493.4,70.3,12.47%,12.3,2,64.5,17.1,50.1,14.4,209.7,60.3
+Data Patterns (India) Ltd.,DATAPATTNS,543428,GENERAL INDUSTRIALS,DEFENCE,119.2,67.5,40.8,37.63%,3.1,2.3,46.3,12.5,33.8,6,148.3,26.5
+Global Health Ltd.,MEDANTA,543654,DIVERSIFIED CONSUMER SERVICES,HEALTHCARE FACILITIES,864.7,631.1,212.9,25.22%,42.9,20.1,170.6,45.4,125.2,4.7,408.9,15.2
+Aarti Industries Ltd.,AARTIIND,524208,CHEMICALS & PETROCHEMICALS,SPECIALTY CHEMICALS,"1,454","1,221.2",232.8,16.01%,93,58.2,81.6,-9.1,90.7,2.5,446.2,12.3
+BLS International Services Ltd.,BLS,540073,DIVERSIFIED CONSUMER SERVICES,TRAVEL SUPPORT SERVICES,416.4,321,86.7,21.27%,7.3,1,87.2,5.2,78.7,1.9,267.6,6.5
+Archean Chemical Industries Ltd.,ACI,543657,CHEMICALS & PETROCHEMICALS,COMMODITY CHEMICALS,301.7,195,95.5,32.86%,17.5,1.9,87.3,21.3,66,5.4,394.4,32.1
+Adani Power Ltd.,ADANIPOWER,ASM,UTILITIES,ELECTRIC UTILITIES,"14,935.7","7,819.2","5,171.4",39.81%,"1,004.5",888.4,"5,223.6","-1,370.6","6,594.2",16.5,"20,604.8",53.4
+Craftsman Automation Ltd.,CRAFTSMAN,543276,AUTOMOBILES & AUTO COMPONENTS,AUTO PARTS & EQUIPMENT,"1,183.8",941.6,237.5,20.14%,66.8,41.6,133.8,29.6,94.5,44.1,298.3,141.2
+NMDC Ltd.,NMDC,526371,METALS & MINING,MINING,"4,335","2,823.6","1,190.4",29.66%,88.8,18.6,"1,404.1",379,"1,026.2",3.5,"5,862.2",20
+Epigral Ltd.,EPIGRAL,543332,CHEMICALS & PETROCHEMICALS,SPECIALTY CHEMICALS,479.1,370.2,107.9,22.57%,31.5,21.3,56.1,17.9,38,9.1,223.4,53.8
+Apar Industries Ltd.,APARINDS,532259,CONSUMER DURABLES,OTHER ELECTRICAL EQUIPMENT/PRODUCTS,"3,944.7","3,576.2",349.8,8.91%,28.2,103.1,237.3,62.9,173.9,45.4,783.9,204.8
+Bikaji Foods International Ltd.,BIKAJI,543653,FMCG,PACKAGED FOODS,614.7,521,87.7,14.41%,15.6,2.9,75.2,15.4,61.2,2.5,173.6,6.9
+Five-Star Business Finance Ltd.,FIVESTAR,543663,BANKING AND FINANCE,FINANCE (INCLUDING NBFCS),522.4,133.2,375,72.28%,5.7,105.9,267,67.6,199.4,6.8,703,24.1
+Ingersoll-Rand (India) Ltd.,INGERRAND,500210,GENERAL INDUSTRIALS,INDUSTRIAL MACHINERY,282.8,210.7,65.7,23.76%,4.6,0.6,67,17.2,49.7,15.8,218.5,69.2
+KFIN Technologies Ltd.,KFINTECH,543720,BANKING AND FINANCE,OTHER FINANCIAL SERVICES,215.3,115.3,93.7,44.82%,12.6,3.2,84.2,22.3,61.4,3.6,215.1,12.6
+Piramal Enterprises Ltd.,PEL,500302,BANKING AND FINANCE,FINANCE (INCLUDING NBFCS),"2,205.2","1,320.1","1,117.9",50.97%,38.3,"1,038.9",-11.8,10.7,48.2,2,"3,906.5",173.9
+NMDC Steel Ltd.,NSLNISP,543768,METALS & MINING,IRON & STEEL/INTERM.PRODUCTS,290.3,349.6,-72.2,-26.04%,74.5,40.8,-174.7,-43.6,-131.1,-0.5,,
+Eris Lifesciences Ltd.,ERIS,540596,PHARMACEUTICALS & BIOTECHNOLOGY,PHARMACEUTICALS,508.8,324.2,181.1,35.85%,42.1,16.3,126.2,3.9,123.4,9.1,385.6,28.3
+Mankind Pharma Ltd.,MANKIND,543904,PHARMACEUTICALS & BIOTECHNOLOGY,PHARMACEUTICALS,"2,768.1","2,025.5",682.6,25.21%,96.5,8.6,637.5,129.8,501,12.5,"1,564.8",39.1
+Kaynes Technology India Ltd.,KAYNES,ASM,CONSUMER DURABLES,OTHER ELECTRICAL EQUIPMENT/PRODUCTS,369.8,312.1,48.8,13.52%,6.5,11.8,39.4,7.1,32.3,5.5,143.2,24.6
+Safari Industries (India) Ltd.,SAFARI,523025,TEXTILES APPARELS & ACCESSORIES,OTHER APPARELS & ACCESSORIES,372.9,306.6,63.5,17.15%,12.2,2.2,51.9,12.1,39.8,16.7,162.3,68.2
+Saregama India Ltd.,SAREGAMA,532163,MEDIA,MOVIES & ENTERTAINMENT,185.6,111.5,60.9,35.32%,8.2,0.2,65.6,17.6,48.1,2.5,193.4,10
+Syrma SGS Technology Ltd.,SYRMA,543573,CONSUMER DURABLES,OTHER ELECTRICAL EQUIPMENT/PRODUCTS,720.6,662.7,49,6.88%,11.6,8,37,6.4,28.3,1.6,132.4,7.5
+Jindal Saw Ltd.,JINDALSAW,ASM,GENERAL INDUSTRIALS,OTHER INDUSTRIAL PRODUCTS,"5,488.9","4,662",804.2,14.71%,142.5,188.7,495.6,139.6,375.7,11.8,"1,135.8",35.5
+Godawari Power & Ispat Ltd.,GPIL,532734,METALS & MINING,IRON & STEEL/INTERM.PRODUCTS,"1,314.2",929.6,361.4,28.00%,34.8,10.2,339.6,86.1,256.9,20.6,785.5,63
+Gillette India Ltd.,GILLETTE,507815,FMCG,PERSONAL PRODUCTS,676.2,530.8,136.7,20.48%,20.1,0.1,125.2,32.5,92.7,28.4,361.6,111
+Symphony Ltd.,SYMPHONY,517385,CONSUMER DURABLES,CONSUMER ELECTRONICS,286,234,41,14.91%,7,2,43,8,35,5.1,114,16.5
+Glenmark Life Sciences Ltd.,GLS,543322,PHARMACEUTICALS & BIOTECHNOLOGY,PHARMACEUTICALS,600.7,428.3,167.1,28.06%,13.1,0.4,158.9,40.2,118.7,9.7,505.5,41.3
+Usha Martin Ltd.,USHAMART,517146,METALS & MINING,IRON & STEEL PRODUCTS,806,640.4,144.3,18.39%,18,6.4,141.2,35,109.5,3.6,399.4,13.1
+Ircon International Ltd.,IRCON,541956,CEMENT AND CONSTRUCTION,CONSTRUCTION & ENGINEERING,"3,136.3","2,771.2",215.7,7.22%,27.1,36.9,301.2,77.6,250.7,2.7,884.6,9.4
+Ujjivan Small Finance Bank Ltd.,UJJIVANSFB,542904,BANKING AND FINANCE,BANKS,"1,579.8",528.6,483.4,34.75%,0,567.8,436.4,108.7,327.7,1.7,"1,254.5",6.4
+Procter & Gamble Health Ltd.,PGHL,500126,PHARMACEUTICALS & BIOTECHNOLOGY,PHARMACEUTICALS,311,216.3,88.7,29.08%,6.5,0.2,88,22.5,65.6,39.5,231.4,139.4
+Allcargo Logistics Ltd.,ALLCARGO,532749,TRANSPORTATION,TRANSPORTATION - LOGISTICS,"3,336.3","3,188.8",118,3.57%,106.7,36.7,14.2,1.3,21.8,0.9,361.9,14.7
+Sheela Foam Ltd.,SFL,540203,DIVERSIFIED CONSUMER SERVICES,FURNITURE-FURNISHING-PAINTS,637.6,547,66.2,10.80%,21.9,8.6,60.2,15.6,44,4.5,192.4,17.7
+Alok Industries Ltd.,ALOKINDS,521070,TEXTILES APPARELS & ACCESSORIES,TEXTILES,"1,369.3","1,323.1",35.9,2.64%,78.6,142.2,-174.6,0,-174.8,-0.3,-948.4,-1.9
+Minda Corporation Ltd.,MINDACORP,538962,AUTOMOBILES & AUTO COMPONENTS,AUTO PARTS & EQUIPMENT,"1,197.9","1,064.5",131.3,10.98%,41.4,14.9,77,18.7,58.8,2.5,278.2,11.6
+Concord Biotech Ltd.,CONCORDBIO,543960,PHARMACEUTICALS & BIOTECHNOLOGY,BIOTECHNOLOGY,270.5,143.2,119.2,45.43%,13.3,0.8,113.2,28.7,81,7.7,,
\ No newline at end of file
diff --git a/data/product_info_1.md b/data/product_info_1.md
new file mode 100644
index 00000000..bfe299f2
--- /dev/null
+++ b/data/product_info_1.md
@@ -0,0 +1,215 @@
+# Information about product item_number: 1
+TrailMaster X4 Tent, price $250,
+
+## Brand
+OutdoorLiving
+
+## Category
+Tents
+
+## Features
+- Polyester material for durability
+- Spacious interior to accommodate multiple people
+- Easy setup with included instructions
+- Water-resistant construction to withstand light rain
+- Mesh panels for ventilation and insect protection
+- Rainfly included for added weather protection
+- Multiple doors for convenient entry and exit
+- Interior pockets for organizing small items
+- Reflective guy lines for improved visibility at night
+- Freestanding design for easy setup and relocation
+- Carry bag included for convenient storage and transportation
+
+## Technical Specs
+**Best Use**: Camping
+**Capacity**: 4-person
+**Season Rating**: 3-season
+**Setup**: Freestanding
+**Material**: Polyester
+**Waterproof**: Yes
+**Floor Area**: 80 square feet
+**Peak Height**: 6 feet
+**Number of Doors**: 2
+**Color**: Green
+**Rainfly**: Included
+**Rainfly Waterproof Rating**: 2000mm
+**Tent Poles**: Aluminum
+**Pole Diameter**: 9mm
+**Ventilation**: Mesh panels and adjustable vents
+**Interior Pockets**: Yes (4 pockets)
+**Gear Loft**: Included
+**Footprint**: Sold separately
+**Guy Lines**: Reflective
+**Stakes**: Aluminum
+**Carry Bag**: Included
+**Dimensions**: 10ft x 8ft x 6ft (length x width x peak height)
+**Packed Size**: 24 inches x 8 inches
+**Weight**: 12 lbs
+
+## TrailMaster X4 Tent User Guide
+
+### Introduction
+
+Thank you for choosing the TrailMaster X4 Tent. This user guide provides instructions on how to set up, use, and maintain your tent effectively. Please read this guide thoroughly before using the tent.
+
+### Package Contents
+
+Ensure that the package includes the following components:
+
+- TrailMaster X4 Tent body
+- Tent poles
+- Rainfly (if applicable)
+- Stakes and guy lines
+- Carry bag
+- User Guide
+
+If any components are missing or damaged, please contact our customer support immediately.
+
+### Tent Setup
+
+#### Step 1: Selecting a Suitable Location
+
+- Find a level and clear area for pitching the tent.
+- Remove any sharp objects or debris that could damage the tent floor.
+
+#### Step 2: Unpacking and Organizing Components
+
+- Lay out all the tent components on the ground.
+- Familiarize yourself with each part, including the tent body, poles, rainfly, stakes, and guy lines.
+
+#### Step 3: Assembling the Tent Poles
+
+- Connect the tent poles according to their designated color codes or numbering.
+- Slide the connected poles through the pole sleeves or attach them to the tent body clips.
+
+#### Step 4: Setting up the Tent Body
+
+- Begin at one end and raise the tent body by pushing up the poles.
+- Ensure that the tent body is evenly stretched and centered.
+- Secure the tent body to the ground using stakes and guy lines as needed.
+
+#### Step 5: Attaching the Rainfly (if applicable)
+
+- If your tent includes a rainfly, spread it over the tent body.
+- Attach the rainfly to the tent corners and secure it with the provided buckles or clips.
+- Adjust the tension of the rainfly to ensure proper airflow and weather protection.
+
+#### Step 6: Securing the Tent
+
+- Stake down the tent corners and guy out the guy lines for additional stability.
+- Adjust the tension of the guy lines to provide optimal stability and wind resistance.
+
+### Tent Takedown and Storage
+
+#### Step 1: Removing Stakes and Guy Lines
+
+- Remove all stakes from the ground.
+- Untie or disconnect the guy lines from the tent and store them separately.
+
+#### Step 2: Taking Down the Tent Body
+
+- Start by collapsing the tent poles carefully.
+- Remove the poles from the pole sleeves or clips.
+- Collapse the tent body and fold it neatly.
+
+#### Step 3: Disassembling the Tent Poles
+
+- Disconnect and separate the individual pole sections.
+- Store the poles in their designated bag or sleeve.
+
+#### Step 4: Packing the Tent
+
+- Fold the tent body tightly and place it in the carry bag.
+- Ensure that the rainfly and any other components are also packed securely.
+
+### Tent Care and Maintenance
+
+- Clean the tent regularly with mild soap and water.
+- Avoid using harsh chemicals or abrasive cleaners.
+- Allow the tent to dry completely before storing it.
+- Store the tent in a cool, dry place away from direct sunlight.
+
+## Cautions
+1. **Avoid Uneven or Rocky Surfaces**: Do not place the tent on uneven or rocky surfaces.
+2. **Stay Clear of Hazardous Areas**: Avoid setting up the tent near hazardous areas.
+3. **No Open Flames or Heat Sources**: Do not use open flames, candles, or any other flammable heat sources near the tent.
+4. **Avoid Overloading**: Do not exceed the maximum weight capacity or overload the tent with excessive gear or equipment.
+5. **Don't Leave Unattended**: Do not leave the tent unattended while open or occupied.
+6. **Avoid Sharp Objects**: Keep sharp objects away from the tent to prevent damage to the fabric or punctures.
+7. **Avoid Using Harsh Chemicals**: Do not use harsh chemicals or abrasive cleaners on the tent, as they may damage the material.
+8. **Don't Store Wet**: Do not store the tent when it is wet or damp, as it can lead to mold, mildew, or fabric deterioration.
+9. **Avoid Direct Sunlight**: Avoid prolonged exposure of the tent to direct sunlight, as it can cause fading or weakening of the fabric.
+10. **Don't Neglect Maintenance**: Regularly clean and maintain the tent according to the provided instructions to ensure its longevity and performance.
+
+## Warranty Information
+Thank you for purchasing the TrailMaster X4 Tent. We are confident in the quality and durability of our product. This warranty provides coverage for any manufacturing defects or issues that may arise during normal use of the tent. Please read the terms and conditions of the warranty below:
+
+1. **Warranty Coverage**: The TrailMaster X4 Tent is covered by a **2-year limited warranty** from the date of purchase. This warranty covers manufacturing defects in materials and workmanship.
+
+2. **What is Covered**:
+ - Seam or fabric tears that occur under normal use and are not a result of misuse or abuse.
+ - Issues with the tent poles, zippers, buckles, or other hardware components that affect the functionality of the tent.
+ - Problems with the rainfly or other included accessories that impact the performance of the tent.
+
+3. **What is Not Covered**:
+ - Damage caused by misuse, abuse, or improper care of the tent.
+ - Normal wear and tear or cosmetic damage that does not affect the functionality of the tent.
+ - Damage caused by extreme weather conditions, natural disasters, or acts of nature.
+ - Any modifications or alterations made to the tent by the user.
+
+4. **Claim Process**:
+ - In the event of a warranty claim, please contact our customer support (contact details provided in the user guide) to initiate the process.
+ - Provide proof of purchase, including the date and place of purchase, along with a detailed description and supporting evidence of the issue.
+
+5. **Resolution Options**:
+ - Upon receipt of the warranty claim, our customer support team will assess the issue and determine the appropriate resolution.
+ - Options may include repair, replacement of the defective parts, or, if necessary, replacement of the entire tent.
+
+6. **Limitations and Exclusions**:
+ - Our warranty is non-transferable and applies only to the original purchaser of the TrailMaster X4 Tent.
+ - The warranty does not cover any incidental or consequential damages resulting from the use or inability to use the tent.
+ - Any unauthorized repairs or alterations void the warranty.
+
+### Contact Information
+
+If you have any questions or need further assistance, please contact our customer support:
+
+- Customer Support Phone: +1-800-123-4567
+- Customer Support Email: support@example.com
+
+## Return Policy
+- **If Membership status "None ":** Returns are accepted within 30 days of purchase, provided the tent is unused, undamaged and in its original packaging. Customer is responsible for the cost of return shipping. Once the returned item is received, a refund will be issued for the cost of the item minus a 10% restocking fee. If the item was damaged during shipping or if there is a defect, the customer should contact customer service within 7 days of receiving the item.
+- **If Membership status "Gold":** Returns are accepted within 60 days of purchase, provided the tent is unused, undamaged and in its original packaging. Free return shipping is provided. Once the returned item is received, a full refund will be issued. If the item was damaged during shipping or if there is a defect, the customer should contact customer service within 7 days of receiving the item.
+- **If Membership status "Platinum":** Returns are accepted within 90 days of purchase, provided the tent is unused, undamaged and in its original packaging. Free return shipping is provided, and a full refund will be issued. If the item was damaged during shipping or if there is a defect, the customer should contact customer service within 7 days of receiving the item.
+
+## Reviews
+1) **Rating:** 5
+ **Review:** I am extremely happy with my TrailMaster X4 Tent! It's spacious, easy to set up, and kept me dry during a storm. The UV protection is a great addition too. Highly recommend it to anyone who loves camping!
+
+2) **Rating:** 3
+ **Review:** I bought the TrailMaster X4 Tent, and while it's waterproof and has a spacious interior, I found it a bit difficult to set up. It's a decent tent, but I wish it were easier to assemble.
+
+3) **Rating:** 5
+ **Review:** The TrailMaster X4 Tent is a fantastic investment for any serious camper. The easy setup and spacious interior make it perfect for extended trips, and the waterproof design kept us dry in heavy rain.
+
+4) **Rating:** 4
+ **Review:** I like the TrailMaster X4 Tent, but I wish it came in more colors. It's comfortable and has many useful features, but the green color just isn't my favorite. Overall, it's a good tent.
+
+5) **Rating:** 5
+ **Review:** This tent is perfect for my family camping trips. The spacious interior and convenient storage pocket make it easy to stay organized. It's also super easy to set up, making it a great addition to our gear.
+
+## FAQ
+1) Can the TrailMaster X4 Tent be used in winter conditions?
+ The TrailMaster X4 Tent is designed for 3-season use and may not be suitable for extreme winter conditions with heavy snow and freezing temperatures.
+
+2) How many people can comfortably sleep in the TrailMaster X4 Tent?
+ The TrailMaster X4 Tent can comfortably accommodate up to 4 people with room for their gear.
+
+3) Is there a warranty on the TrailMaster X4 Tent?
+ Yes, the TrailMaster X4 Tent comes with a 2-year limited warranty against manufacturing defects.
+
+4) Are there any additional accessories included with the TrailMaster X4 Tent?
+ The TrailMaster X4 Tent includes a rainfly, tent stakes, guy lines, and a carry bag for easy transport.
+
+5) Can the TrailMaster X4 Tent be easily carried during hikes?
+ Yes, the TrailMaster X4 Tent weighs just 12lbs, and when packed in its carry bag, it can be comfortably carried during hikes.
diff --git a/media/llama-deployment-2.png b/media/llama-deployment-2.png
new file mode 100644
index 00000000..5503d43f
Binary files /dev/null and b/media/llama-deployment-2.png differ
diff --git a/media/llama-deployment.png b/media/llama-deployment.png
new file mode 100644
index 00000000..5baa40d1
Binary files /dev/null and b/media/llama-deployment.png differ
diff --git a/modules-basic/basic-ai-hub-identity.bicep b/modules-basic/basic-ai-hub-identity.bicep
new file mode 100644
index 00000000..dee5d7ae
--- /dev/null
+++ b/modules-basic/basic-ai-hub-identity.bicep
@@ -0,0 +1,66 @@
+// Creates an Azure AI resource with proxied endpoints for the Azure AI services provider
+
+@description('Azure region of the deployment')
+param location string
+
+@description('Tags to add to the resources')
+param tags object
+
+@description('AI hub name')
+param aiHubName string
+
+@description('AI hub display name')
+param aiHubFriendlyName string = aiHubName
+
+@description('AI hub description')
+param aiHubDescription string
+
+@description('Resource ID of the storage account resource for storing experimentation outputs')
+param storageAccountId string
+
+@description('Resource ID of the AI Services resource')
+param aiServicesId string
+
+@description('Resource ID of the AI Services endpoint')
+param aiServicesTarget string
+
+@description('Model/AI Resource deployment location')
+param modelLocation string
+
+
+resource aiHub 'Microsoft.MachineLearningServices/workspaces@2024-07-01-preview' = {
+ name: aiHubName
+ location: location
+ tags: tags
+ identity: {
+ type: 'SystemAssigned'
+ }
+ properties: {
+ // organization
+ friendlyName: aiHubFriendlyName
+ description: aiHubDescription
+
+ // dependent resources
+ storageAccount: storageAccountId
+ }
+ kind: 'hub'
+
+ resource aiServicesConnection 'connections@2024-07-01-preview' = {
+ name: '${aiHubName}-connection-AIServices'
+ properties: {
+ category: 'AIServices'
+ target: aiServicesTarget
+ authType: 'AAD'
+ isSharedToAll: true
+ metadata: {
+ ApiType: 'Azure'
+ ResourceId: aiServicesId
+ Location: modelLocation
+ }
+ }
+ }
+
+}
+
+
+output aiHubID string = aiHub.id
diff --git a/modules-basic/basic-ai-hub-keys.bicep b/modules-basic/basic-ai-hub-keys.bicep
new file mode 100644
index 00000000..d848c457
--- /dev/null
+++ b/modules-basic/basic-ai-hub-keys.bicep
@@ -0,0 +1,68 @@
+// Creates an Azure AI resource with proxied endpoints for the Azure AI services provider
+
+@description('Azure region of the deployment')
+param location string
+
+@description('Tags to add to the resources')
+param tags object
+
+@description('AI hub name')
+param aiHubName string
+
+@description('AI hub display name')
+param aiHubFriendlyName string = aiHubName
+
+@description('AI hub description')
+param aiHubDescription string
+
+@description('Resource ID of the storage account resource for storing experimentation outputs')
+param storageAccountId string
+
+@description('Resource ID of the AI Services resource')
+param aiServicesId string
+
+@description('Resource ID of the AI Services endpoint')
+param aiServicesTarget string
+
+@description('Model/AI Resource deployment location')
+param modelLocation string
+
+resource aiHub 'Microsoft.MachineLearningServices/workspaces@2024-07-01-preview' = {
+ name: aiHubName
+ location: location
+ tags: tags
+ identity: {
+ type: 'SystemAssigned'
+ }
+ properties: {
+ // organization
+ friendlyName: aiHubFriendlyName
+ description: aiHubDescription
+
+ // dependent resources
+ storageAccount: storageAccountId
+ }
+ kind: 'hub'
+
+ resource aiServicesConnection 'connections@2024-07-01-preview' = {
+ name: '${aiHubName}-connection-AIServices'
+ properties: {
+ category: 'AIServices'
+ target: aiServicesTarget
+ // useWorkspaceManagedIdentity: true
+ authType: 'ApiKey'
+ isSharedToAll: true
+ credentials: {
+ key: '${listKeys(aiServicesId, '2022-10-01').key1}'
+ }
+ metadata: {
+ ApiType: 'Azure'
+ ResourceId: aiServicesId
+ Location: modelLocation
+ }
+ }
+ }
+}
+
+
+output aiHubID string = aiHub.id
diff --git a/modules-basic/basic-ai-project-identity.bicep b/modules-basic/basic-ai-project-identity.bicep
new file mode 100644
index 00000000..fa6a736b
--- /dev/null
+++ b/modules-basic/basic-ai-project-identity.bicep
@@ -0,0 +1,91 @@
+// Creates an Azure AI resource with proxied endpoints for the Azure AI services provider
+
+@description('Azure region of the deployment')
+param location string
+
+@description('Tags to add to the resources')
+param tags object
+
+@description('AI Project name')
+param aiProjectName string
+
+@description('AI Project display name')
+param aiProjectFriendlyName string = aiProjectName
+
+@description('AI Project description')
+param aiProjectDescription string
+
+@description('Resource ID of the AI Hub resource')
+param aiHubId string
+
+param aiServicesName string
+
+resource aiServices 'Microsoft.CognitiveServices/accounts@2023-05-01' existing = {
+ name: aiServicesName
+}
+
+resource aiProject 'Microsoft.MachineLearningServices/workspaces@2023-08-01-preview' = {
+ name: aiProjectName
+ location: location
+ tags: tags
+ identity: {
+ type: 'SystemAssigned'
+ }
+ properties: {
+ // organization
+ friendlyName: aiProjectFriendlyName
+ description: aiProjectDescription
+
+ // dependent resources
+ hubResourceId: aiHubId
+
+ }
+ kind: 'project'
+}
+
+resource cognitiveServicesContributorRole 'Microsoft.Authorization/roleDefinitions@2022-04-01' existing = {
+ name: '25fbc0a9-bd7c-42a3-aa1a-3b75d497ee68'
+ scope: resourceGroup()
+}
+
+resource cognitiveServicesContributorAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01'= {
+ scope: aiServices
+ name: guid(aiProject.id, cognitiveServicesContributorRole.id, aiServices.id)
+ properties: {
+ principalId: aiProject.identity.principalId
+ roleDefinitionId: cognitiveServicesContributorRole.id
+ principalType: 'ServicePrincipal'
+ }
+ }
+
+
+resource cognitiveServicesOpenAIUserRole 'Microsoft.Authorization/roleDefinitions@2022-04-01' existing = {
+ name: '5e0bd9bd-7b93-4f28-af87-19fc36ad61bd'
+ scope: resourceGroup()
+}
+resource cognitiveServicesOpenAIUserRoleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
+ scope: aiServices
+ name: guid(aiProject.id, cognitiveServicesOpenAIUserRole.id, aiServices.id)
+ properties: {
+ principalId: aiProject.identity.principalId
+ roleDefinitionId: cognitiveServicesOpenAIUserRole.id
+ principalType: 'ServicePrincipal'
+ }
+}
+
+resource cognitiveServicesUserRole 'Microsoft.Authorization/roleDefinitions@2022-04-01' existing = {
+ name: 'a97b65f3-24c7-4388-baec-2e87135dc908'
+ scope: resourceGroup()
+}
+
+resource cognitiveServicesUserRoleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
+ scope: aiServices
+ name: guid(aiProject.id, cognitiveServicesUserRole.id, aiServices.id)
+ properties: {
+ principalId: aiProject.identity.principalId
+ roleDefinitionId: cognitiveServicesUserRole.id
+ principalType: 'ServicePrincipal'
+ }
+}
+
+output aiProjectID string = aiProject.id
diff --git a/modules-basic/basic-ai-project-keys.bicep b/modules-basic/basic-ai-project-keys.bicep
new file mode 100644
index 00000000..764ca201
--- /dev/null
+++ b/modules-basic/basic-ai-project-keys.bicep
@@ -0,0 +1,42 @@
+// Creates an Azure AI resource with proxied endpoints for the Azure AI services provider
+
+@description('Azure region of the deployment')
+param location string
+
+@description('Tags to add to the resources')
+param tags object
+
+@description('AI Project name')
+param aiProjectName string
+
+@description('AI Project display name')
+param aiProjectFriendlyName string = aiProjectName
+
+@description('AI Project description')
+param aiProjectDescription string
+
+@description('Resource ID of the AI Hub resource')
+param aiHubId string
+
+
+
+resource aiProject 'Microsoft.MachineLearningServices/workspaces@2023-08-01-preview' = {
+ name: aiProjectName
+ location: location
+ tags: tags
+ identity: {
+ type: 'SystemAssigned'
+ }
+ properties: {
+ // organization
+ friendlyName: aiProjectFriendlyName
+ description: aiProjectDescription
+
+ // dependent resources
+ hubResourceId: aiHubId
+
+ }
+ kind: 'project'
+}
+
+output aiProjectID string = aiProject.id
diff --git a/modules-basic/basic-dependent-resources.bicep b/modules-basic/basic-dependent-resources.bicep
new file mode 100644
index 00000000..e048f685
--- /dev/null
+++ b/modules-basic/basic-dependent-resources.bicep
@@ -0,0 +1,134 @@
+@description('Azure region of the deployment')
+param location string = resourceGroup().location
+
+@description('Tags to add to the resources')
+param tags object = {}
+
+@description('AI services name')
+param aiServicesName string
+
+@description('Model name for deployment')
+param modelName string
+
+@description('Model format for deployment')
+param modelFormat string
+
+@description('Model version for deployment')
+param modelVersion string
+
+@description('Model deployment SKU name')
+param modelSkuName string
+
+@description('Model deployment capacity')
+param modelCapacity int
+
+@description('Model/AI Resource deployment location')
+param modelLocation string
+
+resource aiServices 'Microsoft.CognitiveServices/accounts@2024-06-01-preview' = {
+ name: aiServicesName
+ location: modelLocation
+ sku: {
+ name: 'S0'
+ }
+ kind: 'AIServices' // or 'OpenAI'
+ identity: {
+ type: 'SystemAssigned'
+ }
+ properties: {
+ customSubDomainName: toLower('${toLower(aiServicesName)}')
+ apiProperties: {
+ statisticsEnabled: false
+ }
+ publicNetworkAccess: 'Enabled'
+ }
+}
+
+resource modelDeployment 'Microsoft.CognitiveServices/accounts/deployments@2024-06-01-preview'= {
+ parent: aiServices
+ name: modelName
+ sku : {
+ capacity: modelCapacity
+ name: modelSkuName
+ }
+ properties: {
+ model:{
+ name: modelName
+ format: modelFormat
+ version: modelVersion
+ }
+ }
+}
+
+@description('Name of the storage account')
+param storageName string
+
+@allowed([
+ 'Standard_LRS'
+ 'Standard_ZRS'
+ 'Standard_GRS'
+ 'Standard_GZRS'
+ 'Standard_RAGRS'
+ 'Standard_RAGZRS'
+ 'Premium_LRS'
+ 'Premium_ZRS'
+])
+
+@description('Storage SKU')
+param storageSkuName string = 'Standard_LRS'
+
+var storageNameCleaned = replace(storageName, '-', '')
+
+resource storage 'Microsoft.Storage/storageAccounts@2023-05-01' = {
+ name: storageNameCleaned
+ location: location
+ tags: tags
+ sku: {
+ name: storageSkuName
+ }
+ kind: 'StorageV2'
+ properties: {
+ accessTier: 'Hot'
+ allowBlobPublicAccess: false
+ allowCrossTenantReplication: false
+ allowSharedKeyAccess: true
+ encryption: {
+ keySource: 'Microsoft.Storage'
+ requireInfrastructureEncryption: false
+ services: {
+ blob: {
+ enabled: true
+ keyType: 'Account'
+ }
+ file: {
+ enabled: true
+ keyType: 'Account'
+ }
+ queue: {
+ enabled: true
+ keyType: 'Service'
+ }
+ table: {
+ enabled: true
+ keyType: 'Service'
+ }
+ }
+ }
+ isHnsEnabled: false
+ isNfsV3Enabled: false
+ keyPolicy: {
+ keyExpirationPeriodInDays: 7
+ }
+ largeFileSharesState: 'Disabled'
+ minimumTlsVersion: 'TLS1_2'
+ networkAcls: {
+ bypass: 'AzureServices'
+ defaultAction: 'Deny'
+ }
+ supportsHttpsTrafficOnly: true
+ }
+}
+
+output aiservicesID string = aiServices.id
+output aiservicesTarget string = aiServices.properties.endpoint
+output storageId string = storage.id
diff --git a/modules-standard/standard-ai-hub.bicep b/modules-standard/standard-ai-hub.bicep
new file mode 100644
index 00000000..1ba0759c
--- /dev/null
+++ b/modules-standard/standard-ai-hub.bicep
@@ -0,0 +1,106 @@
+// Creates an Azure AI resource with proxied endpoints for the Azure AI services provider
+
+@description('Azure region of the deployment')
+param location string
+
+@description('Tags to add to the resources')
+param tags object
+
+@description('AI hub name')
+param aiHubName string
+
+@description('AI hub display name')
+param aiHubFriendlyName string = aiHubName
+
+@description('AI hub description')
+param aiHubDescription string
+
+@description('Resource ID of the key vault resource for storing connection strings')
+param keyVaultId string
+
+@description('Resource ID of the storage account resource for storing experimentation outputs')
+param storageAccountId string
+
+@description('Model/AI Resource deployment location')
+param modelLocation string
+
+@description('Resource ID of the AI Services resource')
+param aiServicesId string
+
+@description('Resource ID of the AI Services endpoint')
+param aiServicesTarget string
+
+@description('Name AI Search resource')
+param aiSearchName string
+
+@description('Resource ID of the AI Search resource')
+param aiSearchId string
+
+@description('Name for capabilityHost.')
+param capabilityHostName string = 'caphost1'
+
+var acsConnectionName = '${aiHubName}-connection-AISearch'
+
+var aoaiConnection = '${aiHubName}-connection-AIServices_aoai'
+
+resource aiHub 'Microsoft.MachineLearningServices/workspaces@2024-07-01-preview' = {
+ name: aiHubName
+ location: location
+ tags: tags
+ identity: {
+ type: 'SystemAssigned'
+ }
+ properties: {
+ // organization
+ friendlyName: aiHubFriendlyName
+ description: aiHubDescription
+
+ // dependent resources
+ keyVault: keyVaultId
+ storageAccount: storageAccountId
+ }
+ kind: 'hub'
+
+ resource aiServicesConnection 'connections@2024-07-01-preview' = {
+ name: '${aiHubName}-connection-AIServices'
+ properties: {
+ category: 'AIServices'
+ target: aiServicesTarget
+ authType: 'AAD'
+ isSharedToAll: true
+ metadata: {
+ ApiType: 'Azure'
+ ResourceId: aiServicesId
+ location: modelLocation
+ }
+ }
+ }
+ resource hub_connection_azureai_search 'connections@2024-07-01-preview' = {
+ name: acsConnectionName
+ properties: {
+ category: 'CognitiveSearch'
+ target: 'https://${aiSearchName}.search.windows.net'
+ authType: 'AAD'
+ //useWorkspaceManagedIdentity: false
+ isSharedToAll: true
+ metadata: {
+ ApiType: 'Azure'
+ ResourceId: aiSearchId
+ location: location
+ }
+ }
+ }
+
+ // Resource definition for the capability host
+ resource capabilityHost 'capabilityHosts@2024-10-01-preview' = {
+ name: '${aiHubName}-${capabilityHostName}'
+ properties: {
+ capabilityHostKind: 'Agents'
+ }
+ }
+
+}
+
+output aiHubID string = aiHub.id
+output aoaiConnectionName string = aoaiConnection
+output acsConnectionName string = acsConnectionName
diff --git a/modules-standard/standard-ai-project.bicep b/modules-standard/standard-ai-project.bicep
new file mode 100644
index 00000000..a80d550d
--- /dev/null
+++ b/modules-standard/standard-ai-project.bicep
@@ -0,0 +1,166 @@
+// Creates an Azure AI resource with proxied endpoints for the Azure AI services provider
+
+@description('Azure region of the deployment')
+param location string
+
+@description('Tags to add to the resources')
+param tags object
+
+@description('AI Project name')
+param aiProjectName string
+
+@description('AI Project display name')
+param aiProjectFriendlyName string = aiProjectName
+
+@description('AI Project description')
+param aiProjectDescription string
+
+@description('Resource ID of the AI Hub resource')
+param aiHubId string
+
+@description('Name for capabilityHost.')
+param capabilityHostName string = 'caphost1'
+
+@description('Name for ACS connection.')
+param acsConnectionName string
+
+@description('Name for ACS connection.')
+param aoaiConnectionName string
+
+param aiServicesName string
+
+@description('Name AI Search resource')
+param aiSearchName string
+
+resource aiServices 'Microsoft.CognitiveServices/accounts@2024-06-01-preview' existing = {
+ name: aiServicesName
+}
+
+resource searchService 'Microsoft.Search/searchServices@2024-06-01-preview' existing = {
+ name: aiSearchName
+}
+
+//for constructing endpoint
+var subscriptionId = subscription().subscriptionId
+var resourceGroupName = resourceGroup().name
+
+var projectConnectionString = '${location}.api.azureml.ms;${subscriptionId};${resourceGroupName};${aiProjectName}'
+
+
+var storageConnections = ['${aiProjectName}/workspaceblobstore']
+var aiSearchConnection = ['${acsConnectionName}']
+var aiServiceConnections = ['${aoaiConnectionName}']
+
+
+resource aiProject 'Microsoft.MachineLearningServices/workspaces@2023-08-01-preview' = {
+ name: aiProjectName
+ location: location
+ tags: union(tags, {
+ ProjectConnectionString: projectConnectionString
+ })
+ identity: {
+ type: 'SystemAssigned'
+ }
+ properties: {
+ // organization
+ friendlyName: aiProjectFriendlyName
+ description: aiProjectDescription
+
+ // dependent resources
+ hubResourceId: aiHubId
+
+ }
+ kind: 'project'
+
+ // Resource definition for the capability host
+ resource capabilityHost 'capabilityHosts@2024-10-01-preview' = {
+ name: '${aiProjectName}-${capabilityHostName}'
+ properties: {
+ capabilityHostKind: 'Agents'
+ aiServicesConnections: aiServiceConnections
+ vectorStoreConnections: aiSearchConnection
+ storageConnections: storageConnections
+ }
+ }
+}
+
+resource cognitiveServicesContributorRole 'Microsoft.Authorization/roleDefinitions@2022-04-01' existing = {
+ name: '25fbc0a9-bd7c-42a3-aa1a-3b75d497ee68'
+ scope: resourceGroup()
+}
+
+resource cognitiveServicesContributorAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01'= {
+ scope: aiServices
+ name: guid(aiServices.id, cognitiveServicesContributorRole.id, aiProject.id)
+ properties: {
+ principalId: aiProject.identity.principalId
+ roleDefinitionId: cognitiveServicesContributorRole.id
+ principalType: 'ServicePrincipal'
+ }
+ }
+
+
+resource cognitiveServicesOpenAIUserRole 'Microsoft.Authorization/roleDefinitions@2022-04-01' existing = {
+ name: '5e0bd9bd-7b93-4f28-af87-19fc36ad61bd'
+ scope: resourceGroup()
+}
+resource cognitiveServicesOpenAIUserRoleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
+ scope: aiServices
+ name: guid(aiProject.id, cognitiveServicesOpenAIUserRole.id, aiServices.id)
+ properties: {
+ principalId: aiProject.identity.principalId
+ roleDefinitionId: cognitiveServicesOpenAIUserRole.id
+ principalType: 'ServicePrincipal'
+ }
+}
+
+resource cognitiveServicesUserRole 'Microsoft.Authorization/roleDefinitions@2022-04-01' existing = {
+ name: 'a97b65f3-24c7-4388-baec-2e87135dc908'
+ scope: resourceGroup()
+}
+
+resource cognitiveServicesUserRoleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
+ scope: aiServices
+ name: guid(aiProject.id, cognitiveServicesUserRole.id, aiServices.id)
+ properties: {
+ principalId: aiProject.identity.principalId
+ roleDefinitionId: cognitiveServicesUserRole.id
+ principalType: 'ServicePrincipal'
+ }
+}
+
+// search roles
+resource searchIndexDataContributorRole 'Microsoft.Authorization/roleDefinitions@2022-04-01' existing = {
+ name: '8ebe5a00-799e-43f5-93ac-243d3dce84a7'
+ scope: resourceGroup()
+}
+
+resource searchIndexDataContributorAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
+ scope: searchService
+ name: guid(aiProject.id, searchIndexDataContributorRole.id, searchService.id)
+ properties: {
+ principalId: aiProject.identity.principalId
+ roleDefinitionId: searchIndexDataContributorRole.id
+ principalType: 'ServicePrincipal'
+ }
+}
+
+resource searchServiceContributorRole 'Microsoft.Authorization/roleDefinitions@2022-04-01' existing = {
+ name: '7ca78c08-252a-4471-8644-bb5ff32d4ba0'
+ scope: resourceGroup()
+}
+
+resource searchServiceContributorRoleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
+ scope: searchService
+ name: guid(aiProject.id, searchServiceContributorRole.id, searchService.id)
+ properties: {
+ principalId: aiProject.identity.principalId
+ roleDefinitionId: searchServiceContributorRole.id
+ principalType: 'ServicePrincipal'
+ }
+}
+
+output aiProjectName string = aiProject.name
+output aiProjectResourceId string = aiProject.id
+output aiProjectWorkspaceId string = aiProject.properties.workspaceId
+output projectConnectionString string = aiProject.tags.ProjectConnectionString
diff --git a/modules-standard/standard-dependent-resources.bicep b/modules-standard/standard-dependent-resources.bicep
new file mode 100644
index 00000000..660c4c60
--- /dev/null
+++ b/modules-standard/standard-dependent-resources.bicep
@@ -0,0 +1,157 @@
+// Creates Azure dependent resources for Azure AI studio
+
+@description('Azure region of the deployment')
+param location string = resourceGroup().location
+
+@description('Tags to add to the resources')
+param tags object = {}
+
+@description('AI services name')
+param aiServicesName string
+
+@description('The name of the Key Vault')
+param keyvaultName string
+
+@description('The name of the AI Search resource')
+param aiSearchName string
+
+@description('Name of the storage account')
+param storageName string
+
+var storageNameCleaned = replace(storageName, '-', '')
+
+@description('Model name for deployment')
+param modelName string
+
+@description('Model format for deployment')
+param modelFormat string
+
+@description('Model version for deployment')
+param modelVersion string
+
+@description('Model deployment SKU name')
+param modelSkuName string
+
+@description('Model deployment capacity')
+param modelCapacity int
+
+@description('Model/AI Resource deployment location')
+param modelLocation string
+
+resource keyVault 'Microsoft.KeyVault/vaults@2022-07-01' = {
+ name: keyvaultName
+ location: location
+ tags: tags
+ properties: {
+ createMode: 'default'
+ enabledForDeployment: false
+ enabledForDiskEncryption: false
+ enabledForTemplateDeployment: false
+ enableSoftDelete: true
+ enableRbacAuthorization: true
+ enablePurgeProtection: true
+ networkAcls: {
+ bypass: 'AzureServices'
+ defaultAction: 'Deny'
+ }
+ sku: {
+ family: 'A'
+ name: 'standard'
+ }
+ softDeleteRetentionInDays: 7
+ tenantId: subscription().tenantId
+ }
+}
+
+
+resource aiServices 'Microsoft.CognitiveServices/accounts@2024-06-01-preview' = {
+ name: aiServicesName
+ location: modelLocation
+ sku: {
+ name: 'S0'
+ }
+ kind: 'AIServices' // or 'OpenAI'
+ identity: {
+ type: 'SystemAssigned'
+ }
+ properties: {
+ customSubDomainName: toLower('${(aiServicesName)}')
+ apiProperties: {
+ statisticsEnabled: false
+ }
+ publicNetworkAccess: 'Enabled'
+ }
+}
+resource modelDeployment 'Microsoft.CognitiveServices/accounts/deployments@2024-06-01-preview'= {
+ parent: aiServices
+ name: modelName
+ sku : {
+ capacity: modelCapacity
+ name: modelSkuName
+ }
+ properties: {
+ model:{
+ name: modelName
+ format: modelFormat
+ version: modelVersion
+ }
+ }
+}
+
+resource aiSearch 'Microsoft.Search/searchServices@2024-06-01-preview' = {
+ name: aiSearchName
+ location: location
+ tags: tags
+ identity: {
+ type: 'SystemAssigned'
+ }
+ properties: {
+ disableLocalAuth: false
+ authOptions: { aadOrApiKey: { aadAuthFailureMode: 'http401WithBearerChallenge'}}
+ encryptionWithCmk: {
+ enforcement: 'Unspecified'
+ }
+ hostingMode: 'default'
+ partitionCount: 1
+ publicNetworkAccess: 'enabled'
+ replicaCount: 1
+ semanticSearch: 'disabled'
+ }
+ sku: {
+ name: 'standard'
+ }
+}
+
+// Some regions doesn't support Standard Zone-Redundant storage, need to use Geo-redundant storage
+param noZRSRegions array = ['southindia', 'westus']
+param sku object = contains(noZRSRegions, location) ? { name: 'Standard_GRS' } : { name: 'Standard_ZRS' }
+
+resource storage 'Microsoft.Storage/storageAccounts@2022-05-01' = {
+ name: storageNameCleaned
+ location: location
+ kind: 'StorageV2'
+ sku: sku
+ properties: {
+ minimumTlsVersion: 'TLS1_2'
+ allowBlobPublicAccess: false
+ publicNetworkAccess: 'Enabled'
+ networkAcls: {
+ bypass: 'AzureServices'
+ defaultAction: 'Allow'
+ virtualNetworkRules: []
+ }
+ allowSharedKeyAccess: false
+ }
+}
+
+output aiServicesName string = aiServices.name
+output aiservicesID string = aiServices.id
+output aiservicesTarget string = aiServices.properties.endpoint
+
+output aiSearchName string = aiSearch.name
+output aisearchID string = aiSearch.id
+
+output storageAccountName string = storage.name
+output storageId string = storage.id
+
+output keyvaultId string = keyVault.id
diff --git a/packages/Azure.AI.Projects.1.0.0-alpha.20241114.1.nupkg b/packages/Azure.AI.Projects.1.0.0-alpha.20241114.1.nupkg
new file mode 100644
index 00000000..f8ad0b86
Binary files /dev/null and b/packages/Azure.AI.Projects.1.0.0-alpha.20241114.1.nupkg differ
diff --git a/quickstart.md b/quickstart.md
new file mode 100644
index 00000000..40fa40e0
--- /dev/null
+++ b/quickstart.md
@@ -0,0 +1,480 @@
+# AI Agents Quick Start
+
+This QuickStart demonstrates how to quickly set up your first agent with Azure AI Agent Service.
+
+## Complete Azure prerequisites
+
+1. Create an Azure Subscription for [free](https://azure.microsoft.com/free/ai-services/), if you don't have one already.
+
+2. Make sure all developers have the role: **Azure AI Developer** assigned at the appropriate level. [Learn more](https://learn.microsoft.com/azure/ai-studio/concepts/rbac-ai-studio)
+
+ If you're using a hub/project that already exists, check the [RBAC roles](./rbac.md).
+
+## Setup your Azure AI Hub and Agent project
+
+The following section will show you how to set up an [Azure AI hub and project](https://learn.microsoft.com/azure/ai-studio/quickstarts/get-started-playground) by:
+
+1. Creating an Azure AI Hub to set up your app environment and Azure resources
+
+1. Creating an Azure AI project under your Hub provisions an endpoint for your app to call, and sets up app services to access to resources in your tenant.
+
+1. Connecting an Azure OpenAI resource or an Azure AI resource
+
+If you already have these resources set up, skip to the [configure and run your first agent section below](#configure-and-run-your-first-agent).
+
+### Follow these steps to set up hub and project
+
+1. Install [the Azure CLI](https://learn.microsoft.com/cli/azure/install-azure-cli-windows?tabs=azure-cli). If you have the CLI already installed, make sure it's updated to the latest version.
+
+1. Register providers.
+
+ The following providers must be registered:
+
+ - Microsoft.KeyVault
+ - Microsoft.CognitiveServices
+ - Microsoft.Storage
+ - Microsoft.MachineLearningServices
+ - Microsoft.Search
+ - To use Bing Search tool: Microsoft.Bing
+
+ ```console
+ az provider register -–namespace 'Microsoft.KeyVault'
+ az provider register -–namespace 'Microsoft.CognitiveServices'
+ az provider register -–namespace 'Microsoft.Storage'
+ az provider register -–namespace 'Microsoft.MachineLearningServices'
+ az provider register -–namespace 'Microsoft.Search'
+ # only to use Grounding with Bing Search tool
+ az provider register -–namespace 'Microsoft.Bing'
+ ```
+
+1. To authenticate to your Azure subscription from the Azure CLI, use the following command:
+
+ > [!NOTE]
+ > Be sure to run these commands with the subscription that has been allowlisted for the private preview.
+
+ ```console
+ az login
+ ```
+
+1. Create a resource group:
+
+ ```console
+ az group create --name {my_resource_group} --location eastus
+ ```
+
+ Make sure you have the role **Azure AI Developer** on the resource group you just created.
+
+1. Choose Basic or Standard Agent Setup
+
+
+ **Basic Setup**: Agents use multi-tenant search and storage resources fully managed by Microsoft. You won’t have visibility or control over these underlying Azure resources.
+
+ **Standard Setup**: Agents use customer-owned, single-tenant search and storage resources. With this setup, you have full control and visibility over these resources, but you will incur costs based on your usage.
+
+
+
+ | Template | Description | Auto-deploy |
+ | ------------------- | -----------------------------------------------| -----------------------|
+ |`basic-agent-keys.bicep` | Deploy a basic agent setup that uses API key authentication on the AI Services/AOAI connection. | Coming Soon
+ |`basic-agent-identity.bicep`| Deploy a basic agent setup that uses Managed Identity authentication on the AI Services/AOAI connection. | Coming Soon
+ | `standard-agent.bicep` | Deploy a standard agent setup that uses Managed Identity authentication on the AI Services/AOAI connection. | [](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Frefs%2Fheads%2Fmaster%2Fquickstarts%2Fmicrosoft.azure-ai-agent-service%2Fstandard-agent%2Fazuredeploy.json)
+
+
+ **Manually Deploy Templates**
+
+
+ Option 1: Use basic agent setup.
+
+ - Download the `basic-agent-keys.bicep` file, `basic-agent-identity.bicep` file, and the `modules-basic` folder to your project directory. Your directory should look like this
+
+ ```console
+ /my-project
+ - basic-agent-keys.bicep
+ - basic-agent-identity.bicep
+ - basic-agent.parameters.json
+ /modules-basic
+ - basic-ai-hub-keys.bicep
+ - basic-ai-project-keys.bicep
+ - basic-ai-hub-identity.bicep
+ - basic-ai-project-identity.bicep
+ - basic-dependent-resources.bicep
+ ```
+ - Before deploying resources, decide which configuration file to use:
+ - `basic-agent-keys.bicep`: Uses API key authentication on the AI Services/AOAI connection.
+ - `basic-agent-identity.bicep`: Uses Managed Identity authentication on the AI Services/AOAI connection.
+
+ - Using the resource group you created in the previous step and one of the template files (either basic-agent-keys.bicep or basic-agent-identity.bicep), run one of the following commands:
+
+ - To use default resource names, run:
+
+ ```console
+ az deployment group create --resource-group {my_resource_group} --template-file {my-template-file.bicep}
+ ```
+
+ - To specify custom names for the hub, project, storage account, and/or Azure AI service resources (Note: a randomly generated suffix will be added to prevent accidental duplication), run:
+
+ ```console
+ az deployment group create --resource-group {my_resource_group} --template-file {my-template-file.bicep} --parameters aiHubName='your-hub-name' aiProjectName='your-project-name' storageName='your-storage-name' aiServicesName='your-ai-services-name'
+ ```
+
+ - To customize additional parameters, including the OpenAI model deployment, download and edit the `basic-agent.parameters.json` file, then run:
+
+ ```console
+ az deployment group create --resource-group {my_resource_group} --template-file {my-template-file.bicep} --parameters @basic-agent.parameters.json
+ ```
+
+ Resources for the hub, project, storage account, and AI Services will be created for you. The AI Services account will be connected to your project/hub and a gpt-4o-mini model will be deployed in the eastus region. A Microsoft-managed key vault will be used by default. To deploy a Llama model see [here](https://github.com/Azure/azure-ai-agents/blob/main/samples/llama-3.md).
+
+
+
+
+
+ Option 2: Use standard agent setup.
+
+ - Download the `standard-agent.bicep` file, the `standard-agent.parameters.json` file, and the `modules-standard` folder to your project directory. Your directory should look like this
+
+ ```console
+ /my-project
+ - standard-agent.bicep
+ - standard-agent.parameters.json
+ /modules-standard
+ - standard-ai-hub.bicep
+ - standard-ai-project.bicep
+ - standard-dependent-resources.bicep
+ ```
+ - Using the resource group you created in the previous step, run one of the following commands:
+
+ - To use default resource names, run:
+
+ ```console
+ az deployment group create --resource-group {my_resource_group} --template-file standard-agent.bicep
+ ```
+
+ - To customize additional parameters, including the OpenAI model deployment, hub name, etc, download and edit the `standard-agent.parameters.json` file, then run:
+
+ ```console
+ az deployment group create --resource-group {my_resource_group} --template-file standard-agent.bicep --parameters @standard-agent.parameters.json
+ ```
+
+ Resources for the hub, project, storage account, key vault, AI Services, and Azure AI Search will be created for you. The AI Services, AI Search, and Azure Blob Storage account will be connected to your project/hub and a gpt-4o-mini model will be deployed in the eastus region. To deploy a Llama model see [here](https://github.com/Azure/azure-ai-agents/blob/main/samples/llama-3.md).
+
+
+
+
+
+
+
+
+ Option 3: Follow steps 6-10 if you want specific control over the creation and configuration of these resources.
+
+6. Create an Azure OpenAI resource:
+
+ > [!NOTE]
+ > Azure AI Agent Service is currently available for all OpenAI models in available Azure Regions that are compatible with Azure Assistants (see the [models guide](https://learn.microsoft.com/azure/ai-services/openai/concepts/models#assistants-preview)) and Llama 3.1-405B-instruct. We will be expanding to more models in the future.
+
+ ```console
+ az cognitiveservices account create --name {MyOpenAIResource} --resource-group {my_resource_group} --location eastus --kind OpenAI --sku s0
+ ```
+
+ Alternatively, you can create an AI Services resource:
+
+ ```console
+ az cognitiveservices account create --name {my-multi-service-resource} --resource-group {my_resource_group} --kind AIServices --sku s0 --location eastus
+ ```
+
+ Save the id that gets output, you’ll need it later. It will look similar to: `https://eastus.api.cognitive.microsoft.com/ai_services_resource_id: /subscriptions/1234-5678-abcd-9fc6-62780b3d3e05/resourceGroups/my-resource-group/providers/Microsoft.CognitiveServices/accounts/multi-service-resource`
+
+1. Create an Azure AI Hub.
+
+ > [!NOTE] the following command auto creates a storage account, AML workspace and Key Vault.
+
+ ```console
+ az ml workspace create --kind hub --resource-group {my_resource_group} --name {my_hub_name}
+ ```
+
+ OR
+
+ Optional: If you want to connect an existing storage account and/or key vault you can specify them here:
+
+ ```console
+ az ml workspace create --kind hub --resource-group {my_resource_group} --name {my_hub_name} --location {hub-region} --storage-account {my_storage_account_id} --key-vault {my_key_vault_id}
+ ```
+
+1. Connect your Hub to your Azure AI resource or Azure OpenAI resource. Replace the resource group and hub name with your resource and hub name.
+
+ - Save the following in a file named `connection.yml`.
+
+ - If using an AI Services resource, use the following and replace ai_services_resource_id with the fully qualified ID from earlier.
+
+ ```yml
+ name: myazai_connection
+ type: azure_ai_services
+ endpoint: https://eastus.api.cognitive.microsoft.com/
+ ai_services_resource_id: /subscriptions/12345678-abcd-1234-9fc6-62780b3d3e05/resourceGroups/my-ai-resource-group/providers/Microsoft.CognitiveServices/accounts/multi-service-resource
+ ```
+
+ - If using an Azure OpenAI resource, create the following `connection.yml` file:
+
+ ```yml
+ name: { my_connection_name }
+ type: azure_open_ai
+ azure_endpoint: https://eastus.api.cognitive.microsoft.com/
+ ```
+
+1. Then run the following command:
+
+ ```console
+ az ml connection create --file connection.yml --resource-group {my_resource_group} --workspace-name {my_hub_name}
+ ```
+
+1. Create a Project.
+
+ - Run the following command to find your ARM ID:
+
+ ```console
+ az ml workspace show -n {my_hub_name} --resource-group {my_resource_group} --query id
+ ```
+
+ - Now run this command to create your project
+
+ ```console
+ az ml workspace create --kind project --hub-id {my_hub_ARM_ID} --resource-group {my_resource_group} --name {my_project_name}
+ ```
+
+
+
+## Configure and run your first agent
+
+| Component | Description |
+| --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| Agent | Custom AI that uses AI models in conjunction with tools. |
+| Tool | Tools help extend an agent’s ability to reliably and accurately respond during conversation. Such as connecting to user-defined knowledge bases to ground the model, or enabling web search to provide current information. |
+| Thread | A conversation session between an agent and a user. Threads store Messages and automatically handle truncation to fit content into a model’s context. |
+| Message | A message created by an agent or a user. Messages can include text, images, and other files. Messages are stored as a list on the Thread. |
+| Run | Activation of an agent to begin running based on the contents of Thread. The agent uses its configuration and Thread’s Messages to perform tasks by calling models and tools. As part of a Run, the agent appends Messages to the Thread. |
+| Run Step | A detailed list of steps the agent took as part of a Run. An agent can call tools or create Messages during its run. Examining Run Steps allows you to understand how the agent is getting to its results. |
+
+Use the following code to create an agent and send a message to it. This agent will have the code interpreter tool to enable your agent to perform advanced data analysis in a sandboxed environment.
+
+## Python SDK
+
+### Setup
+
+1. Run the following commands to install the python packages.
+
+ ```console
+ pip install azure-ai-projects
+ pip install azure-identity
+ ```
+
+
+### Create an Agent
+
+Use the following code to create and run an agent. To run this code, you will need to create a connection string using information from your project. This string is in the format:
+
+`;;;`
+
+`HostName` can be found by navigating to your `discovery_url` and removing the leading `https://` and trailing `/discovery`. To find your `discovery_url`, run this CLI command:
+
+`az ml workspace show -n {project_name} --resource-group {resource_group_name} --query discovery_url`
+
+For example, your connection string may look something like:
+
+`eastus.api.azureml.ms;12345678-abcd-1234-9fc6-62780b3d3e05;my-resource-group;my-project-name`
+
+Set this connection string as an environment variable named `PROJECT_CONNECTION_STRING`.
+
+> [!TIP]
+> Want to use the OpenAI SDK? You can find [examples of using the Azure AI Agent service with the OpenAI SDK](./samples/use-openai.md) in the samples folder of this repo.
+
+```python
+import os
+from azure.ai.projects import AIProjectClient
+from azure.ai.projects.models import CodeInterpreterTool
+from azure.identity import DefaultAzureCredential
+from typing import Any
+from pathlib import Path
+
+# Create an Azure AI Client from a connection string, copied from your AI Studio project.
+# At the moment, it should be in the format ";;;"
+# HostName can be found by navigating to your discovery_url and removing the leading "https://" and trailing "/discovery"
+# To find your discovery_url, run the CLI command: az ml workspace show -n {project_name} --resource-group {resource_group_name} --query discovery_url
+# Project Connection example: eastus.api.azureml.ms;12345678-abcd-1234-9fc6-62780b3d3e05;my-resource-group;my-project-name
+# Customer needs to login to Azure subscription via Azure CLI and set the environment variables
+
+project_client = AIProjectClient.from_connection_string(
+ credential=DefaultAzureCredential(), conn_str=os.environ["PROJECT_CONNECTION_STRING"]
+)
+
+with project_client:
+ # Create an instance of the CodeInterpreterTool
+ code_interpreter = CodeInterpreterTool()
+
+ # The CodeInterpreterTool needs to be included in creation of the agent
+ agent = project_client.agents.create_agent(
+ model="gpt-4o-mini",
+ name="my-assistant",
+ instructions="You are helpful assistant",
+ tools=code_interpreter.definitions,
+ tool_resources=code_interpreter.resources,
+ )
+ print(f"Created agent, agent ID: {agent.id}")
+
+ # Create a thread
+ thread = project_client.agents.create_thread()
+ print(f"Created thread, thread ID: {thread.id}")
+
+ # Create a message
+ message = project_client.agents.create_message(
+ thread_id=thread.id,
+ role="user",
+ content="Could you please create a bar chart for the operating profit using the following data and provide the file to me? Company A: $1.2 million, Company B: $2.5 million, Company C: $3.0 million, Company D: $1.8 million",
+ )
+ print(f"Created message, message ID: {message.id}")
+
+ # Run the agent
+ run = project_client.agents.create_and_process_run(thread_id=thread.id, assistant_id=agent.id)
+ print(f"Run finished with status: {run.status}")
+
+ if run.status == "failed":
+ # Check if you got "Rate limit is exceeded.", then you want to get more quota
+ print(f"Run failed: {run.last_error}")
+
+ # Get messages from the thread
+ messages = project_client.agents.get_messages(thread_id=thread.id)
+ print(f"Messages: {messages}")
+
+ # Get the last message from the sender
+ last_msg = messages.get_last_text_message_by_sender("assistant")
+ if last_msg:
+ print(f"Last Message: {last_msg.text.value}")
+
+ # Generate an image file for the bar chart
+ for image_content in messages.image_contents:
+ print(f"Image File ID: {image_content.image_file.file_id}")
+ file_name = f"{image_content.image_file.file_id}_image_file.png"
+ project_client.agents.save_file(file_id=image_content.image_file.file_id, file_name=file_name)
+ print(f"Saved image file to: {Path.cwd() / file_name}")
+
+ # Print the file path(s) from the messages
+ for file_path_annotation in messages.file_path_annotations:
+ print(f"File Paths:")
+ print(f"Type: {file_path_annotation.type}")
+ print(f"Text: {file_path_annotation.text}")
+ print(f"File ID: {file_path_annotation.file_path.file_id}")
+ print(f"Start Index: {file_path_annotation.start_index}")
+ print(f"End Index: {file_path_annotation.end_index}")
+ project_client.agents.save_file(file_id=file_path_annotation.file_path.file_id, file_name=Path(file_path_annotation.text).name)
+
+ # Delete the agent once done
+ project_client.agents.delete_agent(agent.id)
+ print("Deleted agent")
+```
+
+## C#
+
+```Cs
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using Azure.Core.TestFramework;
+using NUnit.Framework;
+
+namespace Azure.AI.Projects.Tests;
+
+public partial class Sample_Agent_Basics : SamplesBase
+{
+ [Test]
+ public async Task BasicExample()
+ {
+ var connectionString = Environment.GetEnvironmentVariable("AZURE_AI_CONNECTION_STRING");
+
+ AgentsClient client = new AgentsClient(connectionString, new DefaultAzureCredential());
+ #endregion
+
+ // Step 1: Create an agent
+ #region Snippet:OverviewCreateAgent
+ Response agentResponse = await client.CreateAgentAsync(
+ model: "gpt-4o",
+ name: "Math Tutor",
+ instructions: "You are a personal math tutor. Write and run code to answer math questions.",
+ tools: new List { new CodeInterpreterToolDefinition() });
+ Agent agent = agentResponse.Value;
+ #endregion
+
+ // Intermission: agent should now be listed
+
+ Response> agentListResponse = await client.GetAgentsAsync();
+
+ //// Step 2: Create a thread
+ #region Snippet:OverviewCreateThread
+ Response threadResponse = await client.CreateThreadAsync();
+ AgentThread thread = threadResponse.Value;
+ #endregion
+
+ // Step 3: Add a message to a thread
+ #region Snippet:OverviewCreateMessage
+ Response messageResponse = await client.CreateMessageAsync(
+ thread.Id,
+ MessageRole.User,
+ "I need to solve the equation `3x + 11 = 14`. Can you help me?");
+ ThreadMessage message = messageResponse.Value;
+ #endregion
+
+ // Intermission: message is now correlated with thread
+ // Intermission: listing messages will retrieve the message just added
+
+ Response> messagesListResponse = await client.GetMessagesAsync(thread.Id);
+ Assert.That(messagesListResponse.Value.Data[0].Id == message.Id);
+
+ // Step 4: Run the agent
+ #region Snippet:OverviewCreateRun
+ Response runResponse = await client.CreateRunAsync(
+ thread.Id,
+ agent.Id,
+ additionalInstructions: "Please address the user as Jane Doe. The user has a premium account.");
+ ThreadRun run = runResponse.Value;
+ #endregion
+
+ #region Snippet:OverviewWaitForRun
+ do
+ {
+ await Task.Delay(TimeSpan.FromMilliseconds(500));
+ runResponse = await client.GetRunAsync(thread.Id, runResponse.Value.Id);
+ }
+ while (runResponse.Value.Status == RunStatus.Queued
+ || runResponse.Value.Status == RunStatus.InProgress);
+ #endregion
+
+ #region Snippet:OverviewListUpdatedMessages
+ Response> afterRunMessagesResponse
+ = await client.GetMessagesAsync(thread.Id);
+ IReadOnlyList messages = afterRunMessagesResponse.Value.Data;
+
+ // Note: messages iterate from newest to oldest, with the messages[0] being the most recent
+ foreach (ThreadMessage threadMessage in messages)
+ {
+ Console.Write($"{threadMessage.CreatedAt:yyyy-MM-dd HH:mm:ss} - {threadMessage.Role,10}: ");
+ foreach (MessageContent contentItem in threadMessage.ContentItems)
+ {
+ if (contentItem is MessageTextContent textItem)
+ {
+ Console.Write(textItem.Text);
+ }
+ else if (contentItem is MessageImageFileContent imageFileItem)
+ {
+ Console.Write($"
+{
+ [Test]
+ public async Task BingGroundingExample()
+ {
+ var connectionString = TestEnvironment.AzureAICONNECTIONSTRING;
+
+ var clientOptions = new AIProjectClientOptions();
+
+ // Adding the custom headers policy
+ clientOptions.AddPolicy(new CustomHeadersPolicy(), HttpPipelinePosition.PerCall);
+ var projectClient = new AIProjectClient(connectionString, new DefaultAzureCredential(), clientOptions);
+
+ GetConnectionResponse bingConnection = await projectClient.GetConnectionsClient().GetConnectionAsync(TestEnvironment.BINGCONNECTIONNAME);
+ var connectionId = bingConnection.Id;
+
+ AgentsClient agentClient = projectClient.GetAgentsClient();
+
+ ToolConnectionList connectionList = new ToolConnectionList
+ {
+ ConnectionList = { new ToolConnection(connectionId) }
+ };
+ BingGroundingToolDefinition bingGroundingTool = new BingGroundingToolDefinition(connectionList);
+
+ Response agentResponse = await agentClient.CreateAgentAsync(
+ model: "gpt-4-1106-preview",
+ name: "my-assistant",
+ instructions: "You are a helpful assistant.",
+ tools: new List { bingGroundingTool });
+ Agent agent = agentResponse.Value;
+
+ // Create thread for communication
+ Response threadResponse = await agentClient.CreateThreadAsync();
+ AgentThread thread = threadResponse.Value;
+
+ // Create message to thread
+ Response messageResponse = await agentClient.CreateMessageAsync(
+ thread.Id,
+ MessageRole.User,
+ "How does wikipedia explain Euler's Identity?");
+ ThreadMessage message = messageResponse.Value;
+
+ // Run the agent
+ Response runResponse = await agentClient.CreateRunAsync(thread, agent);
+
+ do
+ {
+ await Task.Delay(TimeSpan.FromMilliseconds(500));
+ runResponse = await agentClient.GetRunAsync(thread.Id, runResponse.Value.Id);
+ }
+ while (runResponse.Value.Status == RunStatus.Queued
+ || runResponse.Value.Status == RunStatus.InProgress);
+
+ Response> afterRunMessagesResponse
+ = await agentClient.GetMessagesAsync(thread.Id);
+ IReadOnlyList messages = afterRunMessagesResponse.Value.Data;
+
+ // Note: messages iterate from newest to oldest, with the messages[0] being the most recent
+ foreach (ThreadMessage threadMessage in messages)
+ {
+ Console.Write($"{threadMessage.CreatedAt:yyyy-MM-dd HH:mm:ss} - {threadMessage.Role,10}: ");
+ foreach (MessageContent contentItem in threadMessage.ContentItems)
+ {
+ if (contentItem is MessageTextContent textItem)
+ {
+ Console.Write(textItem.Text);
+ }
+ else if (contentItem is MessageImageFileContent imageFileItem)
+ {
+ Console.Write($";;;"
+# Customer needs to login to Azure subscription via Azure CLI and set the environment variables
+
+project_client = AIProjectClient.from_connection_string(
+ credential=DefaultAzureCredential(),
+ conn_str=os.environ["PROJECT_CONNECTION_STRING"],
+)
+
+bing_connection = project_client.connections.get(
+ connection_name=os.environ["BING_CONNECTION_NAME"]
+)
+conn_id = bing_connection.id
+
+print(conn_id)
+
+# Initialize agent bing tool and add the connection id
+bing = BingGroundingTool(connection_id=conn_id)
+
+# Create agent with the bing tool and process assistant run
+with project_client:
+ agent = project_client.agents.create_agent(
+ model="gpt-4o-mini",
+ name="my-assistant",
+ instructions="You are a helpful assistant",
+ tools=bing.definitions,
+ headers={"x-ms-enable-preview": "true"}
+ )
+ print(f"Created agent, ID: {agent.id}")
+
+ # Create thread for communication
+ thread = project_client.agents.create_thread()
+ print(f"Created thread, ID: {thread.id}")
+
+ # Create message to thread
+ message = project_client.agents.create_message(
+ thread_id=thread.id,
+ role="user",
+ content="How is the weather in Seattle today?",
+ )
+ print(f"Created message, ID: {message.id}")
+
+ # Create and process agent run in thread with tools
+ run = project_client.agents.create_and_process_run(thread_id=thread.id, assistant_id=agent.id)
+ print(f"Run finished with status: {run.status}")
+
+ if run.status == "failed":
+ print(f"Run failed: {run.last_error}")
+
+ # Delete the assistant when done
+ project_client.agents.delete_agent(agent.id)
+ print("Deleted agent")
+
+ # Fetch and log all messages
+ messages = project_client.agents.list_messages(thread_id=thread.id)
+ print(f"Messages: {messages}")
diff --git a/samples/bing-search/bingsearch_arm.json b/samples/bing-search/bingsearch_arm.json
new file mode 100644
index 00000000..c98967fb
--- /dev/null
+++ b/samples/bing-search/bingsearch_arm.json
@@ -0,0 +1,24 @@
+{
+ "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
+ "contentVersion": "1.0.0.0",
+ "parameters": {
+ "name": { "type": "String" },
+ "location": {
+ "type": "String",
+ "defaultValue": "global"
+ },
+ "sku": { "type": "String" },
+ "resourceTags": { "type": "object" }
+ },
+ "resources": [
+ {
+ "type": "Microsoft.Bing/accounts",
+ "apiVersion": "2020-06-10",
+ "name": "[parameters('name')]",
+ "location": "[parameters('location')]",
+ "tags": "[parameters('resourceTags')]",
+ "sku": { "name": "G1" },
+ "kind": "Bing.Grounding"
+ }
+ ]
+}
diff --git a/samples/bing-search/bingsearch_para.json b/samples/bing-search/bingsearch_para.json
new file mode 100644
index 00000000..0f0142e7
--- /dev/null
+++ b/samples/bing-search/bingsearch_para.json
@@ -0,0 +1,21 @@
+{
+ "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
+ "contentVersion": "1.0.0.0",
+ "parameters": {
+ "name": {
+ "value": "BING_RESOURCE_NAME"},
+ "sku": {
+ "value": "G1"
+ },
+ "location": {
+ "value": "GLOBAL"
+ },
+ "resourceTags": {
+ "value": {
+ "Name1": "Value1",
+ "Name2": "Value2",
+ "Name3": "Value3"
+ }
+ }
+ }
+}
diff --git a/samples/bing-search/readme.md b/samples/bing-search/readme.md
new file mode 100644
index 00000000..fd5782b3
--- /dev/null
+++ b/samples/bing-search/readme.md
@@ -0,0 +1,70 @@
+# Grounding with Bing Search
+
+Grounding with Bing Search allows your Azure AI Agents to incorporate real-time public web data when generating responses. To start with, you need to create a Grounding with Bing Search resource, then connect this resource to your Azure AI Agents. When a user sends a query, Azure AI Agents will decide if Grounding with Bing Search should be leveraged or not. If so, it will leverage Bing to search over public web data and return relevant chunks. Lastly, Azure AI Agents will use returned chunks to generate a response.
+
+Citations show links to websites used to generate response, but don’t show links to the bing query used for the search. Developers and end users don’t have access to raw content returned from Grounding with Bing Search.
+
+You can ask questions such as "what is the weather in Seattle?" "what is the recent update in ratail industry in the US?" that require real-time public data.
+
+> [!IMPORTANT]
+Grounding with Bing Search is a free service during private preview and your usage will start incurring cost since the integration with Azure AI Agent Service releases to public preview.
+
+## Setup
+
+> [!IMPORTANT]
+> 1. Grounding with Bing Search has a separate [Terms of Use agreement](https://www.microsoft.com/en-us/bing/apis/grounding-legal-preview) you need to agree to in order to move forward. Please [use this form](https://forms.office.com/r/2j3Sgu8S9K) to sign the agreement. After you have signed the form, it will take 1-3 days for us to whitelist your subscription.
+> 2. Please make sure your resource is created in `EastUS`.
+> 3. We recommend using the following models: `gpt-3.5-turbo-0125`, `gpt-4-0125-preview`, `gpt-4-turbo-preview`, `gpt-4-turbo`, `gpt-4-turbo-2024-04-09`, `gpt-4o`, `gpt-4o-mini`, `gpt-4o-mini-2024-07-18`
+
+1. Ensure you've completed the prerequisites and setup steps in the [quickstart](../../quickstart.md).
+
+1. Ensure you have loged in to Azure, using `az login`
+
+1. Register the Bing Search provider
+ ```console
+ az provider register --namespace 'Microsoft.Bing'
+ ```
+
+1. Create a new Grounding with Bing Search resource. You can find the the template file [here](./bingsearch_arm.json) and parameter file [here](./bingsearch_para.json). Make sure you have replace "BING_RESOURCE_NAME" in the parameter file. You can use Azure CLI command:
+
+ ```console
+ az deployment group create​ 
+ --name "$deployment_name"​ 
+ --resource-group "$resource_group"​ 
+ --template-file "$path_to_arm_template_file"​ 
+ --parameters "$path_to_parameters_file";​ 
+ ```
+ An example of the CLI command:
+ ```console
+ az deployment group create​ 
+ --name az-cli-ARM-TEST
+ --resource-group ApiSearch-Test-WestUS2
+ --template-file bingsearch_arm.json
+ --parameters bingsearch_para.json
+ ```
+ Make sure you have created this Grounding with Bing Search resource in the same resource group of your Azure AI Agent, AI Project, etc.
+1. After you have created a Grounding with Bing Search resource, you can find it in [Azure Portal](https://ms.portal.azure.com/#home). Going to the resource group you have created the resource at, search for the Grounding with Bing Search resource you have created.
+
+1. Click the Grounding with Bing Search resource you have created and copy any of the API key
+
+1. Go to [Azure AI Studio](https://ai.azure.com/) and select the AI Project(make sure it's in the same resource group of your Grounding with Bing Search resource). Click Settings and then "+new connection" button in Settings page
+
+
+1. Select "API key" custom connection in other resource types
+
+1. Enter the following information and then create a new connection to your Grounding with Bing Search resource
+- Endpoint: https://api.bing.microsoft.com/
+- Key: YOUR_API_KEY
+- Connection name: YOUR_CONNECTION_NAME (You will use this connection name in the sample code below.)
+- Access: you can choose either "this project only" or "shared to all projects". Just make sure in the sample code below, the project you entered connection string for has access to this connection.
+
+
+## Examples
+
+Run the code samples below and view the output.
+
+>[!NOTE]
+> Be sure that you've [installed the SDK](../../quickstart.md#install-the-sdk-package) for your language.
+
+* [Python](./bing-python.py)
+* [C#](./BingSearch.cs)
diff --git a/samples/code-interpreter/python-code-interpreter.py b/samples/code-interpreter/python-code-interpreter.py
new file mode 100644
index 00000000..9ebacd98
--- /dev/null
+++ b/samples/code-interpreter/python-code-interpreter.py
@@ -0,0 +1,110 @@
+# ------------------------------------
+# Copyright (c) Microsoft Corporation.
+# Licensed under the MIT License.
+# ------------------------------------
+
+"""
+FILE: python-sample.py
+
+DESCRIPTION:
+ This sample demonstrates how to use agent operations with code interpreter from
+ the Azure Agents service using a synchronous client.
+
+USAGE:
+ python python-sample.py
+
+ Before running the sample:
+
+ pip install azure-ai-projects azure-identity
+
+ Set this environment variables with your own values:
+ PROJECT_CONNECTION_STRING - the Azure AI Project connection string, as found in your AI Studio Project.
+"""
+
+import os
+from azure.ai.projects import AIProjectClient
+from azure.ai.projects.models import CodeInterpreterTool
+from azure.ai.projects.models import FilePurpose
+from azure.identity import DefaultAzureCredential
+from pathlib import Path
+
+# Create an Azure AI Client from a connection string, copied from your AI Studio project.
+# At the moment, it should be in the format ";;;"
+# Customer needs to login to Azure subscription via Azure CLI and set the environment variables
+project_client = AIProjectClient.from_connection_string(
+ credential=DefaultAzureCredential(), conn_str=os.environ["PROJECT_CONNECTION_STRING"]
+)
+
+with project_client:
+
+ # upload a file and wait for it to be processed
+ file = project_client.agents.upload_file_and_poll(
+ file_path="../../data/nifty_500_quarterly_results.csv", purpose=FilePurpose.AGENTS
+ )
+ print(f"Uploaded file, file ID: {file.id}")
+
+ # instantiate the CodeInterpreterTool with the necessary files
+ code_interpreter = CodeInterpreterTool(file_ids=[file.id])
+
+ # notice that CodeInterpreter must be enabled in the agent creation, otherwise the agent will not be able to see the file attachment
+ agent = project_client.agents.create_agent(
+ model="gpt-4o-mini",
+ name="my-agent",
+ instructions="You are helpful agent",
+ tools=code_interpreter.definitions,
+ tool_resources=code_interpreter.resources,
+ )
+ print(f"Created agent, agent ID: {agent.id}")
+
+ # create a thread
+ thread = project_client.agents.create_thread()
+ print(f"Created thread, thread ID: {thread.id}")
+
+ # create a message
+ message = project_client.agents.create_message(
+ thread_id=thread.id,
+ role="user",
+ content="Could you please create bar chart in the TRANSPORTATION sector for the operating profit from the uploaded csv file and provide file to me?",
+ )
+ print(f"Created message, message ID: {message.id}")
+
+ # create and execute a run
+ run = project_client.agents.create_and_process_run(thread_id=thread.id, assistant_id=agent.id)
+ print(f"Run finished with status: {run.status}")
+
+ if run.status == "failed":
+ # Check if you got "Rate limit is exceeded.", then you want to get more quota
+ print(f"Run failed: {run.last_error}")
+
+ # delete the original file from the agent to free up space (note: this does not delete your version of the file)
+ project_client.agents.delete_file(file.id)
+ print("Deleted file")
+
+ # print the messages from the agent
+ messages = project_client.agents.get_messages(thread_id=thread.id)
+ print(f"Messages: {messages}")
+
+ # get the most recent message from the assistant
+ last_msg = messages.get_last_text_message_by_sender("assistant")
+ if last_msg:
+ print(f"Last Message: {last_msg.text.value}")
+
+ # save the newly created file
+ for image_content in messages.image_contents:
+ print(f"Image File ID: {image_content.image_file.file_id}")
+ file_name = f"{image_content.image_file.file_id}_image_file.png"
+ project_client.agents.save_file(file_id=image_content.image_file.file_id, file_name=file_name)
+ print(f"Saved image file to: {Path.cwd() / file_name}")
+
+ # iterates through file_path_annotations in messages and prints details for each annotation
+ for file_path_annotation in messages.file_path_annotations:
+ print(f"File Paths:")
+ print(f"Type: {file_path_annotation.type}")
+ print(f"Text: {file_path_annotation.text}")
+ print(f"File ID: {file_path_annotation.file_path.file_id}")
+ print(f"Start Index: {file_path_annotation.start_index}")
+ print(f"End Index: {file_path_annotation.end_index}")
+
+ # delete the agent once done
+ project_client.agents.delete_agent(agent.id)
+ print("Deleted agent")
\ No newline at end of file
diff --git a/samples/code-interpreter/readme.md b/samples/code-interpreter/readme.md
new file mode 100644
index 00000000..28de2e01
--- /dev/null
+++ b/samples/code-interpreter/readme.md
@@ -0,0 +1,50 @@
+# Code interpreter
+
+Code Interpreter allows the Agent to write and run Python code in a sandboxed execution environment. With Code Interpreter enabled, your Agent can run code iteratively to solve more challenging code, math, and data analysis problems.
+
+
+## Examples
+
+Run the code samples below and view the output.
+
+>[!NOTE]
+> Be sure that you've [installed the SDK](../../quickstart.md#install-the-sdk-package) for your language.
+
+* [Python](./python-code-interpreter.py)
+
+# Additional samples
+
+* [Math tutor](https://github.com/openai/openai-cookbook/blob/main/examples/data/oai_docs/tool-code-interpreter.txt)
+
+
+## Supported file types
+
+|File format|MIME Type|
+|---|---|
+|.c| text/x-c |
+|.cpp|text/x-c++ |
+|.csv|application/csv|
+|.docx|application/vnd.openxmlformats-officedocument.wordprocessingml.document|
+|.html|text/html|
+|.java|text/x-java|
+|.json|application/json|
+|.md|text/markdown|
+|.pdf|application/pdf|
+|.php|text/x-php|
+|.pptx|application/vnd.openxmlformats-officedocument.presentationml.presentation|
+|.py|text/x-python|
+|.py|text/x-script.python|
+|.rb|text/x-ruby|
+|.tex|text/x-tex|
+|.txt|text/plain|
+|.css|text/css|
+|.jpeg|image/jpeg|
+|.jpg|image/jpeg|
+|.js|text/javascript|
+|.gif|image/gif|
+|.png|image/png|
+|.tar|application/x-tar|
+|.ts|application/typescript|
+|.xlsx|application/vnd.openxmlformats-officedocument.spreadsheetml.sheet|
+|.xml|application/xml or "text/xml"|
+|.zip|application/zip|
\ No newline at end of file
diff --git a/samples/file-search/FileSearch.cs b/samples/file-search/FileSearch.cs
new file mode 100644
index 00000000..72d8a827
--- /dev/null
+++ b/samples/file-search/FileSearch.cs
@@ -0,0 +1,101 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Threading.Tasks;
+using Azure.Core.TestFramework;
+using NUnit.Framework;
+
+namespace Azure.AI.Projects.Tests;
+
+public partial class Sample_Agent_FileSearch : SamplesBase
+{
+ [Test]
+ public async Task FilesSearchExample()
+ {
+ var connectionString = TestEnvironment.AzureAICONNECTIONSTRING;
+ AgentsClient client = new AgentsClient(connectionString, new DefaultAzureCredential());
+
+ #region Snippet:UploadAgentFilesToUse
+ // Upload a file and wait for it to be processed
+ File.WriteAllText(
+ path: "sample_file_for_upload.txt",
+ contents: "The word 'apple' uses the code 442345, while the word 'banana' uses the code 673457.");
+ Response uploadAgentFileResponse = await client.UploadFileAsync(
+ filePath: "sample_file_for_upload.txt",
+ purpose: AgentFilePurpose.Agents);
+
+ AgentFile uploadedAgentFile = uploadAgentFileResponse.Value;
+ #endregion
+
+ #region Snippet:CreateVectorStore
+ // Create a vector store with the file and wait for it to be processed.
+ // If you do not specify a vector store, create_message will create a vector store with a default expiration policy of seven days after they were last active
+ VectorStore vectorStore = await client.CreateVectorStoreAsync(
+ fileIds: new List { uploadedAgentFile.Id },
+ name: "my_vector_store");
+ #endregion
+
+ #region Snippet:CreateAgentWithFiles
+ FileSearchToolResource fileSearchToolResource = new FileSearchToolResource();
+ fileSearchToolResource.VectorStoreIds.Add(vectorStore.Id);
+
+ // Create an agent with toolResources and process assistant run
+ Response agentResponse = await client.CreateAgentAsync(
+ model: "gpt-4-1106-preview",
+ name: "SDK Test Agent - Retrieval",
+ instructions: "You are a helpful agent that can help fetch data from files you know about.",
+ tools: new List { new FileSearchToolDefinition() },
+ toolResources: new ToolResources() { FileSearch = fileSearchToolResource });
+ Agent agent = agentResponse.Value;
+ #endregion
+
+ // Create thread for communication
+ Response threadResponse = await client.CreateThreadAsync();
+ AgentThread thread = threadResponse.Value;
+
+ // Create message to thread
+ Response messageResponse = await client.CreateMessageAsync(
+ thread.Id,
+ MessageRole.User,
+ "Can you give me the documented codes for 'banana' and 'orange'?");
+ ThreadMessage message = messageResponse.Value;
+
+ // Run the agent
+ Response runResponse = await client.CreateRunAsync(thread, agent);
+
+ do
+ {
+ await Task.Delay(TimeSpan.FromMilliseconds(500));
+ runResponse = await client.GetRunAsync(thread.Id, runResponse.Value.Id);
+ }
+ while (runResponse.Value.Status == RunStatus.Queued
+ || runResponse.Value.Status == RunStatus.InProgress);
+
+ Response> afterRunMessagesResponse
+ = await client.GetMessagesAsync(thread.Id);
+ IReadOnlyList messages = afterRunMessagesResponse.Value.Data;
+
+ // Note: messages iterate from newest to oldest, with the messages[0] being the most recent
+ foreach (ThreadMessage threadMessage in messages)
+ {
+ Console.Write($"{threadMessage.CreatedAt:yyyy-MM-dd HH:mm:ss} - {threadMessage.Role,10}: ");
+ foreach (MessageContent contentItem in threadMessage.ContentItems)
+ {
+ if (contentItem is MessageTextContent textItem)
+ {
+ Console.Write(textItem.Text);
+ }
+ else if (contentItem is MessageImageFileContent imageFileItem)
+ {
+ Console.Write($";;;"
+# Customer needs to login to Azure subscription via Azure CLI and set the environment variables
+
+credential = DefaultAzureCredential()
+project_client = AIProjectClient.from_connection_string(
+ credential=credential, conn_str=os.environ["PROJECT_CONNECTION_STRING"]
+)
+
+with project_client:
+
+ # [START upload_file_and_create_agent_with_file_search]
+ # We will upload the local file to Azure and will use it for vector store creation.
+ _, asset_uri = project_client.upload_file("./data/product_info_1.md")
+
+ # create a vector store with no file and wait for it to be processed
+ ds = VectorStoreDataSource(asset_identifier=asset_uri, asset_type=VectorStoreDataSourceAssetType.URI_ASSET)
+ vector_store = project_client.agents.create_vector_store_and_poll(data_sources=[ds], name="sample_vector_store")
+ print(f"Created vector store, vector store ID: {vector_store.id}")
+
+ # create a file search tool
+ file_search_tool = FileSearchTool(vector_store_ids=[vector_store.id])
+
+ # notices that FileSearchTool as tool and tool_resources must be added or the assistant unable to search the file
+ agent = project_client.agents.create_agent(
+ model="gpt-4o-mini",
+ name="my-assistant",
+ instructions="You are helpful assistant",
+ tools=file_search_tool.definitions,
+ tool_resources=file_search_tool.resources,
+ )
+ # [END upload_file_and_create_agent_with_file_search]
+ print(f"Created agent, agent ID: {agent.id}")
+
+ thread = project_client.agents.create_thread()
+ print(f"Created thread, thread ID: {thread.id}")
+
+ message = project_client.agents.create_message(
+ thread_id=thread.id, role="user", content="What feature does Smart Eyewear offer?"
+ )
+ print(f"Created message, message ID: {message.id}")
+
+ run = project_client.agents.create_and_process_run(thread_id=thread.id, assistant_id=agent.id)
+ print(f"Created run, run ID: {run.id}")
+
+ project_client.agents.delete_vector_store(vector_store.id)
+ print("Deleted vector store")
+
+ project_client.agents.delete_agent(agent.id)
+ print("Deleted agent")
+
+ messages = project_client.agents.list_messages(thread_id=thread.id)
+ print(f"Messages: {messages}")
\ No newline at end of file
diff --git a/samples/file-search/readme.md b/samples/file-search/readme.md
new file mode 100644
index 00000000..97e8c3c0
--- /dev/null
+++ b/samples/file-search/readme.md
@@ -0,0 +1,38 @@
+# File Search
+
+File Search augments the Agent with knowledge from outside its model, such as proprietary product information or documents provided by your users.
+
+To access your files, the file search tool uses the vector store object. Upload your files and create a vector store to contain them. Once the vector store is created, you should poll its status until all files are out of the in_progress state to ensure that all content has finished processing. The SDK provides helpers for uploading and polling.
+
+### File Sources
+- Uploading local files
+- [Coming Soon] Azure Blob Storage
+
+### Basic Agent Setup
+The File Search tool has the same functionality as AOAI Assistants. Microsoft managed search and storage resources are used.
+- Uploaded files get stored in Microsoft managed storage
+- A vector store is created using a Microsoft managed search resource
+
+### Standard Agent Setup
+The File Search tool uses the Azure AI Search and Azure Blob Storage resources you connected during agent setup.
+- Uploaded files get stored in your connected Azure Blob Storage account
+- Vector stores get created using your connected Azure AI Seach resource
+
+
+For both Agent setups, OpenAI handles the entire ingestion process, including automatically parsing and chunking documents, generating and storing embeddings, and utilizing both vector and keyword searches to retrieve relevant content for user queries.
+
+There is no difference in the code between the two setups; the only variation is in where your files and created vector stores are stored.
+
+## Examples
+
+Run the code samples below and view the output.
+
+>[!NOTE]
+> Be sure that you've [installed the SDK](../../quickstart.md#install-the-sdk-package) for your language.
+
+* [Python](./python-file-search.py)
+* [C#](./FileSearch.cs)
+
+## Additional samples
+
+* [Python Quart app](https://github.com/Azure-Samples/azureai-assistant-tool/tree/main/samples/FileSearch)
diff --git a/samples/function-calling/FunctionCalling.cs b/samples/function-calling/FunctionCalling.cs
new file mode 100644
index 00000000..6e1eca5a
--- /dev/null
+++ b/samples/function-calling/FunctionCalling.cs
@@ -0,0 +1,179 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+using System.Text.Json;
+using System.Threading.Tasks;
+using Azure.Core.TestFramework;
+using NUnit.Framework;
+
+namespace Azure.AI.Projects.Tests;
+
+public partial class Sample_Agent_Functions : SamplesBase
+{
+ [Test]
+ public async Task FunctionCallingExample()
+ {
+ var connectionString = TestEnvironment.AzureAICONNECTIONSTRING;
+ AgentsClient client = new AgentsClient(connectionString, new DefaultAzureCredential());
+
+ #region Snippet:FunctionsDefineFunctionTools
+ // Example of a function that defines no parameters
+ string GetUserFavoriteCity() => "Seattle, WA";
+ FunctionToolDefinition getUserFavoriteCityTool = new("getUserFavoriteCity", "Gets the user's favorite city.");
+ // Example of a function with a single required parameter
+ string GetCityNickname(string location) => location switch
+ {
+ "Seattle, WA" => "The Emerald City",
+ _ => throw new NotImplementedException(),
+ };
+ FunctionToolDefinition getCityNicknameTool = new(
+ name: "getCityNickname",
+ description: "Gets the nickname of a city, e.g. 'LA' for 'Los Angeles, CA'.",
+ parameters: BinaryData.FromObjectAsJson(
+ new
+ {
+ Type = "object",
+ Properties = new
+ {
+ Location = new
+ {
+ Type = "string",
+ Description = "The city and state, e.g. San Francisco, CA",
+ },
+ },
+ Required = new[] { "location" },
+ },
+ new JsonSerializerOptions() { PropertyNamingPolicy = JsonNamingPolicy.CamelCase }));
+ // Example of a function with one required and one optional, enum parameter
+ string GetWeatherAtLocation(string location, string temperatureUnit = "f") => location switch
+ {
+ "Seattle, WA" => temperatureUnit == "f" ? "70f" : "21c",
+ _ => throw new NotImplementedException()
+ };
+ FunctionToolDefinition getCurrentWeatherAtLocationTool = new(
+ name: "getCurrentWeatherAtLocation",
+ description: "Gets the current weather at a provided location.",
+ parameters: BinaryData.FromObjectAsJson(
+ new
+ {
+ Type = "object",
+ Properties = new
+ {
+ Location = new
+ {
+ Type = "string",
+ Description = "The city and state, e.g. San Francisco, CA",
+ },
+ Unit = new
+ {
+ Type = "string",
+ Enum = new[] { "c", "f" },
+ },
+ },
+ Required = new[] { "location" },
+ },
+ new JsonSerializerOptions() { PropertyNamingPolicy = JsonNamingPolicy.CamelCase }));
+ #endregion
+
+ #region Snippet:FunctionsHandleFunctionCalls
+ ToolOutput GetResolvedToolOutput(RequiredToolCall toolCall)
+ {
+ if (toolCall is RequiredFunctionToolCall functionToolCall)
+ {
+ if (functionToolCall.Name == getUserFavoriteCityTool.Name)
+ {
+ return new ToolOutput(toolCall, GetUserFavoriteCity());
+ }
+ using JsonDocument argumentsJson = JsonDocument.Parse(functionToolCall.Arguments);
+ if (functionToolCall.Name == getCityNicknameTool.Name)
+ {
+ string locationArgument = argumentsJson.RootElement.GetProperty("location").GetString();
+ return new ToolOutput(toolCall, GetCityNickname(locationArgument));
+ }
+ if (functionToolCall.Name == getCurrentWeatherAtLocationTool.Name)
+ {
+ string locationArgument = argumentsJson.RootElement.GetProperty("location").GetString();
+ if (argumentsJson.RootElement.TryGetProperty("unit", out JsonElement unitElement))
+ {
+ string unitArgument = unitElement.GetString();
+ return new ToolOutput(toolCall, GetWeatherAtLocation(locationArgument, unitArgument));
+ }
+ return new ToolOutput(toolCall, GetWeatherAtLocation(locationArgument));
+ }
+ }
+ return null;
+ }
+ #endregion
+
+ #region Snippet:FunctionsCreateAgentWithFunctionTools
+ // note: parallel function calling is only supported with newer models like gpt-4-1106-preview
+ Response agentResponse = await client.CreateAgentAsync(
+ model: "gpt-4-1106-preview",
+ name: "SDK Test Agent - Functions",
+ instructions: "You are a weather bot. Use the provided functions to help answer questions. "
+ + "Customize your responses to the user's preferences as much as possible and use friendly "
+ + "nicknames for cities whenever possible.",
+ tools: new List { getUserFavoriteCityTool, getCityNicknameTool, getCurrentWeatherAtLocationTool }
+ );
+ Agent agent = agentResponse.Value;
+ #endregion
+
+ Response threadResponse = await client.CreateThreadAsync();
+ AgentThread thread = threadResponse.Value;
+
+ Response messageResponse = await client.CreateMessageAsync(
+ thread.Id,
+ MessageRole.User,
+ "What's the weather like in my favorite city?");
+ ThreadMessage message = messageResponse.Value;
+
+ Response runResponse = await client.CreateRunAsync(thread, agent);
+
+ #region Snippet:FunctionsHandlePollingWithRequiredAction
+ do
+ {
+ await Task.Delay(TimeSpan.FromMilliseconds(500));
+ runResponse = await client.GetRunAsync(thread.Id, runResponse.Value.Id);
+
+ if (runResponse.Value.Status == RunStatus.RequiresAction
+ && runResponse.Value.RequiredAction is SubmitToolOutputsAction submitToolOutputsAction)
+ {
+ List toolOutputs = new();
+ foreach (RequiredToolCall toolCall in submitToolOutputsAction.ToolCalls)
+ {
+ toolOutputs.Add(GetResolvedToolOutput(toolCall));
+ }
+ runResponse = await client.SubmitToolOutputsToRunAsync(runResponse.Value, toolOutputs);
+ }
+ }
+ while (runResponse.Value.Status == RunStatus.Queued
+ || runResponse.Value.Status == RunStatus.InProgress);
+ #endregion
+
+ Response> afterRunMessagesResponse
+ = await client.GetMessagesAsync(thread.Id);
+ IReadOnlyList messages = afterRunMessagesResponse.Value.Data;
+
+ // Note: messages iterate from newest to oldest, with the messages[0] being the most recent
+ foreach (ThreadMessage threadMessage in messages)
+ {
+ Console.Write($"{threadMessage.CreatedAt:yyyy-MM-dd HH:mm:ss} - {threadMessage.Role,10}: ");
+ foreach (MessageContent contentItem in threadMessage.ContentItems)
+ {
+ if (contentItem is MessageTextContent textItem)
+ {
+ Console.Write(textItem.Text);
+ }
+ else if (contentItem is MessageImageFileContent imageFileItem)
+ {
+ Console.Write($";;;"
+# Customer needs to login to Azure subscription via Azure CLI and set the environment variables
+
+project_client = AIProjectClient.from_connection_string(
+ credential=DefaultAzureCredential(), conn_str=os.environ["PROJECT_CONNECTION_STRING"]
+)
+
+
+# When using FunctionTool with ToolSet in agent creation, the tool call events are handled inside the create_stream
+# method and functions gets automatically called by default.
+class MyEventHandler(AgentEventHandler):
+
+ def on_message_delta(self, delta: "MessageDeltaChunk") -> None:
+ for content_part in delta.delta.content:
+ if isinstance(content_part, MessageDeltaTextContent):
+ text_value = content_part.text.value if content_part.text else "No text"
+ print(f"Text delta received: {text_value}")
+
+ def on_thread_message(self, message: "ThreadMessage") -> None:
+ print(f"ThreadMessage created. ID: {message.id}, Status: {message.status}")
+
+ def on_thread_run(self, run: "ThreadRun") -> None:
+ print(f"ThreadRun status: {run.status}")
+
+ if run.status == "failed":
+ print(f"Run failed. Error: {run.last_error}")
+
+ def on_run_step(self, step: "RunStep") -> None:
+ print(f"RunStep type: {step.type}, Status: {step.status}")
+
+ def on_error(self, data: str) -> None:
+ print(f"An error occurred. Data: {data}")
+
+ def on_done(self) -> None:
+ print("Stream completed.")
+
+ def on_unhandled_event(self, event_type: str, event_data: Any) -> None:
+ print(f"Unhandled Event Type: {event_type}, Data: {event_data}")
+
+
+with project_client:
+ functions = FunctionTool(user_functions)
+ toolset = ToolSet()
+ toolset.add(functions)
+
+ agent = project_client.agents.create_agent(
+ model="gpt-4o-mini", name="my-assistant", instructions="You are a helpful assistant", toolset=toolset
+ )
+ print(f"Created agent, ID: {agent.id}")
+
+ thread = project_client.agents.create_thread()
+ print(f"Created thread, thread ID {thread.id}")
+
+ message = project_client.agents.create_message(
+ thread_id=thread.id,
+ role="user",
+ content="Hello, send an email with the datetime and weather information in New York? Also let me know the details",
+ )
+ print(f"Created message, message ID {message.id}")
+
+ with project_client.agents.create_stream(
+ thread_id=thread.id, assistant_id=agent.id, event_handler=MyEventHandler()
+ ) as stream:
+ stream.until_done()
+
+ project_client.agents.delete_agent(agent.id)
+ print("Deleted agent")
+
+ messages = project_client.agents.list_messages(thread_id=thread.id)
+ print(f"Messages: {messages}")
\ No newline at end of file
diff --git a/samples/function-calling/python-function-calling-toolset.py b/samples/function-calling/python-function-calling-toolset.py
new file mode 100644
index 00000000..3eb2a4e1
--- /dev/null
+++ b/samples/function-calling/python-function-calling-toolset.py
@@ -0,0 +1,59 @@
+# This sample demonstrates how to use agent operations with toolset from the Azure Agents service using a synchronous client. It's purpose is to showcase automatic tool calling using ToolSet in non-streaming scenario
+
+import os
+from azure.ai.projects import AIProjectClient
+from azure.identity import DefaultAzureCredential
+from azure.ai.projects.models import FunctionTool, ToolSet, CodeInterpreterTool
+from user_functions import user_functions
+
+
+# Create an Azure AI Client from a connection string, copied from your AI Studio project.
+# At the moment, it should be in the format ";;;"
+# Customer needs to login to Azure subscription via Azure CLI and set the environment variables
+
+project_client = AIProjectClient.from_connection_string(
+ credential=DefaultAzureCredential(),
+ conn_str=os.environ["PROJECT_CONNECTION_STRING"],
+)
+
+# Initialize agent toolset with user functions and code interpreter
+functions = FunctionTool(user_functions)
+code_interpreter = CodeInterpreterTool()
+
+toolset = ToolSet()
+toolset.add(functions)
+toolset.add(code_interpreter)
+
+# Create agent with toolset and process assistant run
+with project_client:
+ agent = project_client.agents.create_agent(
+ model="gpt-4o-mini", name="my-assistant", instructions="You are a helpful assistant", toolset=toolset
+ )
+ print(f"Created agent, ID: {agent.id}")
+
+ # Create thread for communication
+ thread = project_client.agents.create_thread()
+ print(f"Created thread, ID: {thread.id}")
+
+ # Create message to thread
+ message = project_client.agents.create_message(
+ thread_id=thread.id,
+ role="user",
+ content="Hello, send an email with the datetime and weather information in New York?",
+ )
+ print(f"Created message, ID: {message.id}")
+
+ # Create and process agent run in thread with tools
+ run = project_client.agents.create_and_process_run(thread_id=thread.id, assistant_id=agent.id)
+ print(f"Run finished with status: {run.status}")
+
+ if run.status == "failed":
+ print(f"Run failed: {run.last_error}")
+
+ # Delete the assistant when done
+ project_client.agents.delete_agent(agent.id)
+ print("Deleted agent")
+
+ # Fetch and log all messages
+ messages = project_client.agents.list_messages(thread_id=thread.id)
+ print(f"Messages: {messages}")
\ No newline at end of file
diff --git a/samples/function-calling/python-function-calling.py b/samples/function-calling/python-function-calling.py
new file mode 100644
index 00000000..7f13c5fd
--- /dev/null
+++ b/samples/function-calling/python-function-calling.py
@@ -0,0 +1,83 @@
+import os, time
+from azure.ai.projects import AIProjectClient
+from azure.identity import DefaultAzureCredential
+from azure.ai.projects.models import FunctionTool, SubmitToolOutputsAction, RequiredFunctionToolCall
+from user_functions import user_functions # found in the user_functions.py file in this directory.
+
+
+# Create an Azure AI Client from a connection string, copied from your AI Studio project.
+# At the moment, it should be in the format ";;;"
+# Customer needs to login to Azure subscription via Azure CLI and set the environment variables
+
+project_client = AIProjectClient.from_connection_string(
+ credential=DefaultAzureCredential(), conn_str=os.environ["PROJECT_CONNECTION_STRING"]
+)
+
+# Initialize function tool with user functions
+functions = FunctionTool(functions=user_functions)
+
+with project_client:
+ # Create an agent and run user's request with function calls
+ agent = project_client.agents.create_agent(
+ model="gpt-4o-mini",
+ name="my-agent",
+ instructions="You are a helpful agent",
+ tools=functions.definitions,
+ )
+ print(f"Created agent, ID: {agent.id}")
+
+ thread = project_client.agents.create_thread()
+ print(f"Created thread, ID: {thread.id}")
+
+ message = project_client.agents.create_message(
+ thread_id=thread.id,
+ role="user",
+ content="Hello, send an email with the datetime and weather information in New York?",
+ )
+ print(f"Created message, ID: {message.id}")
+
+ run = project_client.agents.create_run(thread_id=thread.id, assistant_id=agent.id)
+ print(f"Created run, ID: {run.id}")
+
+ while run.status in ["queued", "in_progress", "requires_action"]:
+ time.sleep(1)
+ run = project_client.agents.get_run(thread_id=thread.id, run_id=run.id)
+
+ if run.status == "requires_action" and isinstance(run.required_action, SubmitToolOutputsAction):
+ tool_calls = run.required_action.submit_tool_outputs.tool_calls
+ if not tool_calls:
+ print("No tool calls provided - cancelling run")
+ project_client.agents.cancel_run(thread_id=thread.id, run_id=run.id)
+ break
+
+ tool_outputs = []
+ for tool_call in tool_calls:
+ if isinstance(tool_call, RequiredFunctionToolCall):
+ try:
+ output = functions.execute(tool_call)
+ tool_outputs.append(
+ {
+ "tool_call_id": tool_call.id,
+ "output": output,
+ }
+ )
+ except Exception as e:
+ print(f"Error executing tool_call {tool_call.id}: {e}")
+
+ print(f"Tool outputs: {tool_outputs}")
+ if tool_outputs:
+ project_client.agents.submit_tool_outputs_to_run(
+ thread_id=thread.id, run_id=run.id, tool_outputs=tool_outputs
+ )
+
+ print(f"Current run status: {run.status}")
+
+ print(f"Run completed with status: {run.status}")
+
+ # Delete the agent when done
+ project_client.agents.delete_agent(agent.id)
+ print("Deleted agent")
+
+ # Fetch and log all messages
+ messages = project_client.agents.list_messages(thread_id=thread.id)
+ print(f"Messages: {messages}")
diff --git a/samples/function-calling/readme.md b/samples/function-calling/readme.md
new file mode 100644
index 00000000..e9e82eac
--- /dev/null
+++ b/samples/function-calling/readme.md
@@ -0,0 +1,22 @@
+# Function Calling
+
+Azure AI Agents Service supports function calling, which allows you to describe the structure of functions to an Agent and then return the functions that need to be called along with their arguments.
+
+## Setup
+
+To use function calling, you need a function defined that can be called by the AI Agent service. You can find an example in the [user_functions.py](./user_functions.py) file in this folder.
+
+## Examples
+
+Run the code samples below and view the output.
+
+>[!NOTE]
+> Be sure that you've [installed the SDK](../../quickstart.md#install-the-sdk-package) for your language.
+
+* [Python - function calling](./python-function-calling.py)
+* [Python - function calling with automatic tool calling](./python-function-calling-toolset.py)
+* [Python - function calling with streaming](./python-function-calling-streaming.py)
+
+## Additional samples
+
+Get the latest stock price using function calling with Yfinance ([shown in Personal Finance Assistant](https://github.com/Azure-Samples/azureai-samples/blob/main/scenarios/Assistants/api-in-a-box/personal_finance/assistant-personal_finance.ipynb))
diff --git a/samples/function-calling/user_functions.py b/samples/function-calling/user_functions.py
new file mode 100644
index 00000000..265913dd
--- /dev/null
+++ b/samples/function-calling/user_functions.py
@@ -0,0 +1,222 @@
+import json
+import datetime
+from typing import Any, Callable, Set, Dict, List, Optional
+
+# These are the user-defined functions that can be called by the agent.
+
+
+def fetch_current_datetime(format: Optional[str] = None) -> str:
+ """
+ Get the current time as a JSON string, optionally formatted.
+
+ :param format (Optional[str]): The format in which to return the current time. Defaults to None, which uses a standard format.
+ :return: The current time in JSON format.
+ :rtype: str
+ """
+ current_time = datetime.datetime.now()
+
+ # Use the provided format if available, else use a default format
+ if format:
+ time_format = format
+ else:
+ time_format = "%Y-%m-%d %H:%M:%S"
+
+ time_json = json.dumps({"current_time": current_time.strftime(time_format)})
+ return time_json
+
+
+def fetch_weather(location: str) -> str:
+ """
+ Fetches the weather information for the specified location.
+
+ :param location (str): The location to fetch weather for.
+ :return: Weather information as a JSON string.
+ :rtype: str
+ """
+ # In a real-world scenario, you'd integrate with a weather API.
+ # Here, we'll mock the response.
+ mock_weather_data = {"New York": "Sunny, 25°C", "London": "Cloudy, 18°C", "Tokyo": "Rainy, 22°C"}
+ weather = mock_weather_data.get(location, "Weather data not available for this location.")
+ weather_json = json.dumps({"weather": weather})
+ return weather_json
+
+
+def send_email(recipient: str, subject: str, body: str) -> str:
+ """
+ Sends an email with the specified subject and body to the recipient.
+
+ :param recipient (str): Email address of the recipient.
+ :param subject (str): Subject of the email.
+ :param body (str): Body content of the email.
+ :return: Confirmation message.
+ :rtype: str
+ """
+ # In a real-world scenario, you'd use an SMTP server or an email service API.
+ # Here, we'll mock the email sending.
+ print(f"Sending email to {recipient}...")
+ print(f"Subject: {subject}")
+ print(f"Body:\n{body}")
+
+ message_json = json.dumps({"message": f"Email successfully sent to {recipient}."})
+ return message_json
+
+
+def calculate_sum(a: int, b: int) -> str:
+ """Calculates the sum of two integers.
+
+ :param a (int): First integer.
+ :rtype: int
+ :param b (int): Second integer.
+ :rtype: int
+
+ :return: The sum of the two integers.
+ :rtype: str
+ """
+ result = a + b
+ return json.dumps({"result": result})
+
+
+def convert_temperature(celsius: float) -> str:
+ """Converts temperature from Celsius to Fahrenheit.
+
+ :param celsius (float): Temperature in Celsius.
+ :rtype: float
+
+ :return: Temperature in Fahrenheit.
+ :rtype: str
+ """
+ fahrenheit = (celsius * 9 / 5) + 32
+ return json.dumps({"fahrenheit": fahrenheit})
+
+
+def toggle_flag(flag: bool) -> str:
+ """Toggles a boolean flag.
+
+ :param flag (bool): The flag to toggle.
+ :rtype: bool
+
+ :return: The toggled flag.
+ :rtype: str
+ """
+ toggled = not flag
+ return json.dumps({"toggled_flag": toggled})
+
+
+def merge_dicts(dict1: Dict[str, Any], dict2: Dict[str, Any]) -> str:
+ """Merges two dictionaries.
+
+ :param dict1 (Dict[str, Any]): First dictionary.
+ :rtype: dict
+ :param dict2 (Dict[str, Any]): Second dictionary.
+ :rtype: dict
+
+ :return: The merged dictionary.
+ :rtype: str
+ """
+ merged = dict1.copy()
+ merged.update(dict2)
+ return json.dumps({"merged_dict": merged})
+
+
+def get_user_info(user_id: int) -> str:
+ """Retrieves user information based on user ID.
+
+ :param user_id (int): ID of the user.
+ :rtype: int
+
+ :return: User information as a JSON string.
+ :rtype: str
+ """
+ mock_users = {
+ 1: {"name": "Alice", "email": "alice@example.com"},
+ 2: {"name": "Bob", "email": "bob@example.com"},
+ 3: {"name": "Charlie", "email": "charlie@example.com"},
+ }
+ user_info = mock_users.get(user_id, {"error": "User not found."})
+ return json.dumps({"user_info": user_info})
+
+
+def longest_word_in_sentences(sentences: List[str]) -> str:
+ """Finds the longest word in each sentence.
+
+ :param sentences (List[str]): A list of sentences.
+ :return: A JSON string mapping each sentence to its longest word.
+ :rtype: str
+ """
+ if not sentences:
+ return json.dumps({"error": "The list of sentences is empty"})
+
+ longest_words = {}
+ for sentence in sentences:
+ # Split sentence into words
+ words = sentence.split()
+ if words:
+ # Find the longest word
+ longest_word = max(words, key=len)
+ longest_words[sentence] = longest_word
+ else:
+ longest_words[sentence] = ""
+
+ return json.dumps({"longest_words": longest_words})
+
+
+def process_records(records: List[Dict[str, int]]) -> str:
+ """
+ Process a list of records, where each record is a dictionary with string keys and integer values.
+
+ :param records: A list containing dictionaries that map strings to integers.
+ :return: A list of sums of the integer values in each record.
+ """
+ sums = []
+ for record in records:
+ # Sum up all the values in each dictionary and append the result to the sums list
+ total = sum(record.values())
+ sums.append(total)
+ return json.dumps({"sums": sums})
+
+
+# Example User Input for Each Function
+# 1. Fetch Current DateTime
+# User Input: "What is the current date and time?"
+# User Input: "What is the current date and time in '%Y-%m-%d %H:%M:%S' format?"
+
+# 2. Fetch Weather
+# User Input: "Can you provide the weather information for New York?"
+
+# 3. Send Email
+# User Input: "Send an email to john.doe@example.com with the subject 'Meeting Reminder' and body 'Don't forget our meeting at 3 PM.'"
+
+# 4. Calculate Sum
+# User Input: "What is the sum of 45 and 55?"
+
+# 5. Convert Temperature
+# User Input: "Convert 25 degrees Celsius to Fahrenheit."
+
+# 6. Toggle Flag
+# User Input: "Toggle the flag True."
+
+# 7. Merge Dictionaries
+# User Input: "Merge these two dictionaries: {'name': 'Alice'} and {'age': 30}."
+
+# 8. Get User Info
+# User Input: "Retrieve user information for user ID 1."
+
+# 9. Longest Word in Sentences
+# User Input: "Find the longest word in each of these sentences: ['The quick brown fox jumps over the lazy dog', 'Python is an amazing programming language', 'Azure AI capabilities are impressive']."
+
+# 10. Process Records
+# User Input: "Process the following records: [{'a': 10, 'b': 20}, {'x': 5, 'y': 15, 'z': 25}, {'m': 30}]."
+
+# Statically defined user functions for fast reference
+user_functions: Set[Callable[..., Any]] = {
+ fetch_current_datetime,
+ fetch_weather,
+ send_email,
+ calculate_sum,
+ convert_temperature,
+ toggle_flag,
+ merge_dicts,
+ get_user_info,
+ longest_word_in_sentences,
+ process_records,
+}
\ No newline at end of file
diff --git a/samples/investment_advisor/.env.example b/samples/investment_advisor/.env.example
new file mode 100644
index 00000000..d3398967
--- /dev/null
+++ b/samples/investment_advisor/.env.example
@@ -0,0 +1,2 @@
+PROJECT_CONNECTION_STRING=";;;"
+AZURE_OPENAI_DEPLOYMENT="gpt-4o-mini"
\ No newline at end of file
diff --git a/samples/investment_advisor/README.md b/samples/investment_advisor/README.md
new file mode 100644
index 00000000..2fd638e2
--- /dev/null
+++ b/samples/investment_advisor/README.md
@@ -0,0 +1,16 @@
+
+## Personal Financial Assistant
+
+### Overview
+
+Function Calling with Yfinance to get latest stock prices. Summarization of user provided article. Extract country info from article, extract country, capital and other aspects, and call an API to get more information about each country.
+
+### Objective
+
+The objective of the provided notebook file is to create an Azure OpenAI Assistant named "Portfolio Management Assistant" using the Azure OpenAI API. The assistant is designed to act as a personal financial assistant, providing information and insights related to a user's investment portfolio. The script initiates a conversation with the assistant, guiding it through various financial queries and scenarios to showcase its capabilities.
+
+### Programming Languages
+
+- Python
+
+### Estimated Runtime: 10 mins
\ No newline at end of file
diff --git a/samples/investment_advisor/agent-investment_advisor.ipynb b/samples/investment_advisor/agent-investment_advisor.ipynb
new file mode 100644
index 00000000..7608ae3c
--- /dev/null
+++ b/samples/investment_advisor/agent-investment_advisor.ipynb
@@ -0,0 +1,943 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# **Investment Advisor**"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## **About the Scenario**\n",
+ "\n",
+ "This notebook demonstrates a practical use case where an AI Agent is leveraged to gain actionable insights and address key analytical questions related to managing an investment portfolio. It combines data fetching, computation, and visualization to streamline decision-making.\n",
+ "\n",
+ "The scenario utilizes an AI Agent integrated with two powerful tools: Function Calling and Code Interpreter. These tools work together to retrieve stock prices and calculate portfolio metrics, replicating real-world workflows in investment management.\n",
+ "\n",
+ "### Key Steps:\n",
+ "\n",
+ "1. *Upload Investment Data*: Import a CSV file containing the user’s investment portfolio into the OpenAI Project.\n",
+ "2. *Fetch Real-Time Stock Prices*: Use the Yahoo! Finance API via *Function Calling* to retrieve up-to-date closing stock data.\n",
+ "3. *Perform Portfolio Analysis*: Leverage *Code Interpreter* to compute key portfolio metrics and insights.\n",
+ "4. *Create Data Visualations*: Leverage *Color Interpreter* to generate portfolio visualization, and leverage Python libraries to render image."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## **Data**\n",
+ "This scenario uses files from the folder [`data/`](./data/) in this repo. You can clone this repo or copy this folder to make sure you have access to these files when running the sample."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## **Time**\n",
+ "You should expect to spend 10-15 minutes building and running this scenario. "
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## **Before you begin**"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "#### Step 1: Install required libraries\n",
+ "Install dependencies directly within a Jupyter notebook is a good practice because it ensures that all required packages are installed in the correct versions, making the notebook self-contained and reproducible. This approach helps other users or collaborators to set up the environment quickly and avoid potential issues related to missing or incompatible packages."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# Install the packages\n",
+ "%pip install -r ./requirements.txt"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "#### Step 2: Setting up the environment\n",
+ "Before we begin, we need to load the necessary environment variables from a `.env` file. These variables include sensitive information such as API keys and endpoint URLs, which are crucial for running the code successfully.\n",
+ "\n",
+ "Here’s what you need to do:\n",
+ "- Ensure your `.env` file is properly configured in the `.venv/.env` format. We have provided an template `.env` file, `.env.example` for your reference.\n",
+ "- Verify that all required secrets are included in the file before running the code.\n",
+ "\n",
+ "\n",
+ "The `.env` file must contain the following secrets:\n",
+ "- PROJECT_CONNECTION_STRING: URL to connect to the Azure OpenAI Project to access project resources.\n",
+ "- AZURE_OPENAI_DEPLOYMENT: The name of the Azure OpenAI model deployment.\n",
+ "\n",
+ "Now, let’s load these variables and get started!\n",
+ "\n",
+ "Note: Make sure to keep your `.env` file secure and avoid sharing it publicly. \n",
+ "\n",
+ "*For more information about leveraging Python Virtual Environments can be found [here](https://docs.python.org/3/library/venv.html).*"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "import os\n",
+ "from dotenv import load_dotenv\n",
+ "\n",
+ "# Load environment variables from .env file\n",
+ "load_dotenv()\n",
+ "\n",
+ "# Retrieve the secrets\n",
+ "__PROJECT_CONNECTION_STRING = os.getenv(\"PROJECT_CONNECTION_STRING\")\n",
+ "__AZURE_OPENAI_DEPLOYMENT = os.getenv(\"AZURE_OPENAI_DEPLOYMENT\")\n",
+ "\n",
+ "# Verify environment variables\n",
+ "if not all([__PROJECT_CONNECTION_STRING, __AZURE_OPENAI_DEPLOYMENT]):\n",
+ " raise EnvironmentError(\"One or more environment variables are missing. Please check the .env file.\")\n",
+ "else:\n",
+ " print(\"Environment variables loaded successfully.\")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## **Azure Agent Runtime setup**"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "#### Step 1: Initializing the Azure Agent Runtime Client\n",
+ "\n",
+ "Next, we’ll initialize the Azure Agent Runtime client. This client allows us to interact with Azure OpenAI Project Agents. We will use a `DefaultAzureCredential` to authenticate, meaning you will have to be logged in with the Azure CLI."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "import os\n",
+ "from azure.ai.projects import AIProjectClient\n",
+ "from azure.identity import DefaultAzureCredential\n",
+ "\n",
+ "# Initialize the Azure AI Project client\n",
+ "project_client = AIProjectClient.from_connection_string(\n",
+ " credential=DefaultAzureCredential(),\n",
+ " conn_str=os.environ[\"PROJECT_CONNECTION_STRING\"],\n",
+ ")\n",
+ "\n",
+ "agents_client = project_client.agents\n",
+ "\n",
+ "print(\"Agent client created successfully.\")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "#### Step 2: Upload supporting file to Azure OpenAI deployment\n",
+ "\n",
+ "Now, we'll upload the `investment_portfolio.csv` file from the `\\data` directory to Azure OpenAI, ensuring any existing `investment_portfolio.csv` is removed beforehand to ensure the latest version of the file is used and no duplicates exist. This process will handle the entire upload. The file is necessary for this scenario, but its contents can be modified as long as the file structure remains unchanged. The file schema must be as followed:\n",
+ "\n",
+ "- Symbol\n",
+ "- Average_Cost\n",
+ "- QTY"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# Directory containing files to upload\n",
+ "directory=\"data\"\n",
+ "portfolio_file=\"investment_portfolio.csv\"\n",
+ "portfolio_file_id=None\n",
+ "\n",
+ "# Check if the directory exists\n",
+ "if not os.path.isdir(directory):\n",
+ " print(f\"Directory '{directory}' does not exist.\")\n",
+ " raise FileNotFoundError(f\"Directory '{directory}' does not exist.\")\n",
+ "\n",
+ "file_path = os.path.join(directory, portfolio_file)\n",
+ "\n",
+ "# Check if the file exists\n",
+ "if not os.path.isfile(file_path):\n",
+ " print(f\"Skipping non-file item: {portfolio_file}\")\n",
+ "\n",
+ "try:\n",
+ " # Delete existing file on Azure if it has the same name and purpose\n",
+ " existing_files = agents_client.list_files()\n",
+ " for f in existing_files.data:\n",
+ " if f.filename == portfolio_file and f.purpose == \"assistants\":\n",
+ " agents_client.delete_file(f.id)\n",
+ " print(f\"Deleted existing file: {portfolio_file}\")\n",
+ "\n",
+ " # Upload new file\n",
+ " with open(file_path, \"rb\") as file_data:\n",
+ " file = agents_client.upload_file(file=file_data, purpose=\"assistants\")\n",
+ " portfolio_file_id = file.id\n",
+ " print(f\"Uploaded file: {portfolio_file}\")\n",
+ "except Exception as e:\n",
+ " print(f\"Error processing file '{portfolio_file}': {e}\")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## **Azure OpenAI Agent**"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Step 1: Define function for Agent Function Calling tool\n",
+ "In this scenario, we will utilize the *Function Calling* tool within the Agent to enhance our insights by invoking a custom function. Since the LLM and Agent currently lack direct access to the internet for user prompts, *Function Calling* serves as a powerful alternative.\n",
+ "\n",
+ "We will use the `fetch_stock_price` function to retrieve stock data for a specified *ticker symbol*. This function leverages the `yfinance` library to fetch the most recent stock price data, specifically for the last trading day.\n",
+ "\n",
+ "This approach enables the Agent to provide up-to-date, actionable insights by integrating external data sources through custom functions. \n",
+ "\n",
+ "Let’s explore how to implement and use this functionality!"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "import yfinance as yf\n",
+ "\n",
+ "def fetch_stock_price(ticker_symbol: str) -> str:\n",
+ " \"\"\"\n",
+ " Fetch the latest stock price for a given ticker symbol.\n",
+ "\n",
+ " Parameters:\n",
+ " - ticker_symbol (str): The ticker symbol of the stock to retrieve data for.\n",
+ "\n",
+ " Returns:\n",
+ " - str: The closing price of the stock for the latest trading day, or an error message if data is unavailable.\n",
+ "\n",
+ " Example:\n",
+ " >>> fetch_stock_price(\"AAPL\")\n",
+ " \"148.9\"\n",
+ " \"\"\"\n",
+ " \n",
+ " try:\n",
+ " # Fetch the stock's trading history for the last day\n",
+ " stock = yf.Ticker(ticker_symbol)\n",
+ " stock_data = stock.history(period=\"1d\")\n",
+ "\n",
+ " # Check if the data is empty, indicating an invalid ticker or no data available\n",
+ " if stock_data.empty:\n",
+ " return f\"Error: No data found for ticker symbol: {ticker_symbol}\"\n",
+ "\n",
+ " # Retrieve and return the latest closing price\n",
+ " latest_close_price = stock_data['Close'].iloc[-1]\n",
+ " return str(round(latest_close_price, 3))\n",
+ "\n",
+ " except KeyError as e:\n",
+ " return f\"Error: Data missing for key: {e}. Verify the ticker symbol.\"\n",
+ "\n",
+ " except Exception as e:\n",
+ " return f\"Error: Unexpected issue occurred - {type(e).__name__}: {e}\"\n",
+ " \n",
+ "print(\"Function defined successfully.\")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "We define a dictionary, `available_functions`, to map function names to their respective implementations, such as `fetch_stock_price`. This structure is designed to support scalability, allowing easy addition of multiple callable functions to expand your solution."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "available_functions = {\"fetch_stock_price\": fetch_stock_price}"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Step 2: Configure Agent Tool-Calling for Enhanced Functionality\n",
+ "The tool-calling definition informs the LLM about the tools available for its use. In our scenario, this configuration enables both *code interpretation* and *function calling*.\n",
+ "\n",
+ "We will specifically configure the `fetch_stock_price` function alongside the *code interpreter tool*. By integrating this tool into the Agent, we empower it to:\n",
+ "\n",
+ "- Retrieve stock data for a specified ticker symbol using the `fetch_stock_price` function.\n",
+ "- Interpret and analyze the retrieved data to provide meaningful insights in response to user queries.\n",
+ "\n",
+ "This setup allows the Agent to seamlessly combine external data retrieval with code-based reasoning, ensuring accurate and actionable responses to stock-related prompts. \n",
+ "\n",
+ "Let’s define and integrate this tool to unlock its full potential!"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "tools_list = [\n",
+ " {\"type\": \"code_interpreter\"},\n",
+ " {\n",
+ " \"type\": \"function\",\n",
+ " \"function\": {\n",
+ " \"name\": \"fetch_stock_price\",\n",
+ " \"description\": \"Retrieve the latest closing price of a stock using its ticker symbol.\",\n",
+ " \"parameters\": {\n",
+ " \"type\": \"object\",\n",
+ " \"properties\": {\"ticker_symbol\": {\"type\": \"string\", \"description\": \"The ticker symbol of the stock\"}},\n",
+ " \"required\": [\"ticker_symbol\"],\n",
+ " },\n",
+ " },\n",
+ " }\n",
+ "]\n",
+ "\n",
+ "print(\"Tools list defined successfully.\")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Step 3: Creating an Investment Analysis Agent\n",
+ "In this step, we’ll set up an Azure OpenAI Agent with the specified tools to handle investment-related queries. This Agent will also leverage the previously defined function calls to provide accurate and actionable insights. \n",
+ "\n",
+ "Let’s configure the Agent and enable its capabilities! "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# Create the Agent with code interpreter and function calling tools enabled\n",
+ "try:\n",
+ " agent = agents_client.create_agent(\n",
+ " name=\"Investment Advisor Agent\",\n",
+ " instructions=(\n",
+ " \"You are an expert investment analyst. \"\n",
+ " \"Use your knowledge base to answer questions about personal investment portfolio management.\"\n",
+ " ),\n",
+ " model=__AZURE_OPENAI_DEPLOYMENT,\n",
+ " tools=tools_list\n",
+ " )\n",
+ " print(\"Agent created successfully.\\n\", agent.id)\n",
+ "except Exception as e:\n",
+ " print(\"Error creating Agent:\", e)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Step 4: Starting a New Conversation Thread\n",
+ "Let’s create a new thread to handle user interactions. Each thread provides a dedicated space for conversations with the Agent, keeping the context focused and organized. \n",
+ "\n",
+ "This setup ensures clear and seamless communication for each user interaction."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# Create a conversation thread\n",
+ "try:\n",
+ " thread = agents_client.create_thread()\n",
+ " print(\"Thread created successfully:\", thread.id)\n",
+ "except Exception as e:\n",
+ " print(\"Error creating thread:\", e)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## **Demonstrating the Thread Run Process (Manual)**\n",
+ "\n",
+ "The next six cells will demonstrate how the Agent's thread run process works. Instead of running a typical loop with a polling mechanism to monitor the run status, we’ll manually step through the cells to better understand each stage of the process.\n",
+ "\n",
+ "In the subsequent section, these cells will be wrapped into a processing function to expand the functionality by incorporating polling and different completion content type, providing a more streamlined and automated workflow. This approach helps clarify how the thread execution operates while offering a hands-on view of each step."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Step 1: Adding User Message to the Thread\n",
+ "In this step, we’ll add a user message to the thread to demonstrate the Agent’s capabilities. Specifically, we’ll ask for the latest closing price of a specified company (*Microsoft*), which will leverage *function calling* to retrieve this data using the `fetch_stock_price` function.\n",
+ "\n",
+ "The Agent will then use the *code interpreter* to combine this information with the `QTY` data from the uploaded `investment_portfolio.csv` file to calculate the **total investment**. \n",
+ "\n",
+ "This workflow showcases how the Agent integrates external data retrieval with computational analysis to deliver actionable insights."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# Define the user question\n",
+ "prompt_content = \"What is the latest closing price for Microsoft? What is my total investment for MSFT as of today?\"\n",
+ "\n",
+ "# Add the question to the thread\n",
+ "try:\n",
+ " message = agents_client.create_message(\n",
+ " thread_id=thread.id,\n",
+ " role=\"user\",\n",
+ " content=prompt_content,\n",
+ " attachments=[ # Add files by using the attachments parameter\n",
+ " {\"file_id\": portfolio_file_id, \"tools\": [{\"type\": \"code_interpreter\"}]}\n",
+ " ],\n",
+ " )\n",
+ " print(\"Successfully added User prompt to the thread.\\n\", message.id)\n",
+ "except Exception as e:\n",
+ " print(\"Error adding user question:\", e)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Step 2: Running the Agent\n",
+ "Now that the Agent and thread are set up, we'll initiate the Agent's response process. This will analyze the user prompt and provide insights based on the investment portfolio data.\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# Initiate the Agent's response\n",
+ "try:\n",
+ " run = agents_client.create_run(\n",
+ " thread_id=thread.id,\n",
+ " assistant_id=agent.id,\n",
+ " instructions=prompt_content,\n",
+ " )\n",
+ " print(\"Run started:\", run.id)\n",
+ "except Exception as e:\n",
+ " print(\"Error starting run:\", e)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Step 3: Monitor run status"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "A Run is an instance where an Agent operates within a Thread. During a Run, the Agent processes the Thread's Messages and its configuration to perform tasks using models and tools, adding additional Messages to the Thread as part of its operations.\n",
+ "\n",
+ "The Agent might take some time to analyze and respond, so it's important to monitor the run status. Based on the status, *specific actions are executed*. \n",
+ "\n",
+ "Let's dive deeper into these status-driven actions!"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "import json\n",
+ "\n",
+ "# Retrieve the run status\n",
+ "run = agents_client.get_run(\n",
+ " thread_id=thread.id,\n",
+ " run_id=run.id\n",
+ ")\n",
+ "#print(run.model_dump_json(indent=4))\n",
+ "\n",
+ "if run.status in ('queued', 'in_progress'):\n",
+ " print(f\"Run this cell again to monitor the status.\\nCurrent Status: {run.status}\")\n",
+ "else:\n",
+ " print(f\"Monitoring the run status...\\nNavigate to `{run.status}` cell.\")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "#### Step 4a: Failed status\n",
+ "\n",
+ "If the status is `failed` we will print the error message with relevant information to aid in troubleshooting."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "#print(run.model_dump_json(indent=4))\n",
+ "\n",
+ "if run.status == \"failed\":\n",
+ " print(\"Agent run failed. Please try again.\")\n",
+ " print(run)\n",
+ "else:\n",
+ " print(f\"Agent run has not failed...\\nNavigate to and execute the '{run.status}' cell.\")\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "#### Step 4b: Requires Action status\n",
+ "\n",
+ "If the status is `requires_action`, first we need to check if the required action is to submit tool outputs and iterate over the tool calls, ensuring that the requested function exists in the available_functions dictionary. If the function exists, it is called with the provided arguments, and the response is stored. After processing all tool calls, we submit the tool outputs back to the OpenAI client."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "if run.status == \"requires_action\":\n",
+ " print(\"Function Calling ...\")\n",
+ " tool_responses = []\n",
+ " if (\n",
+ " run.required_action.type == \"submit_tool_outputs\"\n",
+ " and run.required_action.submit_tool_outputs.tool_calls is not None\n",
+ " ):\n",
+ " tool_calls = run.required_action.submit_tool_outputs.tool_calls\n",
+ "\n",
+ " for call in tool_calls:\n",
+ " if call.type == \"function\":\n",
+ " if call.function.name not in available_functions:\n",
+ " raise Exception(\"Function requested by the model does not exist\")\n",
+ " function_to_call = available_functions[call.function.name]\n",
+ " tool_response = function_to_call(**json.loads(call.function.arguments))\n",
+ " tool_responses.append({\"tool_call_id\": call.id, \"output\": tool_response})\n",
+ " print(f\"Function '{call.function.name}' called successfully. \\nOutput: {tool_response}\\n\")\n",
+ "\n",
+ " run = agents_client.submit_tool_outputs_to_run(\n",
+ " thread_id=thread.id, run_id=run.id, tool_outputs=tool_responses\n",
+ " )\n",
+ "\n",
+ " print(f\"Results submitted successfully. Go back to the first cell, 'Monitor Run Status' and execute again.\")\n",
+ "else:\n",
+ " print(f\"Navigate to and execute the {run.status} cell.\")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "#### Step 4c: Completed status\n",
+ "\n",
+ "If the status is `completed`, we will fetch and print all messages in the thread, displaying the role and content of each message.The messages are printed in reverse order because messages in a thread are in FILO (First-In-Last-Out) order and in order to make the messages more conversational for ease of user reading, we must reverse the order."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "if run.status == \"completed\":\n",
+ " messages = agents_client.list_messages(thread_id=thread.id, order=\"asc\", after=message.id)\n",
+ "\n",
+ " print(f'Run completed!\\n\\nMESSAGES\\n')\n",
+ "\n",
+ " # Loop through messages and print content based on role\n",
+ " for msg in messages.data:\n",
+ " role = msg.role\n",
+ " content = msg.content[0].text.value\n",
+ " print(f\"{role.capitalize()}: {content}\")\n",
+ "\n",
+ "else:\n",
+ " print(f\"Navigate to and execute the {run.status} cell.\")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## **Refining the Process**"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Step 1: Wrapping the Thread Run Process into a Function\n",
+ "In this section we will refine the manual approach and encapsulate the thread run process into a single function. This function automates the steps demonstrated in the previous cells by including the polling functionality to monitor the run status.\n",
+ "\n",
+ "By wrapping the process into a reusable function, we streamline the workflow and ensure that the thread execution is both efficient and easy to integrate into broader applications. The function also expands the functionality for handling different completion content types, such as image rendering.\n",
+ "\n",
+ "Let’s implement this functionality!"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "import time\n",
+ "import json\n",
+ "import matplotlib.pyplot as plt\n",
+ "from PIL import Image\n",
+ "\n",
+ "available_functions = {\"fetch_stock_price\": fetch_stock_price}\n",
+ "\n",
+ "def process_message(thread_id, prompt_message, attachments_list=None):\n",
+ " try:\n",
+ " # Add the prompt to the thread\n",
+ " message = agents_client.create_message(\n",
+ " thread_id=thread_id,\n",
+ " role=\"user\",\n",
+ " content=prompt_message,\n",
+ " attachments=attachments_list,\n",
+ " )\n",
+ " print(\"User message added...\") #:\", message)\n",
+ "\n",
+ " # Initiate the Agent's response\n",
+ " run = agents_client.create_run(\n",
+ " thread_id=thread_id,\n",
+ " assistant_id=agent.id,\n",
+ " instructions=prompt_message,\n",
+ " )\n",
+ " print(\"Run started...\") #:\", run)\n",
+ " except Exception as e:\n",
+ " print(\"Error starting run:\", e)\n",
+ "\n",
+ " while True: # Polling to monitor Run status\n",
+ " time.sleep(5) # Wait 5 seconds to give the process time to move past `queued` state\n",
+ "\n",
+ " # Retrieves the thread’s response.\n",
+ " run = agents_client.get_run(\n",
+ " thread_id=thread_id,\n",
+ " run_id=run.id\n",
+ " )\n",
+ "\n",
+ " run_status = run.status\n",
+ " print(f\"Run Status: {run_status}\\n\")\n",
+ " if run_status == 'completed':\n",
+ " # Get all messages in thread to read\n",
+ " thread_messages = agents_client.list_messages(thread_id=thread_id, order=\"asc\") #, after=message.id)\n",
+ "\n",
+ " # Loop through thread messages and print content\n",
+ " for thread_message in thread_messages.data:\n",
+ " role = thread_message.role\n",
+ " content = None\n",
+ " if isinstance(thread_message.content, list) and thread_message.content:\n",
+ "\n",
+ " for message_content in thread_message.content:\n",
+ " \n",
+ " # handle text\n",
+ " if hasattr(message_content, \"text\") and hasattr(message_content.text, \"value\"):\n",
+ " content = message_content.text.value\n",
+ "\n",
+ " # handle image file\n",
+ " elif hasattr(message_content, \"image_file\"):\n",
+ " \n",
+ " # Download the file locally\n",
+ " file_content = agents_client.get_file_content(message_content.image_file.file_id)\n",
+ "\n",
+ " # Delete existing file locally if it has the same name\n",
+ " if os.path.exists(\"./data/sample_chart.png\"):\n",
+ " os.remove(\"./data/sample_chart.png\")\n",
+ " print(\"Deleted existing file: ./data/sample_chart.png\")\n",
+ " \n",
+ " with open(\"./data/sample_chart.png\", \"wb\") as f:\n",
+ " for chunk in file_content: \n",
+ " f.write(chunk)\n",
+ " print(\"Image File downloaded to './data' successfully.\")\n",
+ "\n",
+ " # Display the image using Pillow and Matplotlib\n",
+ " img = Image.open(\"./data/sample_chart.png\")\n",
+ " plt.imshow(img)\n",
+ " plt.axis('off')\n",
+ " plt.show()\n",
+ " \n",
+ " else:\n",
+ " content = str(message_content)\n",
+ "\n",
+ " print(f\"{role.capitalize()}: {content}\")\n",
+ " \n",
+ " break\n",
+ " elif run.status == \"failed\":\n",
+ " messages = agents_client.list_messages(thread_id=thread.id)\n",
+ " answer = messages.data[0].content[0].text.value\n",
+ " print(f\"Failed User:\\n{prompt_message}\\nAgent:\\n{answer}\\n\")\n",
+ "\n",
+ " # Handle failed\n",
+ " break\n",
+ "\n",
+ " elif run.status == \"requires_action\" and run.required_action.type == \"submit_tool_outputs\":\n",
+ " print(\"Function calling initiated...\")\n",
+ " tool_calls = run.required_action.submit_tool_outputs.tool_calls\n",
+ " tool_responses = []\n",
+ " \n",
+ " # Iterate over each function call requested by the Agent\n",
+ " for call in tool_calls:\n",
+ " # Check if the call is a function and if the function exists is our custom function\n",
+ " if call.type == \"function\" and call.function.name in available_functions:\n",
+ " func = available_functions[call.function.name] # Retrieve the function reference\n",
+ " \n",
+ " # Parse the function arguments from JSON and execute the function\n",
+ " tool_response = func(**json.loads(call.function.arguments))\n",
+ " \n",
+ " # Store the tool call ID and output to later send back to the Agent\n",
+ " tool_responses.append({\"tool_call_id\": call.id, \"output\": tool_response})\n",
+ " print(f\"Executed '{call.function.name}'. Output: {tool_response}\")\n",
+ " \n",
+ " else:\n",
+ " # Raise an error if the function is not in available_functions to handle unexpected requests\n",
+ " raise ValueError(f\"Requested function '{call.function.name}' is not available.\")\n",
+ " \n",
+ " # Submit all collected tool outputs back to the Agent to satisfy the required action\n",
+ " run = agents_client.submit_tool_outputs_to_run(\n",
+ " thread_id=thread_id, \n",
+ " run_id=run.id, \n",
+ " tool_outputs=tool_responses\n",
+ " )\n",
+ " print(\"Function call(s) completed successfully.\")\n",
+ "\n",
+ " else:\n",
+ " time.sleep(5)\n",
+ "\n",
+ "print(\"Function `process_message` created successfully.\")\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Step 2a: Basic Message Sample\n",
+ "This sample demonstrates how the Agent uses the standard LLM system to answer the query: *\"What is today's date?\"* The Agent responds by retrieving the current date directly from its built-in capabilities, without relying on additional tools or attachments."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "process_message(thread_id=thread.id, prompt_message=\"What is today's date?\")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Step 2b: Code Interpreter Sample\n",
+ "This sample demonstrates the use of *Code Interpreter* to analyze an uploaded portfolio file and answer the query: \"What stock do I have the most investment in?\". The Code Interpreter analyzes the file to identify the stock with the highest investment and provides the result, showcasing its ability to integrate data analysis seamlessly into the conversation."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "attachments=[ # Add files by using the attachments parameter\n",
+ " {\"file_id\": portfolio_file_id, \"tools\": [{\"type\": \"code_interpreter\"}]}\n",
+ " ]\n",
+ "\n",
+ "process_message(thread_id=thread.id, prompt_message=\"Which company have I invested in the most?\", attachments_list=attachments)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Step 2c: Function Calling Sample\n",
+ "This sample demonstrates how the Agent utilizes the *Function Calling* tool to answer the query: *\"What is the current stock price for Amazon?\"*. The Agent invokes the previously defined `fetch_stock_price` function to retrieve the latest stock price for Amazon, showcasing how the Function Calling tool integrates external data retrieval into the Agent's workflow."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "process_message(thread_id=thread.id, prompt_message=\"What is the current stock price for Amazon? Based on this price, what is the total investment value for AMZN?\")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Step 2d: Generating and Visualizing Data\n",
+ "This sample shows how an Agent can be used to generate data visualizations, save them locally, and leverage with Python libraries like `Pillow` and `Matplotlib` for rendering. For example, when asked *\"Show a pie chart of my investments\"*, the Agent analyzes the `investment_portfolio` file using Code Interpreter and creates a downloadable pie chart image."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "process_message(thread_id=thread.id, prompt_message=\"Show a pie chart of my investments? Ensure the pie chart color schema aligns with accessibility standards.\")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## **Clean Up**"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Step 1: Delete Agent Resource\n",
+ "To avoid creating redundant resources and ensure a clean environment, this cell deletes the Agent, thread, and any other created resources.\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# Get agent list\n",
+ "agents = agents_client.list_agents()\n",
+ "\n",
+ "# If the agent exists in the list, delete it\n",
+ "if agent.id in [a.id for a in agents.data]:\n",
+ " response = agents_client.delete_agent(agent.id)\n",
+ " print(\"Deleted Agent Client\\n\",response)\n",
+ "else:\n",
+ " print(\"Agent does not exist to delete.\")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Step 2: Delete File\n",
+ "Deletes the file that was uploaded during the execution of the scenario notebook."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "try:\n",
+ " # Delete existing file on Azure if it has the same name and purpose\n",
+ " existing_files = agents_client.list_files()\n",
+ " for f in existing_files.data:\n",
+ " if f.filename == portfolio_file and f.purpose == \"assistants\":\n",
+ " agents_client.delete_file(f.id)\n",
+ " print(f\"Deleted existing file: {portfolio_file}\")\n",
+ " \n",
+ "\n",
+ "except Exception as e:\n",
+ " print(f\"Error processing file '{portfolio_file}': {e}\")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## **Wrap Up**\n",
+ "This notebook demonstrated how Generative AI can be leveraged to streamline investment portfolio analysis by automating data retrieval, computation, and insight generation. Key aspects included:\n",
+ "\n",
+ "1. *Data Import*:\n",
+ " - Uploaded and processed a CSV file containing the investment portfolio details.\n",
+ "\n",
+ "2. *Real-Time Stock Data Retrieval*:\n",
+ " - Integrated the Yahoo! Finance API to fetch live stock prices for portfolio assets.\n",
+ "\n",
+ "3. *Portfolio Analysis*:\n",
+ " - Computed key metrics such as total portfolio value, asset-wise allocation, and performance indicators.\n",
+ " - Derived actionable insights into asset performance and allocation efficiency.\n",
+ "\n",
+ "4. *Visualization and Insights*:\n",
+ " - Presented key findings with graphs and charts for better interpretation.\n",
+ " - Highlighted trends and potential areas for optimization.\n",
+ "\n",
+ "5. *AI Workflow*:\n",
+ " - Demonstrated how Function Calling and Code Interpreter tools integrate to handle real-world investment management tasks.\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## **Next Steps: Expanding Generative AI Applications**\n",
+ "\n",
+ "Building on this scenario, the following Generative AI-focused advancements can be pursued:\n",
+ "\n",
+ "1. *Interactive Portfolio Management Application*:\n",
+ " - Develop a web or mobile application powered by Generative AI to provide real-time portfolio insights, visualizations, and recommendations.\n",
+ " - Integrate conversational interfaces for users to query portfolio performance or simulate investment strategies in natural language.\n",
+ "\n",
+ "2. *Enhanced Personalization*:\n",
+ " - Train models to provide personalized investment advice based on user-defined goals, risk tolerance, and preferences.\n",
+ " - Implement scenario-based AI recommendations for portfolio rebalancing.\n",
+ "\n",
+ "3. *Proactive Alerts and Forecasts*:\n",
+ " - Use Generative AI to provide alerts for significant market movements or deviations in portfolio performance.\n",
+ " - Implement predictive models to forecast asset performance or potential market risks."
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": ".venv",
+ "language": "python",
+ "name": "python3"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 3
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython3",
+ "version": "3.12.6"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}
diff --git a/samples/investment_advisor/data/investment_portfolio.csv b/samples/investment_advisor/data/investment_portfolio.csv
new file mode 100644
index 00000000..bb2df97b
--- /dev/null
+++ b/samples/investment_advisor/data/investment_portfolio.csv
@@ -0,0 +1,7 @@
+Symbol,Average_Cost,QTY
+MSFT,200,300
+AAPL,114,200
+amzn,125,50
+TSLA,900,100
+NfLx,540,80
+NVDA,450,50
\ No newline at end of file
diff --git a/samples/investment_advisor/requirements.txt b/samples/investment_advisor/requirements.txt
new file mode 100644
index 00000000..7a3c67cf
--- /dev/null
+++ b/samples/investment_advisor/requirements.txt
@@ -0,0 +1,7 @@
+azure-identity==1.19.0
+pandas==2.2.3
+yfinance==0.2.48
+python-dotenv==1.0.1
+Pillow==11.0.0
+matplotlib==3.9.2
+../../packages/azure_ai_projects-1.0.0b1-py3-none-any.whl
\ No newline at end of file
diff --git a/samples/llama-3.md b/samples/llama-3.md
new file mode 100644
index 00000000..da6c61cc
--- /dev/null
+++ b/samples/llama-3.md
@@ -0,0 +1,23 @@
+# Use Llama models with Agents
+
+You can now create agents using Llama 3 in Azure AI Agents Service. To get started:
+1. Go to ai.azure.com and select **Model catalog** in the left navigation menu, and scroll down to **Meta-Llama-3-70B-Instruct**. You can also use this link.
+
+1. Select **Deploy**.
+
+1. In the Deployment options screen that appears, select Serverless API with Azure AI Content Safety.
+
+ 
+
+1. Select your project and click **Subscribe and deploy**.
+
+ 
+
+1. Add the Serverless connection to your hub / project. The deployment name you choose will be the one you reference in your code.
+
+1. When calling agent creation API, set the `models` parameter to your deployment name. For example:
+
+
+ ```python
+ agent = project_client.agents.create_agent( model="llama-3", name="my-agent", instructions="You are a helpful agent" )
+ ```
diff --git a/samples/tracing/async/agents_basics_async_with_azure_monitor_tracing.py b/samples/tracing/async/agents_basics_async_with_azure_monitor_tracing.py
new file mode 100644
index 00000000..935b2d58
--- /dev/null
+++ b/samples/tracing/async/agents_basics_async_with_azure_monitor_tracing.py
@@ -0,0 +1,92 @@
+# ------------------------------------
+# Copyright (c) Microsoft Corporation.
+# Licensed under the MIT License.
+# ------------------------------------
+
+"""
+FILE: sample_agents_basics_async_with_azure_monitor_tracing.py
+
+DESCRIPTION:
+ This sample demonstrates how to use basic agent operations from
+ the Azure Agents service using a asynchronous client with Azure Monitor tracing.
+ View the results in the "Tracing" tab in your Azure AI Studio project page.
+
+USAGE:
+ python sample_agents_basics_async_with_azure_monitor_tracing.py
+
+ Before running the sample:
+
+ pip install azure-ai-projects azure-identity opentelemetry-sdk azure-monitor-opentelemetry
+
+ Set these environment variables with your own values:
+ * PROJECT_CONNECTION_STRING - The Azure AI Project connection string, as found in your AI Studio Project.
+ * AZURE_TRACING_GEN_AI_CONTENT_RECORDING_ENABLED - Optional. Set to `true` to trace the content of chat
+ messages, which may contain personal data. False by default.
+"""
+import asyncio
+import time
+from azure.ai.projects.aio import AIProjectClient
+from azure.identity.aio import DefaultAzureCredential
+from azure.ai.projects.tracing.agents import AIAgentsInstrumentor
+from opentelemetry import trace
+import os
+from azure.monitor.opentelemetry import configure_azure_monitor
+
+
+tracer = trace.get_tracer(__name__)
+
+
+@tracer.start_as_current_span(__file__)
+async def main() -> None:
+
+ # Create an Azure AI Project Client from a connection string, copied from your AI Studio project.
+ # At the moment, it should be in the format ";;;"
+ # Customer needs to login to Azure subscription via Azure CLI and set the environment variables
+
+ project_client = AIProjectClient.from_connection_string(
+ credential=DefaultAzureCredential(), conn_str=os.environ["PROJECT_CONNECTION_STRING"]
+ )
+
+ # Enable Azure Monitor tracing
+ application_insights_connection_string = project_client.telemetry.get_connection_string()
+ if not application_insights_connection_string:
+ print("Application Insights was not enabled for this project.")
+ print("Enable it via the 'Tracing' tab in your AI Studio project page.")
+ exit()
+ configure_azure_monitor(connection_string=application_insights_connection_string)
+
+ async with project_client:
+ agent = await project_client.agents.create_agent(
+ model="gpt-4o", name="my-assistant", instructions="You are helpful assistant"
+ )
+ print(f"Created agent, agent ID: {agent.id}")
+
+ thread = await project_client.agents.create_thread()
+ print(f"Created thread, thread ID: {thread.id}")
+
+ message = await project_client.agents.create_message(
+ thread_id=thread.id, role="user", content="Hello, tell me a joke"
+ )
+ print(f"Created message, message ID: {message.id}")
+
+ run = await project_client.agents.create_run(thread_id=thread.id, assistant_id=agent.id)
+
+ # poll the run as long as run status is queued or in progress
+ while run.status in ["queued", "in_progress", "requires_action"]:
+ # wait for a second
+ time.sleep(1)
+ run = await project_client.agents.get_run(thread_id=thread.id, run_id=run.id)
+
+ print(f"Run status: {run.status}")
+
+ print(f"Run completed with status: {run.status}")
+
+ await project_client.agents.delete_agent(agent.id)
+ print("Deleted agent")
+
+ messages = await project_client.agents.list_messages(thread_id=thread.id)
+ print(f"Messages: {messages}")
+
+
+if __name__ == "__main__":
+ asyncio.run(main())
\ No newline at end of file
diff --git a/samples/tracing/async/agents_basics_async_with_console_tracing.py b/samples/tracing/async/agents_basics_async_with_console_tracing.py
new file mode 100644
index 00000000..7336cf40
--- /dev/null
+++ b/samples/tracing/async/agents_basics_async_with_console_tracing.py
@@ -0,0 +1,93 @@
+# ------------------------------------
+# Copyright (c) Microsoft Corporation.
+# Licensed under the MIT License.
+# ------------------------------------
+
+"""
+FILE: sample_agents_basics_async_with_console_tracing.py
+
+DESCRIPTION:
+ This sample demonstrates how to use basic agent operations from
+ the Azure Agents service using a asynchronous client with tracing to console.
+
+USAGE:
+ python sample_agents_basics_async_with_console_tracing.py
+
+ Before running the sample:
+
+ pip install azure-ai-projects azure-identity opentelemetry-sdk azure-core-tracing-opentelemetry
+
+ If you want to export telemetry to OTLP endpoint (such as Aspire dashboard
+ https://learn.microsoft.com/dotnet/aspire/fundamentals/dashboard/standalone?tabs=bash)
+ install:
+
+ pip install opentelemetry-exporter-otlp-proto-grpc
+
+ Set these environment variables with your own values:
+ * PROJECT_CONNECTION_STRING - The Azure AI Project connection string, as found in your AI Studio Project.
+ * AZURE_TRACING_GEN_AI_CONTENT_RECORDING_ENABLED - Optional. Set to `true` to trace the content of chat
+ messages, which may contain personal data. False by default.
+"""
+import asyncio
+import time
+import sys
+from azure.ai.projects.aio import AIProjectClient
+from azure.identity.aio import DefaultAzureCredential
+from opentelemetry import trace
+import os
+
+
+tracer = trace.get_tracer(__name__)
+
+
+@tracer.start_as_current_span(__file__)
+async def main() -> None:
+
+ # Create an Azure AI Project Client from a connection string, copied from your AI Studio project.
+ # At the moment, it should be in the format ";;;"
+ # Customer needs to login to Azure subscription via Azure CLI and set the environment variables
+
+ project_client = AIProjectClient.from_connection_string(
+ credential=DefaultAzureCredential(), conn_str=os.environ["PROJECT_CONNECTION_STRING"]
+ )
+
+ # Enable console tracing
+ # or, if you have local OTLP endpoint running, change it to
+ # project_client.telemetry.enable(destination="http://localhost:4317")
+ await project_client.telemetry.enable(destination=sys.stdout)
+
+ async with project_client:
+ agent = await project_client.agents.create_agent(
+ model="gpt-4o", name="my-assistant", instructions="You are helpful assistant"
+ )
+ print(f"Created agent, agent ID: {agent.id}")
+
+ thread = await project_client.agents.create_thread()
+ print(f"Created thread, thread ID: {thread.id}")
+
+ message = await project_client.agents.create_message(
+ thread_id=thread.id, role="user", content="Hello, tell me a joke"
+ )
+ print(f"Created message, message ID: {message.id}")
+
+ run = await project_client.agents.create_run(thread_id=thread.id, assistant_id=agent.id)
+
+ # poll the run as long as run status is queued or in progress
+ while run.status in ["queued", "in_progress", "requires_action"]:
+ # wait for a second
+ time.sleep(1)
+ run = await project_client.agents.get_run(thread_id=thread.id, run_id=run.id)
+
+ print(f"Run status: {run.status}")
+
+ print(f"Run completed with status: {run.status}")
+
+ await project_client.agents.delete_agent(agent.id)
+ print("Deleted agent")
+
+ messages = await project_client.agents.list_messages(thread_id=thread.id)
+ print(f"Messages: {messages}")
+
+
+if __name__ == "__main__":
+ asyncio.run(main())
\ No newline at end of file
diff --git a/samples/tracing/readme.md b/samples/tracing/readme.md
new file mode 100644
index 00000000..74468ff7
--- /dev/null
+++ b/samples/tracing/readme.md
@@ -0,0 +1,32 @@
+### Tracing using Application Insights
+
+Reasoning about your agent executions is important for troubleshooting and debugging. However, it can be difficult for complex agents for a number of reasons:
+* There could be a high number of steps, making it hard to keep track of all of them.
+* The sequence of steps could vary based on user input.
+* The inputs/outputs at each stage may be long and deserve more detailed inspection.
+* Each step of an agent might also involve nesting — for example, an agent might invoke a tool, which uses another process, which then invokes another tool. If you notice strange or incorrect output from a top-level agent run, it is difficult to determine exactly where in the execution it was introduced.
+
+Tracing solves this by allowing you to clearly see the inputs and outputs of each primitive involved in a particular agent run, in the order in which they were invoked.
+
+Tracing lets you analyze your agent's performance and behavior by using OpenTelemetry and adding an Application Insights Azure resource to your Azure AI Studio project. See the Tracing tab in your [AI studio](https://ai.azure.com/) project page. If one was enabled, you can get the Application Insights connection string, configure your Agents, and observe the full execution path through Azure Monitor. Typically, you might want to start tracing before you create an Agent.
+
+#### Installation
+
+Make sure to install OpenTelemetry and the Azure SDK tracing plugin:
+
+```bash
+pip install opentelemetry
+pip install azure-core-tracing-opentelemetry
+```
+
+You will also need an exporter to send telemetry to your observability backend. You can print traces to the console or use a local viewer such as [Aspire Dashboard](https://learn.microsoft.com/dotnet/aspire/fundamentals/dashboard/standalone?tabs=bash).
+
+To connect to Aspire Dashboard or another OpenTelemetry compatible backend, install the OTLP exporter:
+
+```bash
+pip install opentelemetry-exporter-otlp
+```
+
+These samples are broken into asynchronous and synchronous samples. From there, each sample has two versions, one that traces and displays the results locally in the console, and one that sends the traces to the Azure Monitor in AI Studio. Navigate to the to the 'Tracing' tab in your AI Studio project page to enable the second set of samples.
+
+Note: the initial release of Azure AI Projects has a bug in the agents tracing functionality. The bug will cause agent function tool call related info (function names and parameter values, which could contain sensitive information) to be included in the traces even when content recoding is not enabled. We are working to fix this issue.
\ No newline at end of file
diff --git a/samples/tracing/sync/agents_basics_with_azure_monitor_tracing.py b/samples/tracing/sync/agents_basics_with_azure_monitor_tracing.py
new file mode 100644
index 00000000..892e0b0c
--- /dev/null
+++ b/samples/tracing/sync/agents_basics_with_azure_monitor_tracing.py
@@ -0,0 +1,89 @@
+# ------------------------------------
+# Copyright (c) Microsoft Corporation.
+# Licensed under the MIT License.
+# ------------------------------------
+
+"""
+FILE: sample_agents_basics_with_azure_monitor_tracing.py
+
+DESCRIPTION:
+ This sample demonstrates how to use basic agent operations from
+ the Azure Agents service using a synchronous client with Azure Monitor tracing.
+ View the results in the "Tracing" tab in your Azure AI Studio project page.
+
+USAGE:
+ python sample_agents_basics_with_azure_monitor_tracing.py
+
+ Before running the sample:
+
+ pip install azure-ai-projects azure-identity azure-monitor-opentelemetry
+
+ Set these environment variables with your own values:
+ * PROJECT_CONNECTION_STRING - The Azure AI Project connection string, as found in your AI Studio Project.
+ * AZURE_TRACING_GEN_AI_CONTENT_RECORDING_ENABLED - Optional. Set to `true` to trace the content of chat
+ messages, which may contain personal data. False by default.
+"""
+
+import os, time
+from azure.ai.projects import AIProjectClient
+from azure.identity import DefaultAzureCredential
+from dotenv import load_dotenv
+
+# Create an AI Project Client from a connection string, copied from your AI Studio project.
+# At the moment, it should be in the format ";;;"
+# Customer needs to login to Azure subscription via Azure CLI and set the environment variables
+
+load_dotenv()
+
+project_client = AIProjectClient.from_connection_string(
+ credential=DefaultAzureCredential(),
+ conn_str=os.environ["PROJECT_CONNECTION_STRING"],
+)
+
+# [START enable_tracing]
+from opentelemetry import trace
+from azure.monitor.opentelemetry import configure_azure_monitor
+
+# Enable Azure Monitor tracing
+application_insights_connection_string = project_client.telemetry.get_connection_string()
+if not application_insights_connection_string:
+ print("Application Insights was not enabled for this project.")
+ print("Enable it via the 'Tracing' tab in your AI Studio project page.")
+ exit()
+configure_azure_monitor(connection_string=application_insights_connection_string)
+
+scenario = os.path.basename(__file__)
+tracer = trace.get_tracer(__name__)
+
+with tracer.start_as_current_span(scenario):
+ with project_client:
+
+ # [END enable_tracing]
+ agent = project_client.agents.create_agent(
+ model="gpt-4o", name="my-assistant", instructions="You are helpful assistant"
+ )
+ print(f"Created agent, agent ID: {agent.id}")
+
+ thread = project_client.agents.create_thread()
+ print(f"Created thread, thread ID: {thread.id}")
+
+ message = project_client.agents.create_message(
+ thread_id=thread.id, role="user", content="Hello, tell me a joke"
+ )
+ print(f"Created message, message ID: {message.id}")
+
+ run = project_client.agents.create_run(thread_id=thread.id, assistant_id=agent.id)
+
+ # poll the run as long as run status is queued or in progress
+ while run.status in ["queued", "in_progress", "requires_action"]:
+ # wait for a second
+ time.sleep(1)
+ run = project_client.agents.get_run(thread_id=thread.id, run_id=run.id)
+
+ print(f"Run status: {run.status}")
+
+ project_client.agents.delete_agent(agent.id)
+ print("Deleted agent")
+
+ messages = project_client.agents.list_messages(thread_id=thread.id)
+ print(f"messages: {messages}")
\ No newline at end of file
diff --git a/samples/tracing/sync/agents_basics_with_console_tracing.py b/samples/tracing/sync/agents_basics_with_console_tracing.py
new file mode 100644
index 00000000..48814cf6
--- /dev/null
+++ b/samples/tracing/sync/agents_basics_with_console_tracing.py
@@ -0,0 +1,90 @@
+# ------------------------------------
+# Copyright (c) Microsoft Corporation.
+# Licensed under the MIT License.
+# ------------------------------------
+
+"""
+FILE: sample_agents_basics_with_console_tracing.py
+
+DESCRIPTION:
+ This sample demonstrates how to use basic agent operations from
+ the Azure Agents service using a synchronous client with tracing to console.
+
+USAGE:
+ python sample_agents_basics_with_console_tracing.py
+
+ Before running the sample:
+
+ pip install azure-ai-projects azure-identity opentelemetry-sdk azure-core-tracing-opentelemetry
+
+ If you want to export telemetry to OTLP endpoint (such as Aspire dashboard
+ https://learn.microsoft.com/dotnet/aspire/fundamentals/dashboard/standalone?tabs=bash)
+ install:
+
+ pip install opentelemetry-exporter-otlp-proto-grpc
+
+ Set these environment variables with your own values:
+ * PROJECT_CONNECTION_STRING - The Azure AI Project connection string, as found in your AI Studio Project.
+ * AZURE_TRACING_GEN_AI_CONTENT_RECORDING_ENABLED - Optional. Set to `true` to trace the content of chat
+ messages, which may contain personal data. False by default.
+"""
+
+import os, sys, time
+from azure.ai.projects import AIProjectClient
+from azure.identity import DefaultAzureCredential
+from opentelemetry import trace
+from dotenv import load_dotenv
+
+# Create an AI Project Client from a connection string, copied from your AI Studio project.
+# At the moment, it should be in the format ";;;"
+# Customer needs to login to Azure subscription via Azure CLI and set the environment variables
+
+load_dotenv()
+
+# Create an AI Project Client from a connection string, copied from your AI Studio project.
+# At the moment, it should be in the format ";;;"
+# Customer needs to login to Azure subscription via Azure CLI and set the environment variables
+
+project_client = AIProjectClient.from_connection_string(
+ credential=DefaultAzureCredential(),
+ conn_str=os.environ["PROJECT_CONNECTION_STRING"],
+)
+
+# Enable console tracing
+# or, if you have local OTLP endpoint running, change it to
+# project_client.telemetry.enable(destination="http://localhost:4317")
+project_client.telemetry.enable(destination=sys.stdout)
+
+scenario = os.path.basename(__file__)
+tracer = trace.get_tracer(__name__)
+
+with tracer.start_as_current_span(scenario):
+ with project_client:
+ agent = project_client.agents.create_agent(
+ model="gpt-4o", name="my-assistant", instructions="You are helpful assistant"
+ )
+ print(f"Created agent, agent ID: {agent.id}")
+
+ thread = project_client.agents.create_thread()
+ print(f"Created thread, thread ID: {thread.id}")
+
+ message = project_client.agents.create_message(
+ thread_id=thread.id, role="user", content="Hello, tell me a joke"
+ )
+ print(f"Created message, message ID: {message.id}")
+
+ run = project_client.agents.create_run(thread_id=thread.id, assistant_id=agent.id)
+
+ # poll the run as long as run status is queued or in progress
+ while run.status in ["queued", "in_progress", "requires_action"]:
+ # wait for a second
+ time.sleep(1)
+ run = project_client.agents.get_run(thread_id=thread.id, run_id=run.id)
+
+ print(f"Run status: {run.status}")
+
+ project_client.agents.delete_agent(agent.id)
+ print("Deleted agent")
+
+ messages = project_client.agents.list_messages(thread_id=thread.id)
+ print(f"messages: {messages}")
\ No newline at end of file
diff --git a/samples/tracing/sync/agents_functions_with_azure_monitor_tracing.py b/samples/tracing/sync/agents_functions_with_azure_monitor_tracing.py
new file mode 100644
index 00000000..a09c9870
--- /dev/null
+++ b/samples/tracing/sync/agents_functions_with_azure_monitor_tracing.py
@@ -0,0 +1,153 @@
+# ------------------------------------
+# Copyright (c) Microsoft Corporation.
+# Licensed under the MIT License.
+# ------------------------------------
+
+"""
+FILE: sample_agents_functions_with_azure_monitor_tracing.py
+
+DESCRIPTION:
+ This sample demonstrates how to use basic agent operations with function tools from
+ the Azure Agents service using a synchronous client with Azure Monitor tracing.
+ View the results in the "Tracing" tab in your Azure AI Studio project page.
+
+USAGE:
+ python sample_agents_functions_with_azure_monitor_tracing.py
+
+ Before running the sample:
+
+ pip install azure-ai-projects azure-identity opentelemetry-sdk azure-monitor-opentelemetry
+
+ Set these environment variables with your own values:
+ * PROJECT_CONNECTION_STRING - The Azure AI Project connection string, as found in your AI Studio Project.
+ * AZURE_TRACING_GEN_AI_CONTENT_RECORDING_ENABLED - Optional. Set to `true` to trace the content of chat
+ messages, which may contain personal data. False by default.
+"""
+from typing import Any, Callable, Set
+
+import os, time, json
+from azure.ai.projects import AIProjectClient
+from azure.identity import DefaultAzureCredential
+from azure.ai.projects.models import FunctionTool, RequiredFunctionToolCall, SubmitToolOutputsAction, ToolOutput
+from opentelemetry import trace
+from azure.monitor.opentelemetry import configure_azure_monitor
+
+
+# Create an AI Project Client from a connection string, copied from your AI Studio project.
+# At the moment, it should be in the format ";;;"
+# Customer needs to login to Azure subscription via Azure CLI and set the environment variables
+
+project_client = AIProjectClient.from_connection_string(
+ credential=DefaultAzureCredential(), conn_str=os.environ["PROJECT_CONNECTION_STRING"]
+)
+
+# Enable Azure Monitor tracing
+application_insights_connection_string = project_client.telemetry.get_connection_string()
+if not application_insights_connection_string:
+ print("Application Insights was not enabled for this project.")
+ print("Enable it via the 'Tracing' tab in your AI Studio project page.")
+ exit()
+configure_azure_monitor(connection_string=application_insights_connection_string)
+
+scenario = os.path.basename(__file__)
+tracer = trace.get_tracer(__name__)
+
+
+# The tracer.start_as_current_span decorator will trace the function call and enable adding additional attributes
+# to the span in the function implementation. Note that this will trace the function parameters and their values.
+@tracer.start_as_current_span("fetch_weather") # type: ignore
+def fetch_weather(location: str) -> str:
+ """
+ Fetches the weather information for the specified location.
+
+ :param location (str): The location to fetch weather for.
+ :return: Weather information as a JSON string.
+ :rtype: str
+ """
+ # In a real-world scenario, you'd integrate with a weather API.
+ # Here, we'll mock the response.
+ mock_weather_data = {"New York": "Sunny, 25°C", "London": "Cloudy, 18°C", "Tokyo": "Rainy, 22°C"}
+
+ # Adding attributes to the current span
+ span = trace.get_current_span()
+ span.set_attribute("requested_location", location)
+
+ weather = mock_weather_data.get(location, "Weather data not available for this location.")
+ weather_json = json.dumps({"weather": weather})
+ return weather_json
+
+
+# Statically defined user functions for fast reference
+user_functions: Set[Callable[..., Any]] = {
+ fetch_weather,
+}
+
+# Initialize function tool with user function
+functions = FunctionTool(functions=user_functions)
+
+with tracer.start_as_current_span(scenario):
+ with project_client:
+ # Create an agent and run user's request with function calls
+ agent = project_client.agents.create_agent(
+ model="gpt-4o",
+ name="my-assistant",
+ instructions="You are a helpful assistant",
+ tools=functions.definitions,
+ )
+ print(f"Created agent, ID: {agent.id}")
+
+ thread = project_client.agents.create_thread()
+ print(f"Created thread, ID: {thread.id}")
+
+ message = project_client.agents.create_message(
+ thread_id=thread.id,
+ role="user",
+ content="Hello, what is the weather in New York?",
+ )
+ print(f"Created message, ID: {message.id}")
+
+ run = project_client.agents.create_run(thread_id=thread.id, assistant_id=agent.id)
+ print(f"Created run, ID: {run.id}")
+
+ while run.status in ["queued", "in_progress", "requires_action"]:
+ time.sleep(1)
+ run = project_client.agents.get_run(thread_id=thread.id, run_id=run.id)
+
+ if run.status == "requires_action" and isinstance(run.required_action, SubmitToolOutputsAction):
+ tool_calls = run.required_action.submit_tool_outputs.tool_calls
+ if not tool_calls:
+ print("No tool calls provided - cancelling run")
+ project_client.agents.cancel_run(thread_id=thread.id, run_id=run.id)
+ break
+
+ tool_outputs = []
+ for tool_call in tool_calls:
+ if isinstance(tool_call, RequiredFunctionToolCall):
+ try:
+ output = functions.execute(tool_call)
+ tool_outputs.append(
+ ToolOutput(
+ tool_call_id=tool_call.id,
+ output=output,
+ )
+ )
+ except Exception as e:
+ print(f"Error executing tool_call {tool_call.id}: {e}")
+
+ print(f"Tool outputs: {tool_outputs}")
+ if tool_outputs:
+ project_client.agents.submit_tool_outputs_to_run(
+ thread_id=thread.id, run_id=run.id, tool_outputs=tool_outputs
+ )
+
+ print(f"Current run status: {run.status}")
+
+ print(f"Run completed with status: {run.status}")
+
+ # Delete the agent when done
+ project_client.agents.delete_agent(agent.id)
+ print("Deleted agent")
+
+ # Fetch and log all messages
+ messages = project_client.agents.list_messages(thread_id=thread.id)
+ print(f"Messages: {messages}")
\ No newline at end of file
diff --git a/samples/tracing/sync/agents_functions_with_console_tracing.py b/samples/tracing/sync/agents_functions_with_console_tracing.py
new file mode 100644
index 00000000..0a604249
--- /dev/null
+++ b/samples/tracing/sync/agents_functions_with_console_tracing.py
@@ -0,0 +1,154 @@
+# ------------------------------------
+# Copyright (c) Microsoft Corporation.
+# Licensed under the MIT License.
+# ------------------------------------
+
+"""
+FILE: sample_agents_functions_with_console_tracing.py
+
+DESCRIPTION:
+ This sample demonstrates how to use basic agent operations with function tools from
+ the Azure Agents service using a synchronous client with tracing to console.
+
+USAGE:
+ python sample_agents_functions_with_console_tracing.py
+
+ Before running the sample:
+
+ pip install azure-ai-projects azure-identity opentelemetry-sdk azure-core-tracing-opentelemetry
+
+ If you want to export telemetry to OTLP endpoint (such as Aspire dashboard
+ https://learn.microsoft.com/dotnet/aspire/fundamentals/dashboard/standalone?tabs=bash)
+ install:
+
+ pip install opentelemetry-exporter-otlp-proto-grpc
+
+ Set these environment variables with your own values:
+ * PROJECT_CONNECTION_STRING - The Azure AI Project connection string, as found in your AI Studio Project.
+ * AZURE_TRACING_GEN_AI_CONTENT_RECORDING_ENABLED - Optional. Set to `true` to trace the content of chat
+ messages, which may contain personal data. False by default.
+"""
+from typing import Any, Callable, Set
+
+import os, sys, time, json
+from azure.ai.projects import AIProjectClient
+from azure.identity import DefaultAzureCredential
+from azure.ai.projects.models import FunctionTool, RequiredFunctionToolCall, SubmitToolOutputsAction, ToolOutput
+from opentelemetry import trace
+
+
+# Create an AI Project Client from a connection string, copied from your AI Studio project.
+# At the moment, it should be in the format ";;;"
+# Customer needs to login to Azure subscription via Azure CLI and set the environment variables
+
+project_client = AIProjectClient.from_connection_string(
+ credential=DefaultAzureCredential(), conn_str=os.environ["PROJECT_CONNECTION_STRING"]
+)
+
+# Enable console tracing
+# or, if you have local OTLP endpoint running, change it to
+# project_client.telemetry.enable(destination="http://localhost:4317")
+project_client.telemetry.enable(destination=sys.stdout)
+
+scenario = os.path.basename(__file__)
+tracer = trace.get_tracer(__name__)
+
+
+# The tracer.start_as_current_span decorator will trace the function call and enable adding additional attributes
+# to the span in the function implementation. Note that this will trace the function parameters and their values.
+@tracer.start_as_current_span("fetch_weather") # type: ignore
+def fetch_weather(location: str) -> str:
+ """
+ Fetches the weather information for the specified location.
+
+ :param location (str): The location to fetch weather for.
+ :return: Weather information as a JSON string.
+ :rtype: str
+ """
+ # In a real-world scenario, you'd integrate with a weather API.
+ # Here, we'll mock the response.
+ mock_weather_data = {"New York": "Sunny, 25°C", "London": "Cloudy, 18°C", "Tokyo": "Rainy, 22°C"}
+
+ # Adding attributes to the current span
+ span = trace.get_current_span()
+ span.set_attribute("requested_location", location)
+
+ weather = mock_weather_data.get(location, "Weather data not available for this location.")
+ weather_json = json.dumps({"weather": weather})
+ return weather_json
+
+
+# Statically defined user functions for fast reference
+user_functions: Set[Callable[..., Any]] = {
+ fetch_weather,
+}
+
+# Initialize function tool with user function
+functions = FunctionTool(functions=user_functions)
+
+with tracer.start_as_current_span(scenario):
+ with project_client:
+ # Create an agent and run user's request with function calls
+ agent = project_client.agents.create_agent(
+ model="gpt-4o",
+ name="my-assistant",
+ instructions="You are a helpful assistant",
+ tools=functions.definitions,
+ )
+ print(f"Created agent, ID: {agent.id}")
+
+ thread = project_client.agents.create_thread()
+ print(f"Created thread, ID: {thread.id}")
+
+ message = project_client.agents.create_message(
+ thread_id=thread.id,
+ role="user",
+ content="Hello, what is the weather in New York?",
+ )
+ print(f"Created message, ID: {message.id}")
+
+ run = project_client.agents.create_run(thread_id=thread.id, assistant_id=agent.id)
+ print(f"Created run, ID: {run.id}")
+
+ while run.status in ["queued", "in_progress", "requires_action"]:
+ time.sleep(1)
+ run = project_client.agents.get_run(thread_id=thread.id, run_id=run.id)
+
+ if run.status == "requires_action" and isinstance(run.required_action, SubmitToolOutputsAction):
+ tool_calls = run.required_action.submit_tool_outputs.tool_calls
+ if not tool_calls:
+ print("No tool calls provided - cancelling run")
+ project_client.agents.cancel_run(thread_id=thread.id, run_id=run.id)
+ break
+
+ tool_outputs = []
+ for tool_call in tool_calls:
+ if isinstance(tool_call, RequiredFunctionToolCall):
+ try:
+ output = functions.execute(tool_call)
+ tool_outputs.append(
+ ToolOutput(
+ tool_call_id=tool_call.id,
+ output=output,
+ )
+ )
+ except Exception as e:
+ print(f"Error executing tool_call {tool_call.id}: {e}")
+
+ print(f"Tool outputs: {tool_outputs}")
+ if tool_outputs:
+ project_client.agents.submit_tool_outputs_to_run(
+ thread_id=thread.id, run_id=run.id, tool_outputs=tool_outputs
+ )
+
+ print(f"Current run status: {run.status}")
+
+ print(f"Run completed with status: {run.status}")
+
+ # Delete the agent when done
+ project_client.agents.delete_agent(agent.id)
+ print("Deleted agent")
+
+ # Fetch and log all messages
+ messages = project_client.agents.list_messages(thread_id=thread.id)
+ print(f"Messages: {messages}")
\ No newline at end of file
diff --git a/samples/tracing/sync/agents_stream_eventhandler_with_azure_monitor_tracing.py b/samples/tracing/sync/agents_stream_eventhandler_with_azure_monitor_tracing.py
new file mode 100644
index 00000000..3dcc55a4
--- /dev/null
+++ b/samples/tracing/sync/agents_stream_eventhandler_with_azure_monitor_tracing.py
@@ -0,0 +1,121 @@
+# ------------------------------------
+# Copyright (c) Microsoft Corporation.
+# Licensed under the MIT License.
+# ------------------------------------
+
+"""
+FILE: sample_agents_stream_eventhandler_with_azure_monitor_tracing.py
+
+DESCRIPTION:
+ This sample demonstrates how to use agent operations with an event handler in streaming from
+ the Azure Agents service using a synchronous client with Azure Monitor tracing.
+ View the results in the "Tracing" tab in your Azure AI Studio project page.
+
+USAGE:
+ python sample_agents_stream_eventhandler_with_azure_monitor_tracing.py
+
+ Before running the sample:
+
+ pip install azure-ai-projects azure-identity opentelemetry-sdk azure-monitor-opentelemetry
+
+ Set these environment variables with your own values:
+ * PROJECT_CONNECTION_STRING - The Azure AI Project connection string, as found in your AI Studio Project.
+ * AZURE_TRACING_GEN_AI_CONTENT_RECORDING_ENABLED - Optional. Set to `true` to trace the content of chat
+ messages, which may contain personal data. False by default.
+
+"""
+
+import os
+from azure.ai.projects import AIProjectClient
+from azure.identity import DefaultAzureCredential
+from azure.ai.projects.models import (
+ AgentEventHandler,
+ MessageDeltaTextContent,
+ MessageDeltaChunk,
+ ThreadMessage,
+ ThreadRun,
+ RunStep,
+)
+from typing import Any
+from opentelemetry import trace
+from azure.monitor.opentelemetry import configure_azure_monitor
+
+# Create an Azure AI Project Client from a connection string, copied from your AI Studio project.
+# At the moment, it should be in the format ";;;"
+# Customer needs to login to Azure subscription via Azure CLI and set the environment variables
+
+project_client = AIProjectClient.from_connection_string(
+ credential=DefaultAzureCredential(),
+ conn_str=os.environ["PROJECT_CONNECTION_STRING"],
+)
+
+
+class MyEventHandler(AgentEventHandler):
+ def on_message_delta(self, delta: "MessageDeltaChunk") -> None:
+ for content_part in delta.delta.content:
+ if isinstance(content_part, MessageDeltaTextContent):
+ text_value = content_part.text.value if content_part.text else "No text"
+ print(f"Text delta received: {text_value}")
+
+ def on_thread_message(self, message: "ThreadMessage") -> None:
+ if len(message.content):
+ print(
+ f"ThreadMessage created. ID: {message.id}, "
+ f"Status: {message.status}, Content: {message.content[0].as_dict()}"
+ )
+ else:
+ print(f"ThreadMessage created. ID: {message.id}, " f"Status: {message.status}")
+
+ def on_thread_run(self, run: "ThreadRun") -> None:
+ print(f"ThreadRun status: {run.status}")
+
+ def on_run_step(self, step: "RunStep") -> None:
+ print(f"RunStep type: {step.type}, Status: {step.status}")
+
+ def on_error(self, data: str) -> None:
+ print(f"An error occurred. Data: {data}")
+
+ def on_done(self) -> None:
+ print("Stream completed.")
+
+ def on_unhandled_event(self, event_type: str, event_data: Any) -> None:
+ print(f"Unhandled Event Type: {event_type}, Data: {event_data}")
+
+
+# Enable Azure Monitor tracing
+application_insights_connection_string = project_client.telemetry.get_connection_string()
+if not application_insights_connection_string:
+ print("Application Insights was not enabled for this project.")
+ print("Enable it via the 'Tracing' tab in your AI Studio project page.")
+ exit()
+configure_azure_monitor(connection_string=application_insights_connection_string)
+
+scenario = os.path.basename(__file__)
+tracer = trace.get_tracer(__name__)
+
+with tracer.start_as_current_span(scenario):
+ with project_client:
+ # Create an agent and run stream with event handler
+ agent = project_client.agents.create_agent(
+ model="gpt-4o", name="my-assistant", instructions="You are a helpful assistant"
+ )
+ print(f"Created agent, agent ID {agent.id}")
+
+ thread = project_client.agents.create_thread()
+ print(f"Created thread, thread ID {thread.id}")
+
+ message = project_client.agents.create_message(
+ thread_id=thread.id, role="user", content="Hello, tell me a joke"
+ )
+ print(f"Created message, message ID {message.id}")
+
+ with project_client.agents.create_stream(
+ thread_id=thread.id, assistant_id=agent.id, event_handler=MyEventHandler()
+ ) as stream:
+ stream.until_done()
+
+ project_client.agents.delete_agent(agent.id)
+ print("Deleted agent")
+
+ messages = project_client.agents.list_messages(thread_id=thread.id)
+ print(f"Messages: {messages}")
\ No newline at end of file
diff --git a/samples/tracing/sync/agents_stream_eventhandler_with_console_tracing.py b/samples/tracing/sync/agents_stream_eventhandler_with_console_tracing.py
new file mode 100644
index 00000000..96bba9b7
--- /dev/null
+++ b/samples/tracing/sync/agents_stream_eventhandler_with_console_tracing.py
@@ -0,0 +1,122 @@
+# ------------------------------------
+# Copyright (c) Microsoft Corporation.
+# Licensed under the MIT License.
+# ------------------------------------
+
+"""
+FILE: sample_agents_stream_eventhandler_with_console_tracing.py
+
+DESCRIPTION:
+ This sample demonstrates how to use agent operations with an event handler in streaming from
+ the Azure Agents service using a synchronous client with tracing to console.
+
+USAGE:
+ python sample_agents_stream_eventhandler_with_console_tracing.py
+
+ Before running the sample:
+
+ pip install azure-ai-projects azure-identity opentelemetry-sdk azure-core-tracing-opentelemetry
+
+ If you want to export telemetry to OTLP endpoint (such as Aspire dashboard
+ https://learn.microsoft.com/dotnet/aspire/fundamentals/dashboard/standalone?tabs=bash)
+ install:
+
+ pip install opentelemetry-exporter-otlp-proto-grpc
+
+ Set these environment variables with your own values:
+ * PROJECT_CONNECTION_STRING - The Azure AI Project connection string, as found in your AI Studio Project.
+ * AZURE_TRACING_GEN_AI_CONTENT_RECORDING_ENABLED - Optional. Set to `true` to trace the content of chat
+ messages, which may contain personal data. False by default.
+"""
+
+import os, sys
+from azure.ai.projects import AIProjectClient
+from azure.identity import DefaultAzureCredential
+from azure.ai.projects.models import (
+ AgentEventHandler,
+ MessageDeltaTextContent,
+ MessageDeltaChunk,
+ ThreadMessage,
+ ThreadRun,
+ RunStep,
+)
+from typing import Any
+from opentelemetry import trace
+
+
+# Create an Azure AI Project Client from a connection string, copied from your AI Studio project.
+# At the moment, it should be in the format ";;;"
+# Customer needs to login to Azure subscription via Azure CLI and set the environment variables
+
+project_client = AIProjectClient.from_connection_string(
+ credential=DefaultAzureCredential(),
+ conn_str=os.environ["PROJECT_CONNECTION_STRING"],
+)
+
+
+class MyEventHandler(AgentEventHandler):
+ def on_message_delta(self, delta: "MessageDeltaChunk") -> None:
+ for content_part in delta.delta.content:
+ if isinstance(content_part, MessageDeltaTextContent):
+ text_value = content_part.text.value if content_part.text else "No text"
+ print(f"Text delta received: {text_value}")
+
+ def on_thread_message(self, message: "ThreadMessage") -> None:
+ if len(message.content):
+ print(
+ f"ThreadMessage created. ID: {message.id}, "
+ f"Status: {message.status}, Content: {message.content[0].as_dict()}"
+ )
+ else:
+ print(f"ThreadMessage created. ID: {message.id}, " f"Status: {message.status}")
+
+ def on_thread_run(self, run: "ThreadRun") -> None:
+ print(f"ThreadRun status: {run.status}")
+
+ def on_run_step(self, step: "RunStep") -> None:
+ print(f"RunStep type: {step.type}, Status: {step.status}")
+
+ def on_error(self, data: str) -> None:
+ print(f"An error occurred. Data: {data}")
+
+ def on_done(self) -> None:
+ print("Stream completed.")
+
+ def on_unhandled_event(self, event_type: str, event_data: Any) -> None:
+ print(f"Unhandled Event Type: {event_type}, Data: {event_data}")
+
+
+# Enable console tracing
+# or, if you have local OTLP endpoint running, change it to
+# project_client.telemetry.enable(destination="http://localhost:4317")
+project_client.telemetry.enable(destination=sys.stdout)
+
+scenario = os.path.basename(__file__)
+tracer = trace.get_tracer(__name__)
+
+with tracer.start_as_current_span(scenario):
+ with project_client:
+ # Create an agent and run stream with event handler
+ agent = project_client.agents.create_agent(
+ model="gpt-4o", name="my-assistant", instructions="You are a helpful assistant"
+ )
+ print(f"Created agent, agent ID {agent.id}")
+
+ thread = project_client.agents.create_thread()
+ print(f"Created thread, thread ID {thread.id}")
+
+ message = project_client.agents.create_message(
+ thread_id=thread.id, role="user", content="Hello, tell me a joke"
+ )
+ print(f"Created message, message ID {message.id}")
+
+ with project_client.agents.create_stream(
+ thread_id=thread.id, assistant_id=agent.id, event_handler=MyEventHandler()
+ ) as stream:
+ stream.until_done()
+
+ project_client.agents.delete_agent(agent.id)
+ print("Deleted agent")
+
+ messages = project_client.agents.list_messages(thread_id=thread.id)
+ print(f"Messages: {messages}")
\ No newline at end of file
diff --git a/samples/use-openai.md b/samples/use-openai.md
new file mode 100644
index 00000000..ac319704
--- /dev/null
+++ b/samples/use-openai.md
@@ -0,0 +1,203 @@
+# Use the OpenAI Python SDK with Azure AI Agent service
+
+In addition to the AI Agent SDK, you can also use the Azure AI Agent service with the OpenAPI SDK. This can be useful if you're an existing Azure OpenAI Assistants customer, and have applications that already utilize the OpenAPI SDK. See the following examples for more information.
+
+## Basic example
+
+> [!TIP]
+> You can find a streaming example in the Azure Python SDK repo on [Github](https://github.com/Azure/azure-sdk-for-python/blob/jhakulin/oai-agents/sdk/ai/azure-ai-projects/samples/agents/sample_openai_assistants_streaming.py).
+
+```python
+import os, time
+from azure.ai.projects import AIProjectClient
+from azure.identity import DefaultAzureCredential
+from openai import AzureOpenAI
+
+
+with AIProjectClient.from_connection_string(
+ credential=DefaultAzureCredential(),
+ conn_str=os.environ["PROJECT_CONNECTION_STRING"],
+) as project_client:
+
+ # Explicit type hinting for IntelliSense
+ client: AzureOpenAI = project_client.inference.get_azure_openai_client()
+
+ with client:
+ agent = client.beta.assistants.create(
+ model="gpt-4o-mini", name="my-agent", instructions="You are a helpful agent"
+ )
+ print(f"Created agent, agent ID: {agent.id}")
+
+ thread = client.beta.threads.create()
+ print(f"Created thread, thread ID: {thread.id}")
+
+ message = client.beta.threads.messages.create(thread_id=thread.id, role="user", content="Hello, tell me a joke")
+ print(f"Created message, message ID: {message.id}")
+
+ run = client.beta.threads.runs.create(thread_id=thread.id, assistant_id=agent.id)
+
+ # Poll the run while run status is queued or in progress
+ while run.status in ["queued", "in_progress", "requires_action"]:
+ time.sleep(1) # Wait for a second
+ run = client.beta.threads.runs.retrieve(thread_id=thread.id, run_id=run.id)
+ print(f"Run status: {run.status}")
+
+ client.beta.assistants.delete(agent.id)
+ print("Deleted agent")
+
+ messages = client.beta.threads.messages.list(thread_id=thread.id)
+ print(f"Messages: {messages}")
+```
+
+
+
+## Function calling
+
+> [!TIP]
+> You can find a streaming example in the Azure Python SDK repo on [Github](https://github.com/Azure/azure-sdk-for-python/blob/jhakulin/oai-agents/sdk/ai/azure-ai-projects/samples/agents/sample_openai_assistants_streaming_functions.py).
+
+```python
+import os, time
+from azure.ai.projects import AIProjectClient
+from azure.identity import DefaultAzureCredential
+from openai import AzureOpenAI
+from openai.types.beta.threads.required_action_function_tool_call import RequiredActionFunctionToolCall
+from azure.ai.projects.models import FunctionTool
+from user_functions import user_functions
+
+
+with AIProjectClient.from_connection_string(
+ credential=DefaultAzureCredential(),
+ conn_str=os.environ["PROJECT_CONNECTION_STRING"],
+) as project_client:
+
+ # Explicit type hinting for IntelliSense
+ client: AzureOpenAI = project_client.inference.get_azure_openai_client()
+
+ # Initialize function tool with user functions
+ functions = FunctionTool(functions=user_functions)
+
+ with client:
+ agent = client.beta.assistants.create(
+ model="gpt-4o-mini", name="my-agent", instructions="You are a helpful agent", tools=functions.definitions
+ )
+ print(f"Created agent, agent ID: {agent.id}")
+
+ thread = client.beta.threads.create()
+ print(f"Created thread, thread ID: {thread.id}")
+
+ message = client.beta.threads.messages.create(thread_id=thread.id, role="user", content="Hello, send an email with the datetime and weather information in New York?")
+ print(f"Created message, message ID: {message.id}")
+
+ run = client.beta.threads.runs.create(thread_id=thread.id, assistant_id=agent.id)
+
+ # Poll the run while run status is queued or in progress
+ while run.status in ["queued", "in_progress", "requires_action"]:
+ time.sleep(1) # Wait for a second
+ run = client.beta.threads.runs.retrieve(thread_id=thread.id, run_id=run.id)
+ print(f"Run status: {run.status}")
+
+ if run.status == "requires_action" and run.required_action is not None:
+
+ tool_calls = run.required_action.submit_tool_outputs.tool_calls
+ if not tool_calls:
+ print("No tool calls provided - cancelling run")
+ client.beta.threads.runs.cancel(thread_id=thread.id, run_id=run.id)
+ break
+
+ tool_outputs = []
+ for tool_call in tool_calls:
+ if isinstance(tool_call, RequiredActionFunctionToolCall):
+ try:
+ output = functions.execute(tool_call)
+ tool_outputs.append(
+ {
+ "tool_call_id": tool_call.id,
+ "output": output,
+ }
+ )
+ except Exception as e:
+ print(f"Error executing tool_call {tool_call.id}: {e}")
+
+ print(f"Tool outputs: {tool_outputs}")
+ if tool_outputs:
+ client.beta.threads.runs.submit_tool_outputs(
+ thread_id=thread.id, run_id=run.id, tool_outputs=tool_outputs
+ )
+
+ client.beta.assistants.delete(agent.id)
+ print("Deleted agent")
+
+ messages = client.beta.threads.messages.list(thread_id=thread.id)
+ print(f"Messages: {messages}")
+```
+
+
+## File search
+
+```python
+import os, time
+from azure.ai.projects import AIProjectClient
+from azure.identity import DefaultAzureCredential
+from openai import AzureOpenAI
+from azure.ai.projects.models import FileSearchTool
+
+
+with AIProjectClient.from_connection_string(
+ credential=DefaultAzureCredential(),
+ conn_str=os.environ["PROJECT_CONNECTION_STRING"],
+) as project_client:
+
+ # Explicit type hinting for IntelliSense
+ client: AzureOpenAI = project_client.inference.get_azure_openai_client()
+
+ openai_file = client.files.create(file=open("product_info_1.md", "rb"), purpose="assistants")
+ print(f"Uploaded file, file ID: {openai_file.id}")
+
+ # Create vector store with file, note: there is no poll method to check the status of vector store is ready
+ openai_vectorstore = client.beta.vector_stores.create(file_ids=[openai_file.id], name="my_vectorstore")
+
+ # poll the vector store status, the vector store status can be "in_progress", "completed", "expired"
+ # status can be get from client.beta.vector_stores.retrieve(openai_vectorstore.id)
+ while openai_vectorstore.status == "in_progress":
+ time.sleep(1)
+ openai_vectorstore = client.beta.vector_stores.retrieve(openai_vectorstore.id)
+
+ print(f"Created vector store, vector store ID: {openai_vectorstore.id}")
+
+ # Create file search tool with resources
+ file_search = FileSearchTool(vector_store_ids=[openai_vectorstore.id])
+
+ with client:
+ agent = client.beta.assistants.create(
+ model="gpt-4o-mini", name="my-agent", instructions="You are a helpful agent", tools=file_search.definitions, tool_resources=file_search.resources
+ )
+ print(f"Created agent, agent ID: {agent.id}")
+
+ thread = client.beta.threads.create()
+ print(f"Created thread, thread ID: {thread.id}")
+
+ message = client.beta.threads.messages.create(thread_id=thread.id, role="user", content="Hello, what Contoso products do you know?")
+ print(f"Created message, message ID: {message.id}")
+
+ run = client.beta.threads.runs.create(thread_id=thread.id, assistant_id=agent.id)
+
+ # Poll the run while run status is queued or in progress
+ while run.status in ["queued", "in_progress", "requires_action"]:
+ time.sleep(1) # Wait for a second
+ run = client.beta.threads.runs.retrieve(thread_id=thread.id, run_id=run.id)
+ print(f"Run status: {run.status}")
+
+ if run.status == "failed":
+ # Check if you got "Rate limit is exceeded.", then you want to get more quota
+ print(f"Run failed: {run.last_error}")
+
+ client.beta.vector_stores.delete(openai_vectorstore.id)
+ print("Deleted vector store")
+
+ client.beta.assistants.delete(agent.id)
+ print("Deleted agent")
+
+ messages = client.beta.threads.messages.list(thread_id=thread.id)
+ print(f"Messages: {messages}")
+```
diff --git a/standard-agent.bicep b/standard-agent.bicep
new file mode 100644
index 00000000..d2ad0989
--- /dev/null
+++ b/standard-agent.bicep
@@ -0,0 +1,136 @@
+// Execute this main file to depoy Azure AI studio resources in the basic security configuraiton
+
+// Parameters
+@minLength(2)
+@maxLength(12)
+@description('Name for the AI resource and used to derive name of dependent resources.')
+param aiHubName string = 'hub-demo'
+
+@description('Friendly name for your Hub resource')
+param aiHubFriendlyName string = 'Agents Hub resource'
+
+@description('Description of your Azure AI resource dispayed in AI studio')
+param aiHubDescription string = 'This is an example AI resource for use in Azure AI Studio.'
+
+@description('Name for the AI project resources.')
+param aiProjectName string = 'project-demo'
+
+@description('Friendly name for your Azure AI resource')
+param aiProjectFriendlyName string = 'Agents Project resource'
+
+@description('Description of your Azure AI resource dispayed in AI studio')
+param aiProjectDescription string = 'This is an example AI Project resource for use in Azure AI Studio.'
+
+@description('Azure region used for the deployment of all resources.')
+param location string = resourceGroup().location
+
+@description('Set of tags to apply to all resources.')
+param tags object = {}
+
+@description('Name of the Azure AI Search account')
+param aiSearchName string = 'agent-ai-search'
+
+@description('Name for capabilityHost.')
+param capabilityHostName string = 'caphost1'
+
+@description('Name of the storage account')
+param storageName string = 'agent-storage'
+
+@description('Name of the Azure AI Services account')
+param aiServicesName string = 'agent-ai-services'
+
+@description('Model name for deployment')
+param modelName string = 'gpt-4o-mini'
+
+@description('Model format for deployment')
+param modelFormat string = 'OpenAI'
+
+@description('Model version for deployment')
+param modelVersion string = '2024-07-18'
+
+@description('Model deployment SKU name')
+param modelSkuName string = 'GlobalStandard'
+
+@description('Model deployment capacity')
+param modelCapacity int = 50
+
+@description('Model deployment location. If you want to deploy an Azure AI resource/model in different location than the rest of the resources created.')
+param modelLocation string = 'eastus'
+
+
+// Variables
+var name = toLower('${aiHubName}')
+var projectName = toLower('${aiProjectName}')
+
+// Create a short, unique suffix, that will be unique to each resource group
+// var uniqueSuffix = substring(uniqueString(resourceGroup().id), 0, 4)
+param deploymentTimestamp string = utcNow('yyyyMMddHHmmss')
+var uniqueSuffix = substring(uniqueString('${resourceGroup().id}-${deploymentTimestamp}'), 0, 4)
+
+
+// Dependent resources for the Azure Machine Learning workspace
+module aiDependencies 'modules-standard/standard-dependent-resources.bicep' = {
+ name: 'dependencies-${name}-${uniqueSuffix}-deployment'
+ params: {
+ location: location
+ storageName: '${storageName}${uniqueSuffix}'
+ keyvaultName: 'kv-${name}-${uniqueSuffix}'
+ aiServicesName: '${aiServicesName}${uniqueSuffix}'
+ aiSearchName: '${aiSearchName}-${uniqueSuffix}'
+ tags: tags
+
+ // Model deployment parameters
+ modelName: modelName
+ modelFormat: modelFormat
+ modelVersion: modelVersion
+ modelSkuName: modelSkuName
+ modelCapacity: modelCapacity
+ modelLocation: modelLocation
+ }
+}
+
+module aiHub 'modules-standard/standard-ai-hub.bicep' = {
+ name: '${name}-${uniqueSuffix}-deployment'
+ params: {
+ // workspace organization
+ aiHubName: '${name}-${uniqueSuffix}'
+ aiHubFriendlyName: aiHubFriendlyName
+ aiHubDescription: aiHubDescription
+ location: location
+ tags: tags
+ capabilityHostName: '${name}-${uniqueSuffix}-${capabilityHostName}'
+ modelLocation: modelLocation
+
+
+ aiSearchName: '${aiSearchName}-${uniqueSuffix}'
+ aiSearchId: aiDependencies.outputs.aisearchID
+ aiServicesId: aiDependencies.outputs.aiservicesID
+ aiServicesTarget: aiDependencies.outputs.aiservicesTarget
+ keyVaultId: aiDependencies.outputs.keyvaultId
+ storageAccountId: aiDependencies.outputs.storageId
+ }
+}
+
+
+module aiProject 'modules-standard/standard-ai-project.bicep' = {
+ name: '${projectName}-${uniqueSuffix}-deployment'
+ params: {
+ // workspace organization
+ aiProjectName: '${projectName}-${uniqueSuffix}'
+ aiProjectFriendlyName: aiProjectFriendlyName
+ aiProjectDescription: aiProjectDescription
+ location: location
+ tags: tags
+
+ capabilityHostName: '${projectName}-${uniqueSuffix}-${capabilityHostName}'
+ // dependent resources
+ aiSearchName: '${aiSearchName}-${uniqueSuffix}'
+ aiServicesName: '${aiServicesName}${uniqueSuffix}'
+ aiHubId: aiHub.outputs.aiHubID
+ acsConnectionName: aiHub.outputs.acsConnectionName
+ aoaiConnectionName: aiHub.outputs.aoaiConnectionName
+ }
+}
+
+output PROJECT_CONNECTION_STRING string = aiProject.outputs.projectConnectionString
+
diff --git a/standard-agent.json b/standard-agent.json
new file mode 100644
index 00000000..1fb110b2
--- /dev/null
+++ b/standard-agent.json
@@ -0,0 +1,952 @@
+{
+ "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
+ "contentVersion": "1.0.0.0",
+ "metadata": {
+ "_generator": {
+ "name": "bicep",
+ "version": "0.31.92.45157",
+ "templateHash": "1114174486229467923"
+ }
+ },
+ "parameters": {
+ "aiHubName": {
+ "type": "string",
+ "defaultValue": "hub-demo",
+ "minLength": 2,
+ "maxLength": 12,
+ "metadata": {
+ "description": "Name for the AI resource and used to derive name of dependent resources."
+ }
+ },
+ "aiHubFriendlyName": {
+ "type": "string",
+ "defaultValue": "Agents Hub resource",
+ "metadata": {
+ "description": "Friendly name for your Hub resource"
+ }
+ },
+ "aiHubDescription": {
+ "type": "string",
+ "defaultValue": "This is an example AI resource for use in Azure AI Studio.",
+ "metadata": {
+ "description": "Description of your Azure AI resource dispayed in AI studio"
+ }
+ },
+ "aiProjectName": {
+ "type": "string",
+ "defaultValue": "project-demo",
+ "metadata": {
+ "description": "Name for the AI project resources."
+ }
+ },
+ "aiProjectFriendlyName": {
+ "type": "string",
+ "defaultValue": "Agents Project resource",
+ "metadata": {
+ "description": "Friendly name for your Azure AI resource"
+ }
+ },
+ "aiProjectDescription": {
+ "type": "string",
+ "defaultValue": "This is an example AI Project resource for use in Azure AI Studio.",
+ "metadata": {
+ "description": "Description of your Azure AI resource dispayed in AI studio"
+ }
+ },
+ "location": {
+ "type": "string",
+ "defaultValue": "[resourceGroup().location]",
+ "metadata": {
+ "description": "Azure region used for the deployment of all resources."
+ }
+ },
+ "tags": {
+ "type": "object",
+ "defaultValue": {},
+ "metadata": {
+ "description": "Set of tags to apply to all resources."
+ }
+ },
+ "aiSearchName": {
+ "type": "string",
+ "defaultValue": "agent-ai-search",
+ "metadata": {
+ "description": "Name of the Azure AI Search account"
+ }
+ },
+ "capabilityHostName": {
+ "type": "string",
+ "defaultValue": "caphost1",
+ "metadata": {
+ "description": "Name for capabilityHost."
+ }
+ },
+ "storageName": {
+ "type": "string",
+ "defaultValue": "agent-storage",
+ "metadata": {
+ "description": "Name of the storage account"
+ }
+ },
+ "aiServicesName": {
+ "type": "string",
+ "defaultValue": "agent-ai-services",
+ "metadata": {
+ "description": "Name of the Azure AI Services account"
+ }
+ },
+ "modelName": {
+ "type": "string",
+ "defaultValue": "gpt-4o-mini",
+ "metadata": {
+ "description": "Model name for deployment"
+ }
+ },
+ "modelFormat": {
+ "type": "string",
+ "defaultValue": "OpenAI",
+ "metadata": {
+ "description": "Model format for deployment"
+ }
+ },
+ "modelVersion": {
+ "type": "string",
+ "defaultValue": "2024-07-18",
+ "metadata": {
+ "description": "Model version for deployment"
+ }
+ },
+ "modelSkuName": {
+ "type": "string",
+ "defaultValue": "GlobalStandard",
+ "metadata": {
+ "description": "Model deployment SKU name"
+ }
+ },
+ "modelCapacity": {
+ "type": "int",
+ "defaultValue": 50,
+ "metadata": {
+ "description": "Model deployment capacity"
+ }
+ },
+ "modelLocation": {
+ "type": "string",
+ "defaultValue": "eastus",
+ "metadata": {
+ "description": "Model deployment location. If you want to deploy an Azure AI resource/model in different location than the rest of the resources created."
+ }
+ },
+ "deploymentTimestamp": {
+ "type": "string",
+ "defaultValue": "[utcNow('yyyyMMddHHmmss')]"
+ }
+ },
+ "variables": {
+ "name": "[toLower(format('{0}', parameters('aiHubName')))]",
+ "projectName": "[toLower(format('{0}', parameters('aiProjectName')))]",
+ "uniqueSuffix": "[substring(uniqueString(format('{0}-{1}', resourceGroup().id, parameters('deploymentTimestamp'))), 0, 4)]"
+ },
+ "resources": [
+ {
+ "type": "Microsoft.Resources/deployments",
+ "apiVersion": "2022-09-01",
+ "name": "[format('dependencies-{0}-{1}-deployment', variables('name'), variables('uniqueSuffix'))]",
+ "properties": {
+ "expressionEvaluationOptions": {
+ "scope": "inner"
+ },
+ "mode": "Incremental",
+ "parameters": {
+ "location": {
+ "value": "[parameters('location')]"
+ },
+ "storageName": {
+ "value": "[format('{0}{1}', parameters('storageName'), variables('uniqueSuffix'))]"
+ },
+ "keyvaultName": {
+ "value": "[format('kv-{0}-{1}', variables('name'), variables('uniqueSuffix'))]"
+ },
+ "aiServicesName": {
+ "value": "[format('{0}{1}', parameters('aiServicesName'), variables('uniqueSuffix'))]"
+ },
+ "aiSearchName": {
+ "value": "[format('{0}-{1}', parameters('aiSearchName'), variables('uniqueSuffix'))]"
+ },
+ "tags": {
+ "value": "[parameters('tags')]"
+ },
+ "modelName": {
+ "value": "[parameters('modelName')]"
+ },
+ "modelFormat": {
+ "value": "[parameters('modelFormat')]"
+ },
+ "modelVersion": {
+ "value": "[parameters('modelVersion')]"
+ },
+ "modelSkuName": {
+ "value": "[parameters('modelSkuName')]"
+ },
+ "modelCapacity": {
+ "value": "[parameters('modelCapacity')]"
+ },
+ "modelLocation": {
+ "value": "[parameters('modelLocation')]"
+ }
+ },
+ "template": {
+ "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
+ "contentVersion": "1.0.0.0",
+ "metadata": {
+ "_generator": {
+ "name": "bicep",
+ "version": "0.31.92.45157",
+ "templateHash": "12339427843824755564"
+ }
+ },
+ "parameters": {
+ "location": {
+ "type": "string",
+ "defaultValue": "[resourceGroup().location]",
+ "metadata": {
+ "description": "Azure region of the deployment"
+ }
+ },
+ "tags": {
+ "type": "object",
+ "defaultValue": {},
+ "metadata": {
+ "description": "Tags to add to the resources"
+ }
+ },
+ "aiServicesName": {
+ "type": "string",
+ "metadata": {
+ "description": "AI services name"
+ }
+ },
+ "keyvaultName": {
+ "type": "string",
+ "metadata": {
+ "description": "The name of the Key Vault"
+ }
+ },
+ "aiSearchName": {
+ "type": "string",
+ "metadata": {
+ "description": "The name of the AI Search resource"
+ }
+ },
+ "storageName": {
+ "type": "string",
+ "metadata": {
+ "description": "Name of the storage account"
+ }
+ },
+ "modelName": {
+ "type": "string",
+ "metadata": {
+ "description": "Model name for deployment"
+ }
+ },
+ "modelFormat": {
+ "type": "string",
+ "metadata": {
+ "description": "Model format for deployment"
+ }
+ },
+ "modelVersion": {
+ "type": "string",
+ "metadata": {
+ "description": "Model version for deployment"
+ }
+ },
+ "modelSkuName": {
+ "type": "string",
+ "metadata": {
+ "description": "Model deployment SKU name"
+ }
+ },
+ "modelCapacity": {
+ "type": "int",
+ "metadata": {
+ "description": "Model deployment capacity"
+ }
+ },
+ "modelLocation": {
+ "type": "string",
+ "metadata": {
+ "description": "Model/AI Resource deployment location"
+ }
+ },
+ "noZRSRegions": {
+ "type": "array",
+ "defaultValue": [
+ "southindia",
+ "westus"
+ ]
+ },
+ "sku": {
+ "type": "object",
+ "defaultValue": "[if(contains(parameters('noZRSRegions'), parameters('location')), createObject('name', 'Standard_GRS'), createObject('name', 'Standard_ZRS'))]"
+ }
+ },
+ "variables": {
+ "storageNameCleaned": "[replace(parameters('storageName'), '-', '')]"
+ },
+ "resources": [
+ {
+ "type": "Microsoft.KeyVault/vaults",
+ "apiVersion": "2022-07-01",
+ "name": "[parameters('keyvaultName')]",
+ "location": "[parameters('location')]",
+ "tags": "[parameters('tags')]",
+ "properties": {
+ "createMode": "default",
+ "enabledForDeployment": false,
+ "enabledForDiskEncryption": false,
+ "enabledForTemplateDeployment": false,
+ "enableSoftDelete": true,
+ "enableRbacAuthorization": true,
+ "enablePurgeProtection": true,
+ "networkAcls": {
+ "bypass": "AzureServices",
+ "defaultAction": "Deny"
+ },
+ "sku": {
+ "family": "A",
+ "name": "standard"
+ },
+ "softDeleteRetentionInDays": 7,
+ "tenantId": "[subscription().tenantId]"
+ }
+ },
+ {
+ "type": "Microsoft.CognitiveServices/accounts",
+ "apiVersion": "2024-06-01-preview",
+ "name": "[parameters('aiServicesName')]",
+ "location": "[parameters('modelLocation')]",
+ "sku": {
+ "name": "S0"
+ },
+ "kind": "AIServices",
+ "identity": {
+ "type": "SystemAssigned"
+ },
+ "properties": {
+ "customSubDomainName": "[toLower(format('{0}', parameters('aiServicesName')))]",
+ "apiProperties": {
+ "statisticsEnabled": false
+ },
+ "publicNetworkAccess": "Enabled"
+ }
+ },
+ {
+ "type": "Microsoft.CognitiveServices/accounts/deployments",
+ "apiVersion": "2024-06-01-preview",
+ "name": "[format('{0}/{1}', parameters('aiServicesName'), parameters('modelName'))]",
+ "sku": {
+ "capacity": "[parameters('modelCapacity')]",
+ "name": "[parameters('modelSkuName')]"
+ },
+ "properties": {
+ "model": {
+ "name": "[parameters('modelName')]",
+ "format": "[parameters('modelFormat')]",
+ "version": "[parameters('modelVersion')]"
+ }
+ },
+ "dependsOn": [
+ "[resourceId('Microsoft.CognitiveServices/accounts', parameters('aiServicesName'))]"
+ ]
+ },
+ {
+ "type": "Microsoft.Search/searchServices",
+ "apiVersion": "2024-06-01-preview",
+ "name": "[parameters('aiSearchName')]",
+ "location": "[parameters('location')]",
+ "tags": "[parameters('tags')]",
+ "identity": {
+ "type": "SystemAssigned"
+ },
+ "properties": {
+ "disableLocalAuth": false,
+ "authOptions": {
+ "aadOrApiKey": {
+ "aadAuthFailureMode": "http401WithBearerChallenge"
+ }
+ },
+ "encryptionWithCmk": {
+ "enforcement": "Unspecified"
+ },
+ "hostingMode": "default",
+ "partitionCount": 1,
+ "publicNetworkAccess": "enabled",
+ "replicaCount": 1,
+ "semanticSearch": "disabled"
+ },
+ "sku": {
+ "name": "standard"
+ }
+ },
+ {
+ "type": "Microsoft.Storage/storageAccounts",
+ "apiVersion": "2022-05-01",
+ "name": "[variables('storageNameCleaned')]",
+ "location": "[parameters('location')]",
+ "kind": "StorageV2",
+ "sku": "[parameters('sku')]",
+ "properties": {
+ "minimumTlsVersion": "TLS1_2",
+ "allowBlobPublicAccess": false,
+ "publicNetworkAccess": "Enabled",
+ "networkAcls": {
+ "bypass": "AzureServices",
+ "defaultAction": "Allow",
+ "virtualNetworkRules": []
+ },
+ "allowSharedKeyAccess": false
+ }
+ }
+ ],
+ "outputs": {
+ "aiServicesName": {
+ "type": "string",
+ "value": "[parameters('aiServicesName')]"
+ },
+ "aiservicesID": {
+ "type": "string",
+ "value": "[resourceId('Microsoft.CognitiveServices/accounts', parameters('aiServicesName'))]"
+ },
+ "aiservicesTarget": {
+ "type": "string",
+ "value": "[reference(resourceId('Microsoft.CognitiveServices/accounts', parameters('aiServicesName')), '2024-06-01-preview').endpoint]"
+ },
+ "aiSearchName": {
+ "type": "string",
+ "value": "[parameters('aiSearchName')]"
+ },
+ "aisearchID": {
+ "type": "string",
+ "value": "[resourceId('Microsoft.Search/searchServices', parameters('aiSearchName'))]"
+ },
+ "storageAccountName": {
+ "type": "string",
+ "value": "[variables('storageNameCleaned')]"
+ },
+ "storageId": {
+ "type": "string",
+ "value": "[resourceId('Microsoft.Storage/storageAccounts', variables('storageNameCleaned'))]"
+ },
+ "keyvaultId": {
+ "type": "string",
+ "value": "[resourceId('Microsoft.KeyVault/vaults', parameters('keyvaultName'))]"
+ }
+ }
+ }
+ }
+ },
+ {
+ "type": "Microsoft.Resources/deployments",
+ "apiVersion": "2022-09-01",
+ "name": "[format('{0}-{1}-deployment', variables('name'), variables('uniqueSuffix'))]",
+ "properties": {
+ "expressionEvaluationOptions": {
+ "scope": "inner"
+ },
+ "mode": "Incremental",
+ "parameters": {
+ "aiHubName": {
+ "value": "[format('{0}-{1}', variables('name'), variables('uniqueSuffix'))]"
+ },
+ "aiHubFriendlyName": {
+ "value": "[parameters('aiHubFriendlyName')]"
+ },
+ "aiHubDescription": {
+ "value": "[parameters('aiHubDescription')]"
+ },
+ "location": {
+ "value": "[parameters('location')]"
+ },
+ "tags": {
+ "value": "[parameters('tags')]"
+ },
+ "capabilityHostName": {
+ "value": "[format('{0}-{1}-{2}', variables('name'), variables('uniqueSuffix'), parameters('capabilityHostName'))]"
+ },
+ "modelLocation": {
+ "value": "[parameters('modelLocation')]"
+ },
+ "aiSearchName": {
+ "value": "[format('{0}-{1}', parameters('aiSearchName'), variables('uniqueSuffix'))]"
+ },
+ "aiSearchId": {
+ "value": "[reference(resourceId('Microsoft.Resources/deployments', format('dependencies-{0}-{1}-deployment', variables('name'), variables('uniqueSuffix'))), '2022-09-01').outputs.aisearchID.value]"
+ },
+ "aiServicesId": {
+ "value": "[reference(resourceId('Microsoft.Resources/deployments', format('dependencies-{0}-{1}-deployment', variables('name'), variables('uniqueSuffix'))), '2022-09-01').outputs.aiservicesID.value]"
+ },
+ "aiServicesTarget": {
+ "value": "[reference(resourceId('Microsoft.Resources/deployments', format('dependencies-{0}-{1}-deployment', variables('name'), variables('uniqueSuffix'))), '2022-09-01').outputs.aiservicesTarget.value]"
+ },
+ "keyVaultId": {
+ "value": "[reference(resourceId('Microsoft.Resources/deployments', format('dependencies-{0}-{1}-deployment', variables('name'), variables('uniqueSuffix'))), '2022-09-01').outputs.keyvaultId.value]"
+ },
+ "storageAccountId": {
+ "value": "[reference(resourceId('Microsoft.Resources/deployments', format('dependencies-{0}-{1}-deployment', variables('name'), variables('uniqueSuffix'))), '2022-09-01').outputs.storageId.value]"
+ }
+ },
+ "template": {
+ "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
+ "contentVersion": "1.0.0.0",
+ "metadata": {
+ "_generator": {
+ "name": "bicep",
+ "version": "0.31.92.45157",
+ "templateHash": "68227875889195354"
+ }
+ },
+ "parameters": {
+ "location": {
+ "type": "string",
+ "metadata": {
+ "description": "Azure region of the deployment"
+ }
+ },
+ "tags": {
+ "type": "object",
+ "metadata": {
+ "description": "Tags to add to the resources"
+ }
+ },
+ "aiHubName": {
+ "type": "string",
+ "metadata": {
+ "description": "AI hub name"
+ }
+ },
+ "aiHubFriendlyName": {
+ "type": "string",
+ "defaultValue": "[parameters('aiHubName')]",
+ "metadata": {
+ "description": "AI hub display name"
+ }
+ },
+ "aiHubDescription": {
+ "type": "string",
+ "metadata": {
+ "description": "AI hub description"
+ }
+ },
+ "keyVaultId": {
+ "type": "string",
+ "metadata": {
+ "description": "Resource ID of the key vault resource for storing connection strings"
+ }
+ },
+ "storageAccountId": {
+ "type": "string",
+ "metadata": {
+ "description": "Resource ID of the storage account resource for storing experimentation outputs"
+ }
+ },
+ "modelLocation": {
+ "type": "string",
+ "metadata": {
+ "description": "Model/AI Resource deployment location"
+ }
+ },
+ "aiServicesId": {
+ "type": "string",
+ "metadata": {
+ "description": "Resource ID of the AI Services resource"
+ }
+ },
+ "aiServicesTarget": {
+ "type": "string",
+ "metadata": {
+ "description": "Resource ID of the AI Services endpoint"
+ }
+ },
+ "aiSearchName": {
+ "type": "string",
+ "metadata": {
+ "description": "Name AI Search resource"
+ }
+ },
+ "aiSearchId": {
+ "type": "string",
+ "metadata": {
+ "description": "Resource ID of the AI Search resource"
+ }
+ },
+ "capabilityHostName": {
+ "type": "string",
+ "defaultValue": "caphost1",
+ "metadata": {
+ "description": "Name for capabilityHost."
+ }
+ }
+ },
+ "variables": {
+ "acsConnectionName": "[format('{0}-connection-AISearch', parameters('aiHubName'))]",
+ "aoaiConnection": "[format('{0}-connection-AIServices_aoai', parameters('aiHubName'))]"
+ },
+ "resources": [
+ {
+ "type": "Microsoft.MachineLearningServices/workspaces/connections",
+ "apiVersion": "2024-07-01-preview",
+ "name": "[format('{0}/{1}', parameters('aiHubName'), format('{0}-connection-AIServices', parameters('aiHubName')))]",
+ "properties": {
+ "category": "AIServices",
+ "target": "[parameters('aiServicesTarget')]",
+ "authType": "AAD",
+ "isSharedToAll": true,
+ "metadata": {
+ "ApiType": "Azure",
+ "ResourceId": "[parameters('aiServicesId')]",
+ "location": "[parameters('modelLocation')]"
+ }
+ },
+ "dependsOn": [
+ "[resourceId('Microsoft.MachineLearningServices/workspaces', parameters('aiHubName'))]"
+ ]
+ },
+ {
+ "type": "Microsoft.MachineLearningServices/workspaces/connections",
+ "apiVersion": "2024-07-01-preview",
+ "name": "[format('{0}/{1}', parameters('aiHubName'), variables('acsConnectionName'))]",
+ "properties": {
+ "category": "CognitiveSearch",
+ "target": "[format('https://{0}.search.windows.net', parameters('aiSearchName'))]",
+ "authType": "AAD",
+ "isSharedToAll": true,
+ "metadata": {
+ "ApiType": "Azure",
+ "ResourceId": "[parameters('aiSearchId')]",
+ "location": "[parameters('location')]"
+ }
+ },
+ "dependsOn": [
+ "[resourceId('Microsoft.MachineLearningServices/workspaces', parameters('aiHubName'))]"
+ ]
+ },
+ {
+ "type": "Microsoft.MachineLearningServices/workspaces/capabilityHosts",
+ "apiVersion": "2024-10-01-preview",
+ "name": "[format('{0}/{1}', parameters('aiHubName'), format('{0}-{1}', parameters('aiHubName'), parameters('capabilityHostName')))]",
+ "properties": {
+ "capabilityHostKind": "Agents"
+ },
+ "dependsOn": [
+ "[resourceId('Microsoft.MachineLearningServices/workspaces', parameters('aiHubName'))]"
+ ]
+ },
+ {
+ "type": "Microsoft.MachineLearningServices/workspaces",
+ "apiVersion": "2024-07-01-preview",
+ "name": "[parameters('aiHubName')]",
+ "location": "[parameters('location')]",
+ "tags": "[parameters('tags')]",
+ "identity": {
+ "type": "SystemAssigned"
+ },
+ "properties": {
+ "friendlyName": "[parameters('aiHubFriendlyName')]",
+ "description": "[parameters('aiHubDescription')]",
+ "keyVault": "[parameters('keyVaultId')]",
+ "storageAccount": "[parameters('storageAccountId')]"
+ },
+ "kind": "hub"
+ }
+ ],
+ "outputs": {
+ "aiHubID": {
+ "type": "string",
+ "value": "[resourceId('Microsoft.MachineLearningServices/workspaces', parameters('aiHubName'))]"
+ },
+ "aoaiConnectionName": {
+ "type": "string",
+ "value": "[variables('aoaiConnection')]"
+ },
+ "acsConnectionName": {
+ "type": "string",
+ "value": "[variables('acsConnectionName')]"
+ }
+ }
+ }
+ },
+ "dependsOn": [
+ "[resourceId('Microsoft.Resources/deployments', format('dependencies-{0}-{1}-deployment', variables('name'), variables('uniqueSuffix')))]"
+ ]
+ },
+ {
+ "type": "Microsoft.Resources/deployments",
+ "apiVersion": "2022-09-01",
+ "name": "[format('{0}-{1}-deployment', variables('projectName'), variables('uniqueSuffix'))]",
+ "properties": {
+ "expressionEvaluationOptions": {
+ "scope": "inner"
+ },
+ "mode": "Incremental",
+ "parameters": {
+ "aiProjectName": {
+ "value": "[format('{0}-{1}', variables('projectName'), variables('uniqueSuffix'))]"
+ },
+ "aiProjectFriendlyName": {
+ "value": "[parameters('aiProjectFriendlyName')]"
+ },
+ "aiProjectDescription": {
+ "value": "[parameters('aiProjectDescription')]"
+ },
+ "location": {
+ "value": "[parameters('location')]"
+ },
+ "tags": {
+ "value": "[parameters('tags')]"
+ },
+ "capabilityHostName": {
+ "value": "[format('{0}-{1}-{2}', variables('projectName'), variables('uniqueSuffix'), parameters('capabilityHostName'))]"
+ },
+ "aiSearchName": {
+ "value": "[format('{0}-{1}', parameters('aiSearchName'), variables('uniqueSuffix'))]"
+ },
+ "aiServicesName": {
+ "value": "[format('{0}{1}', parameters('aiServicesName'), variables('uniqueSuffix'))]"
+ },
+ "aiHubId": {
+ "value": "[reference(resourceId('Microsoft.Resources/deployments', format('{0}-{1}-deployment', variables('name'), variables('uniqueSuffix'))), '2022-09-01').outputs.aiHubID.value]"
+ },
+ "acsConnectionName": {
+ "value": "[reference(resourceId('Microsoft.Resources/deployments', format('{0}-{1}-deployment', variables('name'), variables('uniqueSuffix'))), '2022-09-01').outputs.acsConnectionName.value]"
+ },
+ "aoaiConnectionName": {
+ "value": "[reference(resourceId('Microsoft.Resources/deployments', format('{0}-{1}-deployment', variables('name'), variables('uniqueSuffix'))), '2022-09-01').outputs.aoaiConnectionName.value]"
+ }
+ },
+ "template": {
+ "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
+ "contentVersion": "1.0.0.0",
+ "metadata": {
+ "_generator": {
+ "name": "bicep",
+ "version": "0.31.92.45157",
+ "templateHash": "5076019979158593319"
+ }
+ },
+ "parameters": {
+ "location": {
+ "type": "string",
+ "metadata": {
+ "description": "Azure region of the deployment"
+ }
+ },
+ "tags": {
+ "type": "object",
+ "metadata": {
+ "description": "Tags to add to the resources"
+ }
+ },
+ "aiProjectName": {
+ "type": "string",
+ "metadata": {
+ "description": "AI Project name"
+ }
+ },
+ "aiProjectFriendlyName": {
+ "type": "string",
+ "defaultValue": "[parameters('aiProjectName')]",
+ "metadata": {
+ "description": "AI Project display name"
+ }
+ },
+ "aiProjectDescription": {
+ "type": "string",
+ "metadata": {
+ "description": "AI Project description"
+ }
+ },
+ "aiHubId": {
+ "type": "string",
+ "metadata": {
+ "description": "Resource ID of the AI Hub resource"
+ }
+ },
+ "capabilityHostName": {
+ "type": "string",
+ "defaultValue": "caphost1",
+ "metadata": {
+ "description": "Name for capabilityHost."
+ }
+ },
+ "acsConnectionName": {
+ "type": "string",
+ "metadata": {
+ "description": "Name for ACS connection."
+ }
+ },
+ "aoaiConnectionName": {
+ "type": "string",
+ "metadata": {
+ "description": "Name for ACS connection."
+ }
+ },
+ "aiServicesName": {
+ "type": "string"
+ },
+ "aiSearchName": {
+ "type": "string",
+ "metadata": {
+ "description": "Name AI Search resource"
+ }
+ }
+ },
+ "variables": {
+ "subscriptionId": "[subscription().subscriptionId]",
+ "resourceGroupName": "[resourceGroup().name]",
+ "projectConnectionString": "[format('{0}.api.azureml.ms;{1};{2};{3}', parameters('location'), variables('subscriptionId'), variables('resourceGroupName'), parameters('aiProjectName'))]",
+ "storageConnections": [
+ "[format('{0}/workspaceblobstore', parameters('aiProjectName'))]"
+ ],
+ "aiSearchConnection": [
+ "[format('{0}', parameters('acsConnectionName'))]"
+ ],
+ "aiServiceConnections": [
+ "[format('{0}', parameters('aoaiConnectionName'))]"
+ ]
+ },
+ "resources": [
+ {
+ "type": "Microsoft.MachineLearningServices/workspaces/capabilityHosts",
+ "apiVersion": "2024-10-01-preview",
+ "name": "[format('{0}/{1}', parameters('aiProjectName'), format('{0}-{1}', parameters('aiProjectName'), parameters('capabilityHostName')))]",
+ "properties": {
+ "capabilityHostKind": "Agents",
+ "aiServicesConnections": "[variables('aiServiceConnections')]",
+ "vectorStoreConnections": "[variables('aiSearchConnection')]",
+ "storageConnections": "[variables('storageConnections')]"
+ },
+ "dependsOn": [
+ "[resourceId('Microsoft.MachineLearningServices/workspaces', parameters('aiProjectName'))]"
+ ]
+ },
+ {
+ "type": "Microsoft.MachineLearningServices/workspaces",
+ "apiVersion": "2023-08-01-preview",
+ "name": "[parameters('aiProjectName')]",
+ "location": "[parameters('location')]",
+ "tags": "[union(parameters('tags'), createObject('ProjectConnectionString', variables('projectConnectionString')))]",
+ "identity": {
+ "type": "SystemAssigned"
+ },
+ "properties": {
+ "friendlyName": "[parameters('aiProjectFriendlyName')]",
+ "description": "[parameters('aiProjectDescription')]",
+ "hubResourceId": "[parameters('aiHubId')]"
+ },
+ "kind": "project"
+ },
+ {
+ "type": "Microsoft.Authorization/roleAssignments",
+ "apiVersion": "2022-04-01",
+ "scope": "[format('Microsoft.CognitiveServices/accounts/{0}', parameters('aiServicesName'))]",
+ "name": "[guid(resourceId('Microsoft.CognitiveServices/accounts', parameters('aiServicesName')), resourceId('Microsoft.Authorization/roleDefinitions', '25fbc0a9-bd7c-42a3-aa1a-3b75d497ee68'), resourceId('Microsoft.MachineLearningServices/workspaces', parameters('aiProjectName')))]",
+ "properties": {
+ "principalId": "[reference(resourceId('Microsoft.MachineLearningServices/workspaces', parameters('aiProjectName')), '2023-08-01-preview', 'full').identity.principalId]",
+ "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', '25fbc0a9-bd7c-42a3-aa1a-3b75d497ee68')]",
+ "principalType": "ServicePrincipal"
+ },
+ "dependsOn": [
+ "[resourceId('Microsoft.MachineLearningServices/workspaces', parameters('aiProjectName'))]"
+ ]
+ },
+ {
+ "type": "Microsoft.Authorization/roleAssignments",
+ "apiVersion": "2022-04-01",
+ "scope": "[format('Microsoft.CognitiveServices/accounts/{0}', parameters('aiServicesName'))]",
+ "name": "[guid(resourceId('Microsoft.MachineLearningServices/workspaces', parameters('aiProjectName')), resourceId('Microsoft.Authorization/roleDefinitions', '5e0bd9bd-7b93-4f28-af87-19fc36ad61bd'), resourceId('Microsoft.CognitiveServices/accounts', parameters('aiServicesName')))]",
+ "properties": {
+ "principalId": "[reference(resourceId('Microsoft.MachineLearningServices/workspaces', parameters('aiProjectName')), '2023-08-01-preview', 'full').identity.principalId]",
+ "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', '5e0bd9bd-7b93-4f28-af87-19fc36ad61bd')]",
+ "principalType": "ServicePrincipal"
+ },
+ "dependsOn": [
+ "[resourceId('Microsoft.MachineLearningServices/workspaces', parameters('aiProjectName'))]"
+ ]
+ },
+ {
+ "type": "Microsoft.Authorization/roleAssignments",
+ "apiVersion": "2022-04-01",
+ "scope": "[format('Microsoft.CognitiveServices/accounts/{0}', parameters('aiServicesName'))]",
+ "name": "[guid(resourceId('Microsoft.MachineLearningServices/workspaces', parameters('aiProjectName')), resourceId('Microsoft.Authorization/roleDefinitions', 'a97b65f3-24c7-4388-baec-2e87135dc908'), resourceId('Microsoft.CognitiveServices/accounts', parameters('aiServicesName')))]",
+ "properties": {
+ "principalId": "[reference(resourceId('Microsoft.MachineLearningServices/workspaces', parameters('aiProjectName')), '2023-08-01-preview', 'full').identity.principalId]",
+ "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', 'a97b65f3-24c7-4388-baec-2e87135dc908')]",
+ "principalType": "ServicePrincipal"
+ },
+ "dependsOn": [
+ "[resourceId('Microsoft.MachineLearningServices/workspaces', parameters('aiProjectName'))]"
+ ]
+ },
+ {
+ "type": "Microsoft.Authorization/roleAssignments",
+ "apiVersion": "2022-04-01",
+ "scope": "[format('Microsoft.Search/searchServices/{0}', parameters('aiSearchName'))]",
+ "name": "[guid(resourceId('Microsoft.MachineLearningServices/workspaces', parameters('aiProjectName')), resourceId('Microsoft.Authorization/roleDefinitions', '8ebe5a00-799e-43f5-93ac-243d3dce84a7'), resourceId('Microsoft.Search/searchServices', parameters('aiSearchName')))]",
+ "properties": {
+ "principalId": "[reference(resourceId('Microsoft.MachineLearningServices/workspaces', parameters('aiProjectName')), '2023-08-01-preview', 'full').identity.principalId]",
+ "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', '8ebe5a00-799e-43f5-93ac-243d3dce84a7')]",
+ "principalType": "ServicePrincipal"
+ },
+ "dependsOn": [
+ "[resourceId('Microsoft.MachineLearningServices/workspaces', parameters('aiProjectName'))]"
+ ]
+ },
+ {
+ "type": "Microsoft.Authorization/roleAssignments",
+ "apiVersion": "2022-04-01",
+ "scope": "[format('Microsoft.Search/searchServices/{0}', parameters('aiSearchName'))]",
+ "name": "[guid(resourceId('Microsoft.MachineLearningServices/workspaces', parameters('aiProjectName')), resourceId('Microsoft.Authorization/roleDefinitions', '7ca78c08-252a-4471-8644-bb5ff32d4ba0'), resourceId('Microsoft.Search/searchServices', parameters('aiSearchName')))]",
+ "properties": {
+ "principalId": "[reference(resourceId('Microsoft.MachineLearningServices/workspaces', parameters('aiProjectName')), '2023-08-01-preview', 'full').identity.principalId]",
+ "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', '7ca78c08-252a-4471-8644-bb5ff32d4ba0')]",
+ "principalType": "ServicePrincipal"
+ },
+ "dependsOn": [
+ "[resourceId('Microsoft.MachineLearningServices/workspaces', parameters('aiProjectName'))]"
+ ]
+ }
+ ],
+ "outputs": {
+ "aiProjectName": {
+ "type": "string",
+ "value": "[parameters('aiProjectName')]"
+ },
+ "aiProjectResourceId": {
+ "type": "string",
+ "value": "[resourceId('Microsoft.MachineLearningServices/workspaces', parameters('aiProjectName'))]"
+ },
+ "aiProjectWorkspaceId": {
+ "type": "string",
+ "value": "[reference(resourceId('Microsoft.MachineLearningServices/workspaces', parameters('aiProjectName')), '2023-08-01-preview').workspaceId]"
+ },
+ "projectConnectionString": {
+ "type": "string",
+ "value": "[reference(resourceId('Microsoft.MachineLearningServices/workspaces', parameters('aiProjectName')), '2023-08-01-preview', 'full').tags.ProjectConnectionString]"
+ }
+ }
+ }
+ },
+ "dependsOn": [
+ "[resourceId('Microsoft.Resources/deployments', format('{0}-{1}-deployment', variables('name'), variables('uniqueSuffix')))]"
+ ]
+ }
+ ],
+ "outputs": {
+ "PROJECT_CONNECTION_STRING": {
+ "type": "string",
+ "value": "[reference(resourceId('Microsoft.Resources/deployments', format('{0}-{1}-deployment', variables('projectName'), variables('uniqueSuffix'))), '2022-09-01').outputs.projectConnectionString.value]"
+ }
+ }
+}
\ No newline at end of file
diff --git a/standard-agent.parameters.json b/standard-agent.parameters.json
new file mode 100644
index 00000000..c8258086
--- /dev/null
+++ b/standard-agent.parameters.json
@@ -0,0 +1,58 @@
+{
+ "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
+ "contentVersion": "1.0.0.0",
+ "parameters": {
+ "aiHubName": {
+ "value": "hub-demo"
+ },
+ "aiHubFriendlyName": {
+ "value": "Agents Hub resource"
+ },
+ "aiHubDescription": {
+ "value": "This is an example AI resource for use in Azure AI Studio."
+ },
+ "aiProjectName": {
+ "value": "project-demo"
+ },
+ "aiProjectFriendlyName": {
+ "value": "Agents Project resource"
+ },
+ "aiProjectDescription": {
+ "value": "This is an example AI Project resource for use in Azure AI Studio."
+ },
+ "tags": {
+ "value": {}
+ },
+ "aiSearchName": {
+ "value": "agent-ai-search"
+ },
+ "capabilityHostName": {
+ "value": "caphost1"
+ },
+ "storageName": {
+ "value": "agent-storage"
+ },
+ "aiServicesName": {
+ "value": "agent-ai-services"
+ },
+ "modelName": {
+ "value": "gpt-4o-mini"
+ },
+ "modelFormat": {
+ "value": "OpenAI"
+ },
+ "modelVersion": {
+ "value": "2024-07-18"
+ },
+ "modelSkuName": {
+ "value": "GlobalStandard"
+ },
+ "modelCapacity": {
+ "value": 50
+ },
+ "modelLocation": {
+ "value": "eastus"
+ }
+ }
+ }
+
\ No newline at end of file