Problems when importing FilePurpose' from 'azure.ai.projects.models'

Arthur Reis 10 Reputation points
2025-05-18T15:33:13.9133333+00:00

Hello,

I have followed the tutorial available at: https://microsoftlearning.github.io/mslearn-ai-agents/Instructions/02-build-ai-agent.html very carefully and completed all the steps as instructed. However, I am consistently encountering the following error: ImportError: cannot import name 'FilePurpose' from 'azure.ai.projects.models. The error occurs at the line:

from azure.ai.projects.models import FilePurpose, CodeInterpreterTool

I have double-checked all the steps and also searched for possible solutions online, but I haven't found anything that resolves the issue. I have ensured that all packages are installed as specified, and I’ve been using the correct environment.

These labs are very important to me because I am preparing for the AI-102 exam, which I plan to take in June. I would greatly appreciate your help in resolving this issue so I can continue my studies.

Please note: I followed the tutorial exactly as described.

Thank you in advance for your assistance!

Best regards, Arthur

Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
4,080 questions
{count} vote

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.