Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 27 additions & 27 deletions src/backend/app_kernel.py
Original file line number Diff line number Diff line change
@@ -1,52 +1,52 @@
# app_kernel.py
import asyncio
import json
import logging
import os
import uuid
import re
import json
from typing import List, Dict, Optional, Any
import uuid
from typing import Any, Dict, List, Optional

# FastAPI imports
from fastapi import FastAPI, HTTPException, Query, Request
from fastapi.middleware.cors import CORSMiddleware
# Semantic Kernel imports
import semantic_kernel as sk
from app_config import config
from auth.auth_utils import get_authenticated_user_details

# Azure monitoring
from azure.monitor.opentelemetry import configure_azure_monitor
from config_kernel import Config
from context.cosmos_memory_kernel import CosmosMemoryContext
from event_utils import track_event_if_configured

# Semantic Kernel imports
import semantic_kernel as sk

# Updated import for KernelArguments
from semantic_kernel.functions.kernel_arguments import KernelArguments
# FastAPI imports
from fastapi import FastAPI, HTTPException, Query, Request
from fastapi.middleware.cors import CORSMiddleware
from kernel_agents.agent_factory import AgentFactory

# Local imports
from middleware.health_check import HealthCheckMiddleware
from auth.auth_utils import get_authenticated_user_details
from config_kernel import Config
from context.cosmos_memory_kernel import CosmosMemoryContext
from models.messages_kernel import (
HumanFeedback,
ActionRequest,
ActionResponse,
AgentMessage,
AgentType,
HumanClarification,
HumanFeedback,
InputTask,
Plan,
Step,
AgentMessage,
PlanWithSteps,
ActionRequest,
ActionResponse,
Step,
)
from utils_kernel import initialize_runtime_and_context, get_agents, rai_success
from event_utils import track_event_if_configured
from models.messages_kernel import AgentType
from kernel_agents.agent_factory import AgentFactory
from app_config import config

# Updated import for KernelArguments
from semantic_kernel.functions.kernel_arguments import KernelArguments
from utils_kernel import get_agents, initialize_runtime_and_context, rai_success

# # Check if the Application Insights Instrumentation Key is set in the environment variables
instrumentation_key = os.getenv("APPLICATIONINSIGHTS_INSTRUMENTATION_KEY")
if instrumentation_key:
connection_string = os.getenv("APPLICATIONINSIGHTS_CONNECTION_STRING")
if connection_string:
# Configure Application Insights if the Instrumentation Key is found
configure_azure_monitor(connection_string=instrumentation_key)
configure_azure_monitor(connection_string=connection_string)
logging.info(
"Application Insights configured with the provided Instrumentation Key"
)
Expand Down
Loading