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: Error when running step10_assistant_tool_file_search.py: Resource not found #10212

Closed
anu43 opened this issue Jan 16, 2025 · 2 comments
Closed
Assignees
Labels
agents python Pull requests for the Python Semantic Kernel

Comments

@anu43
Copy link

anu43 commented Jan 16, 2025

Description

When running step8_assistant_vision.py from the main repository, an error occurs indicating an invalid value for the purpose parameter.

Steps to Reproduce

  1. Clone the semantic-kernel repository
  2. Navigate to python/samples/getting_started_with_agents/
  3. Run python step10_assistant_tool_file_search.py

Expected Behavior

The script should run without errors and create a vector store.

Actual Behavior

The script fails with an error: openai.NotFoundError: Error code: 404 - {'error': {'code': '404', 'message': 'Resource not found'}}

Environment

  • Operating System: macOS 15.2
  • Python version: Python 3.10.13
  • Semantic Kernel version: semantic-kernel==1.18.2
  • OpenAI library version: openai==1.59.7

Error Message

Traceback (most recent call last):
  File "/opt/homebrew/anaconda3/envs/sem-kernel/lib/python3.10/site-packages/semantic_kernel/agents/open_ai/open_ai_assistant_base.py", line 584, in create_vector_store
    vector_store = await self.client.beta.vector_stores.create(file_ids=file_ids)
  File "/opt/homebrew/anaconda3/envs/sem-kernel/lib/python3.10/site-packages/openai/resources/beta/vector_stores/vector_stores.py", line 400, in create
    return await self._post(
  File "/opt/homebrew/anaconda3/envs/sem-kernel/lib/python3.10/site-packages/openai/_base_client.py", line 1849, in post
    return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)
  File "/opt/homebrew/anaconda3/envs/sem-kernel/lib/python3.10/site-packages/openai/_base_client.py", line 1543, in request
    return await self._request(
  File "/opt/homebrew/anaconda3/envs/sem-kernel/lib/python3.10/site-packages/openai/_base_client.py", line 1644, in _request
    raise self._make_status_error_from_response(err.response) from None
openai.NotFoundError: Error code: 404 - {'error': {'code': '404', 'message': 'Resource not found'}}

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/nihat/Documents/epam/semantic-kernel/python/samples/getting_started_with_agents/step10_assistant_tool_file_search.py", line 101, in <module>
    asyncio.run(main())
  File "/opt/homebrew/anaconda3/envs/sem-kernel/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/opt/homebrew/anaconda3/envs/sem-kernel/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
    return future.result()
  File "/Users/nihat/Documents/epam/semantic-kernel/python/samples/getting_started_with_agents/step10_assistant_tool_file_search.py", line 63, in main
    agent = await AzureAssistantAgent.create(
  File "/opt/homebrew/anaconda3/envs/sem-kernel/lib/python3.10/site-packages/semantic_kernel/agents/open_ai/azure_assistant_agent.py", line 300, in create
    vector_store_id = await agent.create_vector_store(file_ids=vector_store_file_ids_combined)
  File "/opt/homebrew/anaconda3/envs/sem-kernel/lib/python3.10/site-packages/semantic_kernel/agents/open_ai/open_ai_assistant_base.py", line 587, in create_vector_store
    raise AgentExecutionException("Error creating vector store.") from ex
semantic_kernel.exceptions.agent_exceptions.AgentExecutionException: Error creating vector store.
@markwallace-microsoft markwallace-microsoft added python Pull requests for the Python Semantic Kernel triage labels Jan 16, 2025
@github-actions github-actions bot changed the title Error when running step10_assistant_tool_file_search.py: Resource not found Python: Error when running step10_assistant_tool_file_search.py: Resource not found Jan 16, 2025
@moonbox3 moonbox3 self-assigned this Jan 16, 2025
@moonbox3 moonbox3 added agents and removed triage labels Jan 16, 2025
@moonbox3
Copy link
Contributor

Description

When running step8_assistant_vision.py from the main repository, an error occurs indicating an invalid value for the purpose parameter.

I think this is from #10211?

For this error related to step 10, are you running with AzureOpenAI or OpenAI? The error openai.NotFoundError eludes to OpenAI, but I want to double check as I see that error occur more often with Azure OpenAI.

Please communicate what service, and model you're using.

As an example, I'm using both OpenAI's gpt-4o and AzureOpenAI's gpt-4o-mini and I can run it without errors. My Azure OpenAI API-version is 2024-09-01-preview (this matters).

# AuthorRole.USER: 'Who is the youngest employee?'
# AuthorRole.ASSISTANT: The youngest employee is Teodor Britton, who was born on January 9, 1997【4:0†source】.
# AuthorRole.USER: 'Who works in sales?'
# AuthorRole.ASSISTANT: The employees who work in sales are:

1. Mariam Jaslyn - Sales representative
2. Hicran Bea - Sales manager
3. Angelino Embla - Sales representative【8:0†source】.
# AuthorRole.USER: 'I have a customer request, who can help me?'
# AuthorRole.ASSISTANT: For customer requests, you can reach out to the sales team members who can assist you:

1. Mariam Jaslyn - Sales representative
2. Hicran Bea - Sales manager
3. Angelino Embla - Sales representative【12:0†source】.

@anu43
Copy link
Author

anu43 commented Jan 18, 2025

yeah, you're right. I was using Azure OpenAI 2024-02-15-preview. when I changed, it worked. thanks, my bad :/

@anu43 anu43 closed this as completed Jan 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agents python Pull requests for the Python Semantic Kernel
Projects
Status: No status
Development

No branches or pull requests

3 participants