@@ -72,7 +72,7 @@ async def _delete_thread_async(self, thread_conversation_id: str):
7272 try :
7373 if thread_conversation_id :
7474 # Get credential and use async context managers to ensure proper cleanup
75- credential = await get_azure_credential_async ()
75+ credential = await get_azure_credential_async (client_id = config . azure_client_id )
7676 async with AIProjectClient (
7777 endpoint = config .ai_project_endpoint ,
7878 credential = credential
@@ -98,9 +98,11 @@ class ChatService:
9898 """
9999
100100 def __init__ (self ):
101- self .config = Config ()
102- self .azure_openai_deployment_name = self .config .azure_openai_deployment_model
103- self .orchestrator_agent_name = self .config .orchestrator_agent_name
101+ config = Config ()
102+ self .azure_openai_deployment_name = config .azure_openai_deployment_model
103+ self .orchestrator_agent_name = config .orchestrator_agent_name
104+ self .azure_client_id = config .azure_client_id
105+ self .ai_project_endpoint = config .ai_project_endpoint
104106
105107 def get_thread_cache (self ):
106108 """Get or create the global thread cache."""
@@ -114,8 +116,8 @@ async def stream_openai_text(self, conversation_id: str, query: str) -> Streamin
114116 Get a streaming text response from OpenAI.
115117 """
116118 async with (
117- await get_azure_credential_async () as credential ,
118- AIProjectClient (endpoint = self .config . ai_project_endpoint , credential = credential ) as project_client ,
119+ await get_azure_credential_async (client_id = self . azure_client_id ) as credential ,
120+ AIProjectClient (endpoint = self .ai_project_endpoint , credential = credential ) as project_client ,
119121 ):
120122 thread = None
121123 complete_response = ""
0 commit comments