Skip to content

Feature/add project code#1

Merged
T-Sunm merged 5 commits intomainfrom
feature/add-project-code
Oct 5, 2025
Merged

Feature/add project code#1
T-Sunm merged 5 commits intomainfrom
feature/add-project-code

Conversation

@T-Sunm
Copy link
Owner

@T-Sunm T-Sunm commented Sep 29, 2025

No description provided.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Có một số vde với cái hình này:

  • Hình chưa có thứ tự mũi tên gì, nên có thứ tự nhé, và có thể để mỗi luồng user (dev/client) 1 màu cho dễ phân biệt
  • Pull image cái service nào pull về?
  • Cache với cache layer khác nhau ntn nhỉ?
  • Mũi tên chat history đi tới generator làm gì, k thể hiện đc ở mũi tên, với tại sao lại mũi tên nét đứt?
  • Thường mũi tên nét liền là các luồng chính, mũi tên nét đứt là các luồng phụ mà user không trực tiếp tương tác với nhé



async def get_query_response(user_question, session_id, user_id):
history = rag_service._get_session_history(session_id)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hàm private mà gọi ở đây là sao má

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sao thấy có github r còn jenkins lm j nhỉ? @@ hơi ảo

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

k ai viết jenkins pipeline để là txt nhé... cái này em chưa quen thuộc thì cứ bỏ cicd đi

LANGFUSE_INIT_USER_PASSWORD: ${LANGFUSE_INIT_USER_PASSWORD:-}

clickhouse:
image: clickhouse/clickhouse-server

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mấy cái image luôn luôn phải có tag, và tag đó k nên là latest nhé

max_parallel_requests : 10
timeout: 300 # timeout cho call thường (tối đa 5 phút)
stream_timeout: 30

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sao tự nhiên cái line này trống nhỉ

max_parallel_requests : 10
timeout: 300
stream_timeout: 30
- model_name: lm-studio-guardrail

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Xong cái này lại liền nè

@@ -0,0 +1,5 @@

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nhớ để ý format code

"-> Đang khởi tạo embeddings cho model: sentence-transformers/paraphrase-multilingual-mpnet-base-v2"
)
self.embeddings = get_embeddings()
self.minio_loader = Minio_Loader(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cái class này đặt tên hơi dị, nên theo cú pháp kiểu MinioLoader nhé

else:
logger.info(f"Bucket '{s3_bucket}' already exists")

buffer = BytesIO()
Copy link

@quan-dang quan-dang Oct 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sao upload data mà làm lằng nhằng thế nhỉ? =)) em coi tutorial thử: https://docs.min.io/community/minio-object-store/developers/python/minio-py.html

# Utilities
wget==3.2
pydantic>=2.10.0

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

để ý xoá mấy dòng thừa

run.py Outdated

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tự nhiên thêm file này rất lằng nhằng :v ném luôn vào file main api đi

session_id = input.session_id or str(uuid.uuid4())
user_id = input.user_id or f"user_{str(uuid.uuid4())[:8]}"

async def generate_response():

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sao k có await trong mấy cái async này nhỉ?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Đối với hàm retrieve_restaurants: Nó được khai báo là async def vì FastAPI yêu cầu như vậy khi một trong các dependency (như Depends(get_rag_service)) là hàm async. FastAPI sẽ tự động await các dependency này. Nhiệm vụ chính của hàm này chỉ là trả về StreamingResponse, nó không trực tiếp thực hiện tác vụ I/O nào cần await.

  1. Đối với hàm generate_response: Đây là một async generator. Từ khóa await được sử dụng một cách ngầm định bên trong vòng lặp async for. Cụ thể là ở dòng:
async for chunk in rag_service.get_sse_response(...):
yield chunk

Tại mỗi vòng lặp, nó sẽ "await" để nhận chunk tiếp theo từ stream. Đây là pattern chuẩn và hiệu quả để xử lý streaming response trong Python và FastAPI.

Tóm lại, await vẫn đang diễn ra, nhưng một phần do FastAPI quản lý và phần chính nằm trong cú pháp async for ạ.

ttl,
)

def cache(self, *, namespace: str):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

viết hàm gì dài loằng ngoằng, lại còn dùng *, em nghiên cứu thử hàm với args và kwargs nhé

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hàm nên viết ngắn thôi còn test đc

) # Default to groq if not set

# LLM Parameters
LLMs_TEMPERATURE: float = 0.7

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wtf =)) sao cú pháp đặt tên gì mà chữ s tự nhiên viết bé tẹo

@T-Sunm T-Sunm merged commit ec45769 into main Oct 5, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants