Home / Function/ _acall() — langchain Function Reference

_acall() — langchain Function Reference

Architecture documentation for the _acall() function in moderation.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  bca6ad32_d33f_9e17_5e1c_056f97df298e["_acall()"]
  681be7b2_2ef1_3fa3_8051_488d0318bbe1["OpenAIModerationChain"]
  bca6ad32_d33f_9e17_5e1c_056f97df298e -->|defined in| 681be7b2_2ef1_3fa3_8051_488d0318bbe1
  8f806073_b5ea_22ed_c6ce_442f9541f9ea["_moderate()"]
  bca6ad32_d33f_9e17_5e1c_056f97df298e -->|calls| 8f806073_b5ea_22ed_c6ce_442f9541f9ea
  style bca6ad32_d33f_9e17_5e1c_056f97df298e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/langchain_classic/chains/moderation.py lines 119–129

    async def _acall(
        self,
        inputs: dict[str, Any],
        run_manager: AsyncCallbackManagerForChainRun | None = None,
    ) -> dict[str, Any]:
        if self.openai_pre_1_0:
            return await super()._acall(inputs, run_manager=run_manager)
        text = inputs[self.input_key]
        results = await self.async_client.moderations.create(input=text)
        output = self._moderate(text, results.results[0])
        return {self.output_key: output}

Subdomains

Calls

Frequently Asked Questions

What does _acall() do?
_acall() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/chains/moderation.py.
Where is _acall() defined?
_acall() is defined in libs/langchain/langchain_classic/chains/moderation.py at line 119.
What does _acall() call?
_acall() calls 1 function(s): _moderate.

Analyze Your Own Codebase

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

Try Supermodel Free