반응형 전체 글161 ㅇ홍홍 # ─────────────────────────────# 공통 부모 클래스# ─────────────────────────────class BasePipeline: def __init__(self, config, s3_client): self.config = config self.s3 = s3_client # 공통 실행 순서 (템플릿 메서드) def run(self): self.create_directories() self.download_from_s3() self.preprocess() # 자식이 구현 self.upload_to_s3() # 공통 단계 def create_directo.. 2025. 10. 24. gen answer def generate_answer_from_hits(query: str, hits: List[Dict[str, Any]]) -> str: """ OPENAI_API_KEY가 있으면 LLM으로 생성. 없으면 상위 컨텍스트를 붙여 간단 추출형 답변을 반환. """ context_blocks = [] for h in hits: md = h.get("metadata", {}) header = f"[{md.get('filename')}, chunk={md.get('chunk')}]" context_blocks.append(f"{header}\n{h['text']}") context = "\n\n---\n\n".join(context_bl.. 2025. 10. 20. add import jsonfrom pathlib import Pathfrom typing import List, Dict, Anyimport argparseimport chromadb# -------- 설정 --------PERSIST_DIR = "chroma_store"COLLECTION = "docs"DISTANCE = "cosine"# -------- 신규 데이터 로드 --------def load_preembedded(path: str): """ { "fileA.json": [ {chunk, content, vector}, ... ] } 형식 읽기 """ raw = json.loads(Path(path).read_text(encoding="utf-8")) ids, docs, .. 2025. 10. 15. chroma vectordb import jsonfrom pathlib import Pathfrom typing import List, Dict, Anyimport argparseimport chromadbfrom sentence_transformers import SentenceTransformer# -------- 설정 --------INPUT_JSON = "data/emb_chunks.json" # { "fileA.json": [ {chunk, content, vector}, ... ], ... }PERSIST_DIR = "chroma_store"COLLECTION = "docs"DISTANCE = "cosine" # cosine / l2 / ipEMBED_MODEL = "sentence-t.. 2025. 10. 15. ODR research ODR research & reverse engineeringpaper 대신 참고 link : https://blog.langchain.com/open-deep-research/0. ODR pipeline- scope : 리서치 범위 설정 (user classification, Brief generation)- research : 실제 리서치 수행 (이때 supervisor 과 sub agent 동작)- write : 최종 보고서 작성 (one-shot report generation)https://blog.langchain.com/open-deep-research/1. Scope1) User classification (classify with_user 노드): 리서치 요청시에 사용자의 대화를 통해 추.. 2025. 10. 14. ㅊㅋㅌㅍ 2025. 10. 14. as https://scrawny-shoe-074.notion.site/ODR-research-reverse-engineering-2887ebe4bf198098aa0ec581c9df8253 2025. 10. 14. odr study - paper 대신 참고 link : https://blog.langchain.com/open-deep-research/## ODR pipeline- scope : 리서치 범위 설정 (user classification, Brief generation)- research : 실제 리서치 수행 (이때 supervisor 과 sub agent 동작)- write : 최종 보고서 작성 (one-shot report generation)graph 구조- **Sc.. 2025. 10. 14. ca System Prompt (Code Generation & Editing)You are a senior software engineer.The main programming language is {computing_lang}.Follow user requests to generate, edit, explain, or fix code accurately.Always output clean, well-structured, and runnable code with brief explanations.When editing, include a short summary of changes or a diff.Add concise and meaningful comments inside the code to improv.. 2025. 10. 13. MCP MCP ? MCP(Model Context Protocol)MCP는 쉽게 말해 LLM과 외부 데이터 소스(웹 API, 데이터베이스, 파일 시스템 등)를 하나로 연동할 수 있게 해주는 개방형 표준 프로토콜 MCP 이전의 Tool calling - 프롬프트로 사용자 요청받은 후, LLM (호스트 application) 이 직접 파싱해서 도구를 호출 - 도구 API 마다 포맷이 다르기 때문에 파싱을 잘못할 경우 호출이 제대로 안됨 - 새로운 도구 추가할때마다 프롬프트와 파서 둘다 수정 필요 ex. 1) 사용자가 프롬프트 입력 - " 서울 날씨 알려줘" 2) LLM 프롬프트 안의 규칙을 따라 문자열로 도구 호출 "get_weather("Seoul") .. 2025. 8. 14. 이전 1 2 3 4 ··· 17 다음 728x90 반응형