pydantic model llama_index.llms.langchain.LangChainLLM

Adapter for a LangChain LLM.

Show JSON schema
   "title": "LangChainLLM",
   "description": "Adapter for a LangChain LLM.",
   "type": "object",
   "properties": {
      "callback_manager": {
         "title": "Callback Manager"
      "class_name": {
         "title": "Class Name",
         "type": "string",
         "default": "LangChainLLM"

  • arbitrary_types_allowed: bool = True


  • _validate_callback_manager » callback_manager

async achat(messages: Sequence[ChatMessage], **kwargs: Any) Any

Async chat endpoint for LLM.

async acomplete(*args: Any, **kwargs: Any) Any

Async completion endpoint for LLM.

async astream_chat(messages: Sequence[ChatMessage], **kwargs: Any) Any

Async streaming chat endpoint for LLM.

async astream_complete(*args: Any, **kwargs: Any) Any

Async streaming completion endpoint for LLM.

chat(messages: Sequence[ChatMessage], **kwargs: Any) Any

Chat endpoint for LLM.

classmethod class_name() str

Get the class name, used as a unique ID in serialization.

This provides a key that makes serialization robust against actual class name changes.

complete(*args: Any, **kwargs: Any) Any

Completion endpoint for LLM.

stream_chat(messages: Sequence[ChatMessage], **kwargs: Any) Any

Streaming chat endpoint for LLM.

stream_complete(*args: Any, **kwargs: Any) Any

Streaming completion endpoint for LLM.

property llm: BaseLanguageModel
property metadata: LLMMetadata

LLM metadata.