Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

ppakyeah
Copy link
Contributor

@ppakyeah ppakyeah commented Jan 8, 2025

{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)

🖥️ OS: Win/Mac/Linux   
✅ Checklist      
 - [ ] **Template**: Tutorials follows the required template. 
 - [ ] **Table of Contents(TOC) Links**: All Table of Contents links work. ((Yes/No)
 - [ ] **Image**: Image filenames follow guidelines.
 - [ ] **Imports*: All import statements use the latest versions. Ensure "langchain-teddynote" is not used. 
 - [ ] **Code Execution**: Code runs without errors.
 - Comments: {Write freely, 한국어 기술 가능}     

If no one reviews your PR within a few days, please @-mention one of teddylee777, musangk, BAEM1N

@ppakyeah ppakyeah requested review from gyjong and kofsitho87 January 8, 2025 04:32
@ppakyeah ppakyeah self-assigned this Jan 8, 2025
kofsitho87
kofsitho87 previously approved these changes Jan 8, 2025
Copy link
Contributor

@kofsitho87 kofsitho87 left a 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 비교 내용 추가
@ppakyeah ppakyeah requested a review from kofsitho87 January 8, 2025 10:25
@ppakyeah ppakyeah changed the title [E-4] 13-LCEL / 07-ChainDecorator [E-4] 13-LangChain-Expression-Language / 07-ChainDecorator Jan 8, 2025
Copy link
Contributor

@gyjong gyjong left a 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 표기)
  • 기타 의견:
    특이사항 없습니다. 내용 및 코드 정상 작동 확인 하였습니다. 수고 많으셨습니다.

Copy link
Contributor

@kofsitho87 kofsitho87 left a 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 표기)
  • 기타 의견:
    특이사항 없습니다.
    고생하셨습니다.

@teddylee777 teddylee777 merged commit 0d482bb into LangChain-OpenTutorial:main Jan 9, 2025
1 of 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.

4 participants