diff --git a/python/samples/demos/travel_planning_system/agents.py b/python/samples/demos/travel_planning_system/agents.py index d83e316d1b75..3455898f7ce7 100644 --- a/python/samples/demos/travel_planning_system/agents.py +++ b/python/samples/demos/travel_planning_system/agents.py @@ -1,8 +1,8 @@ # Copyright (c) Microsoft. All rights reserved. from semantic_kernel.agents import ChatCompletionAgent -from semantic_kernel.connectors.ai.open_ai import AzureChatCompletion from semantic_kernel.functions import kernel_function +from reasoning_agent import create_reasoning_compatible_agent _BASE_SYSTEM_MSG = ( "You are a helpful travel planning assistant. Always be professional and provide accurate information." @@ -52,59 +52,52 @@ def search_flights(self, origin: str, destination: str, date: str) -> str: def get_agents() -> dict[str, ChatCompletionAgent]: """Creates and returns a set of agents for the travel planning system.""" - # 1. Conversation Manager Agent - conversation_manager = ChatCompletionAgent( + print("Using ReasoningCompatibleAgent (auto-detects standard vs reasoning models)") + + # Create reasoning-compatible agents that auto-detect model type + conversation_manager = create_reasoning_compatible_agent( name="conversation_manager", description="Manages conversation flow and coordinates between agents", - instructions=f"{_BASE_SYSTEM_MSG} You coordinate the conversation and ensure users get comprehensive help.", - service=AzureChatCompletion(), + instructions="You are a conversation manager for a travel planning system. " + "Coordinate between different agents to help users plan their trips.", ) - # 2. Travel Planner Agent - planner = ChatCompletionAgent( + planner = create_reasoning_compatible_agent( name="planner", description="Creates comprehensive travel plans including flights, hotels, and activities", - instructions=( - f"{_BASE_SYSTEM_MSG} You create detailed travel plans that include flights, hotels, and activities." - ), - service=AzureChatCompletion(), + instructions="You are a travel planner. Create detailed travel itineraries " + "including flights, hotels, and activities based on user preferences.", plugins=[PlanningPlugin()], ) - # 3. Router Agent - router = ChatCompletionAgent( + router = create_reasoning_compatible_agent( name="router", description="Routes tasks to appropriate specialized agents", - instructions=f"{_BASE_SYSTEM_MSG} You analyze plans and delegate tasks to the right specialized agents.", - service=AzureChatCompletion(), + instructions="You are a router agent. Analyze user requests and direct them " + "to the most appropriate specialist agent.", ) - # 4. Destination Expert Agent - destination_expert = ChatCompletionAgent( + destination_expert = create_reasoning_compatible_agent( name="destination_expert", description="Expert in destination recommendations and local information", - instructions=( - f"{_BASE_SYSTEM_MSG} You provide expert advice on destinations, attractions, and local experiences." - ), - service=AzureChatCompletion(), + instructions="You are a destination expert. Provide detailed information about " + "travel destinations, local attractions, and travel tips.", plugins=[PlanningPlugin()], ) - # 5. Flight Agent - flight_agent = ChatCompletionAgent( + flight_agent = create_reasoning_compatible_agent( name="flight_agent", description="Specializes in flight booking", - instructions=f"{_BASE_SYSTEM_MSG} You handle all flight-related tasks including booking.", - service=AzureChatCompletion(), + instructions="You are a flight booking specialist. Help users search for " + "and book flights that meet their travel needs.", plugins=[FlightPlugin()], ) - # 6. Hotel Agent - hotel_agent = ChatCompletionAgent( + hotel_agent = create_reasoning_compatible_agent( name="hotel_agent", description="Specializes in hotel booking", - instructions=f"{_BASE_SYSTEM_MSG} You handle all hotel-related tasks including booking.", - service=AzureChatCompletion(), + instructions="You are a hotel booking specialist. Help users search for " + "and book hotels that meet their accommodation needs.", plugins=[HotelPlugin()], ) diff --git a/python/samples/demos/travel_planning_system/azure_reasoning_service.py b/python/samples/demos/travel_planning_system/azure_reasoning_service.py new file mode 100644 index 000000000000..0ce632c47dd2 --- /dev/null +++ b/python/samples/demos/travel_planning_system/azure_reasoning_service.py @@ -0,0 +1,120 @@ +"""Azure OpenAI Reasoning Service for o3/o1 models.""" + +import logging +import os +from typing import Any, List +import httpx +from semantic_kernel.connectors.ai.open_ai.services.azure_chat_completion import AzureChatCompletion +from semantic_kernel.contents import ChatHistory, ChatMessageContent, AuthorRole +from semantic_kernel.exceptions import ServiceResponseException + +logger = logging.getLogger(__name__) + + +class AzureReasoningCompletion(AzureChatCompletion): + """Azure OpenAI Reasoning service for o3/o1 models that use the reasoning API.""" + + async def get_chat_message_contents( + self, + chat_history: ChatHistory, + settings, + **kwargs: Any, + ) -> List[ChatMessageContent]: + """Override to use reasoning API endpoint with Chain of Thought enhancement.""" + try: + # Convert chat history to reasoning API format + messages = [] + for message in chat_history.messages: + # Skip system messages as they're not supported by reasoning models + if message.role == AuthorRole.SYSTEM: + continue + + # Enhance user messages with chain-of-thought prompting + content = message.content + if message.role == AuthorRole.USER and content: + # Check if this is a planning/complex task that would benefit from CoT + cot_keywords = ["plan", "book", "find", "search", "recommend", "budget", "analyze", "compare"] + if any(keyword in content.lower() for keyword in cot_keywords): + content = f"Think step by step about this request. {content}" + + messages.append({ + "role": str(message.role), + "content": content + }) + + # Prepare reasoning API request + request_data = { + "messages": messages, + "max_completion_tokens": getattr(settings, "max_tokens", 4000), + "temperature": getattr(settings, "temperature", 0.7), + } + + # Get configuration from environment variables + endpoint = os.getenv("AZURE_OPENAI_ENDPOINT", "").rstrip('/') + api_key = os.getenv("AZURE_OPENAI_API_KEY", "") + deployment_name = os.getenv("AZURE_OPENAI_CHAT_DEPLOYMENT_NAME", "o3-mini") + api_version = os.getenv("AZURE_OPENAI_API_VERSION", "2024-12-01-preview") + + # Use reasoning endpoint instead of chat/completions + url = f"{endpoint}/openai/deployments/{deployment_name}/reasoning/completions" + + headers = { + "Content-Type": "application/json", + "api-key": api_key, + } + + logger.info(f"Making reasoning API call to: {url}") + logger.info(f"Deployment: {deployment_name}, API Version: {api_version}") + + # Make the API call + async with httpx.AsyncClient() as client: + response = await client.post( + url=url, + headers=headers, + json=request_data, + params={"api-version": api_version}, + timeout=120.0 # Reasoning models can take longer + ) + + if response.status_code != 200: + error_text = response.text + logger.error(f"Azure Reasoning API error: {response.status_code} - {error_text}") + logger.error(f"Request URL: {url}") + logger.error(f"API Version: {api_version}") + + raise ServiceResponseException( + f"Azure Reasoning API failed with status {response.status_code}: {error_text}" + ) + + response_data = response.json() + logger.info(f"Reasoning API response received successfully") + + # Extract the response content + if "choices" in response_data and len(response_data["choices"]) > 0: + content = response_data["choices"][0]["message"]["content"] + return [ChatMessageContent( + role=AuthorRole.ASSISTANT, + content=content, + model_id=deployment_name + )] + else: + raise ServiceResponseException("No valid response from Azure Reasoning API") + + except httpx.RequestError as e: + logger.error(f"Request error calling Azure Reasoning API: {e}") + raise ServiceResponseException(f"Request failed: {e}") + except Exception as e: + logger.error(f"Unexpected error in Azure Reasoning API: {e}") + raise ServiceResponseException(f"Azure Reasoning service error: {e}") + + async def get_streaming_chat_message_contents( + self, + chat_history: ChatHistory, + settings, + **kwargs: Any, + ): + """Reasoning models don't typically support streaming, fall back to non-streaming.""" + results = await self.get_chat_message_contents(chat_history, settings, **kwargs) + # Simulate streaming by yielding the full response + for result in results: + yield result diff --git a/python/samples/demos/travel_planning_system/group_chat_based_system.py b/python/samples/demos/travel_planning_system/group_chat_based_system.py index 77a7780f3ed7..798ee846279b 100644 --- a/python/samples/demos/travel_planning_system/group_chat_based_system.py +++ b/python/samples/demos/travel_planning_system/group_chat_based_system.py @@ -1,12 +1,16 @@ # Copyright (c) Microsoft. All rights reserved. - +# flake8: noqa import asyncio import sys - +import json +import os from opentelemetry import trace +from opentelemetry.trace import Status, StatusCode, NoOpTracerProvider from samples.demos.travel_planning_system.agents import get_agents from samples.demos.travel_planning_system.observability import enable_observability +from samples.demos.travel_planning_system.reasoning_agent import create_reasoning_compatible_agent + from semantic_kernel.agents import ( BooleanResult, ChatCompletionAgent, @@ -16,7 +20,9 @@ StringResult, ) from semantic_kernel.agents.runtime import InProcessRuntime -from semantic_kernel.connectors.ai.open_ai import AzureChatCompletion, AzureChatPromptExecutionSettings +from semantic_kernel.connectors.ai.open_ai import ( + AzureChatPromptExecutionSettings, +) from semantic_kernel.contents import ( AuthorRole, ChatHistory, @@ -27,6 +33,15 @@ ) from semantic_kernel.functions.kernel_arguments import KernelArguments +from langfuse import Langfuse + +langfuse = Langfuse( + secret_key=os.getenv("LANGFUSE_SECRET_KEY"), + public_key=os.getenv("LANGFUSE_PUBLIC_KEY"), + host="https://us.cloud.langfuse.com" +) + + if sys.version_info >= (3, 12): from typing import override # pragma: no cover else: @@ -38,15 +53,65 @@ def streaming_agent_response_callback(message: StreamingChatMessageContent, is_final: bool) -> None: - """Observer function to print the messages from the agents. - - Args: - message (StreamingChatMessageContent): The streaming message content from the agent. - is_final (bool): Indicates if this is the final part of the message. - """ + """Observer function to print the messages from the agents with minimal telemetry.""" global is_new_message + + # Only create span for final messages to reduce duplicate spans + if is_final: + tracer = trace.get_tracer(__name__) + with tracer.start_as_current_span("streaming_message_final") as stream_span: + stream_span.set_attributes({ + "gen_ai.operation.name": "memory_operation", + "gen_ai.memory.operation_type": "write", + "gen_ai.memory.source_type": "streaming_response", + "message.agent_name": message.name, + "message.content_length": len(message.content) if message.content else 0, + "message.processing_complete": True + }) + + # ENHANCED: Add input/output visibility for Langfuse + if message.content: + # Add the actual message content as an event for Langfuse visibility + stream_span.add_event("gen_ai.content.completion", { + "gen_ai.completion": str(message.content)[:1000], # Truncate for safety + "gen_ai.assistant.message": str(message.content)[:1000], + "output.agent": message.name, + "output.type": "streaming_final", + "output.role": str(message.role) + }) + + # ENHANCED: Capture function calls and results + function_calls = [] + function_results = [] + + for item in message.items: + if isinstance(item, FunctionCallContent): + function_calls.append({ + "function": item.name, + "arguments": str(item.arguments)[:500] # Truncate arguments + }) + elif isinstance(item, FunctionResultContent): + function_results.append({ + "function": item.name, + "result": str(item.result)[:500] # Truncate results + }) + + if function_calls: + stream_span.add_event("gen_ai.tool.calls", { + "tool.calls": json.dumps(function_calls), + "tool.call_count": len(function_calls), + "agent": message.name + }) + + if function_results: + stream_span.add_event("gen_ai.tool.results", { + "tool.results": json.dumps(function_results), + "tool.result_count": len(function_results), + "agent": message.name + }) + + if is_new_message: - print(f"# {message.name}") is_new_message = False print(message.content, end="", flush=True) @@ -76,14 +141,14 @@ class AgentBaseGroupChatManager(GroupChatManager): def __init__(self, **kwargs): """Initialize the base group chat manager with a ChatCompletionAgent.""" - agent = ChatCompletionAgent( + agent = create_reasoning_compatible_agent( name="Manager", description="The manager of the group chat, responsible for coordinating the agents.", instructions=( - "You are the manager of the group chat. " - "Your role is to coordinate the agents and ensure they satisfy the user's request. " + "You are the manager of a group chat for travel planning. " + "Coordinate the conversation between different travel agents " + "to help users plan their trips effectively." ), - service=AzureChatCompletion(), ) super().__init__(agent=agent, **kwargs) @@ -91,27 +156,48 @@ def __init__(self, **kwargs): @override async def should_request_user_input(self, chat_history: ChatHistory) -> BooleanResult: """Determine if the manager should request user input based on the chat history.""" - if len(chat_history.messages) == 0: - return BooleanResult( - result=False, - reason="No agents have spoken yet.", - ) - - last_message = chat_history.messages[-1] - if last_message.role == AuthorRole.USER: - return BooleanResult( - result=False, - reason="User input is not needed if the last message is from the user.", - ) - - messages = chat_history.messages[:] - messages.append(ChatMessageContent(role=AuthorRole.USER, content="Does the group need further user input?")) - - settings = AzureChatPromptExecutionSettings() - settings.response_format = BooleanResult - - response = await self.agent.get_response(messages, arguments=KernelArguments(settings=settings)) - return BooleanResult.model_validate_json(response.message.content) + tracer = trace.get_tracer(__name__) + + with tracer.start_as_current_span("planning_user_input_assessment") as plan_span: + plan_span.set_attributes({ + "gen_ai.operation.name": "plan_task", + "gen_ai.planning.type": "user_input_assessment", + "gen_ai.planning.complexity": "simple", + "gen_ai.planning.stage": "interaction_control", + "chat.message_count": len(chat_history.messages), + "chat.last_message_role": str(chat_history.messages[-1].role) if chat_history.messages else "none" + }) + + if len(chat_history.messages) == 0: + plan_span.set_attribute("planning.decision", "no_input_needed_start") + return BooleanResult( + result=False, + reason="No agents have spoken yet.", + ) + + last_message = chat_history.messages[-1] + if last_message.role == AuthorRole.USER: + plan_span.set_attribute("planning.decision", "no_input_needed_recent") + return BooleanResult( + result=False, + reason="User input is not needed if the last message is from the user.", + ) + + messages = chat_history.messages[:] + messages.append(ChatMessageContent(role=AuthorRole.USER, content="Does the group need further user input?")) + + settings = AzureChatPromptExecutionSettings() + settings.response_format = BooleanResult + + response = await self.agent.get_response(messages, arguments=KernelArguments(settings=settings)) + result = BooleanResult.model_validate_json(response.message.content) + + plan_span.set_attributes({ + "planning.decision": "input_needed" if result.result else "continue_conversation", + "planning.decision_reasoning": result.reason + }) + + return result @override async def should_terminate(self, chat_history: ChatHistory) -> BooleanResult: @@ -147,92 +233,243 @@ async def select_next_agent( participant_descriptions: dict[str, str], ) -> StringResult: """Provide concrete implementation for selecting the next agent to speak.""" - messages = chat_history.messages[:] - messages.append( - ChatMessageContent( - role=AuthorRole.USER, - content=( - "Who should speak next based on the conversation? Pick one agent from the participants:\n" - + "\n".join([f"{k}: {v}" for k, v in participant_descriptions.items()]) - + "\nPlease provide the agent's name." - ), - ) - ) - - settings = AzureChatPromptExecutionSettings() - settings.response_format = StringResult - - response = await self.agent.get_response(messages, arguments=KernelArguments(settings=settings)) - result = StringResult.model_validate_json(response.message.content) - - if result.result not in participant_descriptions: - raise ValueError( - f"Selected agent '{result.result}' is not in the list of participants: " - f"{list(participant_descriptions.keys())}" + tracer = trace.get_tracer(__name__) + + with tracer.start_as_current_span("agent_selection_planning") as selection_span: + selection_span.set_attributes({ + "gen_ai.planning.type": "plan_task", + "gen_ai.planning.complexity": "moderate", + "gen_ai.planning.stage": "agent_coordination", + "gen_ai.operation.name": "plan_task", + "agent.selection.total_participants": len(participant_descriptions), + "agent.selection.available_agents": list(participant_descriptions.keys()), + "agent.selection.conversation_length": len(chat_history.messages) + }) + + messages = chat_history.messages[:] + messages.append( + ChatMessageContent( + role=AuthorRole.USER, + content=( + "Who should speak next based on the conversation? Pick ONE agent from the participants:\n" + + "\n".join([f"- {k}: {v}" for k, v in participant_descriptions.items()]) + + "\n\nYou must respond with a JSON object containing exactly the agent name from the list above.\n" + + "Format: {\"result\": \"agent_name\", \"reason\": \"explanation\"}\n" + + f"Valid agent names: {list(participant_descriptions.keys())}\n" + + "The 'result' field must contain ONLY the agent name, nothing else." + ), + ) ) - return result - + settings = AzureChatPromptExecutionSettings() + settings.response_format = StringResult + + response = await self.agent.get_response(messages, arguments=KernelArguments(settings=settings)) + result = StringResult.model_validate_json(response.message.content) + + # Enhanced validation and error handling + selected_agent = result.result.strip() + + # Check if the result contains extra text and try to extract the agent name + if selected_agent not in participant_descriptions: + # Try to find a valid agent name within the response + for agent_name in participant_descriptions.keys(): + if agent_name in selected_agent: + selection_span.set_attribute("agent.selection.corrected", f"from '{selected_agent}' to '{agent_name}'") + result.result = agent_name + selected_agent = agent_name + break + + # If still not found, raise the error with better debugging info + if selected_agent not in participant_descriptions: + selection_span.set_attribute("agent.selection.error", "invalid_agent_selected") + selection_span.set_attribute("agent.selection.raw_response", response.message.content[:500]) + raise ValueError( + f"Selected agent '{selected_agent}' is not in the list of participants: " + f"{list(participant_descriptions.keys())}. Raw response: {response.message.content[:200]}" + ) + + selection_span.set_attributes({ + "agent.selection.selected": selected_agent, + "agent.selection.reasoning": result.reason, + "planning.decision": "agent_selected" + }) + + return result + @override async def filter_results( self, chat_history: ChatHistory, ) -> MessageResult: """Provide concrete implementation for filtering results.""" - messages = chat_history.messages[:] - messages.append(ChatMessageContent(role=AuthorRole.USER, content="Please summarize the conversation.")) - - settings = AzureChatPromptExecutionSettings() - settings.response_format = StringResult - - response = await self.agent.get_response(messages, arguments=KernelArguments(settings=settings)) - string_with_reason = StringResult.model_validate_json(response.message.content) - - return MessageResult( - result=ChatMessageContent( - role=AuthorRole.ASSISTANT, - content=string_with_reason.result, - ), - reason=string_with_reason.reason, - ) + tracer = trace.get_tracer(__name__) + + with tracer.start_as_current_span("memory_operation_summary") as memory_span: + memory_span.set_attributes({ + "gen_ai.operation.name": "memory_operation", + "gen_ai.memory.operation_type": "write", + "gen_ai.memory.source_type": "conversation_summary", + "gen_ai.memory.memory_type": "working", + "gen_ai.memory.size_bytes": len(str(chat_history.messages)) * 2, + "conversation.message_count": len(chat_history.messages) + }) + + messages = chat_history.messages[:] + messages.append(ChatMessageContent(role=AuthorRole.USER, content="Please summarize the conversation.")) + + settings = AzureChatPromptExecutionSettings() + settings.response_format = StringResult + + response = await self.agent.get_response(messages, arguments=KernelArguments(settings=settings)) + string_with_reason = StringResult.model_validate_json(response.message.content) + + memory_span.set_attributes({ + "memory.summary_length": len(string_with_reason.result), + "memory.summary_generated": True, + "memory.result_processed": True + }) + + return MessageResult( + result=ChatMessageContent( + role=AuthorRole.ASSISTANT, + content=string_with_reason.result, + ), + reason=string_with_reason.reason, + ) @enable_observability async def main(): - """Main function to run the agents.""" - # 1. Create a Group Chat orchestration with multiple agents - agents: dict[str, ChatCompletionAgent] = get_agents() - group_chat_orchestration = GroupChatOrchestration( - members=[ - agents["planner"], - agents["flight_agent"], - agents["hotel_agent"], - ], - manager=AgentBaseGroupChatManager(max_rounds=20, human_response_function=human_response_function), - streaming_agent_response_callback=streaming_agent_response_callback, - ) - - # 2. Create a runtime and start it - runtime = InProcessRuntime() - runtime.start() - - # 3. Invoke the orchestration with a task and the runtime - orchestration_result = await group_chat_orchestration.invoke( - task=( - "Plan a trip to bali for 5 days including flights, hotels, and " + """Main function to run the agents with comprehensive telemetry.""" + tracer = trace.get_tracer(__name__) + + # Create comprehensive session context + with tracer.start_as_current_span("travel_planning_session") as session_span: + session_span.set_attributes({ + "user.id": "demo_user_enhanced", + "conversation.id": "conv_enhanced_001", + "session.type": "enhanced_multi_agent_demo", + # Langfuse-specific attributes + "langfuse.trace.type": "multi_agent_orchestration", + "langfuse.version": "1.0", + "langfuse.session_type": "group_chat" + }) + + # 1. Create a Group Chat orchestration with multiple agents + with tracer.start_as_current_span("agent_initialization") as init_span: + init_span.set_attributes({ + "gen_ai.operation.name": "execute_task", + "gen_ai.task.id": "agent_setup_001", + "gen_ai.task.description": "Initialize multi-agent system" + }) + + agents: dict[str, ChatCompletionAgent] = get_agents() + init_span.set_attribute("agents.count", len(agents)) + init_span.set_attribute("agents.names", list(agents.keys())) + + # Enhanced orchestration with telemetry + with tracer.start_as_current_span("orchestration_setup") as setup_span: + setup_span.set_attributes({ + "gen_ai.operation.name": "execute_task", + "gen_ai.task.id": "orchestration_setup_001", + "gen_ai.task.description": "Setup group chat orchestration" + }) + + group_chat_orchestration = GroupChatOrchestration( + members=[ + agents["planner"], + agents["flight_agent"], + agents["hotel_agent"], + ], + manager=AgentBaseGroupChatManager(max_rounds=20, human_response_function=human_response_function), + streaming_agent_response_callback=streaming_agent_response_callback, + ) + + # 2. Create a runtime and start it + runtime = InProcessRuntime(tracer_provider=NoOpTracerProvider()) + runtime.start() + + # 3. Comprehensive task execution with telemetry + task_description = ( + "Plan a trip to Bali for 5 days including flights, hotels, and " "activities for a vegetarian family of 4 members. The family lives in Seattle, WA, USA. " - "Their vacation starts on July 30th 2025. their have a strict budget of $5000 for the trip. " - "Please provide a detailed plan and make the necessary hotel and flight bookings." - ), - runtime=runtime, - ) - - # 4. Wait for the results - value = await orchestration_result.get() - print(value) - - # 5. Stop the runtime after the invocation is complete - await runtime.stop_when_idle() + "Their vacation starts on July 30th 2025. They have a strict budget of $5000 for the trip. " + "Please think through this step-by-step: first assess the budget allocation, then find suitable flights, " + "select appropriate vegetarian-friendly accommodations, and plan activities. " + "Show your reasoning process and provide a detailed plan with the necessary bookings." + ) + session_span.add_event("gen_ai.content.prompt", { + "gen_ai.prompt": task_description, + "gen_ai.user.message": task_description, + "input.type": "user_request", + "input.source": "main_function", + "input.task_type": "multi_agent_planning", + "input.constraints": json.dumps({ + "budget": 5000, + "duration_days": 5, + "travelers": 4, + "dietary": "vegetarian", + "destination": "Bali", + "origin": "Seattle, WA" + }), + "langfuse.input": task_description # Langfuse-specific + }) + + with tracer.start_as_current_span("comprehensive_task_execution") as task_span: + task_span.set_attributes({ + "gen_ai.operation.name": "execute_task", + "gen_ai.system": "semantic_kernel_multi_agent", + "gen_ai.task.id": "bali_trip_planning_001", + "gen_ai.task.description": task_description, + "gen_ai.task.status": "in_progress", + "gen_ai.task.expected_output": "Complete travel plan with bookings", + "gen_ai.task.constraints": ["budget:5000", "duration:5_days", "travelers:4", "dietary:vegetarian"], + "gen_ai.task.assigned_agents": ["planner", "flight_agent", "hotel_agent"], + "task.destination": "Bali", + "task.duration_days": 5, + "task.travelers": 4, + "task.budget": 5000, + "task.expected_tool_usage": ["flight_search", "hotel_search", "planning_tools"] + }) + + # Invoke the orchestration with a task and the runtime + orchestration_result = await group_chat_orchestration.invoke( + task=task_description, + runtime=runtime, + ) + + # 4. Wait for the results with memory operation tracking + with tracer.start_as_current_span("result_processing") as result_span: + result_span.set_attributes({ + "gen_ai.operation.name": "memory_operation", + "gen_ai.memory.operation_type": "read", + "gen_ai.memory.source_type": "task_result" + }) + + value = await orchestration_result.get() + + result_span.set_attributes({ + "result.length": len(str(value)), + "result.success": True, + "memory.result_retrieved": True + }) + + print(f"\nāœ… Final Result:\n{value}") + + task_span.set_attribute("gen_ai.task.status", "completed") + session_span.add_event("gen_ai.content.completion", { + "gen_ai.completion": str(value)[:2000], # Truncate if too long + "gen_ai.assistant.message": str(value)[:2000], + "output.type": "final_travel_plan", + "output.source": "multi_agent_orchestration", + "output.success": True, + "langfuse.output": str(value)[:2000] # Langfuse-specific + }) + + # 5. Stop the runtime after the invocation is complete + await runtime.stop_when_idle() + if __name__ == "__main__": diff --git a/python/samples/demos/travel_planning_system/latest_trace_span.json b/python/samples/demos/travel_planning_system/latest_trace_span.json new file mode 100644 index 000000000000..9ddffdf40e54 --- /dev/null +++ b/python/samples/demos/travel_planning_system/latest_trace_span.json @@ -0,0 +1,7512 @@ +{ + "data": [ + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spans": [ + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "5fc115acec34efd6", + "operationName": "group_chat_manager.handle_response_message", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "d4be84bfde51cffa" + } + ], + "startTime": 1751314111206197, + "duration": 126281530, + "tags": [ + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "group_chat_manager.handle_response_message" + }, + { + "key": "group_chat.component", + "type": "string", + "value": "manager" + }, + { + "key": "group_chat.operation", + "type": "string", + "value": "handle_response_message" + }, + { + "key": "langfuse.component", + "type": "string", + "value": "group_chat_manager" + }, + { + "key": "langfuse.operation", + "type": "string", + "value": "handle_response_message" + }, + { + "key": "langfuse.success", + "type": "bool", + "value": true + }, + { + "key": "manager.id", + "type": "string", + "value": "GroupChatManagerActor_b18281f3cfae4704ae0ccdec4737ab33/default" + }, + { + "key": "operation.success", + "type": "bool", + "value": true + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.group_chat_diagnostics.decorators" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [ + { + "timestamp": 1751314237487714, + "fields": [ + { + "key": "event", + "type": "string", + "value": "group_chat.message_handled" + }, + { + "key": "event.type", + "type": "string", + "value": "message_processing_complete" + }, + { + "key": "langfuse.message_handled", + "type": "bool", + "value": true + }, + { + "key": "message.operation", + "type": "string", + "value": "handle_response_message" + }, + { + "key": "message.success", + "type": "bool", + "value": true + } + ] + } + ], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "d7d76be02f2e7660", + "operationName": "AutoFunctionInvocationLoop", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "b9eb809136d74104" + } + ], + "startTime": 1751314078917035, + "duration": 1377247, + "tags": [ + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.connectors.ai.chat_completion_client_base" + }, + { + "key": "sk.available_functions", + "type": "string", + "value": "" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "e467e0f38722e0de", + "operationName": "streaming_message_final", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "c6a941c11851f287" + } + ], + "startTime": 1751314085901196, + "duration": 70, + "tags": [ + { + "key": "gen_ai.memory.operation_type", + "type": "string", + "value": "write" + }, + { + "key": "gen_ai.memory.source_type", + "type": "string", + "value": "streaming_response" + }, + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "memory_operation" + }, + { + "key": "message.agent_name", + "type": "string", + "value": "planner" + }, + { + "key": "message.content_length", + "type": "int64", + "value": 804 + }, + { + "key": "message.processing_complete", + "type": "bool", + "value": true + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "__main__" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [ + { + "timestamp": 1751314085901233, + "fields": [ + { + "key": "event", + "type": "string", + "value": "gen_ai.content.completion" + }, + { + "key": "gen_ai.assistant.message", + "type": "string", + "value": "Step 1: Budget Allocation\nThe family has a strict budget of $5000 for 5 days. The main expenses are:\n- Flights (round trip for 4 people)\n- Hotels (5 nights)\n- Food (vegetarian)\n- Activities and local transportation\n\nEstimated budget breakdown:\n- Flights: $2000 (approx $500 per person round trip, since Bali flights can be expensive)\n- Hotels: $1000 (about $200 per night for a family room or 2 rooms)\n- Food: $400 ($20 per person per day, vegetarian meals can be affordable)\n- Activities and local transport: $600\n- Miscellaneous/Buffer: $1000 (flexibility for any extra costs or savings to be reallocated)\n\nNow I will find suitable flights for 4 people round trip Seattle (SEA) to Bali (Denpasar DPS) departing July 30, 2025 and returning August 4, 2025.\n\nSearching flights and hotels in parallel next." + }, + { + "key": "gen_ai.completion", + "type": "string", + "value": "Step 1: Budget Allocation\nThe family has a strict budget of $5000 for 5 days. The main expenses are:\n- Flights (round trip for 4 people)\n- Hotels (5 nights)\n- Food (vegetarian)\n- Activities and local transportation\n\nEstimated budget breakdown:\n- Flights: $2000 (approx $500 per person round trip, since Bali flights can be expensive)\n- Hotels: $1000 (about $200 per night for a family room or 2 rooms)\n- Food: $400 ($20 per person per day, vegetarian meals can be affordable)\n- Activities and local transport: $600\n- Miscellaneous/Buffer: $1000 (flexibility for any extra costs or savings to be reallocated)\n\nNow I will find suitable flights for 4 people round trip Seattle (SEA) to Bali (Denpasar DPS) departing July 30, 2025 and returning August 4, 2025.\n\nSearching flights and hotels in parallel next." + }, + { + "key": "output.agent", + "type": "string", + "value": "planner" + }, + { + "key": "output.role", + "type": "string", + "value": "AuthorRole.ASSISTANT" + }, + { + "key": "output.type", + "type": "string", + "value": "streaming_final" + } + ] + }, + { + "timestamp": 1751314085901263, + "fields": [ + { + "key": "event", + "type": "string", + "value": "gen_ai.tool.calls" + }, + { + "key": "agent", + "type": "string", + "value": "planner" + }, + { + "key": "tool.call_count", + "type": "int64", + "value": 3 + }, + { + "key": "tool.calls", + "type": "string", + "value": "[{\"function\": \"PlanningPlugin-search_flights\", \"arguments\": \"{\\\"origin\\\": \\\"Seattle\\\", \\\"destination\\\": \\\"Denpasar\\\", \\\"date\\\": \\\"2025-07-30\\\"}\"}, {\"function\": \"PlanningPlugin-search_flights\", \"arguments\": \"{\\\"origin\\\": \\\"Denpasar\\\", \\\"destination\\\": \\\"Seattle\\\", \\\"date\\\": \\\"2025-08-04\\\"}\"}, {\"function\": \"PlanningPlugin-search_hotels\", \"arguments\": \"{\\\"location\\\": \\\"Bali\\\", \\\"check_in\\\": \\\"2025-07-30\\\", \\\"check_out\\\": \\\"2025-08-04\\\"}\"}]" + } + ] + } + ], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "c01c5af080e5785e", + "operationName": "chat.streaming_completions gpt-4.1-mini", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "c6a941c11851f287" + } + ], + "startTime": 1751314085901672, + "duration": 4321459, + "tags": [ + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "chat.streaming_completions" + }, + { + "key": "gen_ai.request.model", + "type": "string", + "value": "gpt-4.1-mini" + }, + { + "key": "gen_ai.response.finish_reason", + "type": "string", + "value": "FinishReason.STOP" + }, + { + "key": "gen_ai.response.id", + "type": "string", + "value": "chatcmpl-BoF5KexGGC9y9WQ66c8meShxsvSgr" + }, + { + "key": "gen_ai.system", + "type": "string", + "value": "openai" + }, + { + "key": "gen_ai.usage.input_tokens", + "type": "int64", + "value": 782 + }, + { + "key": "gen_ai.usage.output_tokens", + "type": "int64", + "value": 367 + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.model_diagnostics.decorators" + }, + { + "key": "server.address", + "type": "string", + "value": "https://ai-naarkalgaihub999971652049.openai.azure.com/openai/deployments/gpt-4.1-mini/" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "c6a941c11851f287", + "operationName": "AutoFunctionInvocationLoop", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "26935a4b3fff3ba6" + } + ], + "startTime": 1751314081008602, + "duration": 9214557, + "tags": [ + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.connectors.ai.chat_completion_client_base" + }, + { + "key": "sk.available_functions", + "type": "string", + "value": "PlanningPlugin-get_weather,PlanningPlugin-search_flights,PlanningPlugin-search_hotels" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "ef6213d656ba75f1", + "operationName": "AutoFunctionInvocationLoop", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "b444d6f46d52638e" + } + ], + "startTime": 1751314092171072, + "duration": 1013420, + "tags": [ + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.connectors.ai.chat_completion_client_base" + }, + { + "key": "sk.available_functions", + "type": "string", + "value": "" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "83f9e3290dcd7730", + "operationName": "group_chat_manager.handle_response_message", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "d4be84bfde51cffa" + } + ], + "startTime": 1751314090237017, + "duration": 2950996, + "tags": [ + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "group_chat_manager.handle_response_message" + }, + { + "key": "group_chat.component", + "type": "string", + "value": "manager" + }, + { + "key": "group_chat.operation", + "type": "string", + "value": "handle_response_message" + }, + { + "key": "langfuse.component", + "type": "string", + "value": "group_chat_manager" + }, + { + "key": "langfuse.operation", + "type": "string", + "value": "handle_response_message" + }, + { + "key": "langfuse.success", + "type": "bool", + "value": true + }, + { + "key": "manager.id", + "type": "string", + "value": "GroupChatManagerActor_b18281f3cfae4704ae0ccdec4737ab33/default" + }, + { + "key": "operation.success", + "type": "bool", + "value": true + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.group_chat_diagnostics.decorators" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [ + { + "timestamp": 1751314093188002, + "fields": [ + { + "key": "event", + "type": "string", + "value": "group_chat.message_handled" + }, + { + "key": "event.type", + "type": "string", + "value": "message_processing_complete" + }, + { + "key": "langfuse.message_handled", + "type": "bool", + "value": true + }, + { + "key": "message.operation", + "type": "string", + "value": "handle_response_message" + }, + { + "key": "message.success", + "type": "bool", + "value": true + } + ] + } + ], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "633b1970c55e6a65", + "operationName": "group_chat_agent_message.invoke", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "d4be84bfde51cffa" + } + ], + "startTime": 1751314093191363, + "duration": 32, + "tags": [ + { + "key": "gen_ai.agent.description", + "type": "string", + "value": "Specializes in hotel booking" + }, + { + "key": "gen_ai.agent.id", + "type": "string", + "value": "d155cfa7-89ea-47d6-a912-5e348e5d086e" + }, + { + "key": "gen_ai.agent.name", + "type": "string", + "value": "hotel_agent" + }, + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "group_chat_agent_message.invoke" + }, + { + "key": "group_chat.component", + "type": "string", + "value": "agent_message_handler" + }, + { + "key": "group_chat.operation", + "type": "string", + "value": "invoke" + }, + { + "key": "operation.no_result", + "type": "bool", + "value": true + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.group_chat_diagnostics.decorators" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [ + { + "timestamp": 1751314093191387, + "fields": [ + { + "key": "event", + "type": "string", + "value": "group_chat.agent_invoke" + }, + { + "key": "event.type", + "type": "string", + "value": "agent_invocation" + }, + { + "key": "operation.phase", + "type": "string", + "value": "invoke" + } + ] + } + ], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "6df5c1998082f0af", + "operationName": "group_chat_agent_message.invoke", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "d4be84bfde51cffa" + } + ], + "startTime": 1751314104250486, + "duration": 54, + "tags": [ + { + "key": "gen_ai.agent.description", + "type": "string", + "value": "Creates comprehensive travel plans including flights, hotels, and activities" + }, + { + "key": "gen_ai.agent.id", + "type": "string", + "value": "423f3df4-872b-4359-9ef3-2d2c76ac1d57" + }, + { + "key": "gen_ai.agent.name", + "type": "string", + "value": "planner" + }, + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "group_chat_agent_message.invoke" + }, + { + "key": "group_chat.component", + "type": "string", + "value": "agent_message_handler" + }, + { + "key": "group_chat.operation", + "type": "string", + "value": "invoke" + }, + { + "key": "operation.no_result", + "type": "bool", + "value": true + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.group_chat_diagnostics.decorators" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [ + { + "timestamp": 1751314104250526, + "fields": [ + { + "key": "event", + "type": "string", + "value": "group_chat.agent_invoke" + }, + { + "key": "event.type", + "type": "string", + "value": "agent_invocation" + }, + { + "key": "operation.phase", + "type": "string", + "value": "invoke" + } + ] + } + ], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "75527d7dba2273f2", + "operationName": "chat.completions gpt-4.1-mini", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "a1b7b2e3746f3ef2" + } + ], + "startTime": 1751314090248327, + "duration": 1203822, + "tags": [ + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "chat.completions" + }, + { + "key": "gen_ai.request.model", + "type": "string", + "value": "gpt-4.1-mini" + }, + { + "key": "gen_ai.response.finish_reason", + "type": "string", + "value": "FinishReason.STOP" + }, + { + "key": "gen_ai.response.id", + "type": "string", + "value": "chatcmpl-BoF5PfL6qnlLLs7VTGiwe4uzGyud3" + }, + { + "key": "gen_ai.system", + "type": "string", + "value": "openai" + }, + { + "key": "gen_ai.usage.input_tokens", + "type": "int64", + "value": 821 + }, + { + "key": "gen_ai.usage.output_tokens", + "type": "int64", + "value": 34 + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.model_diagnostics.decorators" + }, + { + "key": "server.address", + "type": "string", + "value": "https://ai-naarkalgaihub999971652049.openai.azure.com/openai/deployments/gpt-4.1-mini/" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "6369dc1b8665f5f2", + "operationName": "group_chat_agent_message.handle_start_message", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "d4be84bfde51cffa" + } + ], + "startTime": 1751314078912488, + "duration": 30, + "tags": [ + { + "key": "gen_ai.agent.description", + "type": "string", + "value": "Specializes in hotel booking" + }, + { + "key": "gen_ai.agent.id", + "type": "string", + "value": "d155cfa7-89ea-47d6-a912-5e348e5d086e" + }, + { + "key": "gen_ai.agent.name", + "type": "string", + "value": "hotel_agent" + }, + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "group_chat_agent_message.handle_start_message" + }, + { + "key": "group_chat.component", + "type": "string", + "value": "agent_message_handler" + }, + { + "key": "group_chat.operation", + "type": "string", + "value": "handle_start_message" + }, + { + "key": "operation.no_result", + "type": "bool", + "value": true + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.group_chat_diagnostics.decorators" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [ + { + "timestamp": 1751314078912496, + "fields": [ + { + "key": "event", + "type": "string", + "value": "group_chat.conversation_start" + }, + { + "key": "event.type", + "type": "string", + "value": "conversation_initialization" + }, + { + "key": "operation.phase", + "type": "string", + "value": "start" + } + ] + } + ], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "f9737c160705a1f1", + "operationName": "chat.streaming_completions gpt-4.1-mini", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "c6a941c11851f287" + } + ], + "startTime": 1751314081008673, + "duration": 1263808, + "tags": [ + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "chat.streaming_completions" + }, + { + "key": "gen_ai.request.model", + "type": "string", + "value": "gpt-4.1-mini" + }, + { + "key": "gen_ai.response.finish_reason", + "type": "string", + "value": "FinishReason.TOOL_CALLS" + }, + { + "key": "gen_ai.response.id", + "type": "string", + "value": "chatcmpl-BoF5F1DqNvp7W7e1iqEmLfGYyGaDx" + }, + { + "key": "gen_ai.system", + "type": "string", + "value": "openai" + }, + { + "key": "gen_ai.usage.input_tokens", + "type": "int64", + "value": 236 + }, + { + "key": "gen_ai.usage.output_tokens", + "type": "int64", + "value": 19 + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.model_diagnostics.decorators" + }, + { + "key": "server.address", + "type": "string", + "value": "https://ai-naarkalgaihub999971652049.openai.azure.com/openai/deployments/gpt-4.1-mini/" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "b9eb809136d74104", + "operationName": "invoke_agent Manager", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "970271ca7e97b987" + } + ], + "startTime": 1751314078913999, + "duration": 1380388, + "tags": [ + { + "key": "gen_ai.agent.description", + "type": "string", + "value": "The manager of the group chat, responsible for coordinating the agents." + }, + { + "key": "gen_ai.agent.id", + "type": "string", + "value": "b45c5348-2a73-42b9-b3e2-0e0ff1ead8fa" + }, + { + "key": "gen_ai.agent.name", + "type": "string", + "value": "Manager" + }, + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "invoke_agent" + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.agent_diagnostics.decorators" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "28ccc2fde8bec883", + "operationName": "invoke_agent Manager", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "2388c73ebf76d864" + } + ], + "startTime": 1751314102331442, + "duration": 990827, + "tags": [ + { + "key": "gen_ai.agent.description", + "type": "string", + "value": "The manager of the group chat, responsible for coordinating the agents." + }, + { + "key": "gen_ai.agent.id", + "type": "string", + "value": "b45c5348-2a73-42b9-b3e2-0e0ff1ead8fa" + }, + { + "key": "gen_ai.agent.name", + "type": "string", + "value": "Manager" + }, + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "invoke_agent" + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.agent_diagnostics.decorators" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "ea3333b53a235736", + "operationName": "chat.completions gpt-4.1-mini", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "2dc6abd561a76333" + } + ], + "startTime": 1751314103387128, + "duration": 859492, + "tags": [ + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "chat.completions" + }, + { + "key": "gen_ai.request.model", + "type": "string", + "value": "gpt-4.1-mini" + }, + { + "key": "gen_ai.response.finish_reason", + "type": "string", + "value": "FinishReason.STOP" + }, + { + "key": "gen_ai.response.id", + "type": "string", + "value": "chatcmpl-BoF5bslpyA2MU5Gcjpu9fbuEQRGvu" + }, + { + "key": "gen_ai.system", + "type": "string", + "value": "openai" + }, + { + "key": "gen_ai.usage.input_tokens", + "type": "int64", + "value": 1547 + }, + { + "key": "gen_ai.usage.output_tokens", + "type": "int64", + "value": 51 + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.model_diagnostics.decorators" + }, + { + "key": "server.address", + "type": "string", + "value": "https://ai-naarkalgaihub999971652049.openai.azure.com/openai/deployments/gpt-4.1-mini/" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "ca47586544854ce3", + "operationName": "main", + "references": [], + "startTime": 1751314078788543, + "duration": 158700034, + "tags": [ + { + "key": "otel.scope.name", + "type": "string", + "value": "samples.demos.travel_planning_system.observability" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "3f5236ebfe267b5b", + "operationName": "group_chat_agent_message.handle_start_message", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "d4be84bfde51cffa" + } + ], + "startTime": 1751314078912083, + "duration": 55, + "tags": [ + { + "key": "gen_ai.agent.description", + "type": "string", + "value": "Creates comprehensive travel plans including flights, hotels, and activities" + }, + { + "key": "gen_ai.agent.id", + "type": "string", + "value": "423f3df4-872b-4359-9ef3-2d2c76ac1d57" + }, + { + "key": "gen_ai.agent.name", + "type": "string", + "value": "planner" + }, + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "group_chat_agent_message.handle_start_message" + }, + { + "key": "group_chat.component", + "type": "string", + "value": "agent_message_handler" + }, + { + "key": "group_chat.operation", + "type": "string", + "value": "handle_start_message" + }, + { + "key": "operation.no_result", + "type": "bool", + "value": true + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.group_chat_diagnostics.decorators" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [ + { + "timestamp": 1751314078912096, + "fields": [ + { + "key": "event", + "type": "string", + "value": "group_chat.conversation_start" + }, + { + "key": "event.type", + "type": "string", + "value": "conversation_initialization" + }, + { + "key": "operation.phase", + "type": "string", + "value": "start" + } + ] + } + ], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "9a4cf7fae71c1a41", + "operationName": "execute_tool PlanningPlugin-get_weather", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "c6a941c11851f287" + } + ], + "startTime": 1751314082275782, + "duration": 933, + "tags": [ + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "execute_tool" + }, + { + "key": "gen_ai.tool.call.id", + "type": "string", + "value": "call_5ki7H8uHRMIgiYDY66EiVrcL" + }, + { + "key": "gen_ai.tool.description", + "type": "string", + "value": "Get weather information for a location." + }, + { + "key": "gen_ai.tool.name", + "type": "string", + "value": "PlanningPlugin-get_weather" + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.functions.kernel_function" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "5ca386bb692d2174", + "operationName": "group_chat_agent_message.invoke", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "d4be84bfde51cffa" + } + ], + "startTime": 1751314093188775, + "duration": 46, + "tags": [ + { + "key": "gen_ai.agent.description", + "type": "string", + "value": "Creates comprehensive travel plans including flights, hotels, and activities" + }, + { + "key": "gen_ai.agent.id", + "type": "string", + "value": "423f3df4-872b-4359-9ef3-2d2c76ac1d57" + }, + { + "key": "gen_ai.agent.name", + "type": "string", + "value": "planner" + }, + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "group_chat_agent_message.invoke" + }, + { + "key": "group_chat.component", + "type": "string", + "value": "agent_message_handler" + }, + { + "key": "group_chat.operation", + "type": "string", + "value": "invoke" + }, + { + "key": "operation.no_result", + "type": "bool", + "value": true + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.group_chat_diagnostics.decorators" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [ + { + "timestamp": 1751314093188812, + "fields": [ + { + "key": "event", + "type": "string", + "value": "group_chat.agent_invoke" + }, + { + "key": "event.type", + "type": "string", + "value": "agent_invocation" + }, + { + "key": "operation.phase", + "type": "string", + "value": "invoke" + } + ] + } + ], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "11cf3c7004f32fce", + "operationName": "chat.completions gpt-4.1-mini", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "39fc851047fa7bf6" + } + ], + "startTime": 1751314102331799, + "duration": 990268, + "tags": [ + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "chat.completions" + }, + { + "key": "gen_ai.request.model", + "type": "string", + "value": "gpt-4.1-mini" + }, + { + "key": "gen_ai.response.finish_reason", + "type": "string", + "value": "FinishReason.STOP" + }, + { + "key": "gen_ai.response.id", + "type": "string", + "value": "chatcmpl-BoF5a1DT9D2GYqt6EPsznvFx5W3UX" + }, + { + "key": "gen_ai.system", + "type": "string", + "value": "openai" + }, + { + "key": "gen_ai.usage.input_tokens", + "type": "int64", + "value": 1440 + }, + { + "key": "gen_ai.usage.output_tokens", + "type": "int64", + "value": 74 + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.model_diagnostics.decorators" + }, + { + "key": "server.address", + "type": "string", + "value": "https://ai-naarkalgaihub999971652049.openai.azure.com/openai/deployments/gpt-4.1-mini/" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "2388c73ebf76d864", + "operationName": "group_chat_manager.determine_state_and_take_action", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "d5b3ed02f14f0853" + } + ], + "startTime": 1751314100682165, + "duration": 3567449, + "tags": [ + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "group_chat_manager.determine_state_and_take_action" + }, + { + "key": "group_chat.component", + "type": "string", + "value": "manager" + }, + { + "key": "group_chat.operation", + "type": "string", + "value": "determine_state_and_take_action" + }, + { + "key": "langfuse.component", + "type": "string", + "value": "group_chat_manager" + }, + { + "key": "langfuse.operation", + "type": "string", + "value": "determine_state_and_take_action" + }, + { + "key": "langfuse.success", + "type": "bool", + "value": true + }, + { + "key": "manager.id", + "type": "string", + "value": "GroupChatManagerActor_b18281f3cfae4704ae0ccdec4737ab33/default" + }, + { + "key": "operation.success", + "type": "bool", + "value": true + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.group_chat_diagnostics.decorators" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [ + { + "timestamp": 1751314100682180, + "fields": [ + { + "key": "event", + "type": "string", + "value": "group_chat.planning" + }, + { + "key": "event.type", + "type": "string", + "value": "coordination_planning" + }, + { + "key": "langfuse.planning", + "type": "bool", + "value": true + }, + { + "key": "operation.phase", + "type": "string", + "value": "planning" + }, + { + "key": "planning.type", + "type": "string", + "value": "state_determination" + } + ] + }, + { + "timestamp": 1751314100682212, + "fields": [ + { + "key": "event", + "type": "string", + "value": "gen_ai.content.prompt" + }, + { + "key": "gen_ai.prompt", + "type": "string", + "value": "AuthorRole.USER: Plan a trip to Bali for 5 days including flights, hotels, and activities for a vegetarian family of 4 members. The family lives in Seattle, WA, USA. Their vacation starts on July 30th 2025. They have \nAuthorRole.USER: Transferred to planner\nAuthorRole.ASSISTANT: Step 1: Budget Allocation\nThe family has a strict budget of $5000 for 5 days. The main expenses are:\n- Flights (round trip for 4 people)\n- Hotels (5 nights)\n- Food (vegetarian)\n- Activities and local \nAuthorRole.USER: Transferred to flight_agent\nAuthorRole.ASSISTANT: Here's my detailed reasoning and plan for the Bali trip for a family of 4 from Seattle with a $5000 budget:\n\n1. Budget Allocation:\n- Flights: Approx $1600 (4 people round trip, $400 each)\n- Hotel: App" + }, + { + "key": "input.message_count", + "type": "int64", + "value": 5 + }, + { + "key": "input.message_type", + "type": "string", + "value": "conversation_history" + }, + { + "key": "input.recent_message_count", + "type": "int64", + "value": 5 + }, + { + "key": "input.source", + "type": "string", + "value": "group_chat_history" + }, + { + "key": "langfuse.conversation", + "type": "string", + "value": "AuthorRole.USER: Plan a trip to Bali for 5 days including flights, hotels, and activities for a vegetarian family of 4 members. The family lives in Seattle, WA, USA. Their vacation starts on July 30th 2025. They have \nAuthorRole.USER: Transferred to planner\nAuthorRole.ASSISTANT: Step 1: Budget Allocation\nThe family has a strict budget of $5000 for 5 days. The main expenses are:\n- Flights (round trip for 4 people)\n- Hotels (5 nights)\n- Food (vegetarian)\n- Activities and local \nAuthorRole.USER: Transferred to flight_agent\nAuthorRole.ASSISTANT: Here's my detailed reasoning and plan for the Bali trip for a family of 4 from Seattle with a $5000 budget:\n\n1. Budget Allocation:\n- Flights: Approx $1600 (4 people round trip, $400 each)\n- Hotel: App" + }, + { + "key": "langfuse.input", + "type": "string", + "value": "AuthorRole.USER: Plan a trip to Bali for 5 days including flights, hotels, and activities for a vegetarian family of 4 members. The family lives in Seattle, WA, USA. Their vacation starts on July 30th 2025. They have \nAuthorRole.USER: Transferred to planner\nAuthorRole.ASSISTANT: Step 1: Budget Allocation\nThe family has a strict budget of $5000 for 5 days. The main expenses are:\n- Flights (round trip for 4 people)\n- Hotels (5 nights)\n- Food (vegetarian)\n- Activities and local \nAuthorRole.USER: Transferred to flight_agent\nAuthorRole.ASSISTANT: Here's my detailed reasoning and plan for the Bali trip for a family of 4 from Seattle with a $5000 budget:\n\n1. Budget Allocation:\n- Flights: Approx $1600 (4 people round trip, $400 each)\n- Hotel: App" + } + ] + }, + { + "timestamp": 1751314100682219, + "fields": [ + { + "key": "event", + "type": "string", + "value": "input.last_message" + }, + { + "key": "context.type", + "type": "string", + "value": "immediate_context" + }, + { + "key": "last.agent", + "type": "string", + "value": "flight_agent" + }, + { + "key": "last.message", + "type": "string", + "value": "Here's my detailed reasoning and plan for the Bali trip for a family of 4 from Seattle with a $5000 budget:\n\n1. Budget Allocation:\n- Flights: Approx $1600 (4 people round trip, $400 each)\n- Hotel: Approx $1000 (5 nights, family room or 2 rooms)\n- Food (vegetarian): Approx $400 ($20 per person/day)\n- Activities & local transport: Approx $600\n- Miscellaneous/Buffer: $400\nTotal = $5000\n\n2. Flights Search:\nSearching for round trip flights Seattle to Bali (Denpasar) from July 30 to August 4, 2025, ke" + }, + { + "key": "last.role", + "type": "string", + "value": "AuthorRole.ASSISTANT" + } + ] + }, + { + "timestamp": 1751314100682244, + "fields": [ + { + "key": "event", + "type": "string", + "value": "planning.participants" + }, + { + "key": "participant.count", + "type": "int64", + "value": 3 + }, + { + "key": "participant.names", + "type": "string", + "value": "[\"planner\",\"flight_agent\",\"hotel_agent\"]" + }, + { + "key": "participants", + "type": "string", + "value": "{\"planner\": \"Creates comprehensive travel plans including flights, hotels, and activities\", \"flight_agent\": \"Specializes in flight booking\", \"hotel_agent\": \"Specializes in hotel booking\"}" + } + ] + }, + { + "timestamp": 1751314104249587, + "fields": [ + { + "key": "event", + "type": "string", + "value": "group_chat.coordination_decision" + }, + { + "key": "coordination.operation", + "type": "string", + "value": "determine_state_and_take_action" + }, + { + "key": "coordination.success", + "type": "bool", + "value": true + }, + { + "key": "event.type", + "type": "string", + "value": "coordination_completed" + }, + { + "key": "langfuse.coordination", + "type": "string", + "value": "Agent coordination decision completed" + }, + { + "key": "planning.decision_made", + "type": "bool", + "value": true + } + ] + }, + { + "timestamp": 1751314104249602, + "fields": [ + { + "key": "event", + "type": "string", + "value": "gen_ai.planning.decision" + }, + { + "key": "langfuse.plan", + "type": "string", + "value": "Group chat coordination decision for determine_state_and_take_action" + }, + { + "key": "planning.completed", + "type": "bool", + "value": true + }, + { + "key": "planning.component", + "type": "string", + "value": "group_chat_manager" + }, + { + "key": "planning.operation", + "type": "string", + "value": "determine_state_and_take_action" + }, + { + "key": "planning.type", + "type": "string", + "value": "overall_coordination" + } + ] + } + ], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "b6c9dbf7bbe15524", + "operationName": "AutoFunctionInvocationLoop", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "81d5a88fa540b5ae" + } + ], + "startTime": 1751314111230307, + "duration": 1208862, + "tags": [ + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.connectors.ai.chat_completion_client_base" + }, + { + "key": "sk.available_functions", + "type": "string", + "value": "" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "233e5f3ce9e0bb7a", + "operationName": "invoke_agent hotel_agent", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "ae02f3914566f0ab" + } + ], + "startTime": 1751314104250841, + "duration": 6945746, + "tags": [ + { + "key": "gen_ai.agent.description", + "type": "string", + "value": "Specializes in hotel booking" + }, + { + "key": "gen_ai.agent.id", + "type": "string", + "value": "d155cfa7-89ea-47d6-a912-5e348e5d086e" + }, + { + "key": "gen_ai.agent.name", + "type": "string", + "value": "hotel_agent" + }, + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "invoke_agent" + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.agent_diagnostics.decorators" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "75a5e2fbafb1fb67", + "operationName": "agent_initialization", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "d4be84bfde51cffa" + } + ], + "startTime": 1751314078788643, + "duration": 82312, + "tags": [ + { + "key": "agents.count", + "type": "int64", + "value": 6 + }, + { + "key": "agents.names", + "type": "string", + "value": "[\"conversation_manager\",\"planner\",\"router\",\"destination_expert\",\"flight_agent\",\"hotel_agent\"]" + }, + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "execute_task" + }, + { + "key": "gen_ai.task.description", + "type": "string", + "value": "Initialize multi-agent system" + }, + { + "key": "gen_ai.task.id", + "type": "string", + "value": "agent_setup_001" + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "__main__" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "0ef73aaa385af7b5", + "operationName": "orchestration_setup", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "d4be84bfde51cffa" + } + ], + "startTime": 1751314078871000, + "duration": 38162, + "tags": [ + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "execute_task" + }, + { + "key": "gen_ai.task.description", + "type": "string", + "value": "Setup group chat orchestration" + }, + { + "key": "gen_ai.task.id", + "type": "string", + "value": "orchestration_setup_001" + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "__main__" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "06168b6ffbcf5f83", + "operationName": "AutoFunctionInvocationLoop", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "8d307cf1576165aa" + } + ], + "startTime": 1751314080295073, + "duration": 711105, + "tags": [ + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.connectors.ai.chat_completion_client_base" + }, + { + "key": "sk.available_functions", + "type": "string", + "value": "" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "07f6c8fb11235a48", + "operationName": "invoke_agent Manager", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "6886b1a8bcfd7a50" + } + ], + "startTime": 1751314091465464, + "duration": 688747, + "tags": [ + { + "key": "gen_ai.agent.description", + "type": "string", + "value": "The manager of the group chat, responsible for coordinating the agents." + }, + { + "key": "gen_ai.agent.id", + "type": "string", + "value": "b45c5348-2a73-42b9-b3e2-0e0ff1ead8fa" + }, + { + "key": "gen_ai.agent.name", + "type": "string", + "value": "Manager" + }, + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "invoke_agent" + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.agent_diagnostics.decorators" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "2b0c0f62f645fcfe", + "operationName": "invoke_agent flight_agent", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "f83e884cf891cfbd" + } + ], + "startTime": 1751314093189034, + "duration": 7479603, + "tags": [ + { + "key": "gen_ai.agent.description", + "type": "string", + "value": "Specializes in flight booking" + }, + { + "key": "gen_ai.agent.id", + "type": "string", + "value": "9de47b69-e5a9-4825-8628-d2ae5c548854" + }, + { + "key": "gen_ai.agent.name", + "type": "string", + "value": "flight_agent" + }, + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "invoke_agent" + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.agent_diagnostics.decorators" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "fcaf7ffaf8760ef2", + "operationName": "execute_tool HotelPlugin-book_hotel", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "375d6f188df74451" + } + ], + "startTime": 1751314109183617, + "duration": 114, + "tags": [ + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "execute_tool" + }, + { + "key": "gen_ai.tool.call.id", + "type": "string", + "value": "call_NO5dpEBlUGojLiPnKB0gk2qI" + }, + { + "key": "gen_ai.tool.description", + "type": "string", + "value": "Book a specific hotel." + }, + { + "key": "gen_ai.tool.name", + "type": "string", + "value": "HotelPlugin-book_hotel" + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.functions.kernel_function" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "90b0239154b7bf1b", + "operationName": "group_chat_agent_message.handle_response_message", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "d4be84bfde51cffa" + } + ], + "startTime": 1751314233134196, + "duration": 95, + "tags": [ + { + "key": "gen_ai.agent.description", + "type": "string", + "value": "Creates comprehensive travel plans including flights, hotels, and activities" + }, + { + "key": "gen_ai.agent.id", + "type": "string", + "value": "423f3df4-872b-4359-9ef3-2d2c76ac1d57" + }, + { + "key": "gen_ai.agent.name", + "type": "string", + "value": "planner" + }, + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "group_chat_agent_message.handle_response_message" + }, + { + "key": "group_chat.component", + "type": "string", + "value": "agent_message_handler" + }, + { + "key": "group_chat.operation", + "type": "string", + "value": "handle_response_message" + }, + { + "key": "operation.no_result", + "type": "bool", + "value": true + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.group_chat_diagnostics.decorators" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "41e36a0bc822fd7a", + "operationName": "AutoFunctionInvocationLoop", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "13985557b7dfb56d" + } + ], + "startTime": 1751314234990910, + "duration": 2491953, + "tags": [ + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.connectors.ai.chat_completion_client_base" + }, + { + "key": "sk.available_functions", + "type": "string", + "value": "" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "2c1f3795898ad34a", + "operationName": "planning_user_input_assessment", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "2388c73ebf76d864" + } + ], + "startTime": 1751314100702133, + "duration": 1597473, + "tags": [ + { + "key": "chat.last_message_role", + "type": "string", + "value": "AuthorRole.ASSISTANT" + }, + { + "key": "chat.message_count", + "type": "int64", + "value": 5 + }, + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "plan_task" + }, + { + "key": "gen_ai.planning.complexity", + "type": "string", + "value": "simple" + }, + { + "key": "gen_ai.planning.stage", + "type": "string", + "value": "interaction_control" + }, + { + "key": "gen_ai.planning.type", + "type": "string", + "value": "user_input_assessment" + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "__main__" + }, + { + "key": "planning.decision", + "type": "string", + "value": "continue_conversation" + }, + { + "key": "planning.decision_reasoning", + "type": "string", + "value": "The planner and flight agent have gathered necessary details and proposed a plan including flights, hotel options, and activities. They are now waiting for confirmation to proceed with the hotel booking and final itinerary, but no further user input is required at this time unless the user wants to approve or modify the plan." + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "2dc6abd561a76333", + "operationName": "AutoFunctionInvocationLoop", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "77744963fd7dd818" + } + ], + "startTime": 1751314103387101, + "duration": 859572, + "tags": [ + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.connectors.ai.chat_completion_client_base" + }, + { + "key": "sk.available_functions", + "type": "string", + "value": "" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "81d5a88fa540b5ae", + "operationName": "invoke_agent Manager", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "1f6db770a63801cd" + } + ], + "startTime": 1751314111230039, + "duration": 1209301, + "tags": [ + { + "key": "gen_ai.agent.description", + "type": "string", + "value": "The manager of the group chat, responsible for coordinating the agents." + }, + { + "key": "gen_ai.agent.id", + "type": "string", + "value": "b45c5348-2a73-42b9-b3e2-0e0ff1ead8fa" + }, + { + "key": "gen_ai.agent.name", + "type": "string", + "value": "Manager" + }, + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "invoke_agent" + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.agent_diagnostics.decorators" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "0871ca76e2a68eec", + "operationName": "streaming_message_final", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "266658642b1670bc" + } + ], + "startTime": 1751314097031471, + "duration": 81, + "tags": [ + { + "key": "gen_ai.memory.operation_type", + "type": "string", + "value": "write" + }, + { + "key": "gen_ai.memory.source_type", + "type": "string", + "value": "streaming_response" + }, + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "memory_operation" + }, + { + "key": "message.agent_name", + "type": "string", + "value": "flight_agent" + }, + { + "key": "message.content_length", + "type": "int64", + "value": 1005 + }, + { + "key": "message.processing_complete", + "type": "bool", + "value": true + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "__main__" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [ + { + "timestamp": 1751314097031518, + "fields": [ + { + "key": "event", + "type": "string", + "value": "gen_ai.content.completion" + }, + { + "key": "gen_ai.assistant.message", + "type": "string", + "value": "Here's my detailed reasoning and plan for the Bali trip for a family of 4 from Seattle with a $5000 budget:\n\n1. Budget Allocation:\n- Flights: Approx $1600 (4 people round trip, $400 each)\n- Hotel: Approx $1000 (5 nights, family room or 2 rooms)\n- Food (vegetarian): Approx $400 ($20 per person/day)\n- Activities & local transport: Approx $600\n- Miscellaneous/Buffer: $400\nTotal = $5000\n\n2. Flights Search:\nSearching for round trip flights Seattle to Bali (Denpasar) from July 30 to August 4, 2025, keeping costs as low as possible, preferably around $400 per person. I will find suitable flight options now.\n\n3. Hotel Search:\nLook for vegetarian-friendly hotels or resorts with good reviews for families, ideally with kitchen facilities or vegetarian options on-site, around $200 per night. \n\n4. Activities:\nPlan local sightseeing such as beach days, cultural visits, nature trips suitable for kids, easy hiking, vegetarian restaurants visits, and relaxation time.\n\nLet me start by finding flight opt" + }, + { + "key": "gen_ai.completion", + "type": "string", + "value": "Here's my detailed reasoning and plan for the Bali trip for a family of 4 from Seattle with a $5000 budget:\n\n1. Budget Allocation:\n- Flights: Approx $1600 (4 people round trip, $400 each)\n- Hotel: Approx $1000 (5 nights, family room or 2 rooms)\n- Food (vegetarian): Approx $400 ($20 per person/day)\n- Activities & local transport: Approx $600\n- Miscellaneous/Buffer: $400\nTotal = $5000\n\n2. Flights Search:\nSearching for round trip flights Seattle to Bali (Denpasar) from July 30 to August 4, 2025, keeping costs as low as possible, preferably around $400 per person. I will find suitable flight options now.\n\n3. Hotel Search:\nLook for vegetarian-friendly hotels or resorts with good reviews for families, ideally with kitchen facilities or vegetarian options on-site, around $200 per night. \n\n4. Activities:\nPlan local sightseeing such as beach days, cultural visits, nature trips suitable for kids, easy hiking, vegetarian restaurants visits, and relaxation time.\n\nLet me start by finding flight opt" + }, + { + "key": "output.agent", + "type": "string", + "value": "flight_agent" + }, + { + "key": "output.role", + "type": "string", + "value": "AuthorRole.ASSISTANT" + }, + { + "key": "output.type", + "type": "string", + "value": "streaming_final" + } + ] + }, + { + "timestamp": 1751314097031549, + "fields": [ + { + "key": "event", + "type": "string", + "value": "gen_ai.tool.calls" + }, + { + "key": "agent", + "type": "string", + "value": "flight_agent" + }, + { + "key": "tool.call_count", + "type": "int64", + "value": 2 + }, + { + "key": "tool.calls", + "type": "string", + "value": "[{\"function\": \"FlightPlugin-book_flight\", \"arguments\": \"{\\\"flight_id\\\": \\\"search_SEA_DPS_20250730_4ppl\\\"}\"}, {\"function\": \"FlightPlugin-book_flight\", \"arguments\": \"{\\\"flight_id\\\": \\\"search_DPS_SEA_20250804_4ppl\\\"}\"}]" + } + ] + } + ], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "4b55cc20ff678dc4", + "operationName": "chat.completions gpt-4.1-mini", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "1752405c5ccc0ebf" + } + ], + "startTime": 1751314091465748, + "duration": 688343, + "tags": [ + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "chat.completions" + }, + { + "key": "gen_ai.request.model", + "type": "string", + "value": "gpt-4.1-mini" + }, + { + "key": "gen_ai.response.finish_reason", + "type": "string", + "value": "FinishReason.STOP" + }, + { + "key": "gen_ai.response.id", + "type": "string", + "value": "chatcmpl-BoF5PtzNZQ3zm6YsuTegoyYi509RC" + }, + { + "key": "gen_ai.system", + "type": "string", + "value": "openai" + }, + { + "key": "gen_ai.usage.input_tokens", + "type": "int64", + "value": 820 + }, + { + "key": "gen_ai.usage.output_tokens", + "type": "int64", + "value": 52 + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.model_diagnostics.decorators" + }, + { + "key": "server.address", + "type": "string", + "value": "https://ai-naarkalgaihub999971652049.openai.azure.com/openai/deployments/gpt-4.1-mini/" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "bf25bc93b64e7687", + "operationName": "group_chat_agent_message.handle_start_message", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "d4be84bfde51cffa" + } + ], + "startTime": 1751314078912320, + "duration": 33, + "tags": [ + { + "key": "gen_ai.agent.description", + "type": "string", + "value": "Specializes in flight booking" + }, + { + "key": "gen_ai.agent.id", + "type": "string", + "value": "9de47b69-e5a9-4825-8628-d2ae5c548854" + }, + { + "key": "gen_ai.agent.name", + "type": "string", + "value": "flight_agent" + }, + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "group_chat_agent_message.handle_start_message" + }, + { + "key": "group_chat.component", + "type": "string", + "value": "agent_message_handler" + }, + { + "key": "group_chat.operation", + "type": "string", + "value": "handle_start_message" + }, + { + "key": "operation.no_result", + "type": "bool", + "value": true + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.group_chat_diagnostics.decorators" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [ + { + "timestamp": 1751314078912330, + "fields": [ + { + "key": "event", + "type": "string", + "value": "group_chat.conversation_start" + }, + { + "key": "event.type", + "type": "string", + "value": "conversation_initialization" + }, + { + "key": "operation.phase", + "type": "string", + "value": "start" + } + ] + } + ], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "355a51772665821e", + "operationName": "chat.completions gpt-4.1-mini", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "d7d76be02f2e7660" + } + ], + "startTime": 1751314078917097, + "duration": 1377158, + "tags": [ + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "chat.completions" + }, + { + "key": "gen_ai.request.model", + "type": "string", + "value": "gpt-4.1-mini" + }, + { + "key": "gen_ai.response.finish_reason", + "type": "string", + "value": "FinishReason.STOP" + }, + { + "key": "gen_ai.response.id", + "type": "string", + "value": "chatcmpl-BoF5DJXhhJaaebrIiKfQOEAXMHHJE" + }, + { + "key": "gen_ai.system", + "type": "string", + "value": "openai" + }, + { + "key": "gen_ai.usage.input_tokens", + "type": "int64", + "value": 235 + }, + { + "key": "gen_ai.usage.output_tokens", + "type": "int64", + "value": 41 + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.model_diagnostics.decorators" + }, + { + "key": "server.address", + "type": "string", + "value": "https://ai-naarkalgaihub999971652049.openai.azure.com/openai/deployments/gpt-4.1-mini/" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "4fb946dcf723d66d", + "operationName": "chat.completions gpt-4.1-mini", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "ef6213d656ba75f1" + } + ], + "startTime": 1751314092171107, + "duration": 1013329, + "tags": [ + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "chat.completions" + }, + { + "key": "gen_ai.request.model", + "type": "string", + "value": "gpt-4.1-mini" + }, + { + "key": "gen_ai.response.finish_reason", + "type": "string", + "value": "FinishReason.STOP" + }, + { + "key": "gen_ai.response.id", + "type": "string", + "value": "chatcmpl-BoF5QSdQXUNStbAmFsm7pRf8riioB" + }, + { + "key": "gen_ai.system", + "type": "string", + "value": "openai" + }, + { + "key": "gen_ai.usage.input_tokens", + "type": "int64", + "value": 927 + }, + { + "key": "gen_ai.usage.output_tokens", + "type": "int64", + "value": 59 + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.model_diagnostics.decorators" + }, + { + "key": "server.address", + "type": "string", + "value": "https://ai-naarkalgaihub999971652049.openai.azure.com/openai/deployments/gpt-4.1-mini/" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "5b5c0b3044ed5548", + "operationName": "group_chat_agent_message.handle_response_message", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "d4be84bfde51cffa" + } + ], + "startTime": 1751314090236743, + "duration": 116, + "tags": [ + { + "key": "gen_ai.agent.description", + "type": "string", + "value": "Specializes in flight booking" + }, + { + "key": "gen_ai.agent.id", + "type": "string", + "value": "9de47b69-e5a9-4825-8628-d2ae5c548854" + }, + { + "key": "gen_ai.agent.name", + "type": "string", + "value": "flight_agent" + }, + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "group_chat_agent_message.handle_response_message" + }, + { + "key": "group_chat.component", + "type": "string", + "value": "agent_message_handler" + }, + { + "key": "group_chat.operation", + "type": "string", + "value": "handle_response_message" + }, + { + "key": "operation.no_result", + "type": "bool", + "value": true + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.group_chat_diagnostics.decorators" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "a2b531c3233846fe", + "operationName": "group_chat_agent_message.handle_response_message", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "d4be84bfde51cffa" + } + ], + "startTime": 1751314100681840, + "duration": 109, + "tags": [ + { + "key": "gen_ai.agent.description", + "type": "string", + "value": "Creates comprehensive travel plans including flights, hotels, and activities" + }, + { + "key": "gen_ai.agent.id", + "type": "string", + "value": "423f3df4-872b-4359-9ef3-2d2c76ac1d57" + }, + { + "key": "gen_ai.agent.name", + "type": "string", + "value": "planner" + }, + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "group_chat_agent_message.handle_response_message" + }, + { + "key": "group_chat.component", + "type": "string", + "value": "agent_message_handler" + }, + { + "key": "group_chat.operation", + "type": "string", + "value": "handle_response_message" + }, + { + "key": "operation.no_result", + "type": "bool", + "value": true + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.group_chat_diagnostics.decorators" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "52090993a4b73d3f", + "operationName": "agent_selection_planning", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "2388c73ebf76d864" + } + ], + "startTime": 1751314103386740, + "duration": 860214, + "tags": [ + { + "key": "agent.selection.available_agents", + "type": "string", + "value": "[\"planner\",\"flight_agent\",\"hotel_agent\"]" + }, + { + "key": "agent.selection.conversation_length", + "type": "int64", + "value": 5 + }, + { + "key": "agent.selection.reasoning", + "type": "string", + "value": "The flight_agent has completed flight booking and recommended hotels. Next, the hotel_agent should take over to find and finalize the vegetarian-friendly hotel accommodations within the budget to proceed with bookings and coordination." + }, + { + "key": "agent.selection.selected", + "type": "string", + "value": "hotel_agent" + }, + { + "key": "agent.selection.total_participants", + "type": "int64", + "value": 3 + }, + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "plan_task" + }, + { + "key": "gen_ai.planning.complexity", + "type": "string", + "value": "moderate" + }, + { + "key": "gen_ai.planning.stage", + "type": "string", + "value": "agent_coordination" + }, + { + "key": "gen_ai.planning.type", + "type": "string", + "value": "plan_task" + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "__main__" + }, + { + "key": "planning.decision", + "type": "string", + "value": "agent_selected" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "8a8d36b471a8a2da", + "operationName": "group_chat_manager.handle_start_message", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "d4be84bfde51cffa" + } + ], + "startTime": 1751314078913189, + "duration": 2093869, + "tags": [ + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "group_chat_manager.handle_start_message" + }, + { + "key": "group_chat.component", + "type": "string", + "value": "manager" + }, + { + "key": "group_chat.operation", + "type": "string", + "value": "handle_start_message" + }, + { + "key": "langfuse.component", + "type": "string", + "value": "group_chat_manager" + }, + { + "key": "langfuse.operation", + "type": "string", + "value": "handle_start_message" + }, + { + "key": "langfuse.success", + "type": "bool", + "value": true + }, + { + "key": "manager.id", + "type": "string", + "value": "GroupChatManagerActor_b18281f3cfae4704ae0ccdec4737ab33/default" + }, + { + "key": "operation.success", + "type": "bool", + "value": true + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.group_chat_diagnostics.decorators" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [ + { + "timestamp": 1751314081007043, + "fields": [ + { + "key": "event", + "type": "string", + "value": "group_chat.message_handled" + }, + { + "key": "event.type", + "type": "string", + "value": "message_processing_complete" + }, + { + "key": "langfuse.message_handled", + "type": "bool", + "value": true + }, + { + "key": "message.operation", + "type": "string", + "value": "handle_start_message" + }, + { + "key": "message.success", + "type": "bool", + "value": true + } + ] + } + ], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "1752405c5ccc0ebf", + "operationName": "AutoFunctionInvocationLoop", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "07f6c8fb11235a48" + } + ], + "startTime": 1751314091465718, + "duration": 688402, + "tags": [ + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.connectors.ai.chat_completion_client_base" + }, + { + "key": "sk.available_functions", + "type": "string", + "value": "" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "930535e71cf0975c", + "operationName": "execute_tool FlightPlugin-book_flight", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "266658642b1670bc" + } + ], + "startTime": 1751314097030823, + "duration": 366, + "tags": [ + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "execute_tool" + }, + { + "key": "gen_ai.tool.call.id", + "type": "string", + "value": "call_7y9541HhjELRu0XtjWPCYuo3" + }, + { + "key": "gen_ai.tool.description", + "type": "string", + "value": "Book a specific flight." + }, + { + "key": "gen_ai.tool.name", + "type": "string", + "value": "FlightPlugin-book_flight" + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.functions.kernel_function" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "ae02f3914566f0ab", + "operationName": "group_chat_agent_message.invoke", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "d4be84bfde51cffa" + } + ], + "startTime": 1751314104250696, + "duration": 6955012, + "tags": [ + { + "key": "gen_ai.agent.description", + "type": "string", + "value": "Specializes in hotel booking" + }, + { + "key": "gen_ai.agent.id", + "type": "string", + "value": "d155cfa7-89ea-47d6-a912-5e348e5d086e" + }, + { + "key": "gen_ai.agent.name", + "type": "string", + "value": "hotel_agent" + }, + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "group_chat_agent_message.invoke" + }, + { + "key": "group_chat.component", + "type": "string", + "value": "agent_message_handler" + }, + { + "key": "group_chat.operation", + "type": "string", + "value": "invoke" + }, + { + "key": "operation.no_result", + "type": "bool", + "value": true + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.group_chat_diagnostics.decorators" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [ + { + "timestamp": 1751314104250714, + "fields": [ + { + "key": "event", + "type": "string", + "value": "group_chat.agent_invoke" + }, + { + "key": "event.type", + "type": "string", + "value": "agent_invocation" + }, + { + "key": "operation.phase", + "type": "string", + "value": "invoke" + } + ] + } + ], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "9453d6d14c21c49a", + "operationName": "result_processing", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "bca6723e725625f9" + } + ], + "startTime": 1751314078911411, + "duration": 158576740, + "tags": [ + { + "key": "gen_ai.memory.operation_type", + "type": "string", + "value": "read" + }, + { + "key": "gen_ai.memory.source_type", + "type": "string", + "value": "task_result" + }, + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "memory_operation" + }, + { + "key": "memory.result_retrieved", + "type": "bool", + "value": true + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "__main__" + }, + { + "key": "result.length", + "type": "int64", + "value": 1072 + }, + { + "key": "result.success", + "type": "bool", + "value": true + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "85a8f69fcc09b02f", + "operationName": "invoke_agent Manager", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "31cf6a33a1723aea" + } + ], + "startTime": 1751314090247966, + "duration": 1204284, + "tags": [ + { + "key": "gen_ai.agent.description", + "type": "string", + "value": "The manager of the group chat, responsible for coordinating the agents." + }, + { + "key": "gen_ai.agent.id", + "type": "string", + "value": "b45c5348-2a73-42b9-b3e2-0e0ff1ead8fa" + }, + { + "key": "gen_ai.agent.name", + "type": "string", + "value": "Manager" + }, + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "invoke_agent" + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.agent_diagnostics.decorators" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "0797d8633e3e46e7", + "operationName": "agent_selection_planning", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "6886b1a8bcfd7a50" + } + ], + "startTime": 1751314092170640, + "duration": 1014112, + "tags": [ + { + "key": "agent.selection.available_agents", + "type": "string", + "value": "[\"planner\",\"flight_agent\",\"hotel_agent\"]" + }, + { + "key": "agent.selection.conversation_length", + "type": "int64", + "value": 3 + }, + { + "key": "agent.selection.reasoning", + "type": "string", + "value": "The planner has outlined the budget and flight details but did not book the flights yet. The next logical step is for the flight_agent to find actual flight options, confirm availability, and make bookings for the family within the budget constraints." + }, + { + "key": "agent.selection.selected", + "type": "string", + "value": "flight_agent" + }, + { + "key": "agent.selection.total_participants", + "type": "int64", + "value": 3 + }, + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "plan_task" + }, + { + "key": "gen_ai.planning.complexity", + "type": "string", + "value": "moderate" + }, + { + "key": "gen_ai.planning.stage", + "type": "string", + "value": "agent_coordination" + }, + { + "key": "gen_ai.planning.type", + "type": "string", + "value": "plan_task" + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "__main__" + }, + { + "key": "planning.decision", + "type": "string", + "value": "agent_selected" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "1f6db770a63801cd", + "operationName": "planning_user_input_assessment", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "de6960c446082857" + } + ], + "startTime": 1751314111229940, + "duration": 1209467, + "tags": [ + { + "key": "chat.last_message_role", + "type": "string", + "value": "AuthorRole.ASSISTANT" + }, + { + "key": "chat.message_count", + "type": "int64", + "value": 7 + }, + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "plan_task" + }, + { + "key": "gen_ai.planning.complexity", + "type": "string", + "value": "simple" + }, + { + "key": "gen_ai.planning.stage", + "type": "string", + "value": "interaction_control" + }, + { + "key": "gen_ai.planning.type", + "type": "string", + "value": "user_input_assessment" + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "__main__" + }, + { + "key": "planning.decision", + "type": "string", + "value": "input_needed" + }, + { + "key": "planning.decision_reasoning", + "type": "string", + "value": "The hotel agent is awaiting user confirmation to finalize the hotel booking and proceed with detailed itinerary and activity bookings." + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "68c0fa8d8a1fdee8", + "operationName": "AutoFunctionInvocationLoop", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "59fc167c725db50c" + } + ], + "startTime": 1751314233131199, + "duration": 1776360, + "tags": [ + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.connectors.ai.chat_completion_client_base" + }, + { + "key": "sk.available_functions", + "type": "string", + "value": "" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "13985557b7dfb56d", + "operationName": "invoke_agent Manager", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "c45c3e30edaa3f05" + } + ], + "startTime": 1751314234990680, + "duration": 2492438, + "tags": [ + { + "key": "gen_ai.agent.description", + "type": "string", + "value": "The manager of the group chat, responsible for coordinating the agents." + }, + { + "key": "gen_ai.agent.id", + "type": "string", + "value": "b45c5348-2a73-42b9-b3e2-0e0ff1ead8fa" + }, + { + "key": "gen_ai.agent.name", + "type": "string", + "value": "Manager" + }, + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "invoke_agent" + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.agent_diagnostics.decorators" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "c45c3e30edaa3f05", + "operationName": "memory_operation_summary", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "de6960c446082857" + } + ], + "startTime": 1751314234979777, + "duration": 2503528, + "tags": [ + { + "key": "conversation.message_count", + "type": "int64", + "value": 8 + }, + { + "key": "gen_ai.memory.memory_type", + "type": "string", + "value": "working" + }, + { + "key": "gen_ai.memory.operation_type", + "type": "string", + "value": "write" + }, + { + "key": "gen_ai.memory.size_bytes", + "type": "int64", + "value": 1283620 + }, + { + "key": "gen_ai.memory.source_type", + "type": "string", + "value": "conversation_summary" + }, + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "memory_operation" + }, + { + "key": "memory.result_processed", + "type": "bool", + "value": true + }, + { + "key": "memory.summary_generated", + "type": "bool", + "value": true + }, + { + "key": "memory.summary_length", + "type": "int64", + "value": 1072 + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "__main__" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "f710826efc8bd7a7", + "operationName": "execute_tool PlanningPlugin-search_flights", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "c6a941c11851f287" + } + ], + "startTime": 1751314085900060, + "duration": 309, + "tags": [ + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "execute_tool" + }, + { + "key": "gen_ai.tool.call.id", + "type": "string", + "value": "call_5cinH5l5tIfzJeV4wL7AX4wg" + }, + { + "key": "gen_ai.tool.description", + "type": "string", + "value": "Search for available flights." + }, + { + "key": "gen_ai.tool.name", + "type": "string", + "value": "PlanningPlugin-search_flights" + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.functions.kernel_function" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "7cfdd6a8274a2757", + "operationName": "group_chat_agent_message.invoke", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "d4be84bfde51cffa" + } + ], + "startTime": 1751314081007685, + "duration": 9228253, + "tags": [ + { + "key": "gen_ai.agent.description", + "type": "string", + "value": "Creates comprehensive travel plans including flights, hotels, and activities" + }, + { + "key": "gen_ai.agent.id", + "type": "string", + "value": "423f3df4-872b-4359-9ef3-2d2c76ac1d57" + }, + { + "key": "gen_ai.agent.name", + "type": "string", + "value": "planner" + }, + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "group_chat_agent_message.invoke" + }, + { + "key": "group_chat.component", + "type": "string", + "value": "agent_message_handler" + }, + { + "key": "group_chat.operation", + "type": "string", + "value": "invoke" + }, + { + "key": "operation.no_result", + "type": "bool", + "value": true + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.group_chat_diagnostics.decorators" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [ + { + "timestamp": 1751314081007718, + "fields": [ + { + "key": "event", + "type": "string", + "value": "group_chat.agent_invoke" + }, + { + "key": "event.type", + "type": "string", + "value": "agent_invocation" + }, + { + "key": "operation.phase", + "type": "string", + "value": "invoke" + } + ] + } + ], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "6886b1a8bcfd7a50", + "operationName": "group_chat_manager.determine_state_and_take_action", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "83f9e3290dcd7730" + } + ], + "startTime": 1751314090237088, + "duration": 2950883, + "tags": [ + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "group_chat_manager.determine_state_and_take_action" + }, + { + "key": "group_chat.component", + "type": "string", + "value": "manager" + }, + { + "key": "group_chat.operation", + "type": "string", + "value": "determine_state_and_take_action" + }, + { + "key": "langfuse.component", + "type": "string", + "value": "group_chat_manager" + }, + { + "key": "langfuse.operation", + "type": "string", + "value": "determine_state_and_take_action" + }, + { + "key": "langfuse.success", + "type": "bool", + "value": true + }, + { + "key": "manager.id", + "type": "string", + "value": "GroupChatManagerActor_b18281f3cfae4704ae0ccdec4737ab33/default" + }, + { + "key": "operation.success", + "type": "bool", + "value": true + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.group_chat_diagnostics.decorators" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [ + { + "timestamp": 1751314090237108, + "fields": [ + { + "key": "event", + "type": "string", + "value": "group_chat.planning" + }, + { + "key": "event.type", + "type": "string", + "value": "coordination_planning" + }, + { + "key": "langfuse.planning", + "type": "bool", + "value": true + }, + { + "key": "operation.phase", + "type": "string", + "value": "planning" + }, + { + "key": "planning.type", + "type": "string", + "value": "state_determination" + } + ] + }, + { + "timestamp": 1751314090237142, + "fields": [ + { + "key": "event", + "type": "string", + "value": "gen_ai.content.prompt" + }, + { + "key": "gen_ai.prompt", + "type": "string", + "value": "AuthorRole.USER: Plan a trip to Bali for 5 days including flights, hotels, and activities for a vegetarian family of 4 members. The family lives in Seattle, WA, USA. Their vacation starts on July 30th 2025. They have \nAuthorRole.USER: Transferred to planner\nAuthorRole.ASSISTANT: Step 1: Budget Allocation\nThe family has a strict budget of $5000 for 5 days. The main expenses are:\n- Flights (round trip for 4 people)\n- Hotels (5 nights)\n- Food (vegetarian)\n- Activities and local " + }, + { + "key": "input.message_count", + "type": "int64", + "value": 3 + }, + { + "key": "input.message_type", + "type": "string", + "value": "conversation_history" + }, + { + "key": "input.recent_message_count", + "type": "int64", + "value": 3 + }, + { + "key": "input.source", + "type": "string", + "value": "group_chat_history" + }, + { + "key": "langfuse.conversation", + "type": "string", + "value": "AuthorRole.USER: Plan a trip to Bali for 5 days including flights, hotels, and activities for a vegetarian family of 4 members. The family lives in Seattle, WA, USA. Their vacation starts on July 30th 2025. They have \nAuthorRole.USER: Transferred to planner\nAuthorRole.ASSISTANT: Step 1: Budget Allocation\nThe family has a strict budget of $5000 for 5 days. The main expenses are:\n- Flights (round trip for 4 people)\n- Hotels (5 nights)\n- Food (vegetarian)\n- Activities and local " + }, + { + "key": "langfuse.input", + "type": "string", + "value": "AuthorRole.USER: Plan a trip to Bali for 5 days including flights, hotels, and activities for a vegetarian family of 4 members. The family lives in Seattle, WA, USA. Their vacation starts on July 30th 2025. They have \nAuthorRole.USER: Transferred to planner\nAuthorRole.ASSISTANT: Step 1: Budget Allocation\nThe family has a strict budget of $5000 for 5 days. The main expenses are:\n- Flights (round trip for 4 people)\n- Hotels (5 nights)\n- Food (vegetarian)\n- Activities and local " + } + ] + }, + { + "timestamp": 1751314090237151, + "fields": [ + { + "key": "event", + "type": "string", + "value": "input.last_message" + }, + { + "key": "context.type", + "type": "string", + "value": "immediate_context" + }, + { + "key": "last.agent", + "type": "string", + "value": "planner" + }, + { + "key": "last.message", + "type": "string", + "value": "Step 1: Budget Allocation\nThe family has a strict budget of $5000 for 5 days. The main expenses are:\n- Flights (round trip for 4 people)\n- Hotels (5 nights)\n- Food (vegetarian)\n- Activities and local transportation\n\nEstimated budget breakdown:\n- Flights: $2000 (approx $500 per person round trip, since Bali flights can be expensive)\n- Hotels: $1000 (about $200 per night for a family room or 2 rooms)\n- Food: $400 ($20 per person per day, vegetarian meals can be affordable)\n- Activities and local t" + }, + { + "key": "last.role", + "type": "string", + "value": "AuthorRole.ASSISTANT" + } + ] + }, + { + "timestamp": 1751314090237182, + "fields": [ + { + "key": "event", + "type": "string", + "value": "planning.participants" + }, + { + "key": "participant.count", + "type": "int64", + "value": 3 + }, + { + "key": "participant.names", + "type": "string", + "value": "[\"planner\",\"flight_agent\",\"hotel_agent\"]" + }, + { + "key": "participants", + "type": "string", + "value": "{\"planner\": \"Creates comprehensive travel plans including flights, hotels, and activities\", \"flight_agent\": \"Specializes in flight booking\", \"hotel_agent\": \"Specializes in hotel booking\"}" + } + ] + }, + { + "timestamp": 1751314093187937, + "fields": [ + { + "key": "event", + "type": "string", + "value": "group_chat.coordination_decision" + }, + { + "key": "coordination.operation", + "type": "string", + "value": "determine_state_and_take_action" + }, + { + "key": "coordination.success", + "type": "bool", + "value": true + }, + { + "key": "event.type", + "type": "string", + "value": "coordination_completed" + }, + { + "key": "langfuse.coordination", + "type": "string", + "value": "Agent coordination decision completed" + }, + { + "key": "planning.decision_made", + "type": "bool", + "value": true + } + ] + }, + { + "timestamp": 1751314093187956, + "fields": [ + { + "key": "event", + "type": "string", + "value": "gen_ai.planning.decision" + }, + { + "key": "langfuse.plan", + "type": "string", + "value": "Group chat coordination decision for determine_state_and_take_action" + }, + { + "key": "planning.completed", + "type": "bool", + "value": true + }, + { + "key": "planning.component", + "type": "string", + "value": "group_chat_manager" + }, + { + "key": "planning.operation", + "type": "string", + "value": "determine_state_and_take_action" + }, + { + "key": "planning.type", + "type": "string", + "value": "overall_coordination" + } + ] + } + ], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "e42e37e31681098e", + "operationName": "invoke_agent Manager", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "2c1f3795898ad34a" + } + ], + "startTime": 1751314100702231, + "duration": 1597296, + "tags": [ + { + "key": "gen_ai.agent.description", + "type": "string", + "value": "The manager of the group chat, responsible for coordinating the agents." + }, + { + "key": "gen_ai.agent.id", + "type": "string", + "value": "b45c5348-2a73-42b9-b3e2-0e0ff1ead8fa" + }, + { + "key": "gen_ai.agent.name", + "type": "string", + "value": "Manager" + }, + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "invoke_agent" + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.agent_diagnostics.decorators" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "f845033ff758878e", + "operationName": "execute_tool HotelPlugin-book_hotel", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "375d6f188df74451" + } + ], + "startTime": 1751314109181733, + "duration": 1481, + "tags": [ + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "execute_tool" + }, + { + "key": "gen_ai.tool.call.id", + "type": "string", + "value": "call_liGdhKnim4woxdV4BGmBVlS9" + }, + { + "key": "gen_ai.tool.description", + "type": "string", + "value": "Book a specific hotel." + }, + { + "key": "gen_ai.tool.name", + "type": "string", + "value": "HotelPlugin-book_hotel" + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.functions.kernel_function" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "55d86a71bf1b5a90", + "operationName": "group_chat_agent_message.handle_response_message", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "d4be84bfde51cffa" + } + ], + "startTime": 1751314111206039, + "duration": 48, + "tags": [ + { + "key": "gen_ai.agent.description", + "type": "string", + "value": "Creates comprehensive travel plans including flights, hotels, and activities" + }, + { + "key": "gen_ai.agent.id", + "type": "string", + "value": "423f3df4-872b-4359-9ef3-2d2c76ac1d57" + }, + { + "key": "gen_ai.agent.name", + "type": "string", + "value": "planner" + }, + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "group_chat_agent_message.handle_response_message" + }, + { + "key": "group_chat.component", + "type": "string", + "value": "agent_message_handler" + }, + { + "key": "group_chat.operation", + "type": "string", + "value": "handle_response_message" + }, + { + "key": "operation.no_result", + "type": "bool", + "value": true + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.group_chat_diagnostics.decorators" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "59fc167c725db50c", + "operationName": "invoke_agent Manager", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "de6960c446082857" + } + ], + "startTime": 1751314233130899, + "duration": 1776804, + "tags": [ + { + "key": "gen_ai.agent.description", + "type": "string", + "value": "The manager of the group chat, responsible for coordinating the agents." + }, + { + "key": "gen_ai.agent.id", + "type": "string", + "value": "b45c5348-2a73-42b9-b3e2-0e0ff1ead8fa" + }, + { + "key": "gen_ai.agent.name", + "type": "string", + "value": "Manager" + }, + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "invoke_agent" + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.agent_diagnostics.decorators" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "5966064b319ff670", + "operationName": "planning_user_input_assessment", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "970271ca7e97b987" + } + ], + "startTime": 1751314078913490, + "duration": 21, + "tags": [ + { + "key": "chat.last_message_role", + "type": "string", + "value": "AuthorRole.USER" + }, + { + "key": "chat.message_count", + "type": "int64", + "value": 1 + }, + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "plan_task" + }, + { + "key": "gen_ai.planning.complexity", + "type": "string", + "value": "simple" + }, + { + "key": "gen_ai.planning.stage", + "type": "string", + "value": "interaction_control" + }, + { + "key": "gen_ai.planning.type", + "type": "string", + "value": "user_input_assessment" + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "__main__" + }, + { + "key": "planning.decision", + "type": "string", + "value": "no_input_needed_recent" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "31cf6a33a1723aea", + "operationName": "planning_user_input_assessment", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "6886b1a8bcfd7a50" + } + ], + "startTime": 1751314090247835, + "duration": 1204448, + "tags": [ + { + "key": "chat.last_message_role", + "type": "string", + "value": "AuthorRole.ASSISTANT" + }, + { + "key": "chat.message_count", + "type": "int64", + "value": 3 + }, + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "plan_task" + }, + { + "key": "gen_ai.planning.complexity", + "type": "string", + "value": "simple" + }, + { + "key": "gen_ai.planning.stage", + "type": "string", + "value": "interaction_control" + }, + { + "key": "gen_ai.planning.type", + "type": "string", + "value": "user_input_assessment" + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "__main__" + }, + { + "key": "planning.decision", + "type": "string", + "value": "continue_conversation" + }, + { + "key": "planning.decision_reasoning", + "type": "string", + "value": "The assistant has all the necessary information to proceed with detailed daily itinerary and booking details for the Bali trip without further user input." + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "2a515ff1c0591b1e", + "operationName": "chat.streaming_completions gpt-4.1-mini", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "266658642b1670bc" + } + ], + "startTime": 1751314097031915, + "duration": 3636428, + "tags": [ + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "chat.streaming_completions" + }, + { + "key": "gen_ai.request.model", + "type": "string", + "value": "gpt-4.1-mini" + }, + { + "key": "gen_ai.response.finish_reason", + "type": "string", + "value": "FinishReason.STOP" + }, + { + "key": "gen_ai.response.id", + "type": "string", + "value": "chatcmpl-BoF5V2Ku3JBihN6trC6NC3zss1GhJ" + }, + { + "key": "gen_ai.system", + "type": "string", + "value": "openai" + }, + { + "key": "gen_ai.usage.input_tokens", + "type": "int64", + "value": 896 + }, + { + "key": "gen_ai.usage.output_tokens", + "type": "int64", + "value": 373 + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.model_diagnostics.decorators" + }, + { + "key": "server.address", + "type": "string", + "value": "https://ai-naarkalgaihub999971652049.openai.azure.com/openai/deployments/gpt-4.1-mini/" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "266658642b1670bc", + "operationName": "AutoFunctionInvocationLoop", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "2b0c0f62f645fcfe" + } + ], + "startTime": 1751314093189874, + "duration": 7478537, + "tags": [ + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.connectors.ai.chat_completion_client_base" + }, + { + "key": "sk.available_functions", + "type": "string", + "value": "FlightPlugin-book_flight" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "6889d3ffa15ce894", + "operationName": "chat.completions gpt-4.1-mini", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "b6c9dbf7bbe15524" + } + ], + "startTime": 1751314111230334, + "duration": 1208788, + "tags": [ + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "chat.completions" + }, + { + "key": "gen_ai.request.model", + "type": "string", + "value": "gpt-4.1-mini" + }, + { + "key": "gen_ai.response.finish_reason", + "type": "string", + "value": "FinishReason.STOP" + }, + { + "key": "gen_ai.response.id", + "type": "string", + "value": "chatcmpl-BoF5kbtQNQR05jnaeDTc9WyzM2TBd" + }, + { + "key": "gen_ai.system", + "type": "string", + "value": "openai" + }, + { + "key": "gen_ai.usage.input_tokens", + "type": "int64", + "value": 1944 + }, + { + "key": "gen_ai.usage.output_tokens", + "type": "int64", + "value": 30 + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.model_diagnostics.decorators" + }, + { + "key": "server.address", + "type": "string", + "value": "https://ai-naarkalgaihub999971652049.openai.azure.com/openai/deployments/gpt-4.1-mini/" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "e3c72a5451d47a1f", + "operationName": "chat.completions gpt-4.1-mini", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "06168b6ffbcf5f83" + } + ], + "startTime": 1751314080295119, + "duration": 711019, + "tags": [ + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "chat.completions" + }, + { + "key": "gen_ai.request.model", + "type": "string", + "value": "gpt-4.1-mini" + }, + { + "key": "gen_ai.response.finish_reason", + "type": "string", + "value": "FinishReason.STOP" + }, + { + "key": "gen_ai.response.id", + "type": "string", + "value": "chatcmpl-BoF5EpHKoazqri4VsUYXOLGavtLha" + }, + { + "key": "gen_ai.system", + "type": "string", + "value": "openai" + }, + { + "key": "gen_ai.usage.input_tokens", + "type": "int64", + "value": 342 + }, + { + "key": "gen_ai.usage.output_tokens", + "type": "int64", + "value": 49 + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.model_diagnostics.decorators" + }, + { + "key": "server.address", + "type": "string", + "value": "https://ai-naarkalgaihub999971652049.openai.azure.com/openai/deployments/gpt-4.1-mini/" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "b444d6f46d52638e", + "operationName": "invoke_agent Manager", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "0797d8633e3e46e7" + } + ], + "startTime": 1751314092170771, + "duration": 1013900, + "tags": [ + { + "key": "gen_ai.agent.description", + "type": "string", + "value": "The manager of the group chat, responsible for coordinating the agents." + }, + { + "key": "gen_ai.agent.id", + "type": "string", + "value": "b45c5348-2a73-42b9-b3e2-0e0ff1ead8fa" + }, + { + "key": "gen_ai.agent.name", + "type": "string", + "value": "Manager" + }, + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "invoke_agent" + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.agent_diagnostics.decorators" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "d8db4e3b1c7ba598", + "operationName": "group_chat_agent_message.handle_response_message", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "d4be84bfde51cffa" + } + ], + "startTime": 1751314090236921, + "duration": 47, + "tags": [ + { + "key": "gen_ai.agent.description", + "type": "string", + "value": "Specializes in hotel booking" + }, + { + "key": "gen_ai.agent.id", + "type": "string", + "value": "d155cfa7-89ea-47d6-a912-5e348e5d086e" + }, + { + "key": "gen_ai.agent.name", + "type": "string", + "value": "hotel_agent" + }, + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "group_chat_agent_message.handle_response_message" + }, + { + "key": "group_chat.component", + "type": "string", + "value": "agent_message_handler" + }, + { + "key": "group_chat.operation", + "type": "string", + "value": "handle_response_message" + }, + { + "key": "operation.no_result", + "type": "bool", + "value": true + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.group_chat_diagnostics.decorators" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "a693e851eae194cc", + "operationName": "group_chat_agent_message.handle_response_message", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "d4be84bfde51cffa" + } + ], + "startTime": 1751314233134425, + "duration": 36, + "tags": [ + { + "key": "gen_ai.agent.description", + "type": "string", + "value": "Specializes in hotel booking" + }, + { + "key": "gen_ai.agent.id", + "type": "string", + "value": "d155cfa7-89ea-47d6-a912-5e348e5d086e" + }, + { + "key": "gen_ai.agent.name", + "type": "string", + "value": "hotel_agent" + }, + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "group_chat_agent_message.handle_response_message" + }, + { + "key": "group_chat.component", + "type": "string", + "value": "agent_message_handler" + }, + { + "key": "group_chat.operation", + "type": "string", + "value": "handle_response_message" + }, + { + "key": "operation.no_result", + "type": "bool", + "value": true + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.group_chat_diagnostics.decorators" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "970271ca7e97b987", + "operationName": "group_chat_manager.determine_state_and_take_action", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "8a8d36b471a8a2da" + } + ], + "startTime": 1751314078913272, + "duration": 2093748, + "tags": [ + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "group_chat_manager.determine_state_and_take_action" + }, + { + "key": "group_chat.component", + "type": "string", + "value": "manager" + }, + { + "key": "group_chat.operation", + "type": "string", + "value": "determine_state_and_take_action" + }, + { + "key": "langfuse.component", + "type": "string", + "value": "group_chat_manager" + }, + { + "key": "langfuse.operation", + "type": "string", + "value": "determine_state_and_take_action" + }, + { + "key": "langfuse.success", + "type": "bool", + "value": true + }, + { + "key": "manager.id", + "type": "string", + "value": "GroupChatManagerActor_b18281f3cfae4704ae0ccdec4737ab33/default" + }, + { + "key": "operation.success", + "type": "bool", + "value": true + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.group_chat_diagnostics.decorators" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [ + { + "timestamp": 1751314078913314, + "fields": [ + { + "key": "event", + "type": "string", + "value": "group_chat.planning" + }, + { + "key": "event.type", + "type": "string", + "value": "coordination_planning" + }, + { + "key": "langfuse.planning", + "type": "bool", + "value": true + }, + { + "key": "operation.phase", + "type": "string", + "value": "planning" + }, + { + "key": "planning.type", + "type": "string", + "value": "state_determination" + } + ] + }, + { + "timestamp": 1751314078913327, + "fields": [ + { + "key": "event", + "type": "string", + "value": "gen_ai.content.prompt" + }, + { + "key": "gen_ai.prompt", + "type": "string", + "value": "AuthorRole.USER: Plan a trip to Bali for 5 days including flights, hotels, and activities for a vegetarian family of 4 members. The family lives in Seattle, WA, USA. Their vacation starts on July 30th 2025. They have " + }, + { + "key": "input.message_count", + "type": "int64", + "value": 1 + }, + { + "key": "input.message_type", + "type": "string", + "value": "conversation_history" + }, + { + "key": "input.recent_message_count", + "type": "int64", + "value": 1 + }, + { + "key": "input.source", + "type": "string", + "value": "group_chat_history" + }, + { + "key": "langfuse.conversation", + "type": "string", + "value": "AuthorRole.USER: Plan a trip to Bali for 5 days including flights, hotels, and activities for a vegetarian family of 4 members. The family lives in Seattle, WA, USA. Their vacation starts on July 30th 2025. They have " + }, + { + "key": "langfuse.input", + "type": "string", + "value": "AuthorRole.USER: Plan a trip to Bali for 5 days including flights, hotels, and activities for a vegetarian family of 4 members. The family lives in Seattle, WA, USA. Their vacation starts on July 30th 2025. They have " + } + ] + }, + { + "timestamp": 1751314078913404, + "fields": [ + { + "key": "event", + "type": "string", + "value": "input.last_message" + }, + { + "key": "context.type", + "type": "string", + "value": "immediate_context" + }, + { + "key": "last.message", + "type": "string", + "value": "Plan a trip to Bali for 5 days including flights, hotels, and activities for a vegetarian family of 4 members. The family lives in Seattle, WA, USA. Their vacation starts on July 30th 2025. They have a strict budget of $5000 for the trip. Please think through this step-by-step: first assess the budget allocation, then find suitable flights, select appropriate vegetarian-friendly accommodations, and plan activities. Show your reasoning process and provide a detailed plan with the necessary bookin" + }, + { + "key": "last.role", + "type": "string", + "value": "AuthorRole.USER" + } + ] + }, + { + "timestamp": 1751314078913425, + "fields": [ + { + "key": "event", + "type": "string", + "value": "planning.participants" + }, + { + "key": "participant.count", + "type": "int64", + "value": 3 + }, + { + "key": "participant.names", + "type": "string", + "value": "[\"planner\",\"flight_agent\",\"hotel_agent\"]" + }, + { + "key": "participants", + "type": "string", + "value": "{\"planner\": \"Creates comprehensive travel plans including flights, hotels, and activities\", \"flight_agent\": \"Specializes in flight booking\", \"hotel_agent\": \"Specializes in hotel booking\"}" + } + ] + }, + { + "timestamp": 1751314081006985, + "fields": [ + { + "key": "event", + "type": "string", + "value": "group_chat.coordination_decision" + }, + { + "key": "coordination.operation", + "type": "string", + "value": "determine_state_and_take_action" + }, + { + "key": "coordination.success", + "type": "bool", + "value": true + }, + { + "key": "event.type", + "type": "string", + "value": "coordination_completed" + }, + { + "key": "langfuse.coordination", + "type": "string", + "value": "Agent coordination decision completed" + }, + { + "key": "planning.decision_made", + "type": "bool", + "value": true + } + ] + }, + { + "timestamp": 1751314081007008, + "fields": [ + { + "key": "event", + "type": "string", + "value": "gen_ai.planning.decision" + }, + { + "key": "langfuse.plan", + "type": "string", + "value": "Group chat coordination decision for determine_state_and_take_action" + }, + { + "key": "planning.completed", + "type": "bool", + "value": true + }, + { + "key": "planning.component", + "type": "string", + "value": "group_chat_manager" + }, + { + "key": "planning.operation", + "type": "string", + "value": "determine_state_and_take_action" + }, + { + "key": "planning.type", + "type": "string", + "value": "overall_coordination" + } + ] + } + ], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "8d307cf1576165aa", + "operationName": "invoke_agent Manager", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "c89731b53aeac77a" + } + ], + "startTime": 1751314080294729, + "duration": 711577, + "tags": [ + { + "key": "gen_ai.agent.description", + "type": "string", + "value": "The manager of the group chat, responsible for coordinating the agents." + }, + { + "key": "gen_ai.agent.id", + "type": "string", + "value": "b45c5348-2a73-42b9-b3e2-0e0ff1ead8fa" + }, + { + "key": "gen_ai.agent.name", + "type": "string", + "value": "Manager" + }, + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "invoke_agent" + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.agent_diagnostics.decorators" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "8b317b756cae5053", + "operationName": "AutoFunctionInvocationLoop", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "e42e37e31681098e" + } + ], + "startTime": 1751314100702494, + "duration": 1596831, + "tags": [ + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.connectors.ai.chat_completion_client_base" + }, + { + "key": "sk.available_functions", + "type": "string", + "value": "" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "d4be84bfde51cffa", + "operationName": "travel_planning_session", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "ca47586544854ce3" + } + ], + "startTime": 1751314078788613, + "duration": 158699914, + "tags": [ + { + "key": "conversation.id", + "type": "string", + "value": "conv_enhanced_001" + }, + { + "key": "langfuse.session_type", + "type": "string", + "value": "group_chat" + }, + { + "key": "langfuse.trace.type", + "type": "string", + "value": "multi_agent_orchestration" + }, + { + "key": "langfuse.version", + "type": "string", + "value": "1.0" + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "__main__" + }, + { + "key": "session.type", + "type": "string", + "value": "enhanced_multi_agent_demo" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + }, + { + "key": "user.id", + "type": "string", + "value": "demo_user_enhanced" + } + ], + "logs": [ + { + "timestamp": 1751314078909232, + "fields": [ + { + "key": "event", + "type": "string", + "value": "gen_ai.content.prompt" + }, + { + "key": "gen_ai.prompt", + "type": "string", + "value": "Plan a trip to Bali for 5 days including flights, hotels, and activities for a vegetarian family of 4 members. The family lives in Seattle, WA, USA. Their vacation starts on July 30th 2025. They have a strict budget of $5000 for the trip. Please think through this step-by-step: first assess the budget allocation, then find suitable flights, select appropriate vegetarian-friendly accommodations, and plan activities. Show your reasoning process and provide a detailed plan with the necessary bookings." + }, + { + "key": "gen_ai.user.message", + "type": "string", + "value": "Plan a trip to Bali for 5 days including flights, hotels, and activities for a vegetarian family of 4 members. The family lives in Seattle, WA, USA. Their vacation starts on July 30th 2025. They have a strict budget of $5000 for the trip. Please think through this step-by-step: first assess the budget allocation, then find suitable flights, select appropriate vegetarian-friendly accommodations, and plan activities. Show your reasoning process and provide a detailed plan with the necessary bookings." + }, + { + "key": "input.constraints", + "type": "string", + "value": "{\"budget\": 5000, \"duration_days\": 5, \"travelers\": 4, \"dietary\": \"vegetarian\", \"destination\": \"Bali\", \"origin\": \"Seattle, WA\"}" + }, + { + "key": "input.source", + "type": "string", + "value": "main_function" + }, + { + "key": "input.task_type", + "type": "string", + "value": "multi_agent_planning" + }, + { + "key": "input.type", + "type": "string", + "value": "user_request" + }, + { + "key": "langfuse.input", + "type": "string", + "value": "Plan a trip to Bali for 5 days including flights, hotels, and activities for a vegetarian family of 4 members. The family lives in Seattle, WA, USA. Their vacation starts on July 30th 2025. They have a strict budget of $5000 for the trip. Please think through this step-by-step: first assess the budget allocation, then find suitable flights, select appropriate vegetarian-friendly accommodations, and plan activities. Show your reasoning process and provide a detailed plan with the necessary bookings." + } + ] + }, + { + "timestamp": 1751314237488195, + "fields": [ + { + "key": "event", + "type": "string", + "value": "gen_ai.content.completion" + }, + { + "key": "gen_ai.assistant.message", + "type": "string", + "value": "Summary of the conversation:\n\nThe user requested a 5-day family trip plan to Bali for 4 vegetarians from Seattle starting July 30, 2025, with a strict $5000 budget including flights, hotels, and activities. The planning was done step-by-step, covering budget allocation, flights, hotels, and activities.\n\nThe allocated budget: $1600 for flights, $1000 for hotels, $400 for food, $600 for activities and transport, and $400 extra as buffer.\n\nFlights: Round trip flights from Seattle to Bali were found within approximately $400 per person, totaling about $1600 for 4.\n\nHotels: Three vegetarian-friendly options within budget were presented, with Ocean View Resort recommended at $190/night for 5 nights totaling $950.\n\nActivities: Suggested a family-oriented, vegetarian-friendly itinerary including beach relaxation, cultural tours, cooking classes, water park visits, and local markets.\n\nThe user confirmed and requested to book the Ocean View Resort, which was booked successfully. The manager awaits confirmation to proceed with detailed activity planning and bookings." + }, + { + "key": "gen_ai.completion", + "type": "string", + "value": "Summary of the conversation:\n\nThe user requested a 5-day family trip plan to Bali for 4 vegetarians from Seattle starting July 30, 2025, with a strict $5000 budget including flights, hotels, and activities. The planning was done step-by-step, covering budget allocation, flights, hotels, and activities.\n\nThe allocated budget: $1600 for flights, $1000 for hotels, $400 for food, $600 for activities and transport, and $400 extra as buffer.\n\nFlights: Round trip flights from Seattle to Bali were found within approximately $400 per person, totaling about $1600 for 4.\n\nHotels: Three vegetarian-friendly options within budget were presented, with Ocean View Resort recommended at $190/night for 5 nights totaling $950.\n\nActivities: Suggested a family-oriented, vegetarian-friendly itinerary including beach relaxation, cultural tours, cooking classes, water park visits, and local markets.\n\nThe user confirmed and requested to book the Ocean View Resort, which was booked successfully. The manager awaits confirmation to proceed with detailed activity planning and bookings." + }, + { + "key": "langfuse.output", + "type": "string", + "value": "Summary of the conversation:\n\nThe user requested a 5-day family trip plan to Bali for 4 vegetarians from Seattle starting July 30, 2025, with a strict $5000 budget including flights, hotels, and activities. The planning was done step-by-step, covering budget allocation, flights, hotels, and activities.\n\nThe allocated budget: $1600 for flights, $1000 for hotels, $400 for food, $600 for activities and transport, and $400 extra as buffer.\n\nFlights: Round trip flights from Seattle to Bali were found within approximately $400 per person, totaling about $1600 for 4.\n\nHotels: Three vegetarian-friendly options within budget were presented, with Ocean View Resort recommended at $190/night for 5 nights totaling $950.\n\nActivities: Suggested a family-oriented, vegetarian-friendly itinerary including beach relaxation, cultural tours, cooking classes, water park visits, and local markets.\n\nThe user confirmed and requested to book the Ocean View Resort, which was booked successfully. The manager awaits confirmation to proceed with detailed activity planning and bookings." + }, + { + "key": "output.source", + "type": "string", + "value": "multi_agent_orchestration" + }, + { + "key": "output.success", + "type": "bool", + "value": true + }, + { + "key": "output.type", + "type": "string", + "value": "final_travel_plan" + } + ] + } + ], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "1010061eefc07161", + "operationName": "group_chat_agent_message.invoke", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "d4be84bfde51cffa" + } + ], + "startTime": 1751314081011062, + "duration": 21, + "tags": [ + { + "key": "gen_ai.agent.description", + "type": "string", + "value": "Specializes in hotel booking" + }, + { + "key": "gen_ai.agent.id", + "type": "string", + "value": "d155cfa7-89ea-47d6-a912-5e348e5d086e" + }, + { + "key": "gen_ai.agent.name", + "type": "string", + "value": "hotel_agent" + }, + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "group_chat_agent_message.invoke" + }, + { + "key": "group_chat.component", + "type": "string", + "value": "agent_message_handler" + }, + { + "key": "group_chat.operation", + "type": "string", + "value": "invoke" + }, + { + "key": "operation.no_result", + "type": "bool", + "value": true + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.group_chat_diagnostics.decorators" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [ + { + "timestamp": 1751314081011078, + "fields": [ + { + "key": "event", + "type": "string", + "value": "group_chat.agent_invoke" + }, + { + "key": "event.type", + "type": "string", + "value": "agent_invocation" + }, + { + "key": "operation.phase", + "type": "string", + "value": "invoke" + } + ] + } + ], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "a1b7b2e3746f3ef2", + "operationName": "AutoFunctionInvocationLoop", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "85a8f69fcc09b02f" + } + ], + "startTime": 1751314090248283, + "duration": 1203886, + "tags": [ + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.connectors.ai.chat_completion_client_base" + }, + { + "key": "sk.available_functions", + "type": "string", + "value": "" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "26935a4b3fff3ba6", + "operationName": "invoke_agent planner", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "7cfdd6a8274a2757" + } + ], + "startTime": 1751314081007810, + "duration": 9215430, + "tags": [ + { + "key": "gen_ai.agent.description", + "type": "string", + "value": "Creates comprehensive travel plans including flights, hotels, and activities" + }, + { + "key": "gen_ai.agent.id", + "type": "string", + "value": "423f3df4-872b-4359-9ef3-2d2c76ac1d57" + }, + { + "key": "gen_ai.agent.name", + "type": "string", + "value": "planner" + }, + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "invoke_agent" + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.agent_diagnostics.decorators" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "39fc851047fa7bf6", + "operationName": "AutoFunctionInvocationLoop", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "28ccc2fde8bec883" + } + ], + "startTime": 1751314102331766, + "duration": 990347, + "tags": [ + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.connectors.ai.chat_completion_client_base" + }, + { + "key": "sk.available_functions", + "type": "string", + "value": "" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "f83e884cf891cfbd", + "operationName": "group_chat_agent_message.invoke", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "d4be84bfde51cffa" + } + ], + "startTime": 1751314093188904, + "duration": 7492181, + "tags": [ + { + "key": "gen_ai.agent.description", + "type": "string", + "value": "Specializes in flight booking" + }, + { + "key": "gen_ai.agent.id", + "type": "string", + "value": "9de47b69-e5a9-4825-8628-d2ae5c548854" + }, + { + "key": "gen_ai.agent.name", + "type": "string", + "value": "flight_agent" + }, + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "group_chat_agent_message.invoke" + }, + { + "key": "group_chat.component", + "type": "string", + "value": "agent_message_handler" + }, + { + "key": "group_chat.operation", + "type": "string", + "value": "invoke" + }, + { + "key": "operation.no_result", + "type": "bool", + "value": true + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.group_chat_diagnostics.decorators" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [ + { + "timestamp": 1751314093188926, + "fields": [ + { + "key": "event", + "type": "string", + "value": "group_chat.agent_invoke" + }, + { + "key": "event.type", + "type": "string", + "value": "agent_invocation" + }, + { + "key": "operation.phase", + "type": "string", + "value": "invoke" + } + ] + } + ], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "b961c8d536a6d269", + "operationName": "group_chat_agent_message.invoke", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "d4be84bfde51cffa" + } + ], + "startTime": 1751314104250617, + "duration": 24, + "tags": [ + { + "key": "gen_ai.agent.description", + "type": "string", + "value": "Specializes in flight booking" + }, + { + "key": "gen_ai.agent.id", + "type": "string", + "value": "9de47b69-e5a9-4825-8628-d2ae5c548854" + }, + { + "key": "gen_ai.agent.name", + "type": "string", + "value": "flight_agent" + }, + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "group_chat_agent_message.invoke" + }, + { + "key": "group_chat.component", + "type": "string", + "value": "agent_message_handler" + }, + { + "key": "group_chat.operation", + "type": "string", + "value": "invoke" + }, + { + "key": "operation.no_result", + "type": "bool", + "value": true + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.group_chat_diagnostics.decorators" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [ + { + "timestamp": 1751314104250635, + "fields": [ + { + "key": "event", + "type": "string", + "value": "group_chat.agent_invoke" + }, + { + "key": "event.type", + "type": "string", + "value": "agent_invocation" + }, + { + "key": "operation.phase", + "type": "string", + "value": "invoke" + } + ] + } + ], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "8023c3edfee3d9a6", + "operationName": "execute_tool HotelPlugin-book_hotel", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "375d6f188df74451" + } + ], + "startTime": 1751314109183390, + "duration": 124, + "tags": [ + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "execute_tool" + }, + { + "key": "gen_ai.tool.call.id", + "type": "string", + "value": "call_cOij0GDhCDYfHydxBLUFwJgi" + }, + { + "key": "gen_ai.tool.description", + "type": "string", + "value": "Book a specific hotel." + }, + { + "key": "gen_ai.tool.name", + "type": "string", + "value": "HotelPlugin-book_hotel" + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.functions.kernel_function" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "cc9166556427977b", + "operationName": "group_chat_agent_message.handle_response_message", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "d4be84bfde51cffa" + } + ], + "startTime": 1751314233134348, + "duration": 41, + "tags": [ + { + "key": "gen_ai.agent.description", + "type": "string", + "value": "Specializes in flight booking" + }, + { + "key": "gen_ai.agent.id", + "type": "string", + "value": "9de47b69-e5a9-4825-8628-d2ae5c548854" + }, + { + "key": "gen_ai.agent.name", + "type": "string", + "value": "flight_agent" + }, + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "group_chat_agent_message.handle_response_message" + }, + { + "key": "group_chat.component", + "type": "string", + "value": "agent_message_handler" + }, + { + "key": "group_chat.operation", + "type": "string", + "value": "handle_response_message" + }, + { + "key": "operation.no_result", + "type": "bool", + "value": true + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.group_chat_diagnostics.decorators" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "136b36c5f4bcad3b", + "operationName": "chat.completions gpt-4.1-mini", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "8b317b756cae5053" + } + ], + "startTime": 1751314100702523, + "duration": 1596749, + "tags": [ + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "chat.completions" + }, + { + "key": "gen_ai.request.model", + "type": "string", + "value": "gpt-4.1-mini" + }, + { + "key": "gen_ai.response.finish_reason", + "type": "string", + "value": "FinishReason.STOP" + }, + { + "key": "gen_ai.response.id", + "type": "string", + "value": "chatcmpl-BoF5ZZG6WKUX5UitB0tNdBXmgZoWl" + }, + { + "key": "gen_ai.system", + "type": "string", + "value": "openai" + }, + { + "key": "gen_ai.usage.input_tokens", + "type": "int64", + "value": 1441 + }, + { + "key": "gen_ai.usage.output_tokens", + "type": "int64", + "value": 68 + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.model_diagnostics.decorators" + }, + { + "key": "server.address", + "type": "string", + "value": "https://ai-naarkalgaihub999971652049.openai.azure.com/openai/deployments/gpt-4.1-mini/" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "ba23b1837ca8e0dd", + "operationName": "execute_tool PlanningPlugin-search_flights", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "c6a941c11851f287" + } + ], + "startTime": 1751314085900547, + "duration": 134, + "tags": [ + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "execute_tool" + }, + { + "key": "gen_ai.tool.call.id", + "type": "string", + "value": "call_IVEjeAsfpkI1pgD1xSbQZ1ap" + }, + { + "key": "gen_ai.tool.description", + "type": "string", + "value": "Search for available flights." + }, + { + "key": "gen_ai.tool.name", + "type": "string", + "value": "PlanningPlugin-search_flights" + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.functions.kernel_function" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "97a069e75f9d0ebc", + "operationName": "group_chat_orchestration.start", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "bca6723e725625f9" + } + ], + "startTime": 1751314078911467, + "duration": 2099855, + "tags": [ + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "group_chat_orchestration.start" + }, + { + "key": "group_chat.component", + "type": "string", + "value": "orchestration" + }, + { + "key": "group_chat.is_root_operation", + "type": "bool", + "value": true + }, + { + "key": "group_chat.operation", + "type": "string", + "value": "start" + }, + { + "key": "orchestration.agent_count", + "type": "int64", + "value": 3 + }, + { + "key": "orchestration.completed", + "type": "bool", + "value": true + }, + { + "key": "orchestration.has_input", + "type": "bool", + "value": true + }, + { + "key": "orchestration.input_length", + "type": "int64", + "value": 503 + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.group_chat_diagnostics.decorators" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [ + { + "timestamp": 1751314078911478, + "fields": [ + { + "key": "event", + "type": "string", + "value": "group_chat.session_start" + }, + { + "key": "event.type", + "type": "string", + "value": "orchestration_start" + }, + { + "key": "session.phase", + "type": "string", + "value": "initialization" + } + ] + }, + { + "timestamp": 1751314078911496, + "fields": [ + { + "key": "event", + "type": "string", + "value": "gen_ai.content.prompt" + }, + { + "key": "gen_ai.prompt", + "type": "string", + "value": "Plan a trip to Bali for 5 days including flights, hotels, and activities for a vegetarian family of 4 members. The family lives in Seattle, WA, USA. Their vacation starts on July 30th 2025. They have a strict budget of $5000 for the trip. Please think through this step-by-step: first assess the budget allocation, then find suitable flights, select appropriate vegetarian-friendly accommodations, and plan activities. Show your reasoning process and provide a detailed plan with the necessary bookings." + }, + { + "key": "group_chat.session_input", + "type": "bool", + "value": true + }, + { + "key": "input.message_type", + "type": "string", + "value": "orchestration_input" + }, + { + "key": "input.source", + "type": "string", + "value": "user_request" + } + ] + }, + { + "timestamp": 1751314078911504, + "fields": [ + { + "key": "event", + "type": "string", + "value": "orchestration.agents_configured" + }, + { + "key": "agents.count", + "type": "int64", + "value": 3 + }, + { + "key": "agents.names", + "type": "string", + "value": "['planner', 'flight_agent', 'hotel_agent']" + } + ] + }, + { + "timestamp": 1751314081011314, + "fields": [ + { + "key": "event", + "type": "string", + "value": "group_chat.session_started" + }, + { + "key": "event.type", + "type": "string", + "value": "orchestration_started" + }, + { + "key": "session.success", + "type": "bool", + "value": true + } + ] + } + ], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "530a708cb166a73c", + "operationName": "chat.streaming_completions gpt-4.1-mini", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "c6a941c11851f287" + } + ], + "startTime": 1751314082277612, + "duration": 3613762, + "tags": [ + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "chat.streaming_completions" + }, + { + "key": "gen_ai.request.model", + "type": "string", + "value": "gpt-4.1-mini" + }, + { + "key": "gen_ai.response.finish_reason", + "type": "string", + "value": "FinishReason.TOOL_CALLS" + }, + { + "key": "gen_ai.response.id", + "type": "string", + "value": "chatcmpl-BoF5G59EDGabv8ov763hIDkEwBJ6f" + }, + { + "key": "gen_ai.system", + "type": "string", + "value": "openai" + }, + { + "key": "gen_ai.usage.input_tokens", + "type": "int64", + "value": 277 + }, + { + "key": "gen_ai.usage.output_tokens", + "type": "int64", + "value": 326 + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.model_diagnostics.decorators" + }, + { + "key": "server.address", + "type": "string", + "value": "https://ai-naarkalgaihub999971652049.openai.azure.com/openai/deployments/gpt-4.1-mini/" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "d5b3ed02f14f0853", + "operationName": "group_chat_manager.handle_response_message", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "d4be84bfde51cffa" + } + ], + "startTime": 1751314100682102, + "duration": 3567544, + "tags": [ + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "group_chat_manager.handle_response_message" + }, + { + "key": "group_chat.component", + "type": "string", + "value": "manager" + }, + { + "key": "group_chat.operation", + "type": "string", + "value": "handle_response_message" + }, + { + "key": "langfuse.component", + "type": "string", + "value": "group_chat_manager" + }, + { + "key": "langfuse.operation", + "type": "string", + "value": "handle_response_message" + }, + { + "key": "langfuse.success", + "type": "bool", + "value": true + }, + { + "key": "manager.id", + "type": "string", + "value": "GroupChatManagerActor_b18281f3cfae4704ae0ccdec4737ab33/default" + }, + { + "key": "operation.success", + "type": "bool", + "value": true + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.group_chat_diagnostics.decorators" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [ + { + "timestamp": 1751314104249638, + "fields": [ + { + "key": "event", + "type": "string", + "value": "group_chat.message_handled" + }, + { + "key": "event.type", + "type": "string", + "value": "message_processing_complete" + }, + { + "key": "langfuse.message_handled", + "type": "bool", + "value": true + }, + { + "key": "message.operation", + "type": "string", + "value": "handle_response_message" + }, + { + "key": "message.success", + "type": "bool", + "value": true + } + ] + } + ], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "5ce9c95c6ccc2461", + "operationName": "chat.streaming_completions gpt-4.1-mini", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "375d6f188df74451" + } + ], + "startTime": 1751314104251520, + "duration": 4922260, + "tags": [ + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "chat.streaming_completions" + }, + { + "key": "gen_ai.request.model", + "type": "string", + "value": "gpt-4.1-mini" + }, + { + "key": "gen_ai.response.finish_reason", + "type": "string", + "value": "FinishReason.TOOL_CALLS" + }, + { + "key": "gen_ai.response.id", + "type": "string", + "value": "chatcmpl-BoF5dMHxidCtZ58Vu9HrtJq4CfkAJ" + }, + { + "key": "gen_ai.system", + "type": "string", + "value": "openai" + }, + { + "key": "gen_ai.usage.input_tokens", + "type": "int64", + "value": 1354 + }, + { + "key": "gen_ai.usage.output_tokens", + "type": "int64", + "value": 400 + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.model_diagnostics.decorators" + }, + { + "key": "server.address", + "type": "string", + "value": "https://ai-naarkalgaihub999971652049.openai.azure.com/openai/deployments/gpt-4.1-mini/" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "6b8de0ef38fced82", + "operationName": "group_chat_agent_message.handle_response_message", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "d4be84bfde51cffa" + } + ], + "startTime": 1751314111206124, + "duration": 35, + "tags": [ + { + "key": "gen_ai.agent.description", + "type": "string", + "value": "Specializes in flight booking" + }, + { + "key": "gen_ai.agent.id", + "type": "string", + "value": "9de47b69-e5a9-4825-8628-d2ae5c548854" + }, + { + "key": "gen_ai.agent.name", + "type": "string", + "value": "flight_agent" + }, + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "group_chat_agent_message.handle_response_message" + }, + { + "key": "group_chat.component", + "type": "string", + "value": "agent_message_handler" + }, + { + "key": "group_chat.operation", + "type": "string", + "value": "handle_response_message" + }, + { + "key": "operation.no_result", + "type": "bool", + "value": true + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.group_chat_diagnostics.decorators" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "091b1ad6308a63f5", + "operationName": "human_in_the_loop", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "de6960c446082857" + } + ], + "startTime": 1751314112478827, + "duration": 120612389, + "tags": [ + { + "key": "otel.scope.name", + "type": "string", + "value": "__main__" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "c89731b53aeac77a", + "operationName": "agent_selection_planning", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "970271ca7e97b987" + } + ], + "startTime": 1751314080294596, + "duration": 711773, + "tags": [ + { + "key": "agent.selection.available_agents", + "type": "string", + "value": "[\"planner\",\"flight_agent\",\"hotel_agent\"]" + }, + { + "key": "agent.selection.conversation_length", + "type": "int64", + "value": 1 + }, + { + "key": "agent.selection.reasoning", + "type": "string", + "value": "The user requested a comprehensive step-by-step plan including budget allocation before bookings, so the planner should start by assessing the budget and outlining the plan before handing off to flight or hotel agents." + }, + { + "key": "agent.selection.selected", + "type": "string", + "value": "planner" + }, + { + "key": "agent.selection.total_participants", + "type": "int64", + "value": 3 + }, + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "plan_task" + }, + { + "key": "gen_ai.planning.complexity", + "type": "string", + "value": "moderate" + }, + { + "key": "gen_ai.planning.stage", + "type": "string", + "value": "agent_coordination" + }, + { + "key": "gen_ai.planning.type", + "type": "string", + "value": "plan_task" + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "__main__" + }, + { + "key": "planning.decision", + "type": "string", + "value": "agent_selected" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "505c78233994703e", + "operationName": "group_chat_agent_message.invoke", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "d4be84bfde51cffa" + } + ], + "startTime": 1751314081010951, + "duration": 43, + "tags": [ + { + "key": "gen_ai.agent.description", + "type": "string", + "value": "Specializes in flight booking" + }, + { + "key": "gen_ai.agent.id", + "type": "string", + "value": "9de47b69-e5a9-4825-8628-d2ae5c548854" + }, + { + "key": "gen_ai.agent.name", + "type": "string", + "value": "flight_agent" + }, + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "group_chat_agent_message.invoke" + }, + { + "key": "group_chat.component", + "type": "string", + "value": "agent_message_handler" + }, + { + "key": "group_chat.operation", + "type": "string", + "value": "invoke" + }, + { + "key": "operation.no_result", + "type": "bool", + "value": true + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.group_chat_diagnostics.decorators" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [ + { + "timestamp": 1751314081010983, + "fields": [ + { + "key": "event", + "type": "string", + "value": "group_chat.agent_invoke" + }, + { + "key": "event.type", + "type": "string", + "value": "agent_invocation" + }, + { + "key": "operation.phase", + "type": "string", + "value": "invoke" + } + ] + } + ], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "cc61720dd770e83c", + "operationName": "execute_tool PlanningPlugin-search_hotels", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "c6a941c11851f287" + } + ], + "startTime": 1751314085900800, + "duration": 138, + "tags": [ + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "execute_tool" + }, + { + "key": "gen_ai.tool.call.id", + "type": "string", + "value": "call_ihxE9NmrlGpZWmyn6N4X61Sp" + }, + { + "key": "gen_ai.tool.description", + "type": "string", + "value": "Search for available hotels." + }, + { + "key": "gen_ai.tool.name", + "type": "string", + "value": "PlanningPlugin-search_hotels" + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.functions.kernel_function" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "ec068650bbce9129", + "operationName": "chat.streaming_completions gpt-4.1-mini", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "266658642b1670bc" + } + ], + "startTime": 1751314093189942, + "duration": 3834143, + "tags": [ + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "chat.streaming_completions" + }, + { + "key": "gen_ai.request.model", + "type": "string", + "value": "gpt-4.1-mini" + }, + { + "key": "gen_ai.response.finish_reason", + "type": "string", + "value": "FinishReason.TOOL_CALLS" + }, + { + "key": "gen_ai.response.id", + "type": "string", + "value": "chatcmpl-BoF5SZVNXlfCOC5qnkOXG636Ful2c" + }, + { + "key": "gen_ai.system", + "type": "string", + "value": "openai" + }, + { + "key": "gen_ai.usage.input_tokens", + "type": "int64", + "value": 746 + }, + { + "key": "gen_ai.usage.output_tokens", + "type": "int64", + "value": 314 + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.model_diagnostics.decorators" + }, + { + "key": "server.address", + "type": "string", + "value": "https://ai-naarkalgaihub999971652049.openai.azure.com/openai/deployments/gpt-4.1-mini/" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "28d37cc4c51e655f", + "operationName": "execute_tool FlightPlugin-book_flight", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "266658642b1670bc" + } + ], + "startTime": 1751314097030415, + "duration": 222, + "tags": [ + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "execute_tool" + }, + { + "key": "gen_ai.tool.call.id", + "type": "string", + "value": "call_AndUezABa8HK8Ybzo7w0zcHt" + }, + { + "key": "gen_ai.tool.description", + "type": "string", + "value": "Book a specific flight." + }, + { + "key": "gen_ai.tool.name", + "type": "string", + "value": "FlightPlugin-book_flight" + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.functions.kernel_function" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "cd277fb2512ef6f7", + "operationName": "chat.streaming_completions gpt-4.1-mini", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "375d6f188df74451" + } + ], + "startTime": 1751314109184384, + "duration": 2012128, + "tags": [ + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "chat.streaming_completions" + }, + { + "key": "gen_ai.request.model", + "type": "string", + "value": "gpt-4.1-mini" + }, + { + "key": "gen_ai.response.finish_reason", + "type": "string", + "value": "FinishReason.STOP" + }, + { + "key": "gen_ai.response.id", + "type": "string", + "value": "chatcmpl-BoF5hiuukQkIrRIHUfV0vOT7iJexz" + }, + { + "key": "gen_ai.system", + "type": "string", + "value": "openai" + }, + { + "key": "gen_ai.usage.input_tokens", + "type": "int64", + "value": 1525 + }, + { + "key": "gen_ai.usage.output_tokens", + "type": "int64", + "value": 180 + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.model_diagnostics.decorators" + }, + { + "key": "server.address", + "type": "string", + "value": "https://ai-naarkalgaihub999971652049.openai.azure.com/openai/deployments/gpt-4.1-mini/" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "8502001ad2213738", + "operationName": "streaming_message_final", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "375d6f188df74451" + } + ], + "startTime": 1751314109183919, + "duration": 59, + "tags": [ + { + "key": "gen_ai.memory.operation_type", + "type": "string", + "value": "write" + }, + { + "key": "gen_ai.memory.source_type", + "type": "string", + "value": "streaming_response" + }, + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "memory_operation" + }, + { + "key": "message.agent_name", + "type": "string", + "value": "hotel_agent" + }, + { + "key": "message.content_length", + "type": "int64", + "value": 1243 + }, + { + "key": "message.processing_complete", + "type": "bool", + "value": true + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "__main__" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [ + { + "timestamp": 1751314109183947, + "fields": [ + { + "key": "event", + "type": "string", + "value": "gen_ai.content.completion" + }, + { + "key": "gen_ai.assistant.message", + "type": "string", + "value": "Let's plan your family trip to Bali step-by-step:\n\n1. Budget allocation for $5000 total:\n- Flights: Approx $1600 (4 round trip tickets at around $400 each, economy)\n- Hotel: Approx $1000 (5 nights at ~$200 per night family room or 2 rooms)\n- Food: $400 ($20 per person per day vegetarian meals)\n- Activities & local transport: $500\n- Miscellaneous: $500 (buffer for visas, souvenirs, extra transport)\n\n2. Flights:\nRound trip flights from Seattle-Tacoma Intl (SEA) to Bali Denpasar (DPS) departing July 30, 2025, returning Aug 4, 2025. Typical economy fares are around $400-$500 per person.\n\n3. Hotels:\nLooking for vegetarian-friendly hotels or resorts with good reviews, family rooms, and appropriate budget (~$200 per night):\n- Option: Ocean View Resort Bali ($190/night) with vegetarian meals available\n- Option: Ubud Green Stay ($150/night) with a vegetarian restaurant onsite\n\n4. Activities:\n- Day 1: Arrival, relax on the beach\n- Day 2: Ubud cultural tour (rice terraces, Sacred Monkey Forest)\n-" + }, + { + "key": "gen_ai.completion", + "type": "string", + "value": "Let's plan your family trip to Bali step-by-step:\n\n1. Budget allocation for $5000 total:\n- Flights: Approx $1600 (4 round trip tickets at around $400 each, economy)\n- Hotel: Approx $1000 (5 nights at ~$200 per night family room or 2 rooms)\n- Food: $400 ($20 per person per day vegetarian meals)\n- Activities & local transport: $500\n- Miscellaneous: $500 (buffer for visas, souvenirs, extra transport)\n\n2. Flights:\nRound trip flights from Seattle-Tacoma Intl (SEA) to Bali Denpasar (DPS) departing July 30, 2025, returning Aug 4, 2025. Typical economy fares are around $400-$500 per person.\n\n3. Hotels:\nLooking for vegetarian-friendly hotels or resorts with good reviews, family rooms, and appropriate budget (~$200 per night):\n- Option: Ocean View Resort Bali ($190/night) with vegetarian meals available\n- Option: Ubud Green Stay ($150/night) with a vegetarian restaurant onsite\n\n4. Activities:\n- Day 1: Arrival, relax on the beach\n- Day 2: Ubud cultural tour (rice terraces, Sacred Monkey Forest)\n-" + }, + { + "key": "output.agent", + "type": "string", + "value": "hotel_agent" + }, + { + "key": "output.role", + "type": "string", + "value": "AuthorRole.ASSISTANT" + }, + { + "key": "output.type", + "type": "string", + "value": "streaming_final" + } + ] + }, + { + "timestamp": 1751314109183975, + "fields": [ + { + "key": "event", + "type": "string", + "value": "gen_ai.tool.calls" + }, + { + "key": "agent", + "type": "string", + "value": "hotel_agent" + }, + { + "key": "tool.call_count", + "type": "int64", + "value": 3 + }, + { + "key": "tool.calls", + "type": "string", + "value": "[{\"function\": \"HotelPlugin-book_hotel\", \"arguments\": \"{\\\"hotel_id\\\": \\\"OceanViewResortBali_001\\\"}\"}, {\"function\": \"HotelPlugin-book_hotel\", \"arguments\": \"{\\\"hotel_id\\\": \\\"UbudGreenStay_002\\\"}\"}, {\"function\": \"HotelPlugin-book_hotel\", \"arguments\": \"{\\\"hotel_id\\\": \\\"BaliGardenHotel_003\\\"}\"}]" + } + ] + } + ], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "375d6f188df74451", + "operationName": "AutoFunctionInvocationLoop", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "233e5f3ce9e0bb7a" + } + ], + "startTime": 1751314104251469, + "duration": 6945061, + "tags": [ + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.connectors.ai.chat_completion_client_base" + }, + { + "key": "sk.available_functions", + "type": "string", + "value": "HotelPlugin-book_hotel" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "0bc4bc43b3a8eb70", + "operationName": "group_chat_agent_message.handle_response_message", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "d4be84bfde51cffa" + } + ], + "startTime": 1751314100682012, + "duration": 42, + "tags": [ + { + "key": "gen_ai.agent.description", + "type": "string", + "value": "Specializes in hotel booking" + }, + { + "key": "gen_ai.agent.id", + "type": "string", + "value": "d155cfa7-89ea-47d6-a912-5e348e5d086e" + }, + { + "key": "gen_ai.agent.name", + "type": "string", + "value": "hotel_agent" + }, + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "group_chat_agent_message.handle_response_message" + }, + { + "key": "group_chat.component", + "type": "string", + "value": "agent_message_handler" + }, + { + "key": "group_chat.operation", + "type": "string", + "value": "handle_response_message" + }, + { + "key": "operation.no_result", + "type": "bool", + "value": true + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.group_chat_diagnostics.decorators" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "77744963fd7dd818", + "operationName": "invoke_agent Manager", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "52090993a4b73d3f" + } + ], + "startTime": 1751314103386857, + "duration": 860013, + "tags": [ + { + "key": "gen_ai.agent.description", + "type": "string", + "value": "The manager of the group chat, responsible for coordinating the agents." + }, + { + "key": "gen_ai.agent.id", + "type": "string", + "value": "b45c5348-2a73-42b9-b3e2-0e0ff1ead8fa" + }, + { + "key": "gen_ai.agent.name", + "type": "string", + "value": "Manager" + }, + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "invoke_agent" + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.agent_diagnostics.decorators" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "ed5659361deee425", + "operationName": "chat.completions gpt-4.1-mini", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "68c0fa8d8a1fdee8" + } + ], + "startTime": 1751314233131227, + "duration": 1776272, + "tags": [ + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "chat.completions" + }, + { + "key": "gen_ai.request.model", + "type": "string", + "value": "gpt-4.1-mini" + }, + { + "key": "gen_ai.response.finish_reason", + "type": "string", + "value": "FinishReason.STOP" + }, + { + "key": "gen_ai.response.id", + "type": "string", + "value": "chatcmpl-BoF7iTR1RkHgLp7ohQ25HQOxgqrun" + }, + { + "key": "gen_ai.system", + "type": "string", + "value": "openai" + }, + { + "key": "gen_ai.usage.input_tokens", + "type": "int64", + "value": 1951 + }, + { + "key": "gen_ai.usage.output_tokens", + "type": "int64", + "value": 59 + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.model_diagnostics.decorators" + }, + { + "key": "server.address", + "type": "string", + "value": "https://ai-naarkalgaihub999971652049.openai.azure.com/openai/deployments/gpt-4.1-mini/" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "9b8c5d8608a62d6a", + "operationName": "chat.completions gpt-4.1-mini", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "41e36a0bc822fd7a" + } + ], + "startTime": 1751314234990932, + "duration": 2491848, + "tags": [ + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "chat.completions" + }, + { + "key": "gen_ai.request.model", + "type": "string", + "value": "gpt-4.1-mini" + }, + { + "key": "gen_ai.response.finish_reason", + "type": "string", + "value": "FinishReason.STOP" + }, + { + "key": "gen_ai.response.id", + "type": "string", + "value": "chatcmpl-BoF7jN2sFjgZMSJ4ehMcdzO5x6hA1" + }, + { + "key": "gen_ai.system", + "type": "string", + "value": "openai" + }, + { + "key": "gen_ai.usage.input_tokens", + "type": "int64", + "value": 1949 + }, + { + "key": "gen_ai.usage.output_tokens", + "type": "int64", + "value": 290 + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.model_diagnostics.decorators" + }, + { + "key": "server.address", + "type": "string", + "value": "https://ai-naarkalgaihub999971652049.openai.azure.com/openai/deployments/gpt-4.1-mini/" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "bca6723e725625f9", + "operationName": "comprehensive_task_execution", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "d4be84bfde51cffa" + } + ], + "startTime": 1751314078909259, + "duration": 158578947, + "tags": [ + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "execute_task" + }, + { + "key": "gen_ai.system", + "type": "string", + "value": "semantic_kernel_multi_agent" + }, + { + "key": "gen_ai.task.assigned_agents", + "type": "string", + "value": "[\"planner\",\"flight_agent\",\"hotel_agent\"]" + }, + { + "key": "gen_ai.task.constraints", + "type": "string", + "value": "[\"budget:5000\",\"duration:5_days\",\"travelers:4\",\"dietary:vegetarian\"]" + }, + { + "key": "gen_ai.task.description", + "type": "string", + "value": "Plan a trip to Bali for 5 days including flights, hotels, and activities for a vegetarian family of 4 members. The family lives in Seattle, WA, USA. Their vacation starts on July 30th 2025. They have a strict budget of $5000 for the trip. Please think through this step-by-step: first assess the budget allocation, then find suitable flights, select appropriate vegetarian-friendly accommodations, and plan activities. Show your reasoning process and provide a detailed plan with the necessary bookings." + }, + { + "key": "gen_ai.task.expected_output", + "type": "string", + "value": "Complete travel plan with bookings" + }, + { + "key": "gen_ai.task.id", + "type": "string", + "value": "bali_trip_planning_001" + }, + { + "key": "gen_ai.task.status", + "type": "string", + "value": "completed" + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "__main__" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + }, + { + "key": "task.budget", + "type": "int64", + "value": 5000 + }, + { + "key": "task.destination", + "type": "string", + "value": "Bali" + }, + { + "key": "task.duration_days", + "type": "int64", + "value": 5 + }, + { + "key": "task.expected_tool_usage", + "type": "string", + "value": "[\"flight_search\",\"hotel_search\",\"planning_tools\"]" + }, + { + "key": "task.travelers", + "type": "int64", + "value": 4 + } + ], + "logs": [], + "processID": "p1", + "warnings": null + }, + { + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "de6960c446082857", + "operationName": "group_chat_manager.determine_state_and_take_action", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "0e6ca4d1277b2e27ef795c997928cf3a", + "spanID": "5fc115acec34efd6" + } + ], + "startTime": 1751314111206231, + "duration": 126281444, + "tags": [ + { + "key": "gen_ai.operation.name", + "type": "string", + "value": "group_chat_manager.determine_state_and_take_action" + }, + { + "key": "group_chat.component", + "type": "string", + "value": "manager" + }, + { + "key": "group_chat.operation", + "type": "string", + "value": "determine_state_and_take_action" + }, + { + "key": "langfuse.component", + "type": "string", + "value": "group_chat_manager" + }, + { + "key": "langfuse.operation", + "type": "string", + "value": "determine_state_and_take_action" + }, + { + "key": "langfuse.success", + "type": "bool", + "value": true + }, + { + "key": "manager.id", + "type": "string", + "value": "GroupChatManagerActor_b18281f3cfae4704ae0ccdec4737ab33/default" + }, + { + "key": "operation.success", + "type": "bool", + "value": true + }, + { + "key": "otel.scope.name", + "type": "string", + "value": "semantic_kernel.utils.telemetry.group_chat_diagnostics.decorators" + }, + { + "key": "span.kind", + "type": "string", + "value": "internal" + } + ], + "logs": [ + { + "timestamp": 1751314111206244, + "fields": [ + { + "key": "event", + "type": "string", + "value": "group_chat.planning" + }, + { + "key": "event.type", + "type": "string", + "value": "coordination_planning" + }, + { + "key": "langfuse.planning", + "type": "bool", + "value": true + }, + { + "key": "operation.phase", + "type": "string", + "value": "planning" + }, + { + "key": "planning.type", + "type": "string", + "value": "state_determination" + } + ] + }, + { + "timestamp": 1751314111206266, + "fields": [ + { + "key": "event", + "type": "string", + "value": "gen_ai.content.prompt" + }, + { + "key": "gen_ai.prompt", + "type": "string", + "value": "AuthorRole.ASSISTANT: Step 1: Budget Allocation\nThe family has a strict budget of $5000 for 5 days. The main expenses are:\n- Flights (round trip for 4 people)\n- Hotels (5 nights)\n- Food (vegetarian)\n- Activities and local \nAuthorRole.USER: Transferred to flight_agent\nAuthorRole.ASSISTANT: Here's my detailed reasoning and plan for the Bali trip for a family of 4 from Seattle with a $5000 budget:\n\n1. Budget Allocation:\n- Flights: Approx $1600 (4 people round trip, $400 each)\n- Hotel: App\nAuthorRole.USER: Transferred to hotel_agent\nAuthorRole.ASSISTANT: Let's plan your family trip to Bali step-by-step:\n\n1. Budget allocation for $5000 total:\n- Flights: Approx $1600 (4 round trip tickets at around $400 each, economy)\n- Hotel: Approx $1000 (5 nights at " + }, + { + "key": "input.message_count", + "type": "int64", + "value": 7 + }, + { + "key": "input.message_type", + "type": "string", + "value": "conversation_history" + }, + { + "key": "input.recent_message_count", + "type": "int64", + "value": 5 + }, + { + "key": "input.source", + "type": "string", + "value": "group_chat_history" + }, + { + "key": "langfuse.conversation", + "type": "string", + "value": "AuthorRole.ASSISTANT: Step 1: Budget Allocation\nThe family has a strict budget of $5000 for 5 days. The main expenses are:\n- Flights (round trip for 4 people)\n- Hotels (5 nights)\n- Food (vegetarian)\n- Activities and local \nAuthorRole.USER: Transferred to flight_agent\nAuthorRole.ASSISTANT: Here's my detailed reasoning and plan for the Bali trip for a family of 4 from Seattle with a $5000 budget:\n\n1. Budget Allocation:\n- Flights: Approx $1600 (4 people round trip, $400 each)\n- Hotel: App\nAuthorRole.USER: Transferred to hotel_agent\nAuthorRole.ASSISTANT: Let's plan your family trip to Bali step-by-step:\n\n1. Budget allocation for $5000 total:\n- Flights: Approx $1600 (4 round trip tickets at around $400 each, economy)\n- Hotel: Approx $1000 (5 nights at " + }, + { + "key": "langfuse.input", + "type": "string", + "value": "AuthorRole.ASSISTANT: Step 1: Budget Allocation\nThe family has a strict budget of $5000 for 5 days. The main expenses are:\n- Flights (round trip for 4 people)\n- Hotels (5 nights)\n- Food (vegetarian)\n- Activities and local \nAuthorRole.USER: Transferred to flight_agent\nAuthorRole.ASSISTANT: Here's my detailed reasoning and plan for the Bali trip for a family of 4 from Seattle with a $5000 budget:\n\n1. Budget Allocation:\n- Flights: Approx $1600 (4 people round trip, $400 each)\n- Hotel: App\nAuthorRole.USER: Transferred to hotel_agent\nAuthorRole.ASSISTANT: Let's plan your family trip to Bali step-by-step:\n\n1. Budget allocation for $5000 total:\n- Flights: Approx $1600 (4 round trip tickets at around $400 each, economy)\n- Hotel: Approx $1000 (5 nights at " + } + ] + }, + { + "timestamp": 1751314111206272, + "fields": [ + { + "key": "event", + "type": "string", + "value": "input.last_message" + }, + { + "key": "context.type", + "type": "string", + "value": "immediate_context" + }, + { + "key": "last.agent", + "type": "string", + "value": "hotel_agent" + }, + { + "key": "last.message", + "type": "string", + "value": "Let's plan your family trip to Bali step-by-step:\n\n1. Budget allocation for $5000 total:\n- Flights: Approx $1600 (4 round trip tickets at around $400 each, economy)\n- Hotel: Approx $1000 (5 nights at ~$200 per night family room or 2 rooms)\n- Food: $400 ($20 per person per day vegetarian meals)\n- Activities & local transport: $500\n- Miscellaneous: $500 (buffer for visas, souvenirs, extra transport)\n\n2. Flights:\nRound trip flights from Seattle-Tacoma Intl (SEA) to Bali Denpasar (DPS) departing Jul" + }, + { + "key": "last.role", + "type": "string", + "value": "AuthorRole.ASSISTANT" + } + ] + }, + { + "timestamp": 1751314111206287, + "fields": [ + { + "key": "event", + "type": "string", + "value": "planning.participants" + }, + { + "key": "participant.count", + "type": "int64", + "value": 3 + }, + { + "key": "participant.names", + "type": "string", + "value": "[\"planner\",\"flight_agent\",\"hotel_agent\"]" + }, + { + "key": "participants", + "type": "string", + "value": "{\"planner\": \"Creates comprehensive travel plans including flights, hotels, and activities\", \"flight_agent\": \"Specializes in flight booking\", \"hotel_agent\": \"Specializes in hotel booking\"}" + } + ] + }, + { + "timestamp": 1751314237487630, + "fields": [ + { + "key": "event", + "type": "string", + "value": "group_chat.coordination_decision" + }, + { + "key": "coordination.operation", + "type": "string", + "value": "determine_state_and_take_action" + }, + { + "key": "coordination.success", + "type": "bool", + "value": true + }, + { + "key": "event.type", + "type": "string", + "value": "coordination_completed" + }, + { + "key": "langfuse.coordination", + "type": "string", + "value": "Agent coordination decision completed" + }, + { + "key": "planning.decision_made", + "type": "bool", + "value": true + } + ] + }, + { + "timestamp": 1751314237487650, + "fields": [ + { + "key": "event", + "type": "string", + "value": "gen_ai.planning.decision" + }, + { + "key": "langfuse.plan", + "type": "string", + "value": "Group chat coordination decision for determine_state_and_take_action" + }, + { + "key": "planning.completed", + "type": "bool", + "value": true + }, + { + "key": "planning.component", + "type": "string", + "value": "group_chat_manager" + }, + { + "key": "planning.operation", + "type": "string", + "value": "determine_state_and_take_action" + }, + { + "key": "planning.type", + "type": "string", + "value": "overall_coordination" + } + ] + } + ], + "processID": "p1", + "warnings": null + } + ], + "processes": { + "p1": { + "serviceName": "otel-compare", + "tags": [ + { + "key": "deployment.environment", + "type": "string", + "value": "development" + }, + { + "key": "service.version", + "type": "string", + "value": "1.0.0" + }, + { + "key": "telemetry.sdk.language", + "type": "string", + "value": "python" + }, + { + "key": "telemetry.sdk.name", + "type": "string", + "value": "opentelemetry" + }, + { + "key": "telemetry.sdk.version", + "type": "string", + "value": "1.34.0" + } + ] + } + }, + "warnings": null + } + ], + "total": 0, + "limit": 0, + "offset": 0, + "errors": null +} \ No newline at end of file diff --git a/python/samples/demos/travel_planning_system/observability.py b/python/samples/demos/travel_planning_system/observability.py index 0f834a1bc77a..a0d25a8b6f7b 100644 --- a/python/samples/demos/travel_planning_system/observability.py +++ b/python/samples/demos/travel_planning_system/observability.py @@ -11,22 +11,31 @@ from opentelemetry.sdk._logs import LoggerProvider, LoggingHandler from opentelemetry.sdk._logs.export import BatchLogRecordProcessor from opentelemetry.sdk.resources import Resource -from opentelemetry.sdk.trace import TracerProvider +from opentelemetry.sdk.trace import TracerProvider, ReadableSpan from opentelemetry.sdk.trace.export import BatchSpanProcessor from opentelemetry.semconv.resource import ResourceAttributes from opentelemetry.trace import set_tracer_provider +from opentelemetry.trace import NoOpTracerProvider from opentelemetry.trace.span import format_trace_id +from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter if sys.version_info >= (3, 12): - pass # pragma: no cover + from typing import override # pragma: no cover else: - pass # pragma: no cover + from typing_extensions import override # pragma: no cover load_dotenv() -APPINSIGHTS_CONNECTION_STRING = os.getenv("APPINSIGHTS_CONNECTION_STRING") +APPINSIGHTS_CONNECTION_STRING = os.getenv("APPLICATIONINSIGHTS_CONNECTION_STRING") + +# Create resource with service name from environment or default +service_name = os.getenv("OTEL_SERVICE_NAME", "TravelPlanningSystemDemo") +resource = Resource.create({ + ResourceAttributes.SERVICE_NAME: service_name, + ResourceAttributes.SERVICE_VERSION: "1.0.0", + "deployment.environment": os.getenv("DEPLOYMENT_ENV", "development") +}) -resource = Resource.create({ResourceAttributes.SERVICE_NAME: "TravelPlanningSystemDemo"}) def set_up_logging(): @@ -67,27 +76,56 @@ def filter(self, record): logger.setLevel(logging.NOTSET) -# class CustomBatchSpanProcessor(BatchSpanProcessor): -# @override -# def on_end(self, span: ReadableSpan): -# if span.name.startswith("agent_runtime"): -# # Skip spans that are part of the agent runtime. -# return -# super().on_end(span) +class CustomBatchSpanProcessor(BatchSpanProcessor): + @override + def on_end(self, span: ReadableSpan): + if span.name.startswith("agent_runtime"): # group_chat_manager + # Skip spans that are part of the agent runtime. + return + # Skip empty streaming message spans + if span.name == "streaming_message_final": + attributes = span.attributes or {} + content_length = attributes.get("message.content_length", 0) + if content_length == 0: + return + super().on_end(span) def set_up_tracing(): exporters = [] - exporters.append(AzureMonitorTraceExporter(connection_string=APPINSIGHTS_CONNECTION_STRING)) - - # Initialize a trace provider for the application. This is a factory for creating tracers. + + # Add Azure Monitor exporter if connection string is available + if APPINSIGHTS_CONNECTION_STRING: + exporters.append(AzureMonitorTraceExporter( + connection_string=APPINSIGHTS_CONNECTION_STRING + )) + print("šŸ“Š Azure Monitor trace export enabled") + + # Add Jaeger/OTLP exporter for local development + jaeger_endpoint = os.getenv("OTEL_EXPORTER_OTLP_TRACES_ENDPOINT", + "http://localhost:4318/v1/traces") + try: + otlp_exporter = OTLPSpanExporter(endpoint=jaeger_endpoint) + exporters.append(otlp_exporter) + print(f"šŸ“Š Jaeger/OTLP trace export enabled: {jaeger_endpoint}") + except Exception as e: + print(f"āš ļø Failed to initialize OTLP exporter: {e}") + + # Initialize a trace provider for the application tracer_provider = TracerProvider(resource=resource) - # Span processors are initialized with an exporter which is responsible - # for sending the telemetry data to a particular backend. + + # Add all available exporters for exporter in exporters: - tracer_provider.add_span_processor(BatchSpanProcessor(exporter)) + # tracer_provider.add_span_processor(BatchSpanProcessor(exporter)) + tracer_provider.add_span_processor(CustomBatchSpanProcessor(exporter)) + # Sets the global default tracer provider set_tracer_provider(tracer_provider) + + if not exporters: + print("āš ļø No trace exporters configured - traces will not be sent") + else: + print(f"āœ… Tracing initialized with {len(exporters)} exporter(s)") def enable_observability(func): diff --git a/python/samples/demos/travel_planning_system/reasoning_agent.py b/python/samples/demos/travel_planning_system/reasoning_agent.py new file mode 100644 index 000000000000..28c135806638 --- /dev/null +++ b/python/samples/demos/travel_planning_system/reasoning_agent.py @@ -0,0 +1,165 @@ +"""Reasoning-compatible agent that can work with both standard and reasoning models.""" + +import sys +import os +import logging +from typing import List, Optional, Any + +# Load environment variables +from dotenv import load_dotenv +load_dotenv() + +# Add current directory to path for importing azure_reasoning_service +sys.path.append(os.path.dirname(__file__)) + +from semantic_kernel.agents import ChatCompletionAgent +from semantic_kernel.connectors.ai.open_ai import AzureChatCompletion +from semantic_kernel.contents import ChatHistory, ChatMessageContent, AuthorRole + +try: + from azure_reasoning_service import AzureReasoningCompletion +except ImportError: + # If import fails, we'll handle it gracefully in the class + AzureReasoningCompletion = None + +logger = logging.getLogger(__name__) + +# Known reasoning models that require the reasoning API endpoint +REASONING_MODELS = { + "o1-mini", "o1-preview", "o1-pro", + "o3-mini", "o3-pro", + # Add more as they become available +} + + +class ReasoningCompatibleAgent(ChatCompletionAgent): + """ + Agent that automatically detects reasoning models and uses the appropriate API. + """ + + def __init__( + self, + name: str, + description: str, + instructions: str, + plugins: Optional[List[Any]] = None, + **kwargs + ): + # Determine which service to use based on the model + deployment_name = os.getenv("AZURE_OPENAI_CHAT_DEPLOYMENT_NAME", "gpt-4o") + + if self._is_reasoning_model(deployment_name): + if AzureReasoningCompletion is None: + logger.warning("AzureReasoningCompletion not available, falling back to standard service") + service = AzureChatCompletion() + modified_instructions = instructions + self._is_fallback = True + else: + logger.info(f"Using reasoning model '{deployment_name}' with AzureReasoningCompletion") + service = AzureReasoningCompletion() + modified_instructions = self._adapt_instructions_for_reasoning(instructions) + self._is_fallback = False + else: + logger.info(f"Using standard model '{deployment_name}' with AzureChatCompletion") + service = AzureChatCompletion() + modified_instructions = instructions + self._is_fallback = False + + # Initialize the parent ChatCompletionAgent + super().__init__( + name=name, + description=description, + instructions=modified_instructions, + service=service, + plugins=plugins or [], + **kwargs + ) + + self._deployment_name = deployment_name + self._is_reasoning = self._is_reasoning_model(deployment_name) + + def _is_reasoning_model(self, model_name: str) -> bool: + """Check if the given model name is a reasoning model.""" + return any(reasoning_model in model_name.lower() for reasoning_model in REASONING_MODELS) + + def _adapt_instructions_for_reasoning(self, instructions: str) -> str: + """ + Adapt instructions for reasoning models with Chain of Thought prompting. + """ + cot_prompt = """ +When solving problems, please think step by step using this approach: + +1. **Understanding**: First, carefully read and understand what is being asked +2. **Analysis**: Break down the problem into smaller components +3. **Planning**: Consider different approaches and choose the best one +4. **Reasoning**: Work through your solution step by step, showing your thinking +5. **Verification**: Check if your solution makes sense and addresses all requirements + +For travel planning tasks specifically: +- Consider budget constraints carefully +- Think about practical logistics (travel times, connections) +- Account for dietary restrictions and preferences +- Verify availability and realistic pricing +- Provide specific, actionable recommendations + +Original instructions: """ + instructions + """ + +Please follow both the chain-of-thought approach above and the specific instructions for your role.""" + + return cot_prompt + + async def invoke(self, chat_history: ChatHistory, **kwargs) -> List[ChatMessageContent]: + """ + Override invoke to handle reasoning model specifics. + """ + if self._is_reasoning: + # For reasoning models, we need to handle system messages differently + modified_history = self._adapt_chat_history_for_reasoning(chat_history) + return await super().invoke(modified_history, **kwargs) + else: + return await super().invoke(chat_history, **kwargs) + + def _adapt_chat_history_for_reasoning(self, chat_history: ChatHistory) -> ChatHistory: + """ + Adapt chat history for reasoning models by handling system messages. + """ + adapted_history = ChatHistory() + + # Process each message + for message in chat_history.messages: + if message.role == AuthorRole.SYSTEM: + # Convert system message to user message with a prefix + user_content = f"[System Instructions]: {message.content}\n\nPlease follow these instructions in your responses." + adapted_history.add_user_message(user_content) + else: + # Keep other messages as-is + adapted_history.add_message(message) + + return adapted_history + + def get_model_info(self) -> dict: + """Get information about the current model configuration.""" + return { + "deployment_name": self._deployment_name, + "is_reasoning_model": self._is_reasoning, + "service_type": "AzureReasoningCompletion" if self._is_reasoning else "AzureChatCompletion" + } + + +def create_reasoning_compatible_agent( + name: str, + description: str, + instructions: str, + plugins: Optional[List[Any]] = None, + **kwargs +) -> ReasoningCompatibleAgent: + """ + Factory function to create a reasoning-compatible agent. + """ + return ReasoningCompatibleAgent( + name=name, + description=description, + instructions=instructions, + plugins=plugins, + **kwargs + ) diff --git a/python/semantic_kernel/agents/orchestration/group_chat.py b/python/semantic_kernel/agents/orchestration/group_chat.py index 4b4fe07b2cc7..2266beea5a43 100644 --- a/python/semantic_kernel/agents/orchestration/group_chat.py +++ b/python/semantic_kernel/agents/orchestration/group_chat.py @@ -23,6 +23,11 @@ from semantic_kernel.contents.utils.author_role import AuthorRole from semantic_kernel.kernel_pydantic import KernelBaseModel from semantic_kernel.utils.feature_stage_decorator import experimental +from semantic_kernel.utils.telemetry.group_chat_diagnostics import ( + trace_group_chat_agent_message, + trace_group_chat_manager_message, + trace_group_chat_orchestration, +) if sys.version_info >= (3, 12): from typing import override # pragma: no cover @@ -103,6 +108,7 @@ class GroupChatAgentActor(AgentActorBase): """An agent actor that process messages in a group chat.""" @message_handler + @trace_group_chat_agent_message("handle_start_message") async def _handle_start_message(self, message: GroupChatStartMessage, ctx: MessageContext) -> None: """Handle the start message for the group chat.""" logger.debug(f"{self.id}: Received group chat start message.") @@ -122,7 +128,9 @@ async def _handle_start_message(self, message: GroupChatStartMessage, ctx: Messa raise ValueError(f"Invalid message body type: {type(message.body)}. Expected {DefaultTypeAlias}.") @message_handler + @trace_group_chat_agent_message("handle_response_message") async def _handle_response_message(self, message: GroupChatResponseMessage, ctx: MessageContext) -> None: + """Handle response message from another agent.""" logger.debug(f"{self.id}: Received group chat response message.") if self._agent_thread is not None: await self._agent_thread.on_new_message(message.body) @@ -130,14 +138,16 @@ async def _handle_response_message(self, message: GroupChatResponseMessage, ctx: self._chat_history.add_message(message.body) @message_handler + @trace_group_chat_agent_message("invoke") async def _handle_request_message(self, message: GroupChatRequestMessage, ctx: MessageContext) -> None: + """Handle request message to invoke this agent.""" if message.agent_name != self._agent.name: return logger.debug(f"{self.id}: Received group chat request message.") - + response = await self._invoke_agent() - + logger.debug(f"{self.id} responded with {response}.") await self.publish_message( @@ -288,6 +298,7 @@ def __init__( super().__init__(description="An actor for the group chat manager.") @message_handler + @trace_group_chat_manager_message("handle_start_message") async def _handle_start_message(self, message: GroupChatStartMessage, ctx: MessageContext) -> None: """Handle the start message for the group chat.""" logger.debug(f"{self.id}: Received group chat start message.") @@ -302,7 +313,9 @@ async def _handle_start_message(self, message: GroupChatStartMessage, ctx: Messa await self._determine_state_and_take_action(ctx.cancellation_token) @message_handler + @trace_group_chat_manager_message("handle_response_message") async def _handle_response_message(self, message: GroupChatResponseMessage, ctx: MessageContext) -> None: + """Handle response messages from agents in the group chat.""" if message.body.role != AuthorRole.USER: self._chat_history.add_message( ChatMessageContent( @@ -314,6 +327,7 @@ async def _handle_response_message(self, message: GroupChatResponseMessage, ctx: await self._determine_state_and_take_action(ctx.cancellation_token) + @trace_group_chat_manager_message("determine_state_and_take_action") async def _determine_state_and_take_action(self, cancellation_token: CancellationToken) -> None: """Determine the state of the group chat and take action accordingly.""" # User input state @@ -419,6 +433,7 @@ def __init__( ) @override + @trace_group_chat_orchestration("start") async def _start( self, task: DefaultTypeAlias, @@ -434,7 +449,6 @@ async def _start( too slow), it might send a request to the next agent before the other actors have the necessary context. """ - async def send_start_message(agent: Agent) -> None: target_actor_id = await runtime.get(self._get_agent_actor_type(agent, internal_topic_type)) await runtime.send_message( diff --git a/python/semantic_kernel/utils/telemetry/group_chat_diagnostics/__init__.py b/python/semantic_kernel/utils/telemetry/group_chat_diagnostics/__init__.py new file mode 100644 index 000000000000..ecd2421e8c17 --- /dev/null +++ b/python/semantic_kernel/utils/telemetry/group_chat_diagnostics/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) Microsoft. All rights reserved. + +from semantic_kernel.utils.telemetry.group_chat_diagnostics.decorators import ( + trace_group_chat_agent_message, + trace_group_chat_manager_message, + trace_group_chat_orchestration, +) + +__all__ = [ + "trace_group_chat_agent_message", + "trace_group_chat_manager_message", + "trace_group_chat_orchestration", +] diff --git a/python/semantic_kernel/utils/telemetry/group_chat_diagnostics/decorators.py b/python/semantic_kernel/utils/telemetry/group_chat_diagnostics/decorators.py new file mode 100644 index 000000000000..c55cceedcf0b --- /dev/null +++ b/python/semantic_kernel/utils/telemetry/group_chat_diagnostics/decorators.py @@ -0,0 +1,701 @@ +# Copyright (c) Microsoft. All rights reserved. + +import functools +import json +from collections.abc import AsyncIterable, Awaitable, Callable +from typing import ParamSpec, TypeVar, cast + +from opentelemetry.trace import get_tracer + +from semantic_kernel.utils.feature_stage_decorator import experimental +from semantic_kernel.utils.telemetry.agent_diagnostics import gen_ai_attributes + +P = ParamSpec("P") +T = TypeVar("T") + +# Creates a tracer from the global tracer provider +tracer = get_tracer(__name__) + + +@experimental +def trace_group_chat_agent_message(operation_name: str): + """Decorator to trace group chat agent message operations with rich input/output.""" + def decorator(func: Callable[P, Awaitable[T]]) -> Callable[P, Awaitable[T]]: + @functools.wraps(func) + async def wrapper(*args: P.args, **kwargs: P.kwargs) -> T: + agent_actor = args[0] if args else None + + with tracer.start_as_current_span(f"group_chat_agent_message.{operation_name}") as span: + # Set basic operation attributes + span.set_attributes({ + gen_ai_attributes.OPERATION: f"group_chat_agent_message.{operation_name}", + "group_chat.operation": operation_name, + "group_chat.component": "agent_message_handler" + }) + + # Capture agent information + if agent_actor and hasattr(agent_actor, '_agent'): + agent = agent_actor._agent + span.set_attributes({ + gen_ai_attributes.AGENT_ID: agent.id, + gen_ai_attributes.AGENT_NAME: agent.name, + }) + if agent.description: + span.set_attribute(gen_ai_attributes.AGENT_DESCRIPTION, agent.description) + + # Capture input context based on operation + try: + if operation_name == "handle_start_message": + # This is the start of a conversation + span.add_event("group_chat.conversation_start", { + "event.type": "conversation_initialization", + "operation.phase": "start" + }) + elif operation_name == "handle_response_message": + # This is handling a response from another agent + message_context = args[1] if len(args) > 1 else kwargs.get('message_context') + if message_context and hasattr(message_context, 'message'): + msg = message_context.message + if hasattr(msg, 'content'): + input_content = str(msg.content)[:1000] + span.add_event("gen_ai.content.prompt", { + "gen_ai.prompt": input_content, + "input.message_type": "agent_response", + "input.source": "other_agent", + "group_chat.message_flow": "agent_to_agent" + }) + + # Capture message metadata + if hasattr(msg, 'role'): + span.set_attribute("input.message_role", str(msg.role)) + if hasattr(message_context, 'sender'): + span.set_attribute("input.sender", str(message_context.sender)) + elif operation_name == "invoke": + # This is the main invoke operation + span.add_event("group_chat.agent_invoke", { + "event.type": "agent_invocation", + "operation.phase": "invoke" + }) + + except Exception as e: + span.set_attribute("input.capture_error", str(e)) + + # Execute the function + result = await func(*args, **kwargs) + + # Capture output + try: + if result: + if hasattr(result, 'content'): + output_content = str(result.content)[:1000] + span.add_event("gen_ai.content.completion", { + "gen_ai.completion": output_content, + "output.message_type": "agent_decision", + "group_chat.output_type": operation_name + }) + elif isinstance(result, bool): + span.add_event("group_chat.decision", { + "decision.result": result, + "decision.operation": operation_name + }) + + span.set_attribute("operation.success", True) + else: + span.set_attribute("operation.no_result", True) + + except Exception as e: + span.set_attribute("output.capture_error", str(e)) + + return result + + return wrapper + return decorator + + +@experimental +def trace_group_chat_manager_message(operation_name: str): + """Enhanced decorator to trace group chat manager message operations with comprehensive input/output for Langfuse.""" + def decorator(func: Callable[P, Awaitable[T]]) -> Callable[P, Awaitable[T]]: + @functools.wraps(func) + async def wrapper(*args: P.args, **kwargs: P.kwargs) -> T: + manager = args[0] if args else None + + with tracer.start_as_current_span(f"group_chat_manager.{operation_name}") as span: + # Set basic operation attributes + span.set_attributes({ + gen_ai_attributes.OPERATION: f"group_chat_manager.{operation_name}", + "group_chat.operation": operation_name, + "group_chat.component": "manager", + "langfuse.operation": operation_name, + "langfuse.component": "group_chat_manager" + }) + + # Capture manager information + if manager and hasattr(manager, 'name'): + span.set_attribute("manager.name", manager.name) + if manager and hasattr(manager, 'id'): + span.set_attribute("manager.id", str(manager.id)) + + # ENHANCED: Comprehensive input context capture + try: + if operation_name == "determine_state_and_take_action": + # This is the key planning/coordination operation + span.add_event("group_chat.planning", { + "event.type": "coordination_planning", + "operation.phase": "planning", + "planning.type": "state_determination", + "langfuse.planning": True + }) + + # Capture complete conversation history for planning context + if hasattr(manager, '_chat_history') and manager._chat_history: + messages = manager._chat_history.messages + if messages: + # Capture recent conversation context (last 5 messages) + recent_messages = messages[-5:] if len(messages) > 5 else messages + conversation_context = "\n".join([ + f"{msg.role}: {str(msg.content)[:200]}" + for msg in recent_messages + if hasattr(msg, 'content') and hasattr(msg, 'role') + ])[:1500] + + span.add_event("gen_ai.content.prompt", { + "gen_ai.prompt": conversation_context, + "input.message_type": "conversation_history", + "input.source": "group_chat_history", + "input.message_count": len(messages), + "input.recent_message_count": len(recent_messages), + "langfuse.input": conversation_context, + "langfuse.conversation": conversation_context + }) + + # Capture the very last message for immediate context + last_message = messages[-1] + if hasattr(last_message, 'content'): + span.add_event("input.last_message", { + "last.message": str(last_message.content)[:500], + "last.role": str(last_message.role), + "last.agent": getattr(last_message, 'name', 'unknown'), + "context.type": "immediate_context" + }) + + # Capture participant information for agent selection context + if hasattr(manager, '_participant_descriptions') and manager._participant_descriptions: + span.add_event("planning.participants", { + "participants": json.dumps(manager._participant_descriptions), + "participant.count": len(manager._participant_descriptions), + "participant.names": list(manager._participant_descriptions.keys()) + }) + + # Try to capture conversation history if available in args + if len(args) > 1: + conversation_data = args[1] if hasattr(args[1], '__iter__') else None + if conversation_data: + span.set_attribute("planning.has_conversation_context", True) + + elif operation_name in ["handle_start_message", "handle_response_message"]: + # Capture message context for start and response operations + message_context = args[1] if len(args) > 1 else kwargs.get('message_context') + if message_context and hasattr(message_context, 'message'): + msg = message_context.message + if hasattr(msg, 'content'): + input_content = str(msg.content)[:1000] + span.add_event("gen_ai.content.prompt", { + "gen_ai.prompt": input_content, + "input.message_type": "coordination_input", + "input.source": "conversation", + "group_chat.coordination_context": operation_name, + "langfuse.input": input_content + }) + + # Enhanced message metadata + if hasattr(msg, 'role'): + span.set_attribute("input.message_role", str(msg.role)) + if hasattr(message_context, 'sender'): + span.set_attribute("input.sender", str(message_context.sender)) + if hasattr(msg, 'name'): + span.set_attribute("input.agent_name", str(msg.name)) + + except Exception as e: + span.set_attribute("input.capture_error", str(e)) + + # Execute the function + result = await func(*args, **kwargs) + + # ENHANCED: Comprehensive output capture - especially important for planning operations + try: + if operation_name == "determine_state_and_take_action": + # This is the planning result - very important for observability + span.add_event("group_chat.coordination_decision", { + "event.type": "coordination_completed", + "coordination.operation": operation_name, + "coordination.success": True, + "planning.decision_made": True, + "langfuse.coordination": "Agent coordination decision completed" + }) + + # Try to capture any planning decision details + if result: + if hasattr(result, '__dict__'): + # Try to capture planning decision details + result_dict = vars(result) + span.add_event("group_chat.planning_result", { + "planning.decision_made": True, + "planning.result_type": type(result).__name__, + "planning.has_details": bool(result_dict), + "langfuse.planning_result": True + }) + + # Capture specific planning details if available + if 'next_agent' in result_dict: + span.set_attribute("planning.next_agent", str(result_dict['next_agent'])) + if 'action' in result_dict: + span.set_attribute("planning.action", str(result_dict['action'])) + + elif isinstance(result, str): + # String result - might be agent selection or action + span.add_event("gen_ai.content.completion", { + "gen_ai.completion": result[:500], + "output.message_type": "planning_decision", + "planning.decision": result[:200], + "langfuse.output": result[:500], + "langfuse.planning_decision": result[:200] + }) + + # Always capture the planning completion + span.add_event("gen_ai.planning.decision", { + "planning.type": "overall_coordination", + "planning.component": "group_chat_manager", + "planning.operation": operation_name, + "planning.completed": True, + "langfuse.plan": f"Group chat coordination decision for {operation_name}" + }) + + elif operation_name in ["handle_start_message", "handle_response_message"]: + # Capture message handling results + span.add_event("group_chat.message_handled", { + "event.type": "message_processing_complete", + "message.operation": operation_name, + "message.success": True, + "langfuse.message_handled": True + }) + + if result and hasattr(result, 'content'): + output_content = str(result.content)[:1000] + span.add_event("gen_ai.content.completion", { + "gen_ai.completion": output_content, + "output.message_type": "manager_response", + "group_chat.manager_output": operation_name, + "langfuse.output": output_content + }) + + # Always set success indicator + span.set_attribute("operation.success", True) + span.set_attribute("langfuse.success", True) + + except Exception as e: + span.set_attribute("output.capture_error", str(e)) + span.set_attribute("langfuse.error", str(e)) + + return result + + return wrapper + return decorator + + +@experimental +def trace_group_chat_orchestration(operation_name: str): + """Decorator to trace group chat orchestration operations with rich input/output.""" + def decorator(func: Callable[P, Awaitable[T]]) -> Callable[P, Awaitable[T]]: + @functools.wraps(func) + async def wrapper(*args: P.args, **kwargs: P.kwargs) -> T: + orchestrator = args[0] if args else None + + with tracer.start_as_current_span(f"group_chat_orchestration.{operation_name}") as span: + # Set basic operation attributes + span.set_attributes({ + gen_ai_attributes.OPERATION: f"group_chat_orchestration.{operation_name}", + "group_chat.operation": operation_name, + "group_chat.component": "orchestration" + }) + + # This is likely the root span for the whole group chat operation + if operation_name == "start": + span.set_attribute("group_chat.is_root_operation", True) + span.add_event("group_chat.session_start", { + "event.type": "orchestration_start", + "session.phase": "initialization" + }) + + # Capture orchestration input + try: + # Look for input message or conversation starter + input_message = None + if len(args) > 1: + input_message = args[1] + elif 'message' in kwargs: + input_message = kwargs['message'] + elif 'input' in kwargs: + input_message = kwargs['input'] + + if input_message and hasattr(input_message, 'content'): + input_content = str(input_message.content)[:1000] + span.add_event("gen_ai.content.prompt", { + "gen_ai.prompt": input_content, + "input.message_type": "orchestration_input", + "input.source": "user_request", + "group_chat.session_input": True + }) + + span.set_attribute("orchestration.has_input", True) + span.set_attribute("orchestration.input_length", len(input_message.content)) + + # Capture orchestration configuration + if orchestrator: + if hasattr(orchestrator, '_members'): + agent_count = len(orchestrator._members) if orchestrator._members else 0 + span.set_attribute("orchestration.agent_count", agent_count) + + # Capture agent names for better observability + if agent_count > 0: + agent_names = [agent.name for agent in orchestrator._members if hasattr(agent, 'name')] + span.add_event("orchestration.agents_configured", { + "agents.count": agent_count, + "agents.names": str(agent_names)[:500] + }) + + except Exception as e: + span.set_attribute("input.capture_error", str(e)) + + # Execute the function and capture result + result = await func(*args, **kwargs) + + # Capture orchestration completion + try: + span.set_attribute("orchestration.completed", True) + + if operation_name == "start": + span.add_event("group_chat.session_started", { + "event.type": "orchestration_started", + "session.success": True + }) + + except Exception as e: + span.set_attribute("output.capture_error", str(e)) + + return result + + return wrapper + return decorator + +@experimental +def trace_agent_invocation(invoke_func: Callable[P, AsyncIterable[T]]) -> Callable[P, AsyncIterable[T]]: + """Enhanced decorator to trace agent invocation with multi-agent context.""" + OPERATION_NAME = "invoke_agent" + + @functools.wraps(invoke_func) + async def wrapper_decorator(*args: P.args, **kwargs: P.kwargs) -> AsyncIterable[T]: + from semantic_kernel.agents.agent import Agent + + agent = cast(Agent, args[0]) + + with tracer.start_as_current_span(f"{OPERATION_NAME} {agent.name}") as span: + # Basic agent information + span.set_attributes({ + gen_ai_attributes.OPERATION: OPERATION_NAME, + gen_ai_attributes.AGENT_ID: agent.id, + gen_ai_attributes.AGENT_NAME: agent.name, + }) + + if agent.description: + span.set_attribute(gen_ai_attributes.AGENT_DESCRIPTION, agent.description) + + # ENHANCED: Capture multi-agent context and input/output + try: + # Try to get additional context from the agent actor + agent_actor = args[0] if hasattr(args[0], '_agent') else None + + # Capture who is invoking this agent (calling context) + if hasattr(agent_actor, 'id'): + span.set_attribute("invocation.source_actor", str(agent_actor.id)) + + # Enhanced: Track calling context for multi-agent scenarios + import inspect + frame = inspect.currentframe() + if frame and frame.f_back and frame.f_back.f_back: + caller_name = frame.f_back.f_back.f_code.co_name + span.set_attribute("invocation.caller_function", caller_name) + + # Detect if this is part of multi-agent coordination + if any(keyword in caller_name.lower() for keyword in ['select', 'should', 'filter', 'manage', 'plan']): + span.set_attribute("invocation.context", "multi_agent_coordination") + span.set_attribute("invocation.coordination_type", caller_name) + + # Add specific coordination context + if 'select' in caller_name.lower(): + span.set_attribute("coordination.operation", "agent_selection") + elif 'should' in caller_name.lower(): + span.set_attribute("coordination.operation", "decision_making") + elif 'filter' in caller_name.lower(): + span.set_attribute("coordination.operation", "result_filtering") + elif 'plan' in caller_name.lower(): + span.set_attribute("coordination.operation", "planning") + + # Capture input messages if available + messages_arg = args[1] if len(args) > 1 else None + if messages_arg: + if hasattr(messages_arg, '__iter__') and not isinstance(messages_arg, str): + # Collection of messages + message_list = list(messages_arg) + if message_list: + span.set_attribute("invocation.input_message_count", len(message_list)) + + # Capture the latest message content + latest_msg = message_list[-1] + if hasattr(latest_msg, 'content'): + input_content = str(latest_msg.content)[:1000] + span.add_event("gen_ai.content.prompt", { + "gen_ai.prompt": input_content, + "input.message_type": "conversation_context", + "input.total_messages": len(message_list), + "input.source": "multi_agent_conversation" + }) + + # Capture conversation context (last few messages) + if len(message_list) > 1: + context_msgs = message_list[-3:] if len(message_list) > 3 else message_list + context_content = "\n".join([ + f"{getattr(msg, 'role', 'unknown')}: {str(getattr(msg, 'content', ''))[:200]}" + for msg in context_msgs + ])[:1000] + + span.add_event("invocation.conversation_context", { + "context.content": context_content, + "context.message_count": len(context_msgs), + "context.type": "recent_conversation" + }) + + elif hasattr(messages_arg, 'content'): + # Single message + input_content = str(messages_arg.content)[:1000] + span.add_event("gen_ai.content.prompt", { + "gen_ai.prompt": input_content, + "input.message_type": "single_message", + "input.source": "direct_invocation" + }) + + except Exception as e: + span.set_attribute("invocation.context_capture_error", str(e)) + + # Execute the async generator and capture output + response_count = 0 + final_message = None + total_content_length = 0 + + async for message in invoke_func(*args, **kwargs): + response_count += 1 + final_message = message + + # Track streaming content + if hasattr(message, 'content') and message.content: + content_length = len(str(message.content)) + total_content_length += content_length + + # Add streaming events for intermediate responses + if response_count <= 5: # Limit events to avoid spam + span.add_event("invocation.streaming_response", { + "response.chunk": response_count, + "response.content": str(message.content)[:200], + "response.length": content_length + }) + + yield message + + # ENHANCED: Capture final output with rich context + if final_message: + if hasattr(final_message, 'content'): + final_content = str(final_message.content)[:1000] + span.add_event("gen_ai.content.completion", { + "gen_ai.completion": final_content, + "gen_ai.assistant.message": final_content, + "output.message_type": "agent_response", + "output.chunk_count": response_count, + "output.agent": agent.name, + "output.total_length": total_content_length + }) + + span.set_attributes({ + "invocation.response_count": response_count, + "invocation.total_content_length": total_content_length, + "invocation.final_message_length": len(final_message.content) if final_message and hasattr(final_message, 'content') else 0, + "invocation.success": True + }) + else: + span.set_attribute("invocation.no_response", True) + + # Mark the wrapper decorator as an agent diagnostics decorator + wrapper_decorator.__agent_diagnostics__ = True # type: ignore + + return wrapper_decorator + + +@experimental +def trace_agent_get_response(get_response_func: Callable[P, Awaitable[T]]) -> Callable[P, Awaitable[T]]: + """Enhanced decorator to trace agent get_response with multi-agent context.""" + OPERATION_NAME = "invoke_agent" + + @functools.wraps(get_response_func) + async def wrapper_decorator(*args: P.args, **kwargs: P.kwargs) -> T: + from semantic_kernel.agents.agent import Agent + + agent = cast(Agent, args[0]) + + with tracer.start_as_current_span(f"{OPERATION_NAME} {agent.name}") as span: + # Basic agent information + span.set_attributes({ + gen_ai_attributes.OPERATION: OPERATION_NAME, + gen_ai_attributes.AGENT_ID: agent.id, + gen_ai_attributes.AGENT_NAME: agent.name, + }) + + if agent.description: + span.set_attribute(gen_ai_attributes.AGENT_DESCRIPTION, agent.description) + + # ENHANCED: Capture input message context + try: + # Capture input messages for get_response + messages = args[1] if len(args) > 1 else kwargs.get('messages', None) + if messages: + if isinstance(messages, list) and messages: + # Multiple messages - capture the conversation context + recent_messages = messages[-3:] if len(messages) > 3 else messages + context_content = "\n".join([f"{msg.role}: {msg.content}" for msg in recent_messages if hasattr(msg, 'content') and hasattr(msg, 'role')])[:1000] + + span.add_event("gen_ai.content.prompt", { + "gen_ai.prompt": context_content, + "input.message_type": "conversation_context", + "input.total_messages": len(messages), + "input.context_messages": len(recent_messages), + "input.source": "conversation_history" + }) + + span.set_attributes({ + "invocation.input_message_count": len(messages), + "invocation.conversation_length": len(messages) + }) + + # Capture the last user message specifically + last_user_msg = None + for msg in reversed(messages): + if hasattr(msg, 'role') and str(msg.role).lower() in ['user', 'human']: + last_user_msg = msg + break + + if last_user_msg and hasattr(last_user_msg, 'content'): + span.add_event("input.last_user_message", { + "user.message": str(last_user_msg.content)[:500], + "message.role": str(last_user_msg.role) + }) + + elif hasattr(messages, 'content'): + # Single message + input_content = str(messages.content)[:1000] + span.add_event("gen_ai.content.prompt", { + "gen_ai.prompt": input_content, + "gen_ai.user.message": input_content, + "input.message_type": "single_message", + "input.source": "direct_call" + }) + + # Capture execution settings if provided + arguments = kwargs.get('arguments', None) + if arguments and hasattr(arguments, 'execution_settings'): + span.set_attribute("invocation.has_execution_settings", True) + # Try to capture some execution settings details + try: + settings = arguments.execution_settings + if hasattr(settings, 'model_id'): + span.set_attribute("invocation.model_id", settings.model_id) + if hasattr(settings, 'temperature'): + span.set_attribute("invocation.temperature", settings.temperature) + if hasattr(settings, 'max_tokens'): + span.set_attribute("invocation.max_tokens", settings.max_tokens) + except: + pass + + # Enhanced: Track calling context for multi-agent scenarios + import inspect + frame = inspect.currentframe() + if frame and frame.f_back and frame.f_back.f_back: + caller_name = frame.f_back.f_back.f_code.co_name + span.set_attribute("invocation.caller_function", caller_name) + + # Detect if this is part of multi-agent coordination + if any(keyword in caller_name.lower() for keyword in ['select', 'should', 'filter', 'manage', 'plan']): + span.set_attribute("invocation.context", "multi_agent_coordination") + span.set_attribute("invocation.coordination_type", caller_name) + + # Add specific coordination context + if 'select' in caller_name.lower(): + span.set_attribute("coordination.operation", "agent_selection") + elif 'should' in caller_name.lower(): + span.set_attribute("coordination.operation", "decision_making") + elif 'filter' in caller_name.lower(): + span.set_attribute("coordination.operation", "result_filtering") + elif 'plan' in caller_name.lower(): + span.set_attribute("coordination.operation", "planning") + + except Exception as e: + span.set_attribute("invocation.context_capture_error", str(e)) + + # Execute the function and capture output + result = await get_response_func(*args, **kwargs) + + # ENHANCED: Capture output content + try: + if hasattr(result, 'message') and result.message: + if hasattr(result.message, 'content') and result.message.content: + output_content = str(result.message.content)[:1000] + span.add_event("gen_ai.content.completion", { + "gen_ai.completion": output_content, + "gen_ai.assistant.message": output_content, + "output.message_type": "agent_response", + "output.agent": agent.name + }) + + span.set_attributes({ + "invocation.output_length": len(result.message.content), + "invocation.success": True + }) + + # If this looks like a structured response (JSON), try to parse it + try: + if result.message.content.strip().startswith('{') and result.message.content.strip().endswith('}'): + parsed = json.loads(result.message.content) + span.add_event("output.structured_response", { + "response.type": "structured_json", + "response.keys": list(parsed.keys()) if isinstance(parsed, dict) else "non_dict" + }) + except: + pass + + elif hasattr(result, 'content') and result.content: + # Direct content response + output_content = str(result.content)[:1000] + span.add_event("gen_ai.content.completion", { + "gen_ai.completion": output_content, + "output.message_type": "direct_response", + "output.agent": agent.name + }) + + span.set_attribute("invocation.output_length", len(result.content)) + + except Exception as e: + span.set_attribute("invocation.output_capture_error", str(e)) + + return result + + # Mark the wrapper decorator as an agent diagnostics decorator + wrapper_decorator.__agent_diagnostics__ = True # type: ignore + + return wrapper_decorator \ No newline at end of file