${avg_transcation}Your response:"""prompt = PromptTemplate.from_template(template)class FeatureformPromptTemplate(StringPromptTemplate):    def format(self, **kwargs) -> str:        user_id = kwargs.pop("user_id")        fpf = client.features([("avg_transactions", "quickstart")], {"user": user_id})        return prompt.format(**kwargs)prompt_template = FeatureformPromptTemplate(input_variables=["user_id"])print(prompt_template.format(user_id="C1410926"))Use in a chain‚ÄãWe can now use this in a chain, successfully creating a chain that achieves personalization backed by the Featureform Feature Platform.from langchain.chat_models import ChatOpenAIfrom langchain.chains import LLMChainchain = LLMChain(llm=ChatOpenAI(), prompt=prompt_template)chain.run("C1410926")AzureML Managed Feature Store‚ÄãWe will use AzureML Managed Feature Store to run the example below. Prerequisites‚ÄãCreate feature store with online materialization using instructions here Enable online materialization and run online inference.A successfully created feature store by following the instructions should have an account featureset with version as 1. It will have accountID as index column with features accountAge, accountCountry, numPaymentRejects1dPerUser.Prompts‚ÄãHere we will set up a custom AzureMLFeatureStorePromptTemplate. This prompt template will take in an account_id and optional query. It then fetches feature values from feature store and format those features into the output prompt. Note that the required input to this prompt template is just account_id, since that is the only user defined piece (all other variables are looked up inside the prompt template).Also note that this is a bootstrap example to showcase how LLM applications can leverage AzureML managed feature store. Developers are welcome to improve the prompt template further to suit their needs.import osos.environ['AZURE_ML_CLI_PRIVATE_FEATURES_ENABLED'] = 'True'import pandasfrom pydantic import Extrafrom langchain.prompts
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. ->: ${avg_transcation}Your response:"""prompt = PromptTemplate.from_template(template)class FeatureformPromptTemplate(StringPromptTemplate):    def format(self, **kwargs) -> str:        user_id = kwargs.pop("user_id")        fpf = client.features([("avg_transactions", "quickstart")], {"user": user_id})        return prompt.format(**kwargs)prompt_template = FeatureformPromptTemplate(input_variables=["user_id"])print(prompt_template.format(user_id="C1410926"))Use in a chain‚ÄãWe can now use this in a chain, successfully creating a chain that achieves personalization backed by the Featureform Feature Platform.from langchain.chat_models import ChatOpenAIfrom langchain.chains import LLMChainchain = LLMChain(llm=ChatOpenAI(), prompt=prompt_template)chain.run("C1410926")AzureML Managed Feature Store‚ÄãWe will use AzureML Managed Feature Store to run the example below. Prerequisites‚ÄãCreate feature store with online materialization using instructions here Enable online materialization and run online inference.A successfully created feature store by following the instructions should have an account featureset with version as 1. It will have accountID as index column with features accountAge, accountCountry, numPaymentRejects1dPerUser.Prompts‚ÄãHere we will set up a custom AzureMLFeatureStorePromptTemplate. This prompt template will take in an account_id and optional query. It then fetches feature values from feature store and format those features into the output prompt. Note that the required input to this prompt template is just account_id, since that is the only user defined piece (all other variables are looked up inside the prompt template).Also note that this is a bootstrap example to showcase how LLM applications can leverage AzureML managed feature store. Developers are welcome to improve the prompt template further to suit their needs.import osos.environ['AZURE_ML_CLI_PRIVATE_FEATURES_ENABLED'] = 'True'import pandasfrom pydantic import Extrafrom langchain.prompts