Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
ddf4b6e
add azure-ai-agentserver-core
lusu-msft Nov 3, 2025
3c8c265
ignore non-exist namespace
lusu-msft Nov 3, 2025
ad1b592
try fix version
lusu-msft Nov 3, 2025
9aef09f
try fix version
lusu-msft Nov 3, 2025
f238c60
try build with updated dependency
lusu-msft Nov 4, 2025
0939aec
fix typo
lusu-msft Nov 4, 2025
31d59b2
try debug build
lusu-msft Nov 4, 2025
b07370f
try debug build
lusu-msft Nov 4, 2025
5059963
try enable build by changing required python version
lusu-msft Nov 4, 2025
1f70e4e
try build with 3.10
lusu-msft Nov 4, 2025
3a120dd
revert ai matrix setting
lusu-msft Nov 4, 2025
94606a6
override azure-ai-agentserver-core required python version to enable …
lusu-msft Nov 4, 2025
253c119
remove unused project files
lusu-msft Nov 4, 2025
5822186
fix init.py
lusu-msft Nov 4, 2025
e897e6f
fix dependency
lusu-msft Nov 4, 2025
070ed65
try fix pylint
lusu-msft Nov 4, 2025
491f5c4
try fix pylint
lusu-msft Nov 4, 2025
5533774
add pytest cases
lusu-msft Nov 4, 2025
7533353
revert eng changes
lusu-msft Nov 4, 2025
92e7443
try fix sphinx
lusu-msft Nov 4, 2025
0303735
Merge branch 'main' into lusu/agentserver-core
lusu-msft Nov 4, 2025
9f516a5
fix format
lusu-msft Nov 4, 2025
e4e0eac
fix dependency check
lusu-msft Nov 4, 2025
d980ecc
fix sphinx build
lusu-msft Nov 4, 2025
c7d1b4c
fix pylint
lusu-msft Nov 5, 2025
15d1b3b
fix proj
lusu-msft Nov 5, 2025
3e9dfb5
update proj
lusu-msft Nov 5, 2025
ec75aed
fix format
lusu-msft Nov 5, 2025
76b0fe3
remove index.md
lusu-msft Nov 5, 2025
58268f6
update test case
lusu-msft Nov 5, 2025
d9b97bd
add license
lusu-msft Nov 5, 2025
5e6a254
remove unused requirement
lusu-msft Nov 5, 2025
58f1824
enable build of package that isn't compatible with 3.9
scbedd Nov 5, 2025
4bdc6cb
remove test compatibiilty override lets see
scbedd Nov 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions eng/pipelines/templates/steps/analyze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,14 @@ steps:
condition: and(succeededOrFailed(), ne(variables['Skip.VerifySdist'],'true'))
inputs:
scriptPath: 'scripts/devops_tasks/dispatch_tox.py'
arguments: '"$(TargetingString)" --service=${{parameters.ServiceDirectory}} --toxenv=verifysdist ${{ parameters.AdditionalTestArgs }}'
arguments: '"$(TargetingString)" --disable-compatibility-filter --service=${{parameters.ServiceDirectory}} --toxenv=verifysdist ${{ parameters.AdditionalTestArgs }}'

- task: PythonScript@0
displayName: 'Verify whl'
condition: and(succeededOrFailed(), ne(variables['Skip.VerifyWhl'],'true'))
inputs:
scriptPath: 'scripts/devops_tasks/dispatch_tox.py'
arguments: '"$(TargetingString)" --service=${{parameters.ServiceDirectory}} --toxenv=verifywhl ${{ parameters.AdditionalTestArgs }}'
arguments: '"$(TargetingString)" --disable-compatibility-filter --service=${{parameters.ServiceDirectory}} --toxenv=verifywhl ${{ parameters.AdditionalTestArgs }}'

- template: run_mypy.yml
parameters:
Expand All @@ -123,7 +123,7 @@ steps:
displayName: 'Run Keyword Validation Check'
inputs:
scriptPath: 'scripts/devops_tasks/dispatch_tox.py'
arguments: '"$(TargetingString)" --service=${{parameters.ServiceDirectory}} --toxenv=verify_keywords ${{ parameters.AdditionalTestArgs }}'
arguments: '"$(TargetingString)" --disable-compatibility-filter --service=${{parameters.ServiceDirectory}} --toxenv=verify_keywords ${{ parameters.AdditionalTestArgs }}'
condition: and(succeededOrFailed(), ne(variables['Skip.KeywordCheck'],'true'))

- template: ../steps/run_bandit.yml
Expand Down
1 change: 1 addition & 0 deletions eng/pipelines/templates/steps/run_bandit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ steps:
--mark_arg="${{ parameters.TestMarkArgument }}"
--service="${{ parameters.ServiceDirectory }}"
--toxenv="bandit"
--disable-compatibility-filter
--disablecov
${{ parameters.AdditionalTestArgs }}
env: ${{ parameters.EnvVars }}
Expand Down
1 change: 1 addition & 0 deletions eng/pipelines/templates/steps/run_black.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ steps:
"$(TargetingString)"
--service="${{ parameters.ServiceDirectory }}"
--checks="black"
--disable-compatibility-filter
--filter-type="Omit_management"
${{ parameters.AdditionalTestArgs }}
env:
Expand Down
1 change: 1 addition & 0 deletions eng/pipelines/templates/steps/run_breaking_changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ steps:
--mark_arg="${{ parameters.TestMarkArgument }}"
--service="${{ parameters.ServiceDirectory }}"
--toxenv="breaking"
--disable-compatibility-filter
--disablecov
env: ${{ parameters.EnvVars }}
condition: and(succeededOrFailed(), ne(variables['Skip.BreakingChanges'],'true'))
1 change: 1 addition & 0 deletions eng/pipelines/templates/steps/run_mypy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ steps:
--service="${{ parameters.ServiceDirectory }}"
--checks="mypy"
--disablecov
--disable-compatibility-filter
${{ parameters.AdditionalTestArgs }}
env:
TOX_PIP_IMPL: "uv"
Expand Down
1 change: 1 addition & 0 deletions eng/pipelines/templates/steps/run_pylint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ steps:
"$(TargetingString)"
--service="${{ parameters.ServiceDirectory }}"
--checks="pylint"
--disable-compatibility-filter
--filter-type="Omit_management"
${{ parameters.AdditionalTestArgs }}
env:
Expand Down
2 changes: 2 additions & 0 deletions eng/pipelines/templates/steps/run_pyright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ steps:
--mark_arg="${{ parameters.TestMarkArgument }}"
--service="${{ parameters.ServiceDirectory }}"
--toxenv="pyright"
--disable-compatibility-filter
--disablecov
${{ parameters.AdditionalTestArgs }}
condition: and(succeededOrFailed(), ne(variables['Skip.Pyright'],'true'))
Expand All @@ -30,6 +31,7 @@ steps:
--mark_arg="${{ parameters.TestMarkArgument }}"
--service="${{ parameters.ServiceDirectory }}"
--toxenv="verifytypes"
--disable-compatibility-filter
--disablecov
${{ parameters.AdditionalTestArgs }}
condition: and(succeededOrFailed(), ne(variables['Skip.Verifytypes'],'true'))
9 changes: 8 additions & 1 deletion eng/scripts/dispatch_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,13 @@ def handler(signum, frame):
help="Maximum number of concurrent checks (default: number of CPU cores).",
)

parser.add_argument(
"--disable-compatibility-filter",
dest="disable_compatibility_filter",
action="store_true",
help="Flag to disable compatibility filter while discovering packages.",
)

args = parser.parse_args()

configure_logging(args)
Expand All @@ -340,7 +347,7 @@ def handler(signum, frame):
args.filter_type = "Build"
compatibility_filter = False
else:
compatibility_filter = True
compatibility_filter = not args.disable_compatibility_filter

targeted_packages = discover_targeted_packages(
args.glob_string, target_dir, "", args.filter_type, compatibility_filter
Expand Down
2 changes: 1 addition & 1 deletion eng/tools/azure-sdk-tools/ci_tools/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def build() -> None:
target_dir,
args.package_filter_string,
filter_type="Build",
compatibility_filter=True,
compatibility_filter=False,
include_inactive=args.inactive,
)

Expand Down
4 changes: 3 additions & 1 deletion eng/tools/azure-sdk-tools/ci_tools/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@
"sdk/textanalytics/azure-ai-textanalytics",
]

TEST_COMPATIBILITY_MAP = {"azure-ai-ml": ">=3.7"}
TEST_COMPATIBILITY_MAP = {
"azure-ai-ml": ">=3.7",
}
TEST_PYTHON_DISTRO_INCOMPATIBILITY_MAP = {
"azure-storage-blob": "pypy",
"azure-storage-queue": "pypy",
Expand Down
9 changes: 8 additions & 1 deletion scripts/devops_tasks/dispatch_tox.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,13 @@
help="Location to generate any output files(if any). For e.g. apiview stub file",
)

parser.add_argument(
"--disable-compatibility-filter",
dest="disable_compatibility_filter",
action="store_true",
help="Flag to disable compatibility filter while discovering packages.",
)

args = parser.parse_args()

configure_logging(args)
Expand All @@ -132,7 +139,7 @@
args.filter_type = "Build"
compatibility_filter = False
else:
compatibility_filter = True
compatibility_filter = not args.disable_compatibility_filter

targeted_packages = discover_targeted_packages(
args.glob_string, target_dir, "", args.filter_type, compatibility_filter
Expand Down
7 changes: 7 additions & 0 deletions sdk/ai/azure-ai-agentserver-core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Release History

## 1.0.0

### Features Added

First version
21 changes: 21 additions & 0 deletions sdk/ai/azure-ai-agentserver-core/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Copyright (c) Microsoft Corporation.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
8 changes: 8 additions & 0 deletions sdk/ai/azure-ai-agentserver-core/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
include *.md
include LICENSE
recursive-include tests *.py
recursive-include samples *.py *.md
recursive-include doc *.rst *.md
include azure/__init__.py
include azure/ai/__init__.py
include azure/ai/agentserver/__init__.py
78 changes: 78 additions & 0 deletions sdk/ai/azure-ai-agentserver-core/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Azure AI Agent Server Adapter

## Install

In current folder, run:
```bash
pip install -e .
```

## Usage

If your agent is not built using a supported framework such as LangGraph and Agent-framework, you can still make it compatible with Microsoft AI Foundry by manually implementing the predefined interface.

```python
import datetime

from azure.ai.agentserver.core import FoundryCBAgent
from azure.ai.agentserver.core.models import (
CreateResponse,
Response as OpenAIResponse,
)
from azure.ai.agentserver.core.models.projects import (
ItemContentOutputText,
ResponsesAssistantMessageItemResource,
ResponseTextDeltaEvent,
ResponseTextDoneEvent,
)


def stream_events(text: str):
assembled = ""
for i, token in enumerate(text.split(" ")):
piece = token if i == len(text.split(" ")) - 1 else token + " "
assembled += piece
yield ResponseTextDeltaEvent(delta=piece)
# Done with text
yield ResponseTextDoneEvent(text=assembled)


async def agent_run(request_body: CreateResponse):
agent = request_body.agent
print(f"agent:{agent}")

if request_body.stream:
return stream_events("I am mock agent with no intelligence in stream mode.")

# Build assistant output content
output_content = [
ItemContentOutputText(
text="I am mock agent with no intelligence.",
annotations=[],
)
]

response = OpenAIResponse(
metadata={},
temperature=0.0,
top_p=0.0,
user="me",
id="id",
created_at=datetime.datetime.now(),
output=[
ResponsesAssistantMessageItemResource(
status="completed",
content=output_content,
)
],
)
return response


my_agent = FoundryCBAgent()
my_agent.agent_run = agent_run

if __name__ == "__main__":
my_agent.run()

```
1 change: 1 addition & 0 deletions sdk/ai/azure-ai-agentserver-core/azure/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore
1 change: 1 addition & 0 deletions sdk/ai/azure-ai-agentserver-core/azure/ai/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# ---------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# ---------------------------------------------------------
__path__ = __import__("pkgutil").extend_path(__path__, __name__)

from ._version import VERSION
from .logger import configure as config_logging
from .server.base import FoundryCBAgent
from .server.common.agent_run_context import AgentRunContext

config_logging()

__all__ = ["FoundryCBAgent", "AgentRunContext"]
__version__ = VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

VERSION = "1.0.0a1"
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# ---------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# ---------------------------------------------------------
class Constants:
# well-known environment variables
APPLICATION_INSIGHTS_CONNECTION_STRING = "_AGENT_RUNTIME_APP_INSIGHTS_CONNECTION_STRING"
AZURE_AI_PROJECT_ENDPOINT = "AZURE_AI_PROJECT_ENDPOINT"
AGENT_ID = "AGENT_ID"
AGENT_NAME = "AGENT_NAME"
AGENT_PROJECT_RESOURCE_ID = "AGENT_PROJECT_NAME"
OTEL_EXPORTER_ENDPOINT = "OTEL_EXPORTER_ENDPOINT"
AGENT_LOG_LEVEL = "AGENT_LOG_LEVEL"
AGENT_DEBUG_ERRORS = "AGENT_DEBUG_ERRORS"
ENABLE_APPLICATION_INSIGHTS_LOGGER = "ENABLE_APPLICATION_INSIGHTS_LOGGER"
Loading
Loading