Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
48f6871
sync from container_agent repo
lusu-msft Nov 11, 2025
aef1c47
sync error format
lusu-msft Nov 11, 2025
43a9c44
updated version and changelog
lusu-msft Nov 11, 2025
f33ec9f
refined changelog
lusu-msft Nov 11, 2025
18d38c4
fix build
lusu-msft Nov 11, 2025
963b06d
update id generator
lusu-msft Nov 11, 2025
b970326
fix agentframework trace init
lusu-msft Nov 11, 2025
6fb2f03
update version and changelog
lusu-msft Nov 11, 2025
5a01655
fix pylint
lusu-msft Nov 11, 2025
f30779b
pin azure-ai-agents and azure-ai-projects version
lusu-msft Nov 13, 2025
2ea401f
Merge branch 'main' into lusu/agentserver-1110
lusu-msft Nov 13, 2025
2891cab
Feature Agent Server support tools (#43961)
ganeshyb Nov 13, 2025
b7d7bea
update changelog and version
lusu-msft Nov 13, 2025
52a9256
fix cspell
lusu-msft Nov 13, 2025
ba4e1fc
fix pylint and mypy for -core
lusu-msft Nov 13, 2025
661ecb3
fix agents sdk version
lusu-msft Nov 13, 2025
8ba9f1b
pylint fixes (#44010)
ganeshyb Nov 13, 2025
5bbf605
Merge branch 'main' into lusu/agentserver-1110
lusu-msft Nov 13, 2025
07af6de
Merge branch 'lusu/agentserver-1110' of https://github.com/Azure/azur…
lusu-msft Nov 13, 2025
76f935b
Lint and mypy fixes
ganeshyb Nov 14, 2025
ba7ba50
fix mypy and pylint
lusu-msft Nov 14, 2025
cb15c94
fix mypy
lusu-msft Nov 14, 2025
1259358
[ai-agentserver] Fix AF streaming issue (#44068)
JC-386 Nov 17, 2025
a26603e
Refactor Azure AI Tool Client Configuration and Enhance OAuth Consen…
ganeshyb Nov 17, 2025
9cdf214
Fix function output parse
JC-386 Nov 17, 2025
82e5ce9
Merge branch 'jc/agentserver/af-streaming-fix' into lusu/agentserver-…
JC-386 Nov 17, 2025
9b46eb9
Refactor ToolClient to handle optional schema properties and required…
ganeshyb Nov 17, 2025
f50155a
fix mypy error on AF
JC-386 Nov 17, 2025
b0dcb07
do not index AgentRunContext
lusu-msft Nov 17, 2025
b72be77
Filter tools and update project dependenceis
ganeshyb Nov 17, 2025
c9c5307
Merge branch 'lusu/agentserver-1110' of https://github.com/Azure/azur…
ganeshyb Nov 17, 2025
bee67f7
fixing pylint
lusu-msft Nov 17, 2025
8898d8d
Merge branch 'lusu/agentserver-1110' of https://github.com/Azure/azur…
lusu-msft Nov 17, 2025
cba5fdc
fix build
lusu-msft Nov 17, 2025
b5b2086
fix mypy
lusu-msft Nov 17, 2025
7d42f0d
remove DONE when getting error
JC-386 Nov 17, 2025
dfd1bd1
fix pylint
lusu-msft Nov 17, 2025
c18d494
do not add user oid to tracing
lusu-msft Nov 17, 2025
30b78e9
[AgentServer][Agentframework] update agent framework version (#44102)
lusu-msft Nov 19, 2025
1137076
fix dependency
lusu-msft Nov 20, 2025
b7a2280
[AgentServer] fix build pipelines (#44145)
lusu-msft Nov 22, 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
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Release History


## 1.0.0b2 (2025-11-10)

Fixed some bugs


## 1.0.0b1 (2025-11-07)

### Features Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

VERSION = "1.0.0b1"
VERSION = "1.0.0b2"
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

from azure.ai.agentserver.core import AgentRunContext, FoundryCBAgent
from azure.ai.agentserver.core.constants import Constants as AdapterConstants
from azure.ai.agentserver.core.logger import get_logger
from azure.ai.agentserver.core.logger import APPINSIGHT_CONNSTR_ENV_NAME, get_logger
from azure.ai.agentserver.core.models import (
CreateResponse,
Response as OpenAIResponse,
Expand Down Expand Up @@ -77,7 +77,7 @@ def _resolve_stream_timeout(self, request_body: CreateResponse) -> float:

def init_tracing(self):
exporter = os.environ.get(AdapterConstants.OTEL_EXPORTER_ENDPOINT)
app_insights_conn_str = os.environ.get(AdapterConstants.APPLICATION_INSIGHTS_CONNECTION_STRING)
app_insights_conn_str = os.environ.get(APPINSIGHT_CONNSTR_ENV_NAME)
project_endpoint = os.environ.get(AdapterConstants.AZURE_AI_PROJECT_ENDPOINT)

if project_endpoint:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def _append_function_result_content(self, content: FunctionResultContent, sink:
result = [raw]
elif isinstance(raw, list):
for item in raw:
result.append(self._coerce_result_text(item)) # type: ignore
result.append(self._coerce_result_text(item)) # type: ignore
call_id = getattr(content, "call_id", None) or ""
func_out_id = self._context.id_generator.generate_function_output_id()
sink.append(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,7 @@ def build_response(self, status: str) -> OpenAIResponse:
"id": self._response_id,
"status": status,
"created_at": self._response_created_at,
"conversation": self._context.get_conversation_object(),
}
if status == "completed" and self._completed_output_items:
response_data["output"] = self._completed_output_items
Expand Down
6 changes: 6 additions & 0 deletions sdk/agentserver/azure-ai-agentserver-core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Release History


## 1.0.0b2 (2025-11-10)

Fixed some bugs


## 1.0.0b1 (2025-11-07)

### Features Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

VERSION = "1.0.0b1"
VERSION = "1.0.0b2"
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
# ---------------------------------------------------------
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"
ENABLE_APPLICATION_INSIGHTS_LOGGER = "AGENT_APP_INSIGHTS_ENABLED"
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@

request_context = contextvars.ContextVar("request_context", default=None)

APPINSIGHT_CONNSTR_ENV_NAME = "APPLICATIONINSIGHTS_CONNECTION_STRING"


def get_dimensions():
env_values = {name: value for name, value in vars(Constants).items() if not name.startswith("_")}
Expand Down Expand Up @@ -58,9 +60,9 @@ def get_project_endpoint():

def get_application_insights_connstr():
try:
conn_str = os.environ.get(Constants.APPLICATION_INSIGHTS_CONNECTION_STRING)
conn_str = os.environ.get(APPINSIGHT_CONNSTR_ENV_NAME)
if not conn_str:
print("environment variable APPLICATION_INSIGHTS_CONNECTION_STRING not set.")
print(f"environment variable {APPINSIGHT_CONNSTR_ENV_NAME} not set.")
project_endpoint = get_project_endpoint()
if project_endpoint:
# try to get the project connected application insights
Expand All @@ -72,7 +74,7 @@ def get_application_insights_connstr():
if not conn_str:
print(f"no connected application insights found for project:{project_endpoint}")
else:
os.environ[Constants.APPLICATION_INSIGHTS_CONNECTION_STRING] = conn_str
os.environ[APPINSIGHT_CONNSTR_ENV_NAME] = conn_str
return conn_str
except Exception as e:
print(f"failed to get application insights with error: {e}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from starlette.types import ASGIApp

from ..constants import Constants
from ..logger import get_logger, request_context
from ..logger import APPINSIGHT_CONNSTR_ENV_NAME, get_logger, request_context
from ..models import (
Response as OpenAIResponse,
ResponseStreamEvent,
Expand Down Expand Up @@ -93,7 +93,7 @@ async def runs_endpoint(request):
kind=trace.SpanKind.SERVER,
):
try:
logger.info("Start processing CreateResponse request:")
logger.info("Start processing CreateResponse request.")

context_carrier = {}
TraceContextTextMapPropagator().inject(context_carrier)
Expand All @@ -105,7 +105,7 @@ async def runs_endpoint(request):
try:
first_event = next(resp)
except Exception as e: # noqa: BLE001
err_msg = str(e) if DEBUG_ERRORS else "Internal error"
err_msg = _format_error(e)
logger.error("Generator initialization failed: %s\n%s", e, traceback.format_exc())
return JSONResponse({"error": err_msg}, status_code=500)

Expand All @@ -119,14 +119,14 @@ def gen():
for event in resp:
yield _event_to_sse_chunk(event)
except Exception as e: # noqa: BLE001
err_msg = str(e) if DEBUG_ERRORS else "Internal error"
err_msg = _format_error(e)
logger.error("Error in non-async generator: %s\n%s", e, traceback.format_exc())
payload = {"error": err_msg}
yield f"event: error\ndata: {json.dumps(payload)}\n\n"
yield "data: [DONE]\n\n"
error_sent = True
finally:
logger.info("End of processing CreateResponse request:")
logger.info("End of processing CreateResponse request.")
otel_context.detach(token)
if not error_sent:
yield "data: [DONE]\n\n"
Expand All @@ -143,7 +143,7 @@ def empty_gen():

return StreamingResponse(empty_gen(), media_type="text/event-stream")
except Exception as e: # noqa: BLE001
err_msg = str(e) if DEBUG_ERRORS else "Internal error"
err_msg = _format_error(e)
logger.error("Async generator initialization failed: %s\n%s", e, traceback.format_exc())
return JSONResponse({"error": err_msg}, status_code=500)

Expand All @@ -157,7 +157,7 @@ async def gen_async():
async for event in resp:
yield _event_to_sse_chunk(event)
except Exception as e: # noqa: BLE001
err_msg = str(e) if DEBUG_ERRORS else "Internal error"
err_msg = _format_error(e)
logger.error("Error in async generator: %s\n%s", e, traceback.format_exc())
payload = {"error": err_msg}
yield f"event: error\ndata: {json.dumps(payload)}\n\n"
Expand Down Expand Up @@ -261,7 +261,7 @@ def run(self, port: int = int(os.environ.get("DEFAULT_AD_PORT", 8088))) -> None:

def init_tracing(self):
exporter = os.environ.get(Constants.OTEL_EXPORTER_ENDPOINT)
app_insights_conn_str = os.environ.get(Constants.APPLICATION_INSIGHTS_CONNECTION_STRING)
app_insights_conn_str = os.environ.get(APPINSIGHT_CONNSTR_ENV_NAME)
if exporter or app_insights_conn_str:
from opentelemetry.sdk.resources import Resource
from opentelemetry.sdk.trace import TracerProvider
Expand Down Expand Up @@ -311,5 +311,14 @@ def _event_to_sse_chunk(event: ResponseStreamEvent) -> str:
return f"data: {event_data}\n\n"


def _format_error(exc: Exception) -> str:
message = str(exc)
if message:
return message
if DEBUG_ERRORS:
return repr(exc)
return "Internal error"


def _to_response(result: Union[Response, dict]) -> Response:
return result if isinstance(result, Response) else JSONResponse(result)
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def stream(self) -> bool:
def get_agent_id_object(self) -> AgentId:
agent = self.request.get("agent")
if not agent:
return None # type: ignore
return None # type: ignore
return AgentId(
{
"type": agent.type,
Expand All @@ -57,7 +57,7 @@ def get_agent_id_object(self) -> AgentId:

def get_conversation_object(self) -> ResponseConversation1:
if not self._conversation_id:
return None # type: ignore
return None # type: ignore
return ResponseConversation1(id=self._conversation_id)


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

def _deserialize_agent_reference(payload: dict) -> AgentReference:
if not payload:
return None # type: ignore
return None # type: ignore
return AgentReference(**payload)
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def _new_id(

infix = infix or ""
prefix_part = f"{prefix}{delimiter}" if prefix else ""
return f"{prefix_part}{entropy}{infix}{pkey}"
return f"{prefix_part}{infix}{pkey}{entropy}"

@staticmethod
def _secure_entropy(string_length: int) -> str:
Expand Down
6 changes: 6 additions & 0 deletions sdk/agentserver/azure-ai-agentserver-langgraph/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Release History


## 1.0.0b2 (2025-11-10)

Fixed some bugs


## 1.0.0b1 (2025-11-07)

### Features Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

VERSION = "1.0.0b1"
VERSION = "1.0.0b2"
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def try_process_message(

return is_processed, next_processor, events

def on_start( # mypy: ignore[override]
def on_start( # mypy: ignore[override]
self, event, run_details, stream_state: StreamEventState
) -> tuple[bool, List[project_models.ResponseStreamEvent]]:
if self.started:
Expand All @@ -81,8 +81,9 @@ def on_start( # mypy: ignore[override]

return True, [start_event]

def on_end(self, message, context, stream_state: StreamEventState
) -> List[project_models.ResponseStreamEvent]: # mypy: ignore[override]
def on_end(
self, message, context, stream_state: StreamEventState
) -> List[project_models.ResponseStreamEvent]: # mypy: ignore[override]
aggregated_content = self.item_content_helper.create_item_content()
done_event = project_models.ResponseContentPartDoneEvent(
item_id=self.item_id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ def __init__(self, logger, parent):
self.parent = parent # parent generator

def try_process_message(
self,
message: AnyMessage, # mypy: ignore[valid-type]
context: AgentRunContext,
stream_state: StreamEventState
): # mypy: ignore[empty-body]
self,
message: AnyMessage, # mypy: ignore[valid-type]
context: AgentRunContext,
stream_state: StreamEventState,
): # mypy: ignore[empty-body]
"""
Try to process the incoming message.

Expand All @@ -63,8 +63,8 @@ def on_start(self) -> tuple[bool, List[project_models.ResponseStreamEvent]]:
return False, []

def on_end(
self, message: AnyMessage, context: AgentRunContext, stream_state: StreamEventState
) -> tuple[bool, List[project_models.ResponseStreamEvent]]:
self, message: AnyMessage, context: AgentRunContext, stream_state: StreamEventState
) -> tuple[bool, List[project_models.ResponseStreamEvent]]:
"""
Generate the ending events for this layer.
TODO: handle different end conditions, e.g. normal end, error end, etc.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def process(
self.aggregated_content += item
stream_state.sequence_number += 1
res.append(chunk_event)
return True, self, res # mypy: ignore[return-value]
return True, self, res # mypy: ignore[return-value]
return False, self, []

def has_finish_reason(self, message) -> bool:
Expand All @@ -92,7 +92,7 @@ def should_end(self, message) -> bool:
return True
return False

def on_end( # mypy: ignore[override]
def on_end( # mypy: ignore[override]
self, message, context: AgentRunContext, stream_state: StreamEventState
) -> tuple[bool, List[project_models.ResponseStreamEvent]]:
if not self.started:
Expand Down
Loading