Conversation
There was a problem hiding this comment.
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é
guardrails/config_restapi/actions.py
Outdated
|
|
||
|
|
||
| async def get_query_response(user_question, session_id, user_id): | ||
| history = rag_service._get_session_history(session_id) |
There was a problem hiding this comment.
sao thấy có github r còn jenkins lm j nhỉ? @@ hơi ảo
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 | ||
|
|
| max_parallel_requests : 10 | ||
| timeout: 300 | ||
| stream_timeout: 30 | ||
| - model_name: lm-studio-guardrail |
| @@ -0,0 +1,5 @@ | |||
|
|
|||
| "-> Đang khởi tạo embeddings cho model: sentence-transformers/paraphrase-multilingual-mpnet-base-v2" | ||
| ) | ||
| self.embeddings = get_embeddings() | ||
| self.minio_loader = Minio_Loader( |
There was a problem hiding this comment.
Cái class này đặt tên hơi dị, nên theo cú pháp kiểu MinioLoader nhé
ingest_data/plugins/jobs/utils.py
Outdated
| else: | ||
| logger.info(f"Bucket '{s3_bucket}' already exists") | ||
|
|
||
| buffer = BytesIO() |
There was a problem hiding this comment.
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
ingest_data/requirements.txt
Outdated
| # Utilities | ||
| wget==3.2 | ||
| pydantic>=2.10.0 | ||
|
|
run.py
Outdated
There was a problem hiding this comment.
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(): |
There was a problem hiding this comment.
sao k có await trong mấy cái async này nhỉ?
There was a problem hiding this comment.
Đố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.
- Đố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 chunkTạ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 ạ.
src/cache/semantic_cache.py
Outdated
| ttl, | ||
| ) | ||
|
|
||
| def cache(self, *, namespace: str): |
There was a problem hiding this comment.
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é
src/config/settings.py
Outdated
| ) # Default to groq if not set | ||
|
|
||
| # LLM Parameters | ||
| LLMs_TEMPERATURE: float = 0.7 |
There was a problem hiding this comment.
wtf =)) sao cú pháp đặt tên gì mà chữ s tự nhiên viết bé tẹo
No description provided.