Browse Source
Add llm op
Signed-off-by: Kaiyuan Hu <kaiyuan.hu@zilliz.com>
main
1 changed files with
2 additions and
1 deletions
-
eqa_search.py
|
@ -108,6 +108,7 @@ def enhanced_qa_search_pipe(config): |
|
|
p = ( |
|
|
p = ( |
|
|
p.map('result', 'docs', lambda x:[i[2] for i in x]) |
|
|
p.map('result', 'docs', lambda x:[i[2] for i in x]) |
|
|
.map(('question', 'docs', 'history'), 'prompt', ops.prompt.question_answer()) |
|
|
.map(('question', 'docs', 'history'), 'prompt', ops.prompt.question_answer()) |
|
|
|
|
|
.map('prompt', 'answer', ops.LLM.OpenAI(api_key=config.openai_api_key)) |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
return p.output('question', 'history', 'docs', 'prompt') |
|
|
|
|
|
|
|
|
return p.output('answer') |
|
|