From 9def5225926a6202442259e763529816392c0f98 Mon Sep 17 00:00:00 2001 From: taha-aiplanet Date: Tue, 4 Jun 2024 01:33:06 +0800 Subject: [PATCH] Create Running_Observability.py --- cookbook/Running_Observability.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 cookbook/Running_Observability.py diff --git a/cookbook/Running_Observability.py b/cookbook/Running_Observability.py new file mode 100644 index 0000000..9ec9720 --- /dev/null +++ b/cookbook/Running_Observability.py @@ -0,0 +1,20 @@ +from beyondllm import source,retrieve,generator, llms, embeddings +from beyondllm.observe import Observer +import os + +os.environ['OPENAI_API_KEY'] = 'sk-****' + +Observe = Observer() +Observe.run() + +llm=llms.ChatOpenAIModel() +embed_model = embeddings.OpenAIEmbeddings() + +data = source.fit("https://www.youtube.com/watch?v=oJJyTztI_6g",dtype="youtube",chunk_size=512,chunk_overlap=50) +retriever = retrieve.auto_retriever(data,embed_model,type="normal",top_k=4) + +pipeline = generator.Generate(question="what tool is video mentioning about?",retriever=retriever, llm=llm) +pipeline = generator.Generate(question="What is the tool used for?",retriever=retriever, llm=llm) +pipeline = generator.Generate(question="How can i use the tool for my own use?",retriever=retriever, llm=llm) + +