logo
Browse Source

Update example

Signed-off-by: junjie.jiang <junjie.jiang@zilliz.com>
main
junjie.jiang 1 year ago
parent
commit
492cd4183c
  1. 5
      README.md

5
README.md

@ -33,14 +33,17 @@ input:
p = ( p = (
pipe.input('question', 'doc', 'history') pipe.input('question', 'doc', 'history')
.map('docs', 'docs', lambda x: x[:2000])
.map(('question', 'doc', 'history'), 'prompt', ops.prompt.template(temp, ['question', 'context'])) .map(('question', 'doc', 'history'), 'prompt', ops.prompt.template(temp, ['question', 'context']))
.map('prompt', 'answer', ops.LLM.OpenAI()) .map('prompt', 'answer', ops.LLM.OpenAI())
.output('answer') .output('answer')
) )
an1 = p('Tell me something about Towhee', towhee_docs, []).get()[0] 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)
``` ```

Loading…
Cancel
Save