Skip to content

Commit 57a5e60

Browse files
author
Jesus Terrazas
committed
update openai
1 parent dad5755 commit 57a5e60

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

libraries/microsoft-agents-a365-tooling-extensions-openai/microsoft_agents_a365/tooling/extensions/openai/mcp_tool_registration_service.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ class MCPServerInfo:
3838

3939
class McpToolRegistrationService:
4040
"""Service for managing MCP tools and servers for an agent"""
41+
_orchestrator_name: str = "OpenAI"
4142

4243
def __init__(self, logger: Optional[logging.Logger] = None):
4344
"""
@@ -89,6 +90,7 @@ async def add_tool_servers_to_agent(
8990
mcp_server_configs = await self.config_service.list_tool_servers(
9091
agentic_app_id=agentic_app_id,
9192
auth_token=auth_token,
93+
orchestrator_name=self._orchestrator_name,
9294
)
9395

9496
self._logger.info(f"Loaded {len(mcp_server_configs)} MCP server configurations")
@@ -133,9 +135,9 @@ async def add_tool_servers_to_agent(
133135
# Prepare headers with authorization
134136
headers = si.headers or {}
135137
if auth_token:
136-
headers[Constants.Headers.AUTHORIZATION] = f"Bearer {auth_token}"
138+
headers[Constants.Headers.AUTHORIZATION] = f"{Constants.Headers.BEARER_PREFIX} {auth_token}"
137139

138-
headers[Constants.Headers.USER_AGENT] = Utility.get_user_agent_header("OpenAI")
140+
headers[Constants.Headers.USER_AGENT] = Utility.get_user_agent_header(self._orchestrator_name)
139141

140142
# Create MCPServerStreamableHttpParams with proper configuration
141143
params = MCPServerStreamableHttpParams(url=si.url, headers=headers)

0 commit comments

Comments
 (0)