LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
    • Overview
    • Caches
    • Callbacks
    • Documents
    • Document loaders
    • Embeddings
    • Exceptions
    • Language models
    • Serialization
    • Output parsers
    • Prompts
    • Rate limiters
    • Retrievers
    • Runnables
    • Utilities
    • Vector stores
    MCP Adapters
    Standard Tests
    Text Splitters
    ⌘I

    LangChain Assistant

    Ask a question to get started

    Enter to send•Shift+Enter new line

    Menu

    OverviewCachesCallbacksDocumentsDocument loadersEmbeddingsExceptionsLanguage modelsSerializationOutput parsersPromptsRate limitersRetrieversRunnablesUtilitiesVector stores
    MCP Adapters
    Standard Tests
    Text Splitters
    Language
    Theme
    Pythonlangchain-corelanguage_modelsfake_chat_modelsParrotFakeChatModel
    Class●Since v0.1

    ParrotFakeChatModel

    Copy
    ParrotFakeChatModel(
        self,
        *args: Any = (),
        **kwargs: Any = {},
    )

    Bases

    BaseChatModel

    Inherited fromBaseChatModel

    Attributes

    Arate_limiter: BaseRateLimiter | None
    —

    An optional rate limiter to use for limiting the number of requests.

    Adisable_streaming: bool | Literal['tool_calling']
    —

    Whether to disable streaming for this model.

    Aoutput_version: str | None
    —

    Version of AIMessage output format to store in message content.

    View source on GitHub
    Aprofile: ModelProfile | None
    —

    Profile detailing model capabilities.

    Amodel_config
    AOutputType: Any
    —

    Get the output type for this Runnable.

    Methods

    MinvokeMainvokeMstreamMastreamMstream_events
    —

    Stream events from this chat model.

    Mastream_events
    —

    Async variant of stream_events. See stream_events for full docs.

    Mgenerate
    —

    Pass a sequence of prompts to the model and return model generations.

    Magenerate
    —

    Asynchronously pass a sequence of prompts to a model and return generations.

    Mgenerate_promptMagenerate_promptMdict
    —

    DEPRECATED - use asdict() instead.

    Masdict
    —

    Return a dictionary representation of the chat model.

    Mbind
    —

    Bind kwargs to this chat model, returning a typed _ChatModelBinding.

    Mbind_tools
    —

    Bind tools to the model.

    Mwith_structured_output
    —

    Model wrapper that returns outputs formatted to match the given schema.

    Inherited fromBaseLanguageModel

    Attributes

    Acache: BaseCache | bool | None
    —

    Whether to cache the response.

    Averbose: bool
    —

    Whether to print out response text.

    Acallbacks: Callbacks
    —

    Callbacks to add to the run trace.

    Atags: list[str] | None
    —

    Tags to add to the run trace.

    Ametadata: builtins.dict[str, Any] | None
    —

    Metadata to add to the run trace.

    Acustom_get_token_ids: Callable[[str], list[int]] | None
    —

    Optional encoder to use for counting tokens.

    Amodel_configAInputType: TypeAlias
    —

    Get the input type for this Runnable.

    Methods

    Mmodel_post_init
    —

    Pydantic V2 lifecycle hook called automatically after __init__.

    Mset_verbose
    —

    If verbose is None, set it.

    Mgenerate_prompt
    —

    Pass a sequence of prompts to the model and return model generations.

    Magenerate_prompt
    —

    Asynchronously pass a sequence of prompts and return model generations.

    Generic fake chat model that can be used to test the chat model interface.

    • Chat model should be usable in both sync and async tests
    M
    with_structured_output
    —

    Not implemented on this class.

    Mget_token_ids
    —

    Return the ordered IDs of the tokens in a text.

    Mget_num_tokens
    —

    Get the number of tokens present in the text.

    Mget_num_tokens_from_messages
    —

    Get the number of tokens in the messages.