File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -122,8 +122,13 @@ async def evaluate_conversation(
122122 }
123123
124124 # Add context to query_response if found
125- if context [0 ] is not None :
126- query_response ["context" ] = context [0 ]
125+ if context and context [0 ] is not None :
126+ # If context is a string, wrap it in the expected format for the RAI service
127+ context_value = context [0 ]
128+ if isinstance (context_value , str ):
129+ query_response ["context" ] = {"contexts" : [{"content" : context_value }]}
130+ else :
131+ query_response ["context" ] = context_value
127132
128133 if tool_calls and any (tool_calls ):
129134 query_response ["tool_calls" ] = [call for sublist in tool_calls for call in sublist if call ]
Original file line number Diff line number Diff line change @@ -145,6 +145,8 @@ async def get_attack_objectives(
145145 if client_id :
146146 from azure .identity import DefaultAzureCredential
147147
148+ self .logger .info (f"Using client_id: { client_id } to set token in aml-aca-token header " )
149+
148150 # Get token using the client_id for managed identity
149151 managed_identity_credential = DefaultAzureCredential (
150152 managed_identity_client_id = client_id , exclude_interactive_browser_credential = True
You can’t perform that action at this time.
0 commit comments