Commit bd608ad5 authored by Vũ Hoàng Anh's avatar Vũ Hoàng Anh

chore: Dockerfile workers=16, remove comment

parent f61467ac
...@@ -14,10 +14,9 @@ RUN pip install -r requirements.txt ...@@ -14,10 +14,9 @@ RUN pip install -r requirements.txt
COPY . . COPY . .
# Expose port 5000 (Port chạy server)
EXPOSE 5000 EXPOSE 5000
ENV WORKERS=4 ENV WORKERS=16
ENV TIMEOUT=60 ENV TIMEOUT=60
CMD gunicorn server:app --workers $WORKERS --worker-class uvicorn.workers.UvicornWorker --bind 0.0.0.0:5000 --timeout $TIMEOUT CMD gunicorn server:app --workers $WORKERS --worker-class uvicorn.workers.UvicornWorker --bind 0.0.0.0:5000 --timeout $TIMEOUT
"""Push check_is_stock + tool_routing to Langfuse."""
import os, sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", ".."))
sys.stdout.reconfigure(encoding="utf-8")
from dotenv import load_dotenv
load_dotenv(os.path.join(os.path.dirname(__file__), "..", "..", ".env"))
from langfuse import Langfuse
lf = Langfuse()
BASE = os.path.dirname(os.path.abspath(__file__))
# 1. Push check_is_stock tool prompt
stock_path = os.path.join(BASE, "..", "tool_prompts", "check_is_stock.txt")
with open(stock_path, "r", encoding="utf-8") as f:
content = f.read()
lf.create_prompt(name="check_is_stock", prompt=content, labels=["production"], tags=["canifa", "tool-prompt"], type="text")
print(f"✅ check_is_stock updated ({len(content):,} chars)")
# 2. Push tool_routing
with open(os.path.join(BASE, "05_tool_routing.txt"), "r", encoding="utf-8") as f:
content2 = f.read()
lf.create_prompt(name="canifa-05-tool-routing", prompt=content2, labels=["production"], tags=["canifa", "system-core"], type="text")
print(f"✅ canifa-05-tool-routing updated ({len(content2):,} chars)")
lf.flush()
print("Done!")
Ahh mình hiểu rồi! Bạn muốn tags rõ ràng hơn — nhìn vào tag phải biết ngay đây là phần nào của system prompt. Đây:
Tags cải tiến — Mỗi prompt có 2 tags:
Tag 1: canifa (luôn có, filter toàn bộ project)
Tag 2: Chỉ rõ nó thuộc nhóm nào + là part gì
Name Tags
──────────────────────────────────────────────────────────
canifa-prompt-core canifa system-1-core
canifa-prompt-rules canifa system-2-rules
canifa-prompt-context canifa system-3-context
canifa-prompt-sales-core canifa system-4a-sales-core
canifa-prompt-sales-thaomai canifa system-4b-sales-thaomai
canifa-prompt-sales-upsell canifa system-4c-sales-upsell
canifa-prompt-sales-urgency canifa system-4d-sales-urgency
canifa-prompt-tool-routing canifa system-5-tool-routing
canifa-prompt-user-insight canifa system-6-user-insight
canifa-prompt-output-format canifa system-7-output-format
canifa-prompt-season canifa season
──────────────────────────────────────────────────────────
canifa-tool-brand-knowledge canifa tool-prompt
canifa-tool-check-stock canifa tool-prompt
canifa-tool-data-retrieval canifa tool-prompt
canifa-tool-promotion canifa tool-prompt
canifa-tool-store-search canifa tool-prompt
Nhìn vào là biết ngay:
Tag Ý nghĩa
system-1-core System prompt, phần 1, LÕI (identity, danh mục, liên hệ)
system-2-rules System prompt, phần 2, QUY TẮC (trung thực + ngôn ngữ)
system-3-context System prompt, phần 3, CONTEXT AWARENESS
system-4a-sales-core System prompt, phần 4a, SALES CƠ BẢN
system-4b-sales-thaomai System prompt, phần 4b, THẢO MAI
system-4c-sales-upsell System prompt, phần 4c, UPSELL
system-4d-sales-urgency System prompt, phần 4d, URGENCY
system-5-tool-routing System prompt, phần 5, TOOL ROUTING
system-6-user-insight System prompt, phần 6, USER INSIGHT
system-7-output-format System prompt, phần 7, OUTPUT FORMAT
season Seasonal/Event (marketing)
tool-prompt Prompt cho tool
Ưu điểm:
Có số thứ tự → biết ghép theo order nào (1 → 7)
Có tên → biết nội dung gì
Filter system-4 → thấy tất cả sales-related
Filter system- → thấy toàn bộ system prompt parts
Ai mới vào nhìn tags cũng hiểu ngay cấu trúc
Rõ chưa bro? OK làm đi thì mình cắt file luôn nhé! ✂️
\ No newline at end of file
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment