this can be tedious, that's why you can let the output parser gegnerate you the instructions based on the model (pydantic)from langchain_decorators import llm_promptfrom pydantic import BaseModel, Fieldclass TheOutputStructureWeExpect(BaseModel):    name:str = Field (description="The name of the company")    headline:str = Field( description="The description of the company (for landing page)")    employees:list[str] = Field(description="5-8 fake employee names with their positions")@llm_prompt()def fake_company_generator(company_business:str)->TheOutputStructureWeExpect:    """ Generate a fake company that {company_business}    {FORMAT_INSTRUCTIONS}    """    returncompany = fake_company_generator(company_business="sells cookies")# print the result nicely formattedprint("Company name: ",company.name)print("company headline: ",company.headline)print("company employees: ",company.employees)Binding the prompt to an objectfrom pydantic import BaseModelfrom langchain_decorators import llm_promptclass AssistantPersonality(BaseModel):    assistant_name:str    assistant_role:str    field:str    @property    def a_property(self):        return "whatever"    def hello_world(self, function_kwarg:str=None):        """        We can reference any {field} or {a_property} inside our prompt... and combine it with {function_kwarg} in the method        """        @llm_prompt    def introduce_your_self(self)->str:        """        ```¬†<prompt:system>        You are an assistant named {assistant_name}.         Your role is to act as {assistant_role}        ```        ```<prompt:user>        Introduce your self (in less than 20 words)        ```        """    personality = AssistantPersonality(assistant_name="John", assistant_role="a pirate")print(personality.introduce_your_self(personality))More examples:these and few more examples are also available in the colab notebook hereincluding the ReAct Agent re-implementation using purely langchain
lanchchain decorators is a layer on the top of LangChain that provides syntactic sugar üç≠ for writing custom langchain prompts and chains
lanchchain decorators is a layer on the top of LangChain that provides syntactic sugar üç≠ for writing custom langchain prompts and chains ->: this can be tedious, that's why you can let the output parser gegnerate you the instructions based on the model (pydantic)from langchain_decorators import llm_promptfrom pydantic import BaseModel, Fieldclass TheOutputStructureWeExpect(BaseModel):    name:str = Field (description="The name of the company")    headline:str = Field( description="The description of the company (for landing page)")    employees:list[str] = Field(description="5-8 fake employee names with their positions")@llm_prompt()def fake_company_generator(company_business:str)->TheOutputStructureWeExpect:    """ Generate a fake company that {company_business}    {FORMAT_INSTRUCTIONS}    """    returncompany = fake_company_generator(company_business="sells cookies")# print the result nicely formattedprint("Company name: ",company.name)print("company headline: ",company.headline)print("company employees: ",company.employees)Binding the prompt to an objectfrom pydantic import BaseModelfrom langchain_decorators import llm_promptclass AssistantPersonality(BaseModel):    assistant_name:str    assistant_role:str    field:str    @property    def a_property(self):        return "whatever"    def hello_world(self, function_kwarg:str=None):        """        We can reference any {field} or {a_property} inside our prompt... and combine it with {function_kwarg} in the method        """        @llm_prompt    def introduce_your_self(self)->str:        """        ```¬†<prompt:system>        You are an assistant named {assistant_name}.         Your role is to act as {assistant_role}        ```        ```<prompt:user>        Introduce your self (in less than 20 words)        ```        """    personality = AssistantPersonality(assistant_name="John", assistant_role="a pirate")print(personality.introduce_your_self(personality))More examples:these and few more examples are also available in the colab notebook hereincluding the ReAct Agent re-implementation using purely langchain