azure-search-openai-demo icon indicating copy to clipboard operation
azure-search-openai-demo copied to clipboard

TypeError: "type" object is not subscriptable

Open smallbirds2 opened this issue 2 years ago • 1 comments
trafficstars

Hey, I was trying to run this code locally. Using the the "./start.sh" script. It fails in deploying the backend script. I tried different versions of python, but I am facing the same issue.

Starting backend

Traceback (most recent call last): File "./app.py", line 12, in from approaches.chatreadretrieveread import ChatReadRetrieveReadApproach File "/home/peter/azure-demo/azure-search-openai-demo/app/backend/approaches/chatreadretrieveread.py", line 10, in class ChatReadRetrieveReadApproach(Approach): File "/home/peter/azure-demo/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

smallbirds2 avatar Apr 24 '23 13:04 smallbirds2

My python version is 3.8.8

I need to import " from typing import List,Dict,Any"

and rewrite "def run(self, history: List[Dict], overrides: Dict) -> Any:"

then It is work

scovin1109 avatar Apr 25 '23 06:04 scovin1109

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this issue will be closed.

github-actions[bot] avatar Dec 28 '23 01:12 github-actions[bot]

We've decided to only support 3.9+, closing.

pamelafox avatar Mar 12 '24 11:03 pamelafox