-
Notifications
You must be signed in to change notification settings - Fork 282
[E-4] 13-LangChain-Expression-Language / 07-ChainDecorator #227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[E-4] 13-LangChain-Expression-Language / 07-ChainDecorator #227
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Review Checklist]
-
Review OS:
- Mac
-
Template Rule 준수 여부:
- Template Rule 가이드를 준수하였는가? (Check 표기)
-
Table of Contents 링크 확인:
- Table of Contents의 링크가 원활하게 동작하는지 확인하였는가? (Check 표기)
-
이미지 파일명 검토:
- 이미지가 포함되어 있다면, 이미지의 파일명이 가이드를 준수하였는가? (Check 표기)
-
최신 import 방식 사용 여부:
- import 구문이 예전 legacy 방식이 아닌 최신 버전을 따르는가? (Check 표기)
-
코드 동작 확인:
- 모든 코드가 오류 없이 동작하는가? (Check 표기)
- Warning 발생 시 코멘트에 적어주세요.
-
제출 파일 확인:
- 꼭 필요한 파일들만 제출되었는가?
- 튜토리얼 외 설정 파일이나 다른 분이 작업한 파일이 포함되었는지 Files Changed에서 확인 부탁드립니다. (Check 표기)
- 꼭 필요한 파일들만 제출되었는가?
-
기타 의견:
현재 튜토리얼은 @chain 데코레이터의 사용법을 잘 설명하고 있습니다. 다만 개인적으로는 @chain 데코레이터의 장점을 설명하기 위해 RunnableLambda의 비교 내용을 추가하면 어떨지 조심스럽게 제안드립니다.
from langchain_core.runnables import RunnableLambda
# Example 1: Using RunnableLambda
def regular_function(text):
chain1 = prompt1 | ChatOpenAI(model="gpt-4o-mini") | StrOutputParser()
output1 = chain1.invoke({"topic": text})
chain2 = prompt2 | ChatOpenAI(model="gpt-4o-mini") | StrOutputParser()
return chain2.invoke({"sentence": output1})
runnable_lambda_example = RunnableLambda(regular_function)
runnable_lambda_example.invoke("quantum mechanics")
# Example 2: Using @chain decorator
@chain
def custom_chain(text):
...
print(custom_chain.invoke("quantum mechanics"))
- RunnableLambda 비교 내용 추가
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Review Checklist]
-
Review OS:
- Windows / Mac / Linux (Mac)
-
Template Rule 준수 여부:
- Template Rule 가이드를 준수하였는가? (Check 표기)
-
Table of Contents 링크 확인:
- Table of Contents의 링크가 원활하게 동작하는지 확인하였는가? (Check 표기)
-
이미지 파일명 검토:
- 이미지가 포함되어 있다면, 이미지의 파일명이 가이드를 준수하였는가? (Check 표기)
-
최신 import 방식 사용 여부:
- import 구문이 예전 legacy 방식이 아닌 최신 버전을 따르는가? (Check 표기)
-
코드 동작 확인:
- 모든 코드가 오류 없이 동작하는가? (Check 표기)
- Warning 발생 시 코멘트에 적어주세요.
-
제출 파일 확인:
- 꼭 필요한 파일들만 제출되었는가?
- 튜토리얼 외 설정 파일이나 다른 분이 작업한 파일이 포함되었는지 Files Changed에서 확인 부탁드립니다. (Check 표기)
- 꼭 필요한 파일들만 제출되었는가?
-
기타 의견:
특이사항 없습니다. 내용 및 코드 정상 작동 확인 하였습니다. 수고 많으셨습니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Review Checklist]
-
Review OS:
- Mac
-
Template Rule 준수 여부:
- Template Rule 가이드를 준수하였는가? (Check 표기)
-
Table of Contents 링크 확인:
- Table of Contents의 링크가 원활하게 동작하는지 확인하였는가? (Check 표기)
-
이미지 파일명 검토:
- 이미지가 포함되어 있다면, 이미지의 파일명이 가이드를 준수하였는가? (Check 표기)
-
최신 import 방식 사용 여부:
- import 구문이 예전 legacy 방식이 아닌 최신 버전을 따르는가? (Check 표기)
-
코드 동작 확인:
- 모든 코드가 오류 없이 동작하는가? (Check 표기)
- Warning 발생 시 코멘트에 적어주세요.
-
제출 파일 확인:
- 꼭 필요한 파일들만 제출되었는가?
- 튜토리얼 외 설정 파일이나 다른 분이 작업한 파일이 포함되었는지 Files Changed에서 확인 부탁드립니다. (Check 표기)
- 꼭 필요한 파일들만 제출되었는가?
-
기타 의견:
특이사항 없습니다.
고생하셨습니다.
{PR Message - Write freely, remove this bracket if unnecessary}
Author Checklist
PR Title Format: I have confirmed that the PR title follows the correct format. (e.g., [N-2] 07-Text Splitter / 07-RecursiveCharacterTextSplitter)
Committed Files: I have ensured that no unnecessary files (e.g., .bin, .gitignore, poetry.lock, pyproject.toml) are included. These files are not allowed.
(Optional) Related Issue: If this PR is linked to an issue, I have referenced the issue number in the PR message. (e.g., Fixes Update 01-PromptTemplate.ipynb #123)
❌ Do not include unnecessary files (e.g., .bin, .gitignore, poetry.lock, pyproject.toml) or other people's code. If included, close the PR and create a new PR.
Review Template (Intial PR)
If no one reviews your PR within a few days, please @-mention one of teddylee777, musangk, BAEM1N