Home / Function/ _call() — langchain Function Reference

_call() — langchain Function Reference

Architecture documentation for the _call() function in base.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  62e4d560_1563_c959_ce77_10d90ce81c1f["_call()"]
  2ce04a9b_5637_00e2_15a2_00f9ad51f684["QAGenerationChain"]
  62e4d560_1563_c959_ce77_10d90ce81c1f -->|defined in| 2ce04a9b_5637_00e2_15a2_00f9ad51f684
  style 62e4d560_1563_c959_ce77_10d90ce81c1f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/langchain_classic/chains/qa_generation/base.py lines 116–127

    def _call(
        self,
        inputs: dict[str, Any],
        run_manager: CallbackManagerForChainRun | None = None,
    ) -> dict[str, list]:
        docs = self.text_splitter.create_documents([inputs[self.input_key]])
        results = self.llm_chain.generate(
            [{"text": d.page_content} for d in docs],
            run_manager=run_manager,
        )
        qa = [json.loads(res[0].text) for res in results.generations]
        return {self.output_key: qa}

Subdomains

Frequently Asked Questions

What does _call() do?
_call() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/chains/qa_generation/base.py.
Where is _call() defined?
_call() is defined in libs/langchain/langchain_classic/chains/qa_generation/base.py at line 116.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free