LangChain4j operates on two levels of abstraction:
LangChain4j 提供了兩種類型API抽象
Low level. At this level, you have the most freedom and access to all the low-level components such as ChatModel, UserMessage, AiMessage, EmbeddingStore, Embedding, etc. These are the "primitives" of your LLM-powered application. You have complete control over how to combine them, but you will need to write more glue code.
低級API:比較偏底層,你擁有最大的自由度,可以訪問所有底層組件,如ChatModel、UserMessage、AiMessage、EmbeddingStore、Embedding等。這些組件是你基于大型語言模型(LLM)的應用的“基本構建塊”。你可以完全控制如何組合它們,但需要編寫更多像膠水一樣的粘合代碼。
High level. At this level, you interact with LLMs using high-level APIs like AI Services, which hides all the complexity and boilerplate from you. You still have the flexibility to adjust and fine-tune the behavior, but it is done in a declarative manner.
高級API:在這一層面,你通過使用像AI Services 這樣的高級應用程序編程接口(API)與大型語言模型(LLM)進行交互,這些API會為你隱藏所有復雜性和模板內容。
你仍然可以靈活地調整和微調行為,但這是以聲明性的方式完成的。