Skip to content

Commit

Permalink
프롬프트 간단히 수정 (#119)
Browse files Browse the repository at this point in the history
* 기사 재생성 LLM 요청 프로토타입 #25 (#36)

* 환경변수 파일 ignore 추가

* python-dotenv 의존성 추가
- .env 파일

* get_platform_client 생성

* 네이밍 수정

* 쉬운 기사 변환 프로토타입 생성

* 프롬프트 버저닝 및 txt파일로 분리

* ai 요청 결과를 json으로 파싱

* 링크를 넣으면 크롤링 해서 새로운 쉬운 기사로 생성하여 DB에 저장

* 수정

---------

Co-authored-by: 정지민 <[email protected]>
Co-authored-by: Vackam <[email protected]>
  • Loading branch information
3 people authored Jul 18, 2024
1 parent b54ad03 commit e004703
Showing 1 changed file with 14 additions and 38 deletions.
52 changes: 14 additions & 38 deletions app/model/prompt/graphic_article/2024-07-10.txt
Original file line number Diff line number Diff line change
@@ -1,45 +1,21 @@
You are provided with a summary of a dataset and the title of a news article. Suggest a suitable graph type for visualizing the data using plotly, including necessary preprocessing steps and additional keyword arguments. Also, create the body text of the article based on the visualization. Use only the column names provided in the summary for x_value and y_value. Follow the specified graph types and preprocessing steps only.
You are provided with a summary of a dataset and the title of a easy news article. Suggest a suitable graph type for visualizing the data using plotly, including necessary preprocessing steps and additional keyword arguments.
Also, create the body text of the article based on the visualization.
Use only the column names provided in the summary for x_value and y_value. Follow the specified graph types and preprocessing steps only.

Valid graph types: bar, line, pie, histogram, scatter, choropleth, funnel
Valid preprocessing steps: melt, pivot, groupby, filter, drop, replace, merge, sort
"Also, create the body text of the article based on the visualization, which must be over five lines, each separated by '\n', include an 이모티콘 on each line, and be written in a friendly '해요' style."

You should respond in JSON format.
Responses should be in JSON format.
Response format:
{
"graph_type": "valid_graph_type",
"x_value": "x_value_name",
"y_value": "y_value_name",
"preprocessing_steps": [
{
"type": "valid_preprocessing_type",
"params": {"key": "value", ...}
},
...
] or null,
"kwargs": {
"key": "value",
...
} or null,
"article": {
"body": "Detailed article body based on the data visualization, it must be Korean"
}
}

Example:
{
"graph_type": "bar",
"x_value": "category",
"y_value": "count",
"preprocessing_steps": [
{
"type": "groupby",
"params": {"by": ["category"], "agg_func": {"count": "sum"}}
}
],
"kwargs": {
"color": "blue"
},
"article": {
"body": "의대생 중 95%나 되는 인원이 시험을 치지 않겠다고 선언했어요!"
}
"graph_type": "valid_graph_type",
"x_value": "x_value_name",
"y_value": "y_value_name",
"preprocessing_steps":
[ { "type": "valid_preprocessing_type", "params": {"key": "value", ...} }, ... ] or null,
"kwargs": { "key": "value", ... } or null,
"article": {
"body": 매일의 판매액을 한눈에 볼 수 있게 했어요 📈\n매출 데이터는 날짜별로 그룹화했어요 🗓️\n날짜 순서대로 정렬했어요 📅\n그래프에서 각 날짜의 판매액을 확인할 수 있어요 🛒\n이제 일별 매출 트렌드를 알 수 있어요 😊
}
}

0 comments on commit e004703

Please sign in to comment.