Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python: Bug: Getting http 400 error in assistant_agent_file_manipulation.py #10499

Closed
mrochon opened this issue Feb 12, 2025 · 3 comments
Closed
Assignees
Labels
agents bug Something isn't working python Pull requests for the Python Semantic Kernel

Comments

@mrochon
Copy link

mrochon commented Feb 12, 2025

Describe the bug
Running the code on my own machine, with no code change except change to path for the csv input file, I am getting:
Error code: 400 - {'error': {'message': "Unknown parameter: 'tool_resources'.", 'type': 'invalid_request_error', 'param': 'tool_resources', 'code': 'unknown_parameter'}} on AzureAssistantAgent create.

To Reproduce
Steps to reproduce the behavior:
Running code as is.

Expected behavior
Some valid output, not an error.

Screenshots
If applicable, add screenshots to help explain your problem.

Platform

  • Language: Python
  • Source: python/samples/concepts/agents/assistant_agent/assistant_agent_file_manipulation.py
  • AI model: AzureOpenAI:GPT-4o-mini(2024-07-18)
  • IDE: VS Code
  • OS: Windows

Additional context
Add any other context about the problem here.

@mrochon mrochon added the bug Something isn't working label Feb 12, 2025
@markwallace-microsoft markwallace-microsoft added python Pull requests for the Python Semantic Kernel triage labels Feb 12, 2025
@github-actions github-actions bot changed the title Bug: Getting http 400 error in assistant_agent_file_manipulation.py Python: Bug: Getting http 400 error in assistant_agent_file_manipulation.py Feb 12, 2025
@moonbox3 moonbox3 self-assigned this Feb 12, 2025
@moonbox3 moonbox3 removed the triage label Feb 12, 2025
@moonbox3
Copy link
Contributor

moonbox3 commented Feb 12, 2025

Hello @mrochon, what Azure api version are you using? I am using AZURE_OPENAI_API_VERSION="2024-12-01-preview" and I don't have any 400s, it is running well for me. Looks like your AI model is fine, but please verify the api version. Also, what version of Python are you using? 400s are client-side errors, so there is some issue with your current configuration.

@mrochon
Copy link
Author

mrochon commented Feb 12, 2025

My .env had

AZURE_OPENAI_API_VERSION="2024-02-15-preview"

After I changed it 2024-12-01-preview the code worked fine.

Nowhere in the source is that environment variable loaded though. Which class loads it behind the scenes?

@moonbox3
Copy link
Contributor

@mrochon we use Pydantic settings, which loads env vars if present. When creating the assistant, we get a hold of the necessary settings. You can always override via the constructor, if necessary.

I will pick up a work item soon to improve the docs about which api versions and models are needed to run the assistants. Azure OpenAI is tricky because of all of the api versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agents bug Something isn't working python Pull requests for the Python Semantic Kernel
Projects
Status: No status
Development

No branches or pull requests

3 participants