API 명세 (python)

langchain API Reference — 🦜🔗 LangChain 0.0.338

langchain.js

Introduction | 🦜️🔗 Langchain

Input/output type

https://python.langchain.com/docs/expression_language/interface#output-schema

Component Input Type Output Type
Prompt Dictionary PromptValue
ChatModel Single string, list of chat messages or a PromptValue ChatMessage
LLM Single string, list of chat messages or a PromptValue String
OutputParser The output of an LLM or ChatModel Depends on the parser
Retriever Single string List of Documents
Tool Single string or dictionary, depending on the tool Depends on the tool

LCEL

langChain Expression Language

streaming

결과를 한번에 주지 않고 실시간으로 출력해주는 기능

python에서 console output으로 출력하기


...
from langchain.callbacks import StreamingStdOutCallbackHandler

chat = ChatOpenAI(streaming=True, callbacks=[StreamingStdOutCallbackHandler()])
...

Prompt