Why does basic create_agent I try with Foundry get me 404? #3346
-
"agent-framework>=1.0.0b260114",from agent_framework.azure import AzureAIProjectAgentProvider
from azure.core.exceptions import ResourceNotFoundError
from azure.identity.aio import AzureCliCredential
async def main() -> None:
# Using environment variables
az_credential = AzureCliCredential()
pclient = AzureAIProjectAgentProvider(
project_endpoint='https://aoain7jzhc2pl6f5i.openai.azure.com/',
credential=az_credential)
#try:
agent = await pclient.create_agent(
name="JokeAssistant",
model='chatModelDeployment',
instructions="You are good at telling jokes.")Is there something I'm misunderstanding about the API usage? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
|
Also, am I understanding correctly that this is the underlying REST API? |
Beta Was this translation helpful? Give feedback.
-
|
@moonbox3 Thanks, I was under some misunderstandings like |
Beta Was this translation helpful? Give feedback.
We use the
azure-ai-projectsandazure-ai-agentsSDKs. Your project_endpoint looks to be incorrect. This is pointing to an Azure OpenAI resource, not an Agent Service project. You'll need to create a project in the new Foundry portal if you haven't. The endpoint is of the form:https://<resource-name>.services.ai.azure.com/api/projects/<project-name>.