pydantic import Extrafrom langchain.prompts import PromptTemplate, StringPromptTemplatefrom azure.identity import AzureCliCredentialfrom azureml.featurestore import FeatureStoreClient, init_online_lookup, get_online_featuresclass AzureMLFeatureStorePromptTemplate(StringPromptTemplate, extra=Extra.allow):    def __init__(self, subscription_id: str, resource_group: str, feature_store_name: str, **kwargs):        # this is an example template for proof of concept and can be changed to suit the developer needs        template = """            {query}            ###            account id = {account_id}            account age = {account_age}            account country = {account_country}            payment rejects 1d per user = {payment_rejects_1d_per_user}            ###            """        prompt_template=PromptTemplate.from_template(template)        super().__init__(prompt=prompt_template, input_variables=["account_id", "query"])        # use AzureMLOnBehalfOfCredential() in spark context        credential = AzureCliCredential()        self._fs_client = FeatureStoreClient(            credential=credential,            subscription_id=subscription_id,            resource_group_name=resource_group,            name=feature_store_name)                self._feature_set = self._fs_client.feature_sets.get(name="accounts", version=1)        init_online_lookup(self._feature_set.features, credential, force=True)            def format(self, **kwargs) -> str:            if "account_id" not in kwargs:            raise "account_id needed to fetch details from feature store"        account_id = kwargs.pop("account_id")                query=""        if "query" in kwargs:            query = kwargs.pop("query")        # feature set is registered with accountID as entity index column.        obs = pandas.DataFrame({'accountID': [account_id]})        # get the feature details for the input entity from feature store.        df = get_online_features(self._feature_set.features, obs)
Feature stores are a concept from traditional machine learning that make sure data fed into models is up-to-date and relevant. For more on this, see here.
Feature stores are a concept from traditional machine learning that make sure data fed into models is up-to-date and relevant. For more on this, see here. ->: pydantic import Extrafrom langchain.prompts import PromptTemplate, StringPromptTemplatefrom azure.identity import AzureCliCredentialfrom azureml.featurestore import FeatureStoreClient, init_online_lookup, get_online_featuresclass AzureMLFeatureStorePromptTemplate(StringPromptTemplate, extra=Extra.allow):    def __init__(self, subscription_id: str, resource_group: str, feature_store_name: str, **kwargs):        # this is an example template for proof of concept and can be changed to suit the developer needs        template = """            {query}            ###            account id = {account_id}            account age = {account_age}            account country = {account_country}            payment rejects 1d per user = {payment_rejects_1d_per_user}            ###            """        prompt_template=PromptTemplate.from_template(template)        super().__init__(prompt=prompt_template, input_variables=["account_id", "query"])        # use AzureMLOnBehalfOfCredential() in spark context        credential = AzureCliCredential()        self._fs_client = FeatureStoreClient(            credential=credential,            subscription_id=subscription_id,            resource_group_name=resource_group,            name=feature_store_name)                self._feature_set = self._fs_client.feature_sets.get(name="accounts", version=1)        init_online_lookup(self._feature_set.features, credential, force=True)            def format(self, **kwargs) -> str:            if "account_id" not in kwargs:            raise "account_id needed to fetch details from feature store"        account_id = kwargs.pop("account_id")                query=""        if "query" in kwargs:            query = kwargs.pop("query")        # feature set is registered with accountID as entity index column.        obs = pandas.DataFrame({'accountID': [account_id]})        # get the feature details for the input entity from feature store.        df = get_online_features(self._feature_set.features, obs)