From 901595b10f08972ee3ac5fc08c346dbb561a7d62 Mon Sep 17 00:00:00 2001 From: msi-JunXiang Date: Sun, 3 Sep 2023 16:26:26 +0800 Subject: type hints Use `from __future__ import annotations avoid `dict` and `list` cause "TypeErro: 'type' object is not subscriptable". Refer to the following Stack Overflow discussions for more information: 1. https://stackoverflow.com/questions/75202610/typeerror-type-object-is-not-subscriptable-python 2. https://stackoverflow.com/questions/59101121/type-hint-for-a-dict-gives-typeerror-type-object-is-not-subscriptable --- g4f/Provider/Vercel.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'g4f/Provider/Vercel.py') diff --git a/g4f/Provider/Vercel.py b/g4f/Provider/Vercel.py index f2377db4..8aaf5656 100644 --- a/g4f/Provider/Vercel.py +++ b/g4f/Provider/Vercel.py @@ -1,7 +1,13 @@ -import base64, json, uuid, quickjs +from __future__ import annotations -from curl_cffi import requests -from ..typing import Any, CreateResult, TypedDict +import base64 +import json +import uuid + +import quickjs +from curl_cffi import requests + +from ..typing import Any, CreateResult, TypedDict from .base_provider import BaseProvider -- cgit v1.2.3