Skip to content

Commit dee9a5e

Browse files
committed
Merge branch 'lusu/agentserver-core' into lusu/agentserver-af
2 parents b72112f + 93369cb commit dee9a5e

File tree

15 files changed

+128
-18
lines changed

15 files changed

+128
-18
lines changed

sdk/ai/azure-ai-agentserver-core/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Release History
22

3-
## 1.0.0
3+
## 1.0.0a1 (2025-11-06)
44

55
### Features Added
66

sdk/ai/azure-ai-agentserver-core/MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ recursive-include doc *.rst *.md
66
include azure/__init__.py
77
include azure/ai/__init__.py
88
include azure/ai/agentserver/__init__.py
9+
include azure/ai/agentserver/core/py.typed

sdk/ai/azure-ai-agentserver-core/README.md

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
# Azure AI Agent Server Adapter
22

3-
## Install
43

5-
In current folder, run:
4+
## Getting started
5+
66
```bash
7-
pip install -e .
7+
pip install azure-ai-agentserver-core
88
```
99

10-
## Usage
10+
## Key concepts
11+
12+
This is the core package for Azure AI Agent server. It hosts your agent as a container on the cloud.
13+
14+
You can talk to your agent using azure-ai-project sdk
15+
16+
17+
## Examples
1118

1219
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.
1320

@@ -76,3 +83,37 @@ if __name__ == "__main__":
7683
my_agent.run()
7784

7885
```
86+
87+
## Troubleshooting
88+
89+
First run your agent with azure-ai-agentserver-core locally.
90+
91+
If it works on local by failed on cloud. Check your logs in the application insight connected to your Azure AI Foundry Project.
92+
93+
94+
### Reporting issues
95+
96+
To report an issue with the client library, or request additional features, please open a GitHub issue [here](https://github.com/Azure/azure-sdk-for-python/issues). Mention the package name "azure-ai-agents" in the title or content.
97+
98+
99+
## Next steps
100+
101+
Please visit [Samples](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/ai/azure-ai-agentserver-core/samples) folder. There are several cases for you to build your agent with azure-ai-agentserver
102+
103+
104+
## Contributing
105+
106+
This project welcomes contributions and suggestions. Most contributions require
107+
you to agree to a Contributor License Agreement (CLA) declaring that you have
108+
the right to, and actually do, grant us the rights to use your contribution.
109+
For details, visit https://cla.microsoft.com.
110+
111+
When you submit a pull request, a CLA-bot will automatically determine whether
112+
you need to provide a CLA and decorate the PR appropriately (e.g., label,
113+
comment). Simply follow the instructions provided by the bot. You will only
114+
need to do this once across all repos using our CLA.
115+
116+
This project has adopted the
117+
[Microsoft Open Source Code of Conduct][code_of_conduct]. For more information,
118+
see the Code of Conduct FAQ or contact [email protected] with any
119+
additional questions or comments.
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
# ---------------------------------------------------------
22
# Copyright (c) Microsoft Corporation. All rights reserved.
33
# ---------------------------------------------------------
4+
# pylint: disable=no-name-in-module
45
from typing import Optional
56

6-
from .openai import response_create_params #pylint: disable=no-name-in-module
7+
from .openai import response_create_params # type: ignore
78
from . import projects as _azure_ai_projects_models
89

9-
class CreateResponse(response_create_params.ResponseCreateParamsBase, total=False):
10+
class CreateResponse(response_create_params.ResponseCreateParamsBase, total=False): # type: ignore
1011
agent: Optional[_azure_ai_projects_models.AgentReference]
1112
stream: Optional[bool]

sdk/ai/azure-ai-agentserver-core/azure/ai/agentserver/core/models/projects/_models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
)
4848

4949
if TYPE_CHECKING:
50-
from .. import _types, models as _models
50+
from .. import _types, models as _models # type: ignore
5151

5252

5353
class Tool(_Model):

sdk/ai/azure-ai-agentserver-core/azure/ai/agentserver/core/models/projects/py.typed

Lines changed: 0 additions & 1 deletion
This file was deleted.

sdk/ai/azure-ai-agentserver-core/azure/ai/agentserver/core/py.typed

Whitespace-only changes.

sdk/ai/azure-ai-agentserver-core/azure/ai/agentserver/core/server/base.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,20 @@ def set_request_id_to_context_var(self, request):
6060
request_context.set(ctx)
6161

6262
def set_run_context_to_context_var(self, run_context):
63+
agent_id = ""
64+
agent_obj = run_context.get_agent_id_object()
65+
if agent_obj:
66+
agent_name = getattr(agent_obj, "name", "")
67+
agent_version = getattr(agent_obj, "version", "")
68+
agent_id = f"{agent_name}:{agent_version}"
69+
6370
res = {
6471
"azure.ai.agentshosting.response_id": run_context.response_id or "",
6572
"azure.ai.agentshosting.conversation_id": run_context.conversation_id or "",
6673
"azure.ai.agentshosting.streaming": str(run_context.stream or False),
74+
"gen_ai.agent.id": agent_id,
75+
"gen_ai.provider.name": "AzureAI Hosted Agents",
76+
"gen_ai.response.id": run_context.response_id or "",
6777
}
6878
ctx = request_context.get() or {}
6979
ctx.update(res)

sdk/ai/azure-ai-agentserver-core/azure/ai/agentserver/core/server/common/agent_run_context.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def stream(self) -> bool:
4646
def get_agent_id_object(self) -> AgentId:
4747
agent = self.request.get("agent")
4848
if not agent:
49-
return None
49+
return None # type: ignore
5050
return AgentId(
5151
{
5252
"type": agent.type,
@@ -57,7 +57,7 @@ def get_agent_id_object(self) -> AgentId:
5757

5858
def get_conversation_object(self) -> ResponseConversation1:
5959
if not self._conversation_id:
60-
return None
60+
return None # type: ignore
6161
return ResponseConversation1(id=self._conversation_id)
6262

6363

@@ -72,5 +72,5 @@ def _deserialize_create_response(payload: dict) -> CreateResponse:
7272

7373
def _deserialize_agent_reference(payload: dict) -> AgentReference:
7474
if not payload:
75-
return None
75+
return None # type: ignore
7676
return AgentReference(**payload)
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"ignoreWords": [
3+
"Agentic",
4+
"UPIA",
5+
"ANSII",
6+
"inpainting",
7+
"CSDL",
8+
"azureai",
9+
"GLEU",
10+
"fstring",
11+
"alnum",
12+
"GENAI",
13+
"Prereqs",
14+
"mslearn",
15+
"PYTHONIOENCODING",
16+
"GETFL",
17+
"DETFL",
18+
"SETFL",
19+
"Planifica"
20+
],
21+
"ignorePaths": [
22+
"*.csv",
23+
"*.json",
24+
"*.rst",
25+
"samples/**"
26+
]
27+
}

0 commit comments

Comments
 (0)