on Aim. By default, the session is reset rather than being terminated outright.Scenario 1 In the first scenario, we will use OpenAI LLM.# scenario 1 - LLMllm_result = llm.generate(["Tell me a joke", "Tell me a poem"] * 3)aim_callback.flush_tracker(    langchain_asset=llm,    experiment_name="scenario 2: Chain with multiple SubChains on multiple generations",)Scenario 2 Scenario two involves chaining with multiple SubChains across multiple generations.from langchain.prompts import PromptTemplatefrom langchain.chains import LLMChain# scenario 2 - Chaintemplate = """You are a playwright. Given the title of play, it is your job to write a synopsis for that title.Title: {title}Playwright: This is a synopsis for the above play:"""prompt_template = PromptTemplate(input_variables=["title"], template=template)synopsis_chain = LLMChain(llm=llm, prompt=prompt_template, callbacks=callbacks)test_prompts = [    {        "title": "documentary about good video games that push the boundary of game design"    },    {"title": "the phenomenon behind the remarkable speed of cheetahs"},    {"title": "the best in class mlops tooling"},]synopsis_chain.apply(test_prompts)aim_callback.flush_tracker(    langchain_asset=synopsis_chain, experiment_name="scenario 3: Agent with Tools")Scenario 3 The third scenario involves an agent with tools.from langchain.agents import initialize_agent, load_toolsfrom langchain.agents import AgentType# scenario 3 - Agent with Toolstools = load_tools(["serpapi", "llm-math"], llm=llm, callbacks=callbacks)agent = initialize_agent(    tools,    llm,    agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION,    callbacks=callbacks,)agent.run(    "Who is Leo DiCaprio's girlfriend? What is her current age raised to the 0.43 power?")aim_callback.flush_tracker(langchain_asset=agent, reset=False, finish=True)            > Entering new AgentExecutor chain...     I need to find out who Leo DiCaprio's girlfriend is and then calculate her age raised to the 0.43 power.    Action:
Aim makes it super easy to visualize and debug LangChain executions. Aim tracks inputs and outputs of LLMs and tools, as well as actions of agents.
Aim makes it super easy to visualize and debug LangChain executions. Aim tracks inputs and outputs of LLMs and tools, as well as actions of agents. ->: on Aim. By default, the session is reset rather than being terminated outright.Scenario 1 In the first scenario, we will use OpenAI LLM.# scenario 1 - LLMllm_result = llm.generate(["Tell me a joke", "Tell me a poem"] * 3)aim_callback.flush_tracker(    langchain_asset=llm,    experiment_name="scenario 2: Chain with multiple SubChains on multiple generations",)Scenario 2 Scenario two involves chaining with multiple SubChains across multiple generations.from langchain.prompts import PromptTemplatefrom langchain.chains import LLMChain# scenario 2 - Chaintemplate = """You are a playwright. Given the title of play, it is your job to write a synopsis for that title.Title: {title}Playwright: This is a synopsis for the above play:"""prompt_template = PromptTemplate(input_variables=["title"], template=template)synopsis_chain = LLMChain(llm=llm, prompt=prompt_template, callbacks=callbacks)test_prompts = [    {        "title": "documentary about good video games that push the boundary of game design"    },    {"title": "the phenomenon behind the remarkable speed of cheetahs"},    {"title": "the best in class mlops tooling"},]synopsis_chain.apply(test_prompts)aim_callback.flush_tracker(    langchain_asset=synopsis_chain, experiment_name="scenario 3: Agent with Tools")Scenario 3 The third scenario involves an agent with tools.from langchain.agents import initialize_agent, load_toolsfrom langchain.agents import AgentType# scenario 3 - Agent with Toolstools = load_tools(["serpapi", "llm-math"], llm=llm, callbacks=callbacks)agent = initialize_agent(    tools,    llm,    agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION,    callbacks=callbacks,)agent.run(    "Who is Leo DiCaprio's girlfriend? What is her current age raised to the 0.43 power?")aim_callback.flush_tracker(langchain_asset=agent, reset=False, finish=True)            > Entering new AgentExecutor chain...     I need to find out who Leo DiCaprio's girlfriend is and then calculate her age raised to the 0.43 power.    Action: