full of surprise\n\nFull of joy and full of surprise\n\nBe brave and take small steps\n\nThe future will be revealed with depth\n\nIn the morning, when dawn arrives\n\nA fresh start, no reason to hide\n\nSomewhere down the road, there's a heart that beats\n\nBelieve in yourself, you'll always succeed.", generation_info={'finish_reason': 'stop', 'logprobs': None})]], llm_output={'token_usage': {'completion_tokens': 504, 'total_tokens': 528, 'prompt_tokens': 24}, 'model_name': 'text-davinci-003'})You can then check the metric if it was successful by calling the is_successful() method.answer_relevancy_metric.is_successful()# returns True/FalseOnce you have ran that, you should be able to see our dashboard below. Scenario 2: Tracking an LLM in a chain without callbacks‚ÄãTo track an LLM in a chain without callbacks, you can plug into it at the end.We can start by defining a simple chain as shown below.import requestsfrom langchain.chains import RetrievalQAfrom langchain.document_loaders import TextLoaderfrom langchain.embeddings.openai import OpenAIEmbeddingsfrom langchain.llms import OpenAIfrom langchain.text_splitter import CharacterTextSplitterfrom langchain.vectorstores import Chromatext_file_url = "https://raw.githubusercontent.com/hwchase17/chat-your-data/master/state_of_the_union.txt"openai_api_key = "sk-XXX"with open("state_of_the_union.txt", "w") as f:  response = requests.get(text_file_url)  f.write(response.text)loader = TextLoader("state_of_the_union.txt")documents = loader.load()text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=0)texts = text_splitter.split_documents(documents)embeddings = OpenAIEmbeddings(openai_api_key=openai_api_key)docsearch = Chroma.from_documents(texts, embeddings)qa = RetrievalQA.from_chain_type(  llm=OpenAI(openai_api_key=openai_api_key), chain_type="stuff",  retriever=docsearch.as_retriever())# Providing a new question-answering pipelinequery = "Who is the president?"result = qa.run(query)After defining a chain,
DeepEval package for unit testing LLMs.
DeepEval package for unit testing LLMs. ->: full of surprise\n\nFull of joy and full of surprise\n\nBe brave and take small steps\n\nThe future will be revealed with depth\n\nIn the morning, when dawn arrives\n\nA fresh start, no reason to hide\n\nSomewhere down the road, there's a heart that beats\n\nBelieve in yourself, you'll always succeed.", generation_info={'finish_reason': 'stop', 'logprobs': None})]], llm_output={'token_usage': {'completion_tokens': 504, 'total_tokens': 528, 'prompt_tokens': 24}, 'model_name': 'text-davinci-003'})You can then check the metric if it was successful by calling the is_successful() method.answer_relevancy_metric.is_successful()# returns True/FalseOnce you have ran that, you should be able to see our dashboard below. Scenario 2: Tracking an LLM in a chain without callbacks‚ÄãTo track an LLM in a chain without callbacks, you can plug into it at the end.We can start by defining a simple chain as shown below.import requestsfrom langchain.chains import RetrievalQAfrom langchain.document_loaders import TextLoaderfrom langchain.embeddings.openai import OpenAIEmbeddingsfrom langchain.llms import OpenAIfrom langchain.text_splitter import CharacterTextSplitterfrom langchain.vectorstores import Chromatext_file_url = "https://raw.githubusercontent.com/hwchase17/chat-your-data/master/state_of_the_union.txt"openai_api_key = "sk-XXX"with open("state_of_the_union.txt", "w") as f:  response = requests.get(text_file_url)  f.write(response.text)loader = TextLoader("state_of_the_union.txt")documents = loader.load()text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=0)texts = text_splitter.split_documents(documents)embeddings = OpenAIEmbeddings(openai_api_key=openai_api_key)docsearch = Chroma.from_documents(texts, embeddings)qa = RetrievalQA.from_chain_type(  llm=OpenAI(openai_api_key=openai_api_key), chain_type="stuff",  retriever=docsearch.as_retriever())# Providing a new question-answering pipelinequery = "Who is the president?"result = qa.run(query)After defining a chain,