= self.prompt.format_prompt(**inputs)        # Whenever you call a language model, or another chain, you should pass        # a callback manager to it. This allows the inner run to be tracked by        # any callbacks that are registered on the outer run.        # You can always obtain a callback manager for this by calling        # `run_manager.get_child()` as shown below.        response = self.llm.generate_prompt(            [prompt_value], callbacks=run_manager.get_child() if run_manager else None        )        # If you want to log something about this run, you can do so by calling        # methods on the `run_manager`, as shown below. This will trigger any        # callbacks that are registered for that event.        if run_manager:            run_manager.on_text("Log something about this run")        return {self.output_key: response.generations[0][0].text}    async def _acall(        self,        inputs: Dict[str, Any],        run_manager: Optional[AsyncCallbackManagerForChainRun] = None,    ) -> Dict[str, str]:        # Your custom chain logic goes here        # This is just an example that mimics LLMChain        prompt_value = self.prompt.format_prompt(**inputs)        # Whenever you call a language model, or another chain, you should pass        # a callback manager to it. This allows the inner run to be tracked by        # any callbacks that are registered on the outer run.        # You can always obtain a callback manager for this by calling        # `run_manager.get_child()` as shown below.        response = await self.llm.agenerate_prompt(            [prompt_value], callbacks=run_manager.get_child() if run_manager else None        )        # If you want to log something about this run, you can do so by calling        # methods on the `run_manager`, as shown below. This will trigger any        # callbacks that are registered for that event.        if run_manager:            await run_manager.on_text("Log something about this run")        return
To implement your own custom chain you can subclass Chain and implement the following methods:
To implement your own custom chain you can subclass Chain and implement the following methods: ->: = self.prompt.format_prompt(**inputs)        # Whenever you call a language model, or another chain, you should pass        # a callback manager to it. This allows the inner run to be tracked by        # any callbacks that are registered on the outer run.        # You can always obtain a callback manager for this by calling        # `run_manager.get_child()` as shown below.        response = self.llm.generate_prompt(            [prompt_value], callbacks=run_manager.get_child() if run_manager else None        )        # If you want to log something about this run, you can do so by calling        # methods on the `run_manager`, as shown below. This will trigger any        # callbacks that are registered for that event.        if run_manager:            run_manager.on_text("Log something about this run")        return {self.output_key: response.generations[0][0].text}    async def _acall(        self,        inputs: Dict[str, Any],        run_manager: Optional[AsyncCallbackManagerForChainRun] = None,    ) -> Dict[str, str]:        # Your custom chain logic goes here        # This is just an example that mimics LLMChain        prompt_value = self.prompt.format_prompt(**inputs)        # Whenever you call a language model, or another chain, you should pass        # a callback manager to it. This allows the inner run to be tracked by        # any callbacks that are registered on the outer run.        # You can always obtain a callback manager for this by calling        # `run_manager.get_child()` as shown below.        response = await self.llm.agenerate_prompt(            [prompt_value], callbacks=run_manager.get_child() if run_manager else None        )        # If you want to log something about this run, you can do so by calling        # methods on the `run_manager`, as shown below. This will trigger any        # callbacks that are registered for that event.        if run_manager:            await run_manager.on_text("Log something about this run")        return