LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
LangChain
  • Universal
  • Hub
  • Node
  • Load
  • Serializable
  • Encoder Backed
  • File System
  • In Memory
LangChain Core
  • Agents
  • Caches
  • Base
  • Dispatch
  • Web
  • Manager
  • Promises
  • Chat History
  • Context
  • Base
  • Langsmith
  • Documents
  • Embeddings
  • Errors
  • Example Selectors
  • Indexing
  • Base
  • Chat Models
  • Llms
  • Profile
  • Load
  • Serializable
  • Memory
  • Messages
  • Tool
  • Output Parsers
  • Openai Functions
  • Openai Tools
  • Outputs
  • Prompt Values
  • Prompts
  • Retrievers
  • Document Compressors
  • Runnables
  • Graph
  • Singletons
  • Stores
  • Structured Query
  • Tools
  • Base
  • Console
  • Log Stream
  • Run Collector
  • Tracer Langchain
  • Stream
  • Async Caller
  • Chunk Array
  • Context
  • Env
  • Event Source Parse
  • Format
  • Function Calling
  • Hash
  • Json Patch
  • Json Schema
  • Math
  • Ssrf
  • Stream
  • Testing
  • Tiktoken
  • Types
  • Vectorstores
Text Splitters
MCP Adapters
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

LangChain
UniversalHubNodeLoadSerializableEncoder BackedFile SystemIn Memory
LangChain Core
AgentsCachesBaseDispatchWebManagerPromisesChat HistoryContextBaseLangsmithDocumentsEmbeddingsErrorsExample SelectorsIndexingBaseChat ModelsLlmsProfileLoadSerializableMemoryMessagesToolOutput ParsersOpenai FunctionsOpenai ToolsOutputsPrompt ValuesPromptsRetrieversDocument CompressorsRunnablesGraphSingletonsStoresStructured QueryToolsBaseConsoleLog StreamRun CollectorTracer LangchainStreamAsync CallerChunk ArrayContextEnvEvent Source ParseFormatFunction CallingHashJson PatchJson SchemaMathSsrfStreamTestingTiktokenTypesVectorstores
Text Splitters
MCP Adapters
Language
Theme
JavaScript@langchain/corelanguage_modelsbaseBaseLanguageModelInterface
Interface●Since v1.0

BaseLanguageModelInterface

Base interface implemented by all runnables. Used for cross-compatibility between different versions of LangChain core.

Should not change on patch releases.

Copy
interface BaseLanguageModelInterface

Bases

RunnableInterface<BaseLanguageModelInput, RunOutput, CallOptions>

Properties

property
lc_serializable: boolean
property
callKeys: string[]
property
lc_id: string[]

Methods

method
_identifyingParams→ Record<string, any>

Get the identifying parameters of the LLM.

method
_llmType→ string
method
_modelType→ string
method
batch→ Promise<RunOutput[]>

Default implementation of batch, which calls invoke N times. Subclasses should override this method if they can batch more efficiently.

method
generatePrompt→ Promise<LLMResult>
method
getName→ string
method
getNumTokens→ Promise<number>

Get the number of tokens in the content.

method
invoke→ Promise<RunOutput>

Method to invoke the document transformation. This method calls the transformDocuments method with the provided input.

method
stream→ Promise<IterableReadableStream<RunOutput>>

Stream output in chunks.

method
transform→ AsyncGenerator<RunOutput>

Default implementation of transform, which buffers input and then calls stream. Subclasses should override this method if they can start producing output while input is still being generated.

deprecatedmethod
serialize→ SerializedLLM

Inherited fromRunnableInterface

Properties

Plc_serializable: booleanPlc_id: string[]

Methods

Mbatch→ Promise<RunOutput[]>
—

Default implementation of batch, which calls invoke N times.

MgetName→ stringMinvoke→ Promise<RunOutput>
—

Method to invoke the document transformation. This method calls the

Mstream→ Promise<IterableReadableStream<RunOutput>>
—

Stream output in chunks.

Mtransform→ AsyncGenerator<RunOutput>
—

Default implementation of transform, which buffers input and then calls stream.

Inherited fromSerializableInterface

Properties

Plc_id: string[]
View source on GitHub