return values
    class Config:
        """Configuration for this pydantic object."""
        arbitrary_types_allowed = True
    # --- Runnable methods ---
    @property
    def OutputType(self) -> Any:
        """Get the input type for this runnable."""
        return Union[
            HumanMessageChunk,
            AIMessageChunk,
            ChatMessageChunk,
            FunctionMessageChunk,
            SystemMessageChunk,
        ]
    def _convert_input(self, input: LanguageModelInput) -> PromptValue:
        if isinstance(input, PromptValue):
            return input
        elif isinstance(input, str):
            return StringPromptValue(text=input)
        elif isinstance(input, list):
            return ChatPromptValue(messages=input)
        else:
            raise ValueError(
                f"Invalid input type {type(input)}. "
                "Must be a PromptValue, str, or list of BaseMessages."
            )
[docs]    def invoke(
        self,
        input: LanguageModelInput,
        config: Optional[RunnableConfig] = None,
        *,
        stop: Optional[List[str]] = None,
        **kwargs: Any,
    ) -> BaseMessageChunk:
        config = config or {}
        return cast(
            BaseMessageChunk,
            cast(
                ChatGeneration,
                self.generate_prompt(
                    [self._convert_input(input)],
                    stop=stop,
                    callbacks=config.get("callbacks"),
                    tags=config.get("tags"),
                    metadata=config.get("metadata"),
                    run_name=config.get("run_name"),
                    **kwargs,
                ).generations[0][0],
            ).message,
        )
[docs]    async def ainvoke(
        self,
        input: LanguageModelInput,