microsoft-agents-a365-tooling-extensions-openai 0.1.0__tar.gz
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.
- microsoft_agents_a365_tooling_extensions_openai-0.1.0/PKG-INFO +66 -0
- microsoft_agents_a365_tooling_extensions_openai-0.1.0/README.md +33 -0
- microsoft_agents_a365_tooling_extensions_openai-0.1.0/microsoft_agents_a365/tooling/extensions/openai/__init__.py +11 -0
- microsoft_agents_a365_tooling_extensions_openai-0.1.0/microsoft_agents_a365/tooling/extensions/openai/mcp_tool_registration_service.py +223 -0
- microsoft_agents_a365_tooling_extensions_openai-0.1.0/microsoft_agents_a365_tooling_extensions_openai.egg-info/PKG-INFO +66 -0
- microsoft_agents_a365_tooling_extensions_openai-0.1.0/microsoft_agents_a365_tooling_extensions_openai.egg-info/SOURCES.txt +10 -0
- microsoft_agents_a365_tooling_extensions_openai-0.1.0/microsoft_agents_a365_tooling_extensions_openai.egg-info/dependency_links.txt +1 -0
- microsoft_agents_a365_tooling_extensions_openai-0.1.0/microsoft_agents_a365_tooling_extensions_openai.egg-info/requires.txt +14 -0
- microsoft_agents_a365_tooling_extensions_openai-0.1.0/microsoft_agents_a365_tooling_extensions_openai.egg-info/top_level.txt +1 -0
- microsoft_agents_a365_tooling_extensions_openai-0.1.0/pyproject.toml +72 -0
- microsoft_agents_a365_tooling_extensions_openai-0.1.0/setup.cfg +4 -0
- microsoft_agents_a365_tooling_extensions_openai-0.1.0/setup.py +28 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: microsoft-agents-a365-tooling-extensions-openai
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: OpenAI integration for Agent 365 Tooling SDK
|
|
5
|
+
Author-email: Microsoft <support@microsoft.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/microsoft/Agent365-python
|
|
8
|
+
Project-URL: Repository, https://github.com/microsoft/Agent365-python
|
|
9
|
+
Project-URL: Issues, https://github.com/microsoft/Agent365-python/issues
|
|
10
|
+
Project-URL: Documentation, https://github.com/microsoft/Agent365-python/tree/main/libraries/microsoft-agents-a365-tooling-extensions-openai
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
17
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
18
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
19
|
+
Requires-Python: >=3.11
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
Requires-Dist: microsoft-agents-a365-tooling>=0.0.0
|
|
22
|
+
Requires-Dist: openai-agents
|
|
23
|
+
Requires-Dist: asyncio-throttle
|
|
24
|
+
Provides-Extra: dev
|
|
25
|
+
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
26
|
+
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
|
|
27
|
+
Requires-Dist: ruff>=0.1.0; extra == "dev"
|
|
28
|
+
Requires-Dist: black>=23.0.0; extra == "dev"
|
|
29
|
+
Requires-Dist: mypy>=1.0.0; extra == "dev"
|
|
30
|
+
Provides-Extra: test
|
|
31
|
+
Requires-Dist: pytest>=7.0.0; extra == "test"
|
|
32
|
+
Requires-Dist: pytest-asyncio>=0.21.0; extra == "test"
|
|
33
|
+
|
|
34
|
+
# microsoft-agents-a365-tooling-extensions-openai
|
|
35
|
+
|
|
36
|
+
[](https://pypi.org/project/microsoft-agents-a365-tooling-extensions-openai)
|
|
37
|
+
[](https://pypi.org/project/microsoft-agents-a365-tooling-extensions-openai)
|
|
38
|
+
|
|
39
|
+
OpenAI Agents SDK specific tools and services for AI agent development. Provides MCP (Model Context Protocol) tool registration service for dynamically adding MCP servers to OpenAI Agents SDK-based agents.
|
|
40
|
+
|
|
41
|
+
## Installation
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
pip install microsoft-agents-a365-tooling-extensions-openai
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Usage
|
|
48
|
+
|
|
49
|
+
For usage examples and detailed documentation, see the [Tooling documentation](https://learn.microsoft.com/microsoft-agent-365/developer/tooling?tabs=python) on Microsoft Learn.
|
|
50
|
+
|
|
51
|
+
## Support
|
|
52
|
+
|
|
53
|
+
For issues, questions, or feedback:
|
|
54
|
+
|
|
55
|
+
- File issues in the [GitHub Issues](https://github.com/microsoft/Agent365-python/issues) section
|
|
56
|
+
- See the [main documentation](../../../README.md) for more information
|
|
57
|
+
|
|
58
|
+
## Trademarks
|
|
59
|
+
|
|
60
|
+
*Microsoft, Windows, Microsoft Azure and/or other Microsoft products and services referenced in the documentation may be either trademarks or registered trademarks of Microsoft in the United States and/or other countries. The licenses for this project do not grant you rights to use any Microsoft names, logos, or trademarks. Microsoft's general trademark guidelines can be found at http://go.microsoft.com/fwlink/?LinkID=254653.*
|
|
61
|
+
|
|
62
|
+
## License
|
|
63
|
+
|
|
64
|
+
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
65
|
+
|
|
66
|
+
Licensed under the MIT License - see the [LICENSE](../../../LICENSE.md) file for details.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# microsoft-agents-a365-tooling-extensions-openai
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/microsoft-agents-a365-tooling-extensions-openai)
|
|
4
|
+
[](https://pypi.org/project/microsoft-agents-a365-tooling-extensions-openai)
|
|
5
|
+
|
|
6
|
+
OpenAI Agents SDK specific tools and services for AI agent development. Provides MCP (Model Context Protocol) tool registration service for dynamically adding MCP servers to OpenAI Agents SDK-based agents.
|
|
7
|
+
|
|
8
|
+
## Installation
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
pip install microsoft-agents-a365-tooling-extensions-openai
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
For usage examples and detailed documentation, see the [Tooling documentation](https://learn.microsoft.com/microsoft-agent-365/developer/tooling?tabs=python) on Microsoft Learn.
|
|
17
|
+
|
|
18
|
+
## Support
|
|
19
|
+
|
|
20
|
+
For issues, questions, or feedback:
|
|
21
|
+
|
|
22
|
+
- File issues in the [GitHub Issues](https://github.com/microsoft/Agent365-python/issues) section
|
|
23
|
+
- See the [main documentation](../../../README.md) for more information
|
|
24
|
+
|
|
25
|
+
## Trademarks
|
|
26
|
+
|
|
27
|
+
*Microsoft, Windows, Microsoft Azure and/or other Microsoft products and services referenced in the documentation may be either trademarks or registered trademarks of Microsoft in the United States and/or other countries. The licenses for this project do not grant you rights to use any Microsoft names, logos, or trademarks. Microsoft's general trademark guidelines can be found at http://go.microsoft.com/fwlink/?LinkID=254653.*
|
|
28
|
+
|
|
29
|
+
## License
|
|
30
|
+
|
|
31
|
+
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
32
|
+
|
|
33
|
+
Licensed under the MIT License - see the [LICENSE](../../../LICENSE.md) file for details.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Copyright (c) Microsoft Corporation.
|
|
2
|
+
# Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
"""
|
|
5
|
+
OpenAI extensions for Microsoft Agent 365 Tooling SDK
|
|
6
|
+
|
|
7
|
+
Tooling and utilities specifically for OpenAI framework integration.
|
|
8
|
+
Provides OpenAI-specific helper utilities.
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
__version__ = "1.0.0"
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
# Copyright (c) Microsoft. All rights reserved.
|
|
2
|
+
|
|
3
|
+
from typing import Dict, Optional
|
|
4
|
+
from dataclasses import dataclass
|
|
5
|
+
import logging
|
|
6
|
+
|
|
7
|
+
from agents import Agent
|
|
8
|
+
|
|
9
|
+
from microsoft_agents.hosting.core import Authorization, TurnContext
|
|
10
|
+
|
|
11
|
+
from agents.mcp import (
|
|
12
|
+
MCPServerStreamableHttp,
|
|
13
|
+
MCPServerStreamableHttpParams,
|
|
14
|
+
)
|
|
15
|
+
from microsoft_agents_a365.runtime.utility import Utility
|
|
16
|
+
from microsoft_agents_a365.tooling.services.mcp_tool_server_configuration_service import (
|
|
17
|
+
McpToolServerConfigurationService,
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
from microsoft_agents_a365.tooling.utils.utility import (
|
|
21
|
+
get_mcp_platform_authentication_scope,
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
# TODO: This is not needed. Remove this.
|
|
26
|
+
@dataclass
|
|
27
|
+
class MCPServerInfo:
|
|
28
|
+
"""Information about an MCP server"""
|
|
29
|
+
|
|
30
|
+
name: str
|
|
31
|
+
url: str
|
|
32
|
+
server_type: str = "streamable_http" # hosted, streamable_http, sse, stdio
|
|
33
|
+
headers: Optional[Dict[str, str]] = None
|
|
34
|
+
require_approval: str = "never"
|
|
35
|
+
timeout: int = 30 # Timeout in seconds (will be converted to milliseconds for MCPServerStreamableHttpParams)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
class McpToolRegistrationService:
|
|
39
|
+
"""Service for managing MCP tools and servers for an agent"""
|
|
40
|
+
|
|
41
|
+
def __init__(self, logger: Optional[logging.Logger] = None):
|
|
42
|
+
"""
|
|
43
|
+
Initialize the MCP Tool Registration Service for OpenAI.
|
|
44
|
+
|
|
45
|
+
Args:
|
|
46
|
+
logger: Logger instance for logging operations.
|
|
47
|
+
"""
|
|
48
|
+
self._logger = logger or logging.getLogger(self.__class__.__name__)
|
|
49
|
+
self.config_service = McpToolServerConfigurationService(logger=self._logger)
|
|
50
|
+
|
|
51
|
+
async def add_tool_servers_to_agent(
|
|
52
|
+
self,
|
|
53
|
+
agent: Agent,
|
|
54
|
+
auth: Authorization,
|
|
55
|
+
auth_handler_name: str,
|
|
56
|
+
context: TurnContext,
|
|
57
|
+
auth_token: Optional[str] = None,
|
|
58
|
+
):
|
|
59
|
+
"""
|
|
60
|
+
Add new MCP servers to the agent by creating a new Agent instance.
|
|
61
|
+
|
|
62
|
+
Note: Due to OpenAI Agents SDK limitations, MCP servers must be set during
|
|
63
|
+
Agent creation. If new servers are found, this method creates a new Agent
|
|
64
|
+
instance with all MCP servers (existing + new) properly initialized.
|
|
65
|
+
|
|
66
|
+
Args:
|
|
67
|
+
agent: The existing agent to add servers to
|
|
68
|
+
auth: Authorization handler for token exchange.
|
|
69
|
+
auth_handler_name: Name of the authorization handler.
|
|
70
|
+
context: Turn context for the current operation.
|
|
71
|
+
auth_token: Authentication token to access the MCP servers.
|
|
72
|
+
|
|
73
|
+
Returns:
|
|
74
|
+
New Agent instance with all MCP servers, or original agent if no new servers
|
|
75
|
+
"""
|
|
76
|
+
|
|
77
|
+
if not auth_token:
|
|
78
|
+
scopes = get_mcp_platform_authentication_scope()
|
|
79
|
+
authToken = await auth.exchange_token(context, scopes, auth_handler_name)
|
|
80
|
+
auth_token = authToken.token
|
|
81
|
+
|
|
82
|
+
# Get MCP server configurations from the configuration service
|
|
83
|
+
# mcp_server_configs = []
|
|
84
|
+
# TODO: radevika: Update once the common project is merged.
|
|
85
|
+
|
|
86
|
+
agentic_app_id = Utility.resolve_agent_identity(context, auth_token)
|
|
87
|
+
self._logger.info(f"Listing MCP tool servers for agent {agentic_app_id}")
|
|
88
|
+
mcp_server_configs = await self.config_service.list_tool_servers(
|
|
89
|
+
agentic_app_id=agentic_app_id,
|
|
90
|
+
auth_token=auth_token,
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
self._logger.info(f"Loaded {len(mcp_server_configs)} MCP server configurations")
|
|
94
|
+
|
|
95
|
+
# Convert MCP server configs to MCPServerInfo objects
|
|
96
|
+
mcp_servers_info = []
|
|
97
|
+
for server_config in mcp_server_configs:
|
|
98
|
+
server_info = MCPServerInfo(
|
|
99
|
+
name=server_config.mcp_server_name,
|
|
100
|
+
url=server_config.mcp_server_unique_name,
|
|
101
|
+
)
|
|
102
|
+
mcp_servers_info.append(server_info)
|
|
103
|
+
|
|
104
|
+
# Get existing MCP servers from the agent
|
|
105
|
+
existing_mcp_servers = (
|
|
106
|
+
list(agent.mcp_servers) if hasattr(agent, "mcp_servers") and agent.mcp_servers else []
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
# Prepare new MCP servers to add
|
|
110
|
+
new_mcp_servers = []
|
|
111
|
+
connected_servers = []
|
|
112
|
+
|
|
113
|
+
existing_server_urls = []
|
|
114
|
+
for server in existing_mcp_servers:
|
|
115
|
+
# Check for URL in params dict (MCPServerStreamableHttp stores URL in params["url"])
|
|
116
|
+
if (
|
|
117
|
+
hasattr(server, "params")
|
|
118
|
+
and isinstance(server.params, dict)
|
|
119
|
+
and "url" in server.params
|
|
120
|
+
):
|
|
121
|
+
existing_server_urls.append(server.params["url"])
|
|
122
|
+
elif hasattr(server, "params") and hasattr(server.params, "url"):
|
|
123
|
+
existing_server_urls.append(server.params.url)
|
|
124
|
+
elif hasattr(server, "url"):
|
|
125
|
+
existing_server_urls.append(server.url)
|
|
126
|
+
|
|
127
|
+
for si in mcp_servers_info:
|
|
128
|
+
# Check if MCP server already exists
|
|
129
|
+
|
|
130
|
+
if si.url not in existing_server_urls:
|
|
131
|
+
try:
|
|
132
|
+
# Prepare headers with authorization
|
|
133
|
+
headers = si.headers or {}
|
|
134
|
+
if auth_token:
|
|
135
|
+
headers["Authorization"] = f"Bearer {auth_token}"
|
|
136
|
+
|
|
137
|
+
# Create MCPServerStreamableHttpParams with proper configuration
|
|
138
|
+
params = MCPServerStreamableHttpParams(url=si.url, headers=headers)
|
|
139
|
+
|
|
140
|
+
# Create MCP server
|
|
141
|
+
mcp_server = MCPServerStreamableHttp(params=params, name=si.name)
|
|
142
|
+
|
|
143
|
+
# CRITICAL: Connect the server before adding it to the agent
|
|
144
|
+
# This fixes the "Server not initialized. Make sure you call `connect()` first." error
|
|
145
|
+
# TODO: When App Manifest scenario lits up for onboarding agent, we need to pull a flag and disconnect if the flag is disabled.
|
|
146
|
+
await mcp_server.connect()
|
|
147
|
+
|
|
148
|
+
new_mcp_servers.append(mcp_server)
|
|
149
|
+
connected_servers.append(mcp_server)
|
|
150
|
+
|
|
151
|
+
existing_server_urls.append(si.url)
|
|
152
|
+
self._logger.info(
|
|
153
|
+
f"Successfully connected to MCP server '{si.name}' at {si.url}"
|
|
154
|
+
)
|
|
155
|
+
|
|
156
|
+
except Exception as e:
|
|
157
|
+
# Log the error but continue with other servers
|
|
158
|
+
self._logger.warning(
|
|
159
|
+
f"Failed to connect to MCP server {si.name} at {si.url}: {e}"
|
|
160
|
+
)
|
|
161
|
+
continue
|
|
162
|
+
|
|
163
|
+
# If we have new servers, we need to recreate the agent
|
|
164
|
+
# The OpenAI Agents SDK requires MCP servers to be set during agent creation
|
|
165
|
+
if new_mcp_servers:
|
|
166
|
+
try:
|
|
167
|
+
self._logger.info(f"Recreating agent with {len(new_mcp_servers)} new MCP servers")
|
|
168
|
+
all_mcp_servers = existing_mcp_servers + new_mcp_servers
|
|
169
|
+
|
|
170
|
+
# Recreate the agent with all MCP servers
|
|
171
|
+
from agents import Agent
|
|
172
|
+
|
|
173
|
+
new_agent = Agent(
|
|
174
|
+
name=agent.name,
|
|
175
|
+
model=agent.model,
|
|
176
|
+
model_settings=agent.model_settings
|
|
177
|
+
if hasattr(agent, "model_settings")
|
|
178
|
+
else None,
|
|
179
|
+
instructions=agent.instructions,
|
|
180
|
+
tools=agent.tools,
|
|
181
|
+
mcp_servers=all_mcp_servers,
|
|
182
|
+
)
|
|
183
|
+
|
|
184
|
+
# Copy agent attributes to preserve state
|
|
185
|
+
for attr_name in ["name", "model", "instructions", "tools"]:
|
|
186
|
+
if hasattr(agent, attr_name):
|
|
187
|
+
setattr(new_agent, attr_name, getattr(agent, attr_name))
|
|
188
|
+
|
|
189
|
+
# Store connected servers for potential cleanup
|
|
190
|
+
if not hasattr(self, "_connected_servers"):
|
|
191
|
+
self._connected_servers = []
|
|
192
|
+
self._connected_servers.extend(connected_servers)
|
|
193
|
+
|
|
194
|
+
self._logger.info(
|
|
195
|
+
f"Agent recreated successfully with {len(all_mcp_servers)} total MCP servers"
|
|
196
|
+
)
|
|
197
|
+
# Return the new agent (caller needs to replace the old one)
|
|
198
|
+
return new_agent
|
|
199
|
+
|
|
200
|
+
except Exception as e:
|
|
201
|
+
# Clean up connected servers if agent creation fails
|
|
202
|
+
self._logger.error(f"Failed to recreate agent with new MCP servers: {e}")
|
|
203
|
+
await self._cleanup_servers(connected_servers)
|
|
204
|
+
raise e
|
|
205
|
+
|
|
206
|
+
self._logger.info("No new MCP servers to add to agent")
|
|
207
|
+
return agent
|
|
208
|
+
|
|
209
|
+
async def _cleanup_servers(self, servers):
|
|
210
|
+
"""Clean up connected MCP servers"""
|
|
211
|
+
for server in servers:
|
|
212
|
+
try:
|
|
213
|
+
if hasattr(server, "cleanup"):
|
|
214
|
+
await server.cleanup()
|
|
215
|
+
except Exception as e:
|
|
216
|
+
# Log cleanup errors but don't raise them
|
|
217
|
+
self._logger.debug(f"Error during server cleanup: {e}")
|
|
218
|
+
|
|
219
|
+
async def cleanup_all_servers(self):
|
|
220
|
+
"""Clean up all connected MCP servers"""
|
|
221
|
+
if hasattr(self, "_connected_servers"):
|
|
222
|
+
await self._cleanup_servers(self._connected_servers)
|
|
223
|
+
self._connected_servers = []
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: microsoft-agents-a365-tooling-extensions-openai
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: OpenAI integration for Agent 365 Tooling SDK
|
|
5
|
+
Author-email: Microsoft <support@microsoft.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/microsoft/Agent365-python
|
|
8
|
+
Project-URL: Repository, https://github.com/microsoft/Agent365-python
|
|
9
|
+
Project-URL: Issues, https://github.com/microsoft/Agent365-python/issues
|
|
10
|
+
Project-URL: Documentation, https://github.com/microsoft/Agent365-python/tree/main/libraries/microsoft-agents-a365-tooling-extensions-openai
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
17
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
18
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
19
|
+
Requires-Python: >=3.11
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
Requires-Dist: microsoft-agents-a365-tooling>=0.0.0
|
|
22
|
+
Requires-Dist: openai-agents
|
|
23
|
+
Requires-Dist: asyncio-throttle
|
|
24
|
+
Provides-Extra: dev
|
|
25
|
+
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
26
|
+
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
|
|
27
|
+
Requires-Dist: ruff>=0.1.0; extra == "dev"
|
|
28
|
+
Requires-Dist: black>=23.0.0; extra == "dev"
|
|
29
|
+
Requires-Dist: mypy>=1.0.0; extra == "dev"
|
|
30
|
+
Provides-Extra: test
|
|
31
|
+
Requires-Dist: pytest>=7.0.0; extra == "test"
|
|
32
|
+
Requires-Dist: pytest-asyncio>=0.21.0; extra == "test"
|
|
33
|
+
|
|
34
|
+
# microsoft-agents-a365-tooling-extensions-openai
|
|
35
|
+
|
|
36
|
+
[](https://pypi.org/project/microsoft-agents-a365-tooling-extensions-openai)
|
|
37
|
+
[](https://pypi.org/project/microsoft-agents-a365-tooling-extensions-openai)
|
|
38
|
+
|
|
39
|
+
OpenAI Agents SDK specific tools and services for AI agent development. Provides MCP (Model Context Protocol) tool registration service for dynamically adding MCP servers to OpenAI Agents SDK-based agents.
|
|
40
|
+
|
|
41
|
+
## Installation
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
pip install microsoft-agents-a365-tooling-extensions-openai
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Usage
|
|
48
|
+
|
|
49
|
+
For usage examples and detailed documentation, see the [Tooling documentation](https://learn.microsoft.com/microsoft-agent-365/developer/tooling?tabs=python) on Microsoft Learn.
|
|
50
|
+
|
|
51
|
+
## Support
|
|
52
|
+
|
|
53
|
+
For issues, questions, or feedback:
|
|
54
|
+
|
|
55
|
+
- File issues in the [GitHub Issues](https://github.com/microsoft/Agent365-python/issues) section
|
|
56
|
+
- See the [main documentation](../../../README.md) for more information
|
|
57
|
+
|
|
58
|
+
## Trademarks
|
|
59
|
+
|
|
60
|
+
*Microsoft, Windows, Microsoft Azure and/or other Microsoft products and services referenced in the documentation may be either trademarks or registered trademarks of Microsoft in the United States and/or other countries. The licenses for this project do not grant you rights to use any Microsoft names, logos, or trademarks. Microsoft's general trademark guidelines can be found at http://go.microsoft.com/fwlink/?LinkID=254653.*
|
|
61
|
+
|
|
62
|
+
## License
|
|
63
|
+
|
|
64
|
+
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
65
|
+
|
|
66
|
+
Licensed under the MIT License - see the [LICENSE](../../../LICENSE.md) file for details.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
README.md
|
|
2
|
+
pyproject.toml
|
|
3
|
+
setup.py
|
|
4
|
+
microsoft_agents_a365/tooling/extensions/openai/__init__.py
|
|
5
|
+
microsoft_agents_a365/tooling/extensions/openai/mcp_tool_registration_service.py
|
|
6
|
+
microsoft_agents_a365_tooling_extensions_openai.egg-info/PKG-INFO
|
|
7
|
+
microsoft_agents_a365_tooling_extensions_openai.egg-info/SOURCES.txt
|
|
8
|
+
microsoft_agents_a365_tooling_extensions_openai.egg-info/dependency_links.txt
|
|
9
|
+
microsoft_agents_a365_tooling_extensions_openai.egg-info/requires.txt
|
|
10
|
+
microsoft_agents_a365_tooling_extensions_openai.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
microsoft_agents_a365
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68", "wheel", "tzdata"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "microsoft-agents-a365-tooling-extensions-openai"
|
|
7
|
+
dynamic = ["version"]
|
|
8
|
+
authors = [
|
|
9
|
+
{ name = "Microsoft", email = "support@microsoft.com" },
|
|
10
|
+
]
|
|
11
|
+
description = "OpenAI integration for Agent 365 Tooling SDK"
|
|
12
|
+
readme = "README.md"
|
|
13
|
+
requires-python = ">=3.11"
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 3 - Alpha",
|
|
16
|
+
"Intended Audience :: Developers",
|
|
17
|
+
"Programming Language :: Python :: 3",
|
|
18
|
+
"Programming Language :: Python :: 3.11",
|
|
19
|
+
"Programming Language :: Python :: 3.12",
|
|
20
|
+
"Operating System :: OS Independent",
|
|
21
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
22
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
23
|
+
]
|
|
24
|
+
license = {text = "MIT"}
|
|
25
|
+
dependencies = [
|
|
26
|
+
"microsoft-agents-a365-tooling >= 0.0.0",
|
|
27
|
+
"openai-agents",
|
|
28
|
+
"asyncio-throttle",
|
|
29
|
+
]
|
|
30
|
+
|
|
31
|
+
[project.urls]
|
|
32
|
+
Homepage = "https://github.com/microsoft/Agent365-python"
|
|
33
|
+
Repository = "https://github.com/microsoft/Agent365-python"
|
|
34
|
+
Issues = "https://github.com/microsoft/Agent365-python/issues"
|
|
35
|
+
Documentation = "https://github.com/microsoft/Agent365-python/tree/main/libraries/microsoft-agents-a365-tooling-extensions-openai"
|
|
36
|
+
|
|
37
|
+
[project.optional-dependencies]
|
|
38
|
+
dev = [
|
|
39
|
+
"pytest >= 7.0.0",
|
|
40
|
+
"pytest-asyncio >= 0.21.0",
|
|
41
|
+
"ruff >= 0.1.0",
|
|
42
|
+
"black >= 23.0.0",
|
|
43
|
+
"mypy >= 1.0.0",
|
|
44
|
+
]
|
|
45
|
+
test = [
|
|
46
|
+
"pytest >= 7.0.0",
|
|
47
|
+
"pytest-asyncio >= 0.21.0",
|
|
48
|
+
]
|
|
49
|
+
|
|
50
|
+
[tool.setuptools.packages.find]
|
|
51
|
+
where = ["."]
|
|
52
|
+
|
|
53
|
+
[tool.setuptools]
|
|
54
|
+
license-files = ["../../LICENSE"]
|
|
55
|
+
include-package-data = true
|
|
56
|
+
|
|
57
|
+
[tool.setuptools.package-data]
|
|
58
|
+
"*" = ["../../LICENSE"]
|
|
59
|
+
|
|
60
|
+
[tool.black]
|
|
61
|
+
line-length = 100
|
|
62
|
+
target-version = ['py311']
|
|
63
|
+
|
|
64
|
+
[tool.ruff]
|
|
65
|
+
line-length = 100
|
|
66
|
+
target-version = "py311"
|
|
67
|
+
|
|
68
|
+
[tool.mypy]
|
|
69
|
+
python_version = "3.11"
|
|
70
|
+
strict = true
|
|
71
|
+
warn_return_any = true
|
|
72
|
+
warn_unused_configs = true
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Copyright (c) Microsoft Corporation.
|
|
2
|
+
# Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
import sys
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
from os import environ
|
|
7
|
+
from setuptools import setup
|
|
8
|
+
|
|
9
|
+
# Get version from environment variable set by CI/CD
|
|
10
|
+
package_version = environ.get("AGENT365_PYTHON_SDK_PACKAGE_VERSION", "0.0.0")
|
|
11
|
+
|
|
12
|
+
# Add versioning helper to path
|
|
13
|
+
helper_path = Path(__file__).parent.parent.parent / "versioning" / "helper"
|
|
14
|
+
sys.path.insert(0, str(helper_path))
|
|
15
|
+
|
|
16
|
+
from setup_utils import get_dynamic_dependencies
|
|
17
|
+
|
|
18
|
+
# Use minimum version strategy:
|
|
19
|
+
# - Internal packages get: >= current_base_version (e.g., >= 0.1.0)
|
|
20
|
+
# - Automatically updates when you build new versions
|
|
21
|
+
# - Consumers can upgrade to any higher version
|
|
22
|
+
setup(
|
|
23
|
+
version=package_version,
|
|
24
|
+
install_requires=get_dynamic_dependencies(
|
|
25
|
+
use_compatible_release=False, # No upper bound
|
|
26
|
+
use_exact_match=False, # Not exact match
|
|
27
|
+
),
|
|
28
|
+
)
|