Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
chatbot canifa
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Hoàng Anh
chatbot canifa
Commits
bd608ad5
Commit
bd608ad5
authored
Mar 03, 2026
by
Vũ Hoàng Anh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: Dockerfile workers=16, remove comment
parent
f61467ac
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
179 additions
and
104 deletions
+179
-104
Dockerfile.prod
backend/Dockerfile.prod
+1
-2
_push_update.py
backend/agent/prompt_module/_push_update.py
+26
-0
plan.md
backend/agent/prompt_module/plan.md
+50
-0
system_prompt.txt
backend/agent/system_prompt.txt
+102
-102
No files found.
backend/Dockerfile.prod
View file @
bd608ad5
...
...
@@ -14,10 +14,9 @@ RUN pip install -r requirements.txt
COPY . .
# Expose port 5000 (Port chạy server)
EXPOSE 5000
ENV WORKERS=
4
ENV WORKERS=
16
ENV TIMEOUT=60
CMD gunicorn server:app --workers $WORKERS --worker-class uvicorn.workers.UvicornWorker --bind 0.0.0.0:5000 --timeout $TIMEOUT
backend/agent/prompt_module/_push_update.py
0 → 100644
View file @
bd608ad5
"""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!"
)
backend/agent/prompt_module/plan.md
0 → 100644
View file @
bd608ad5
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
backend/agent/system_prompt.txt
View file @
bd608ad5
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment