목록 LangChain (3)
KEEP GOING

LCEL(LangChain Expression Language)LCEL을 사용하여 langchain의 다양한 구성 요소를 단일 체인으로 결합할 수 있다. LCEL 기본 형태: prompt+model+output parser CommaSeparatedListOutputParser 사용 리스트 형태로 결과를 받기 위해 사용 # promptTemplate + OutParserfrom langchain_core.output_parsers import CommaSeparatedListOutputParserfrom langchain_core.prompts import PromptTemplatefrom langchain_openai import ChatOpenAI# 콤마로 구분된 리스트 출력 파서 초기화output..

LangChain에서는 허깅페이스 허브에 배포되어 있는 사전 학습 모델을 활용하여 LLM 체인을 구성할 수 있음. HuggingFace Hub이란?120k 이상의 모델, 20k의 데이터셋, 50k의 데모 앱(Spaces)를 포함하는 플랫폼오픈소스로 공개적으로 이용 가능 라이브러리 설치 !pip install langchain!pip install huggingface_hub transformers datasets 허깅페이스 토큰 발급허깅페이스 회원가입 후 토큰 발급 https://huggingface.co/ Hugging Face – The AI community building the future.The Home of Machine Learning Create, discover and collabora..

LangChain이란?LLM 기반의 애플리케이션을 구축하기 위한 오픈소스 프레임워크LangChain을 활용할 경우 재훈련이나 fine tuning 없이 분야별 LLM 애플리케이션을 개발할 수 있음 LangChain 활용 사례검색, 프롬프트, 임베딩, 유사도 검색, 랭킹 환경 세팅라이브러리 설치 및 환경변수 설정LANGCHAIN_API_KEY 입력 > API Keys > Create API Key 생성 후 복사 https://smith.langchain.com/o/4700d6ec-c086-52ed-b6d2-266b15769dc4/settings LangSmith smith.langchain.com # OpenAI 활용을 위한 langchain 라이브러리 설치 !pip install -q langchain ..