TypeError: 'type' object is not subscriptable while Starting Backend

Chhanechhara, Milin 100 Reputation points
2023-05-25T14:10:44.3066667+00:00

I am initializing azure-search-openai-demo project locally using ./start.sh command and here is the error I am getting from app.py. Here is the error log below:

Building frontend


> frontend@0.0.0 build
> tsc && vite build

vite v4.1.1 building for production...
✓ 1250 modules transformed.
../backend/static/index.html                    0.47 kB
../backend/static/assets/github-fab00c2d.svg    0.96 kB
../backend/static/assets/index-2fb53ec2.css     7.44 kB │ gzip:   2.19 kB
../backend/static/assets/index-7abdfda7.js    625.74 kB │ gzip: 204.86 kB │ map: 5,054.95 kB

(!) Some chunks are larger than 500 kBs after minification. Consider:
- Using dynamic import() to code-split the application
- Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/configuration-options/#output-manualchunks
- Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.

Starting backend

Traceback (most recent call last):
  File "./app.py", line 12, in <module>
    from approaches.chatreadretrieveread import ChatReadRetrieveReadApproach
  File "/home/milin/azure-search-openai-demo/app/backend/approaches/chatreadretrieveread.py", line 10, in <module>
    class ChatReadRetrieveReadApproach(Approach):
  File "/home/milin/azure-search-openai-demo/app/backend/approaches/chatreadretrieveread.py", line 51, in ChatReadRetrieveReadApproach
    def run(self, history: list[dict], overrides: dict) -> any:
TypeError: 'type' object is not subscriptable
Failed to start backend
Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
4,092 questions
{count} votes

Accepted answer
  1. VasaviLankipalle-MSFT 18,676 Reputation points Moderator
    2023-05-25T20:29:58.6733333+00:00

    Hi @Chhanechhara, Milin , Thanks for using Microsoft Q&A Platform.

    Could you please confirm the python version being used for this project? Try using Python 3.10 and see.

    Also, please refer here for similar kind of issues and let us know if that helps: https://github.com/Azure-Samples/azure-search-openai-demo/issues/142

    I hope this helps.

    Regards,
    Vasavi

    -Please kindly accept the answer and vote 'yes' if you feel helpful to support the community, thanks.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

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.