CustomLLM cannot be used to build `Chains` when using `LLM` or `Runnable` 
Labels: name: auto:bug, name: area: models

### Checked other resources

- [X] I added a very descriptive title to this issue.
- [X] I searched the LangChain documentation with the integrated search.
- [X] I used the GitHub search to find a similar question and didn't find it.

### Example Code

- With `LLM`:

```py
import os
from typing import Any, List

import requests
from langchain.callbacks.base import Callbacks
from langchain.chains import LLMChain
from langchain.chains.base import Chain
from langchain.prompts import PromptTemplate
from langchain_core.callbacks.manager import CallbackManagerForLLMRun
from langchain_core.language_models.llms import LLM

required_envs = ["API_BASE", "API_KEY", "DEPLOYMENT_NAME"]
for env in required_envs:
    if env not in os.environ:
        raise ValueError(f"Missing required environment variable: {env}")


class CustomLLM(LLM):
    @property
    def _llm_type(self) -> str:
        return "CustomLLM"

    def _call(
        self,
        prompt: str,
        stop: List[str] | None = None,
        run_manager: CallbackManagerForLLMRun | None = None,
        **kwargs: Any
    ) -> str:
        """Call the API with the given prompt and return the result."""
        self._api_endpoint: str = str(os.getenv("API_BASE"))
        self._api_key: str = str(os.getenv("API_KEY"))
        self._deployment_name: str = str(os.getenv("DEPLOYMENT_NAME"))

        result = requests.post(
            f"{self._api_endpoint}/llm/deployments/{self._deployment_name}/chat/completions?api-version=2023-05-15",
            headers={
                "Content-Type": "application/json",
                "api-key": self._api_key,
            },
            json={
                "messages": prompt,
                "temperature": 0,
                "top_p": 0,
                "model": "gpt-4-32k",
            },
        )

        if result.status_code != 200:
            raise RuntimeError(
                f"Failed to call API: {result.status_code} {result.content}"
            )
        else:
            return result.json()["choices"][0]["message"]


def get_chain(prompt: PromptTemplate, callbacks: Callbacks = []) -> Chain:
    """
    This function initializes and returns an LLMChain with a given prompt and callbacks.

    Args:
        prompt (str): The prompt to initialize the LLMChain with.
        callbacks (Callbacks): Langchain callbacks fo

    Returns:
        Chain: An instance of LLMChain.
    """
    llm = CustomLLM()
    chain = LLMChain(llm=llm, prompt=prompt, callbacks=callbacks)
    return chain


if __name__ == "__main__":
    prompt_template = """
    You are an insurance agent. You are provided with instructions, and you must provide an answer.
    Question: {question}
    """
    prompt = PromptTemplate(
        template=prompt_template,
        input_variables=["question"],
    )
    chain = get_chain(prompt)

    result = chain.invoke({"question": "What is the best insurance policy for me?"})
    print(result)
``` 
- With `Runnable`:

```py
import os
from typing import Any, List

import requests
from langchain.callbacks.base import Callbacks
from langchain.chains import LLMChain
from langchain.chains.base import Chain
from langchain.prompts import PromptTemplate
from langchain_core.callbacks.manager import CallbackManagerForLLMRun
from langchain.schema.runnable import Runnable
from langchain.schema.language_model import LanguageModelInput


required_envs = ["API_BASE", "API_KEY", "DEPLOYMENT_NAME"]
for env in required_envs:
    if env not in os.environ:
        raise ValueError(f"Missing required environment variable: {env}")


class CustomLLM(LLM):
    @property
    def _llm_type(self) -> str:
        return "CustomLLM"

    def invoke(
        self, input: LanguageModelInput, config: RunnableConfig | None = None
    ) -> str:
        return super().invoke(input)

    def _call(
        self,
        prompt: str,
        run_manager: Optional[CallbackManagerForLLMRun] = None,
    ) -> str:
        """Call the API with the given prompt and return the result."""
        self._api_endpoint: str = str(os.getenv("OPENAI_API_BASE"))
        self._api_key: str = str(os.getenv("OPENAI_API_BASE"))
        self._deployment_name: str = str(os.getenv("DEPLOYMENT_NAME"))

        result = requests.post(
            f"{self._api_endpoint}/llm/deployments/{self._deployment_name}/chat/completions?api-version=2023-05-15",
            headers={
                "Content-Type": "application/json",
                "api-key": self._api_key,
            },
            json={
                "messages": prompt,
                "temperature": 0,
                "top_p": 0,
                "model": "gpt-4-32k",
            },
        )

        if result.status_code != 200:
            raise RuntimeError(
                f"Failed to call API: {result.status_code} {result.content}"
            )
        else:
            return result.json()["choices"][0]["message"]


def get_chain(prompt: PromptTemplate, callbacks: Callbacks = []) -> Chain:
    """
    This function initializes and returns an LLMChain with a given prompt and callbacks.

    Args:
        prompt (str): The prompt to initialize the LLMChain with.
        callbacks (Callbacks): Langchain callbacks fo

    Returns:
        Chain: An instance of LLMChain.
    """
    llm = CustomLLM()
    chain = LLMChain(llm=llm, prompt=prompt, callbacks=callbacks)
    return chain


if __name__ == "__main__":
    prompt_template = """
    You are an insurance agent. You are provided with instructions, and you must provide an answer.
    Question: {question}
    """
    prompt = PromptTemplate(
        template=prompt_template,
        input_variables=["question"],
    )
    chain = get_chain(prompt)

    result = chain.invoke({"question": "What is the best insurance policy for me?"})
    print(result)
```

### Description

Hi!
I'm not exactly whether this is a bug, or an expected behavior.

I'm in a situation where I cannot use the LLM directly, and instead need to use APIs that interact with the LLM itself.
I've hence decided to create a CustomLLM using the documentation [here](https://python.langchain.com/docs/modules/model_io/llms/custom_llm) to keep leveraging `Chain` features. 
Here are the problems I've been facing:
- When using the `LLM` class as the Base class of my `CustomLLM` class, I run into the following error:

```
Traceback (most recent call last):
  File "custom_llm.py", line 83, in <module>
    chain = get_chain(prompt)
            ^^^^^^^^^^^^^^^^^
  File "custom_llm.py", line 70, in get_chain
    chain = LLMChain(llm=llm, prompt=prompt, callbacks=callbacks)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".venv/lib/python3.11/site-packages/langchain/load/serializable.py", line 97, in __init__
    super().__init__(**kwargs)
  File ".venv/lib/python3.11/site-packages/pydantic/v1/main.py", line 341, in __init__
    raise validation_error
pydantic.v1.error_wrappers.ValidationError: 2 validation errors for LLMChain
llm
  instance of Runnable expected (type=type_error.arbitrary_type; expected_arbitrary_type=Runnable)
llm
  instance of Runnable expected (type=type_error.arbitrary_type; expected_arbitrary_type=Runnable)
```

- Following this error, I've decided to modify the class, so it extends from `Runnable` (cf second code snippet in the example)  but when running the new code I get this:

```
Traceback (most recent call last):
  File "utils/custom_llm.py", line 90, in <module>
    result = chain.invoke({"question": "What is the best insurance policy for me?"})
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".venv/lib/python3.11/site-packages/langchain/chains/base.py", line 87, in invoke
    return self(
           ^^^^^
  File ".venv/lib/python3.11/site-packages/langchain/chains/base.py", line 310, in __call__
    raise e
  File ".venv/lib/python3.11/site-packages/langchain/chains/base.py", line 304, in __call__
    self._call(inputs, run_manager=run_manager)
  File ".venv/lib/python3.11/site-packages/langchain/chains/llm.py", line 108, in _call
    response = self.generate([inputs], run_manager=run_manager)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".venv/lib/python3.11/site-packages/langchain/chains/llm.py", line 127, in generate
    results = self.llm.bind(stop=stop, **self.llm_kwargs).batch(
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".venv/lib/python3.11/site-packages/langchain/schema/runnable/base.py", line 2658, in batch
    return self.bound.batch(
           ^^^^^^^^^^^^^^^^^
  File ".venv/lib/python3.11/site-packages/langchain/schema/runnable/base.py", line 321, in batch
    return cast(List[Output], [invoke(inputs[0], configs[0])])
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".venv/lib/python3.11/site-packages/langchain/schema/runnable/base.py", line 317, in invoke
    return self.invoke(input, config, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: CustomLLM.invoke() got an unexpected keyword argument 'stop'
``` 

### System Info

langchain==0.0.329
langchain-core==0.1.9

Platform: MacOS 13.6.2
Python:  3.11

### Related Components

- [X] LLMs/Chat Models
- [ ] Embedding Models
- [X] Prompts / Prompt Templates / Prompt Selectors
- [ ] Output Parsers
- [ ] Document Loaders
- [ ] Vector Stores / Retrievers
- [ ] Memory
- [ ] Agents / Agent Executors
- [ ] Tools / Toolkits
- [X] Chains
- [ ] Callbacks/Tracing
- [ ] Async