You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Python: [Bug]: strict field does not exist in JSON schema in Foundry when using with Create Agent API for Azure V2 #3229
When an agent is created using the Create API in the new Foundry V2 update, the JSON schema details of the newly created agent do not include the "strict: true" field. I also tried using Pydantic's "ConfigDict(extra="forbid")" setting, but it didn't work.
Code Sample
import asyncio
import os
from agent_framework.azure import AzureAIProjectAgentProvider
from azure.ai.projects.aio import AIProjectClient
from azure.core.exceptions import ResourceNotFoundError
from azure.identity import InteractiveBrowserCredential
from pydantic import BaseModel
class TestSchema(BaseModel):
subject: str
summary: str
async def main():
credential = InteractiveBrowserCredential()
async with AIProjectClient(
endpoint=os.environ["AZURE_AI_FOUNDRY_PROJECT_ENDPOINT"],
credential=credential,
) as project_client:
provider = AzureAIProjectAgentProvider(project_client=project_client)
agent_name = "summarizer-agent"
try:
agent = await provider.get_agent(name=agent_name)
print(f"Agent found: {agent.name}")
except ResourceNotFoundError:
agent = await provider.create_agent(
name=agent_name,
model="gpt-5.2",
instructions="You are responsible for writing a brief summary of a few sentences on the given subject.",
description="An agent that summarizes a given subject.",
response_format=TestSchema,
)
print(f"Agent created: {agent.name}")
response = await agent.run(subject="Artificial Intelligence") print("===== Agent Response =====") print(response)
if __name__ == "__main__":
asyncio.run(main())
changed the title [-]Python: [Bug]: strict field is not exist in JSON schema in Foundry when using with Create Agent API for Azure V2[/-][+]Python: [Bug]: strict field does not exist in JSON schema in Foundry when using with Create Agent API for Azure V2[/+]on Jan 15, 2026
Activity
[-]Python: [Bug]: strict field is not exist in JSON schema in Foundry when using with Create Agent API for Azure V2[/-][+]Python: [Bug]: strict field does not exist in JSON schema in Foundry when using with Create Agent API for Azure V2[/+]