Here is how it works:Using Global settings:# define global settings for all prompty (if not set - chatGPT is the current default)from langchain_decorators import GlobalSettingsGlobalSettings.define_settings(    default_llm=ChatOpenAI(temperature=0.0), this is default... can change it here globally    default_streaming_llm=ChatOpenAI(temperature=0.0,streaming=True), this is default... can change it here for all ... will be used for streaming)Using predefined prompt types#You can change the default prompt typesfrom langchain_decorators import PromptTypes, PromptTypeSettingsPromptTypes.AGENT_REASONING.llm = ChatOpenAI()# Or you can just define your own ones:class MyCustomPromptTypes(PromptTypes):    GPT4=PromptTypeSettings(llm=ChatOpenAI(model="gpt-4"))@llm_prompt(prompt_type=MyCustomPromptTypes.GPT4) def write_a_complicated_code(app_idea:str)->str:    ...Define the settings directly in the decoratorfrom langchain.llms import OpenAI@llm_prompt(    llm=OpenAI(temperature=0.7),    stop_tokens=["\nObservation"],    ...    )def creative_writer(book_title:str)->str:    ...Passing a memory and/or callbacks:‚ÄãTo pass any of these, just declare them in the function (or use kwargs to pass anything)@llm_prompt()async def write_me_short_post(topic:str, platform:str="twitter", memory:SimpleMemory = None):    """    {history_key}    Write me a short header for my post about {topic} for {platform} platform.     It should be for {audience} audience.    (Max 15 words)    """    passawait write_me_short_post(topic="old movies")Simplified streamingIf we want to leverage streaming:we need to define prompt as async function turn on the streaming on the decorator, or we can define PromptType with streaming oncapture the stream using StreamingContextThis way we just mark which prompt should be streamed, not needing to tinker with what LLM should we use, passing around the creating and distribute streaming handler into particular part of our chain... just turn the streaming on/off on
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 ->: Here is how it works:Using Global settings:# define global settings for all prompty (if not set - chatGPT is the current default)from langchain_decorators import GlobalSettingsGlobalSettings.define_settings(    default_llm=ChatOpenAI(temperature=0.0), this is default... can change it here globally    default_streaming_llm=ChatOpenAI(temperature=0.0,streaming=True), this is default... can change it here for all ... will be used for streaming)Using predefined prompt types#You can change the default prompt typesfrom langchain_decorators import PromptTypes, PromptTypeSettingsPromptTypes.AGENT_REASONING.llm = ChatOpenAI()# Or you can just define your own ones:class MyCustomPromptTypes(PromptTypes):    GPT4=PromptTypeSettings(llm=ChatOpenAI(model="gpt-4"))@llm_prompt(prompt_type=MyCustomPromptTypes.GPT4) def write_a_complicated_code(app_idea:str)->str:    ...Define the settings directly in the decoratorfrom langchain.llms import OpenAI@llm_prompt(    llm=OpenAI(temperature=0.7),    stop_tokens=["\nObservation"],    ...    )def creative_writer(book_title:str)->str:    ...Passing a memory and/or callbacks:‚ÄãTo pass any of these, just declare them in the function (or use kwargs to pass anything)@llm_prompt()async def write_me_short_post(topic:str, platform:str="twitter", memory:SimpleMemory = None):    """    {history_key}    Write me a short header for my post about {topic} for {platform} platform.     It should be for {audience} audience.    (Max 15 words)    """    passawait write_me_short_post(topic="old movies")Simplified streamingIf we want to leverage streaming:we need to define prompt as async function turn on the streaming on the decorator, or we can define PromptType with streaming oncapture the stream using StreamingContextThis way we just mark which prompt should be streamed, not needing to tinker with what LLM should we use, passing around the creating and distribute streaming handler into particular part of our chain... just turn the streaming on/off on