From a547f518c3387f17661b4959b0a62d8a3bcc10d3 Mon Sep 17 00:00:00 2001 From: "junjie.jiang" Date: Mon, 5 Jun 2023 19:10:52 +0800 Subject: [PATCH] Update readme Signed-off-by: junjie.jiang --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f7f8c18..98346a6 100644 --- a/README.md +++ b/README.md @@ -23,19 +23,22 @@ Prompt to answer a question. from towhee import ops, pipe import requests -towhee_docs = requests.get('https://raw.githubusercontent.com/towhee-io/towhee/main/README.md').context +towhee_docs = requests.get('https://raw.githubusercontent.com/towhee-io/towhee/main/README.md').content p = ( pipe.input('question', 'docs', 'history') + .map('docs', 'docs', lambda x: x[:2000]) .map(('question', 'docs', 'history'), 'prompt', ops.prompt.question_answer()) .map('prompt', 'answer', ops.LLM.OpenAI()) .output('answer') ) an1 = p('Tell me something about Towhee', towhee_docs, []).get()[0] +print(an1) -an2 = p('Give an example', towhee_docs, [('Tell me something about Towhee', an1)]).get()[0] +an2 = p('How to use it', towhee_docs, [('Tell me something about Towhee', an1)]).get()[0] +print(an2) ```