azure-ai-agentserver-core 1.0.0b2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- azure/ai/agentserver/__init__.py +1 -0
- azure/ai/agentserver/core/__init__.py +14 -0
- azure/ai/agentserver/core/_version.py +9 -0
- azure/ai/agentserver/core/constants.py +13 -0
- azure/ai/agentserver/core/logger.py +161 -0
- azure/ai/agentserver/core/models/__init__.py +7 -0
- azure/ai/agentserver/core/models/_create_response.py +12 -0
- azure/ai/agentserver/core/models/openai/__init__.py +16 -0
- azure/ai/agentserver/core/models/projects/__init__.py +820 -0
- azure/ai/agentserver/core/models/projects/_enums.py +767 -0
- azure/ai/agentserver/core/models/projects/_models.py +15049 -0
- azure/ai/agentserver/core/models/projects/_patch.py +39 -0
- azure/ai/agentserver/core/models/projects/_patch_evaluations.py +48 -0
- azure/ai/agentserver/core/models/projects/_utils/__init__.py +6 -0
- azure/ai/agentserver/core/models/projects/_utils/model_base.py +1237 -0
- azure/ai/agentserver/core/models/projects/_utils/serialization.py +2030 -0
- azure/ai/agentserver/core/py.typed +0 -0
- azure/ai/agentserver/core/server/__init__.py +1 -0
- azure/ai/agentserver/core/server/base.py +324 -0
- azure/ai/agentserver/core/server/common/__init__.py +1 -0
- azure/ai/agentserver/core/server/common/agent_run_context.py +76 -0
- azure/ai/agentserver/core/server/common/id_generator/__init__.py +5 -0
- azure/ai/agentserver/core/server/common/id_generator/foundry_id_generator.py +136 -0
- azure/ai/agentserver/core/server/common/id_generator/id_generator.py +19 -0
- azure_ai_agentserver_core-1.0.0b2.dist-info/METADATA +149 -0
- azure_ai_agentserver_core-1.0.0b2.dist-info/RECORD +29 -0
- azure_ai_agentserver_core-1.0.0b2.dist-info/WHEEL +5 -0
- azure_ai_agentserver_core-1.0.0b2.dist-info/licenses/LICENSE +21 -0
- azure_ai_agentserver_core-1.0.0b2.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: azure-ai-agentserver-core
|
|
3
|
+
Version: 1.0.0b2
|
|
4
|
+
Summary: Agents server adapter for Azure AI
|
|
5
|
+
Author-email: Microsoft Corporation <azpysdkhelp@microsoft.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: repository, https://github.com/Azure/azure-sdk-for-python
|
|
8
|
+
Keywords: azure,azure sdk
|
|
9
|
+
Classifier: Programming Language :: Python
|
|
10
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
16
|
+
Requires-Python: >=3.10
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
License-File: LICENSE
|
|
19
|
+
Requires-Dist: azure-monitor-opentelemetry>=1.5.0
|
|
20
|
+
Requires-Dist: azure-ai-projects
|
|
21
|
+
Requires-Dist: azure-ai-agents>=1.2.0b5
|
|
22
|
+
Requires-Dist: azure-core>=1.35.0
|
|
23
|
+
Requires-Dist: azure-identity
|
|
24
|
+
Requires-Dist: openai>=1.80.0
|
|
25
|
+
Requires-Dist: opentelemetry-api>=1.35
|
|
26
|
+
Requires-Dist: opentelemetry-exporter-otlp-proto-http
|
|
27
|
+
Requires-Dist: starlette>=0.45.0
|
|
28
|
+
Requires-Dist: uvicorn>=0.31.0
|
|
29
|
+
Dynamic: license-file
|
|
30
|
+
|
|
31
|
+
# Azure AI Agent Server Adapter for Python
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
## Getting started
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
pip install azure-ai-agentserver-core
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Key concepts
|
|
41
|
+
|
|
42
|
+
This is the core package for Azure AI Agent server. It hosts your agent as a container on the cloud.
|
|
43
|
+
|
|
44
|
+
You can talk to your agent using azure-ai-project sdk.
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
## Examples
|
|
48
|
+
|
|
49
|
+
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.
|
|
50
|
+
|
|
51
|
+
```python
|
|
52
|
+
import datetime
|
|
53
|
+
|
|
54
|
+
from azure.ai.agentserver.core import FoundryCBAgent
|
|
55
|
+
from azure.ai.agentserver.core.models import (
|
|
56
|
+
CreateResponse,
|
|
57
|
+
Response as OpenAIResponse,
|
|
58
|
+
)
|
|
59
|
+
from azure.ai.agentserver.core.models.projects import (
|
|
60
|
+
ItemContentOutputText,
|
|
61
|
+
ResponsesAssistantMessageItemResource,
|
|
62
|
+
ResponseTextDeltaEvent,
|
|
63
|
+
ResponseTextDoneEvent,
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def stream_events(text: str):
|
|
68
|
+
assembled = ""
|
|
69
|
+
for i, token in enumerate(text.split(" ")):
|
|
70
|
+
piece = token if i == len(text.split(" ")) - 1 else token + " "
|
|
71
|
+
assembled += piece
|
|
72
|
+
yield ResponseTextDeltaEvent(delta=piece)
|
|
73
|
+
# Done with text
|
|
74
|
+
yield ResponseTextDoneEvent(text=assembled)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
async def agent_run(request_body: CreateResponse):
|
|
78
|
+
agent = request_body.agent
|
|
79
|
+
print(f"agent:{agent}")
|
|
80
|
+
|
|
81
|
+
if request_body.stream:
|
|
82
|
+
return stream_events("I am mock agent with no intelligence in stream mode.")
|
|
83
|
+
|
|
84
|
+
# Build assistant output content
|
|
85
|
+
output_content = [
|
|
86
|
+
ItemContentOutputText(
|
|
87
|
+
text="I am mock agent with no intelligence.",
|
|
88
|
+
annotations=[],
|
|
89
|
+
)
|
|
90
|
+
]
|
|
91
|
+
|
|
92
|
+
response = OpenAIResponse(
|
|
93
|
+
metadata={},
|
|
94
|
+
temperature=0.0,
|
|
95
|
+
top_p=0.0,
|
|
96
|
+
user="me",
|
|
97
|
+
id="id",
|
|
98
|
+
created_at=datetime.datetime.now(),
|
|
99
|
+
output=[
|
|
100
|
+
ResponsesAssistantMessageItemResource(
|
|
101
|
+
status="completed",
|
|
102
|
+
content=output_content,
|
|
103
|
+
)
|
|
104
|
+
],
|
|
105
|
+
)
|
|
106
|
+
return response
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
my_agent = FoundryCBAgent()
|
|
110
|
+
my_agent.agent_run = agent_run
|
|
111
|
+
|
|
112
|
+
if __name__ == "__main__":
|
|
113
|
+
my_agent.run()
|
|
114
|
+
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Troubleshooting
|
|
118
|
+
|
|
119
|
+
First run your agent with azure-ai-agentserver-core locally.
|
|
120
|
+
|
|
121
|
+
If it works on local by failed on cloud. Check your logs in the application insight connected to your Azure AI Foundry Project.
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
### Reporting issues
|
|
125
|
+
|
|
126
|
+
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.
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
## Next steps
|
|
130
|
+
|
|
131
|
+
Please visit [Samples](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/agentserver/azure-ai-agentserver-core/samples) folder. There are several cases for you to build your agent with azure-ai-agentserver
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
## Contributing
|
|
135
|
+
|
|
136
|
+
This project welcomes contributions and suggestions. Most contributions require
|
|
137
|
+
you to agree to a Contributor License Agreement (CLA) declaring that you have
|
|
138
|
+
the right to, and actually do, grant us the rights to use your contribution.
|
|
139
|
+
For details, visit https://cla.microsoft.com.
|
|
140
|
+
|
|
141
|
+
When you submit a pull request, a CLA-bot will automatically determine whether
|
|
142
|
+
you need to provide a CLA and decorate the PR appropriately (e.g., label,
|
|
143
|
+
comment). Simply follow the instructions provided by the bot. You will only
|
|
144
|
+
need to do this once across all repos using our CLA.
|
|
145
|
+
|
|
146
|
+
This project has adopted the
|
|
147
|
+
[Microsoft Open Source Code of Conduct][code_of_conduct]. For more information,
|
|
148
|
+
see the Code of Conduct FAQ or contact opencode@microsoft.com with any
|
|
149
|
+
additional questions or comments.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
azure/ai/agentserver/__init__.py,sha256=bpT73UG7mZL_JjEqMwbYx6q69jA8J5Jcoul1LcDokhA,81
|
|
2
|
+
azure/ai/agentserver/core/__init__.py,sha256=j2VELC92FGP-zk4fahH2rk1RVfOG1J4dvu2FUlfGF88,514
|
|
3
|
+
azure/ai/agentserver/core/_version.py,sha256=g637Xd9Uf23mTrNOKxXc_oX7Wi-Zaz6tfo5NYxUwOr0,486
|
|
4
|
+
azure/ai/agentserver/core/constants.py,sha256=Gm_TlYr6umosiorvwuJiuQGkFrKM0E75eL6QFzDA2lI,615
|
|
5
|
+
azure/ai/agentserver/core/logger.py,sha256=LKtR62iIc_ipp1JINHJsIrjOmKpHVR9zBLxNpqYXIAA,6289
|
|
6
|
+
azure/ai/agentserver/core/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
|
+
azure/ai/agentserver/core/models/__init__.py,sha256=Btn4GMbIH73BOUQWUJ_j_vR4jh5uJXSk7Oa4bp-18g0,389
|
|
8
|
+
azure/ai/agentserver/core/models/_create_response.py,sha256=DIZsQPgGVkiLmCJ77fiL_XVTdkBhDNqUPQBVCjyQrFU,546
|
|
9
|
+
azure/ai/agentserver/core/models/openai/__init__.py,sha256=uzEfQbnIbfwiIbqU2Wp4wmqw0_OsMTqqoFP9W4BLhyw,724
|
|
10
|
+
azure/ai/agentserver/core/models/projects/__init__.py,sha256=EDoM9CwAiNlk0Mh8OPals2fgw51W0ldvoy0WLqzYcJo,24247
|
|
11
|
+
azure/ai/agentserver/core/models/projects/_enums.py,sha256=xIbLRbHYKBeXW0bnAO4B3gWeeYKNFa_KMnyevNQMwNA,28340
|
|
12
|
+
azure/ai/agentserver/core/models/projects/_models.py,sha256=G7TitFs5mKKyztFpzIbLsws2ZEZBPhkHbG65Qy1nRS4,628079
|
|
13
|
+
azure/ai/agentserver/core/models/projects/_patch.py,sha256=dWBK2BzNQXjZ_SjstkF0EwLzEJxRl9tKt3W8-uOqs0A,1302
|
|
14
|
+
azure/ai/agentserver/core/models/projects/_patch_evaluations.py,sha256=7XconuuIcE5A3s3GuMHXmzqeePJz553x02HnqQh2mOE,2678
|
|
15
|
+
azure/ai/agentserver/core/models/projects/_utils/__init__.py,sha256=nh5swTUwCBe3xsb9n60QMcuJ33d89Itwx7q9V-oDOUE,450
|
|
16
|
+
azure/ai/agentserver/core/models/projects/_utils/model_base.py,sha256=z3grn98sQg_F0DaLQ0DtMOkn8EoLtW083CzS-r8p6fg,45593
|
|
17
|
+
azure/ai/agentserver/core/models/projects/_utils/serialization.py,sha256=WrHETL6uaaDLnB7TVbe25huhlLDm3aWBGphIutnJcA4,81946
|
|
18
|
+
azure/ai/agentserver/core/server/__init__.py,sha256=ED6jHcYiuYpr_0vjGz0zx2lrrmJT9sDJCzIljoDfmlM,65
|
|
19
|
+
azure/ai/agentserver/core/server/base.py,sha256=MYzc9K7EPjTlhKAMRv_z_Ip34hs3ZYIsrMYv1F2gFpQ,14537
|
|
20
|
+
azure/ai/agentserver/core/server/common/__init__.py,sha256=ED6jHcYiuYpr_0vjGz0zx2lrrmJT9sDJCzIljoDfmlM,65
|
|
21
|
+
azure/ai/agentserver/core/server/common/agent_run_context.py,sha256=vd-GMvVSz86rQhO9OtJ1vhWfmyNc4wJqH51twvXPRxU,2382
|
|
22
|
+
azure/ai/agentserver/core/server/common/id_generator/__init__.py,sha256=J_Cmr9IKDtiY7KQ4vjOy9-BwZ8AxVwUHKWesdhDCY_U,246
|
|
23
|
+
azure/ai/agentserver/core/server/common/id_generator/foundry_id_generator.py,sha256=Rg4MKTtnkNoSuKAlfG1SB_VMkwy_2EZdSGqk36XBwqg,5306
|
|
24
|
+
azure/ai/agentserver/core/server/common/id_generator/id_generator.py,sha256=XFhEZD8R4qMxFdAwk7TizVTT8Wq-srhvhSJX3T6P2Ew,613
|
|
25
|
+
azure_ai_agentserver_core-1.0.0b2.dist-info/licenses/LICENSE,sha256=_VMkgdgo4ToLE8y1mOAjOKNhd0BnWoYu5r3BVBto6T0,1073
|
|
26
|
+
azure_ai_agentserver_core-1.0.0b2.dist-info/METADATA,sha256=NxH4CP62qUuqLpMG-WeqnQgK-gfqkqSGoJp05QQE7U0,4730
|
|
27
|
+
azure_ai_agentserver_core-1.0.0b2.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
|
|
28
|
+
azure_ai_agentserver_core-1.0.0b2.dist-info/top_level.txt,sha256=S7DhWV9m80TBzAhOFjxDUiNbKszzoThbnrSz5MpbHSQ,6
|
|
29
|
+
azure_ai_agentserver_core-1.0.0b2.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
Copyright (c) Microsoft Corporation.
|
|
2
|
+
|
|
3
|
+
MIT License
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
azure
|