ML&DL and LLM
LangChain - 1.1 Model I/O Concept
이반&핫버드
2024. 3. 27. 16:07
참조 : https://python.langchain.com/docs/modules/model_io/concepts
Concepts | 🦜️🔗 Langchain
The core element of any language model application is...the model. LangChain gives you the building blocks to interface with any language model. Everything in this section is about making it easier to work with models. This largely involves a clear interfa
python.langchain.com
Concepts
Group | Item | Desc | Others |
Model | LLMs | LLMs in LangChain refer to pure text completion models. | |
Chat Models | Chat models are often backed by LLMs but tuned specifically for having conversations. | ||
Cosideration | These two API types have pretty different input and output schemas. In particular, the prompting strategies for LLMs vs ChatModels may be quite different. Different models have different prompting strategies - Anthropic's models work best with XML - while OpenAI's work best with JSON |
||
Messages | HumanMessage | Messge from user | |
AIMessage | Message from the model | ||
SystemMessage | Only some model support | ||
FunctionMessage | The inputs to language models | ||
Prompt | PromptValue | ||
PromptTemplate | |||
MessagePromptTemplate | HumanMessagePromptTemplate AIMessagePromptTemplate SystemMessagePromtTemplate |
||
MessagPlaceholder | Oftentimes inputs to prompts can be a list of messages. This is when you would use a MessagesPlaceholder. |
||
ChatPromptTemplate | |||
Output Parser |
StrOutputParser | LLM = String ChatModel = message (.contents) |
|
OpenAI Functions Parsers | |||
Agent Output Parsers |