Home / Function/ input_variables() — langchain Function Reference

input_variables() — langchain Function Reference

Architecture documentation for the input_variables() function in chat.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  9fc34a3e_6617_7bc4_7075_3dd0dbc27244["input_variables()"]
  c5f45b6e_9126_7fa3_ba5a_e6a86d45b6d5["MessagesPlaceholder"]
  9fc34a3e_6617_7bc4_7075_3dd0dbc27244 -->|defined in| c5f45b6e_9126_7fa3_ba5a_e6a86d45b6d5
  45230c2b_7a6d_5f8e_c2d6_80b39a0d02c4["input_variables()"]
  9fc34a3e_6617_7bc4_7075_3dd0dbc27244 -->|calls| 45230c2b_7a6d_5f8e_c2d6_80b39a0d02c4
  style 9fc34a3e_6617_7bc4_7075_3dd0dbc27244 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/prompts/chat.py lines 192–198

    def input_variables(self) -> list[str]:
        """Input variables for this prompt template.

        Returns:
            List of input variable names.
        """
        return [self.variable_name] if not self.optional else []

Subdomains

Frequently Asked Questions

What does input_variables() do?
input_variables() is a function in the langchain codebase, defined in libs/core/langchain_core/prompts/chat.py.
Where is input_variables() defined?
input_variables() is defined in libs/core/langchain_core/prompts/chat.py at line 192.
What does input_variables() call?
input_variables() calls 1 function(s): input_variables.

Analyze Your Own Codebase

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

Try Supermodel Free