Compare commits

...

1 Commits

Author SHA1 Message Date
Eugene Yurtsev
4cabec6e8b Make azure-core optional 2023-04-27 11:25:24 -04:00
2 changed files with 6 additions and 4 deletions

View File

@@ -4,13 +4,11 @@ from __future__ import annotations
import logging import logging
import os import os
from typing import Any, Dict, Iterable, List, Optional, Union from typing import TYPE_CHECKING, Any, Dict, Iterable, List, Optional, Union
import aiohttp import aiohttp
import requests import requests
from aiohttp import ServerTimeoutError from aiohttp import ServerTimeoutError
from azure.core.credentials import TokenCredential
from azure.core.exceptions import ClientAuthenticationError
from pydantic import BaseModel, Field, root_validator from pydantic import BaseModel, Field, root_validator
from requests.exceptions import Timeout from requests.exceptions import Timeout
@@ -18,6 +16,10 @@ from langchain.tools.powerbi.prompt import SCHEMA_ERROR_RESPONSE, UNAUTHORIZED_R
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
if TYPE_CHECKING:
from azure.core.credentials import TokenCredential
from azure.core.exceptions import ClientAuthenticationError
BASE_URL = os.getenv("POWERBI_BASE_URL", "https://api.powerbi.com/v1.0/myorg/datasets/") BASE_URL = os.getenv("POWERBI_BASE_URL", "https://api.powerbi.com/v1.0/myorg/datasets/")

View File

@@ -17,7 +17,7 @@ SQLAlchemy = ">1.3,<3"
requests = "^2" requests = "^2"
PyYAML = ">=5.4.1" PyYAML = ">=5.4.1"
numpy = "^1" numpy = "^1"
azure-core = {version = "^1.26.4"} azure-core = {version = "^1.26.4", optional = true}
tqdm = {version = ">=4.48.0", optional = true} tqdm = {version = ">=4.48.0", optional = true}
openapi-schema-pydantic = "^1.2" openapi-schema-pydantic = "^1.2"
faiss-cpu = {version = "^1", optional = true} faiss-cpu = {version = "^1", optional = true}