...
3개의 패키지 추가 필요, 0.2.4 부터 VectorDB가 안나옴.
코드 블럭 |
---|
|
pip install keyrings.alt
pip install bs4
pip install promptflow-vectordb==0.2.3 |
코드 블럭 |
---|
title | search_result_filtering |
---|
|
from promptflow import tool
# The inputs section will change based on the arguments of the tool function, after you save the code
# Adding type to arguments and return value will help the system show the types properly
# Please update the function name/signature per need
@tool
def my_python_tool(search_result: dict):
# print(search_result[0]['original_entity']['text'])
# 검색된 여러개의 문서에서 original_entity의 text 부분만 배열로 만들어서 반환
return [entity['original_entity']['text'] for entity in search_result]
|
코드 블럭 |
---|
|
system:
Summary result for question in Korean.
Never use your knowledge and only use the text displayed in ```.
If the question asks for a comparison, display it as a table.
user:
question: {{question}}
search_results:
```
{% for item in search_results %}
{{item}}
{% endfor %}
``` |
RAG 시나리오 고민중.
- PF 설정
- PF 기반으로 Embedding API 만들기
- 배치를 통해 임베딩 데이터 생성
- 검색엔진에 임베딩 데이터 인덱싱
- 인덱싱 정보를 활용한 검색 API 생성 활용
- 검색 데이터 추가하여 검색 정보 확인
...