[
  {
    "path": ".gitignore",
    "content": "# ===== Python =====\n\n# Python\n__pycache__/\n*.py[cod]\n*$py.class\n*.so\n.Python\nbuild/\ndevelop-eggs/\ndist/\ndownloads/\neggs/\n.eggs/\nlib/\nlib64/\nparts/\nsdist/\nvar/\nwheels/\n*.egg-info/\n.installed.cfg\n*.egg\n\n# Virtual Environment\nvenv/\nenv/\nENV/\n.env\n.venv/\n\n# IDEs and Editors\n.idea/\n.vscode/\n*.swp\n*.swo\n*~\n\n# OS generated files\n.DS_Store\n.DS_Store?\n._*\n.Spotlight-V100\n.Trashes\nehthumbs.db\nThumbs.db\n\n# Logs and databases\n*.log\n*.sqlite\n*.db\n\n# Coverage and testing\n.coverage\nhtmlcov/\n.tox/\n.pytest_cache/\ncoverage.xml\n*.cover\n\n# Documentation\ndocs/_build/\n\n\n# ===== JavaScript =====\n\n# Node modules\nnode_modules/\n\n# Optional npm cache\n.npm\n\n# Optional eslint cache\n.eslintcache\n\n# Optional REPL history\n.node_repl_history\n\n# Output of 'npm pack'\n*.tgz\n\n# Yarn\n.yarn/\n.yarn-integrity\n\n# dotenv environment variables\n.env\n.env.test\n.env.production\n\n# Build output\ndist/\nbuild/\n\n# Logs\nlogs/\n\n# VS Code\n.vscode/\n\n# IntelliJ/WebStorm\n.idea/\n\n# Jest coverage\ncoverage/\n"
  },
  {
    "path": "README.md",
    "content": "# Learning LangChain Code Examples\n\nThis repository contains code examples (in python and javascript) from each chapter of the book [\"Learning LangChain: Building AI and LLM Applications with LangChain and LangGraph\"](https://www.oreilly.com/library/view/learning-langchain/9781098167271/) published by O'Reilly Media.\n\nTo run the examples, you can clone the repository and run the examples in your preferred language folders.\n\n## Table of Contents\n\n- [Quick Start](#quick-start)\n  - [Environment variables setup](#environment-variables-setup)\n  - [Running the chapter examples](#running-the-chapter-examples)\n- [Repository Structure](#repository-structure)\n- [Chapter-wise Examples](#chapter-wise-examples)\n- [Docker Setup and Usage](#docker-setup-and-usage)\n    - [Installing Docker](#installing-docker)\n    - [Running the PostgreSQL Container](#running-the-postgresql-container)\n    - [Troubleshooting Docker](#troubleshooting-docker)\n- [Setting up Chinook.db with SQLite](#setting-up-chinookdb-with-sqlite)\n- [General Troubleshooting](#general-troubleshooting)\n\n## Quick Start\n\n### Environment variables setup\n\nFirst, we need the environment variables required to run the examples in this repository.\n\nYou can find the full list in the `.env.example` file. Copy this file to a `.env` and fill in the values:\n\n```bash\ncp .env.example .env\n```\n\n- **OPENAI_API_KEY**: You can get your key [here](https://platform.openai.com/account/api-keys). This will enable you to run the examples that require an OpenAI model.\n\n- **LANGCHAIN_API_KEY**: You can get your key by creating an account [here](https://smith.langchain.com/). This will enable you to interact with the LangSmith tracing and debugging tools.\n\n- **LANGCHAIN_TRACING_V2=true**: This is required to enable visual tracing and debugging in LangSmith for the examples.\n\nIf you want to run the production example in chapter 9, you need a Supabase account and a Supabase API key:\n\n1. To register for a Supabase account, go to [supabase.com](https://supabase.com) and sign up.\n2. Once you have an account, create a new project then navigate to the settings section.\n3. In the settings section, navigate to the API section to see your keys.\n4. Copy the project URL and service_role key and add them to the `.env` file as values for `SUPABASE_URL` and `SUPABASE_SERVICE_ROLE_KEY`.\n\n### Running the chapter examples\n\n#### For Python examples:\n\nIf you haven't installed Python on your system, install it first as per the instructions [here](https://www.python.org/downloads/).\n\n1. Create a virtual environment:\n```bash\npython -m venv .venv\n```\n\n2. Activate the virtual environment:\n\nFor MacOS/Linux:\n```bash\nsource .venv/bin/activate\n```\n\nFor Windows:\n```bash\n.venv\\Scripts\\activate\n```\n\nAfter activation, your terminal prompt should prefix with (venv), indicating that the virtual environment is active.\n\n3. Install the dependencies in the pyproject.toml file:\n```bash\npip install -e .\n```\n\n4. Verify the installation:\n```bash\npip list\n```\n\n5. Run an example to see the output:\n```bash\npython ch2/py/a-text-loader.py\n```\n\n#### For JavaScript examples:\n\nIf you haven't installed Node.js on your system, install it first as per the instructions [here](https://nodejs.org/).\n\n1. Install the dependencies in the package.json file:\n```bash\nnpm install\n```\n\n2. Run the example to see the output:\n```bash\nnode ch2/js/a-text-loader.js\n```\n\n## Repository Structure\n\nThe repository is structured as follows:\n\n```\n├── .env.example          # Example environment variables\n├── learning-langchain    # Root directory\n│   ├── ch1               # Chapter 1 examples\n│   │   ├── js            # JavaScript examples\n│   │   │   ├── a-llm.js  # Example file\n│   │   │   └── ...\n│   │   └── py            # Python examples\n│   │       ├── a-llm.py  # Example file\n│   │       └── ...\n│   ├── ch2               # Chapter 2 examples\n│   │   ├── js            # JavaScript examples\n│   │   │   └── ...\n│   │   └── py            # Python examples\n│   │       └── ...\n│   ├── ...               # Remaining chapters\n│   ├── test.pdf          # Test PDF file\n│   ├── test.txt          # Test text file\n│   ├── package.json      # JavaScript dependencies\n│   ├── pyproject.toml    # Python dependencies\n│   └── README.md         # This file\n└── ...\n```\n\nEach chapter (ch1, ch2, etc.) contains subdirectories `js` and `py` for JavaScript and Python examples, respectively.\n\n## Chapter-wise Examples\n\nHere's a brief overview of the code examples available for each chapter:\n\n### Chapter 1: Introduction to LangChain\n\nDemonstrates basic usage of LLMs, Chat models, prompts, and output parsers.\n\nFiles:\n- `ch1/js/*.js`: JavaScript examples\n- `ch1/py/*.py`: Python examples\n\n### Chapter 2: Document Loading and Data Transformation\n\nCovers loading data from various sources (text files, web pages, PDFs), splitting text into chunks, and creating embeddings.\n\nFiles:\n- `ch2/js/*.js`: JavaScript examples\n- `ch2/py/*.py`: Python examples\n\n### Chapter 3: Retrieval\n\nExplores different retrieval strategies, including basic RAG, query rewriting, multi-query, RAG fusion, and self-query.\n\nFiles:\n- `ch3/js/*.js`: JavaScript examples\n- `ch3/py/*.py`: Python examples\n\n### Chapter 4: Memory\n\nDemonstrates how to add memory to your chains and agents, including simple memory, state graphs, persistent memory, and message trimming/filtering/merging.\n\nFiles:\n- `ch4/js/*.js`: JavaScript examples\n- `ch4/py/*.py`: Python examples\n\n### Chapter 5: Chatbots\n\nShows how to build chatbots using LangGraph, including basic chatbots, SQL generators, and multi-RAG chatbots.\n\nFiles:\n- `ch5/js/*.js`: JavaScript examples\n- `ch5/py/*.py`: Python examples\n\n### Chapter 6: Agents\n\nCovers building agents with tools, including basic agents, forcing the first tool, and using many tools.\n\nFiles:\n- `ch6/js/*.js`: JavaScript examples\n- `ch6/py/*.py`: Python examples\n\n### Chapter 7: Subgraphs\n\nExplores how to use subgraphs to create more complex agents, including reflection, direct subgraphs, function subgraphs, and supervisors.\n\nFiles:\n- `ch7/js/*.js`: JavaScript examples\n- `ch7/py/*.py`: Python examples\n\n### Chapter 8: Productionizing LangGraph\n\nDemonstrates how to productionize LangGraph applications, including structured output, streaming output, interruption, authorization, resuming, editing state, and forking.\n\nFiles:\n- `ch8/js/*.js`: JavaScript examples\n- `ch8/py/*.py`: Python examples\n\n### Chapter 9: Deployment\n\nProvides examples of deploying LangGraph applications.\n\nFiles:\n- `ch9/js/*`: JavaScript examples\n- `ch9/py/*`: Python examples\n\n#### Running the Local Development Server\n\nYou can run the local development server for either JavaScript or Python implementations from the root directory:\n\n##### For JavaScript:\n```bash\n# Using npm script\nnpm run langgraph:dev\n```\n\n##### For Python:\nYou have two options:\n\n1. Using the CLI directly:\n```bash\nlanggraph dev -c ch9/py/langgraph.json --verbose\n```\n\n2. Using the installed script command:\n```bash\nlanggraph-dev\n```\n\nNote: To use the script command, make sure you have installed the package in development mode (`pip install -e .`).\n\n### Chapter 10: Evaluation\n\nShows how to evaluate LangChain applications, including agent evaluation for RAG and SQL, and creating datasets.\n\nFiles:\n- `ch10/js/*.js`: JavaScript examples\n- `ch10/py/*.py`: Python examples\n\n## Docker Setup and Usage\n\nSeveral examples in this repository require Docker to be installed and running to set up a PostgreSQL database with the pgvector extension. This section provides guidance on setting up Docker and running the PostgreSQL container.\n\n\n### Installing Docker\n1. Download Docker Desktop:\n\nGo to the Docker [website](https://www.docker.com/get-started/) and download the appropriate version for your operating system (Windows, macOS, or Linux).\n\n2. Install Docker Desktop:\n\n- Windows: Double-click the downloaded installer and follow the on-screen instructions. You may need to enable virtualization in your BIOS settings.\n\n- macOS: Drag the Docker icon to the Applications folder and double-click to start.\n\n- Linux: Follow the instructions provided on the Docker website for your specific distribution.\n\n3. Start Docker Desktop:\n\nAfter installation, start Docker Desktop. On Windows and macOS, it will run in the system tray. On Linux, you may need to start it manually.\n\n4. Verify the installation:\n\nTo check if Docker is installed, run:\n```bash\ndocker --version\n```\n\n\n### Running the PostgreSQL Container\n\nRun the Docker command:\n\nOpen a terminal or command prompt and run the following command to start the PostgreSQL container with the pgvector extension:\n\n```bash\ndocker run \\\n    --name pgvector-container \\\n    -e POSTGRES_USER=langchain \\\n    -e POSTGRES_PASSWORD=langchain \\\n    -e POSTGRES_DB=langchain \\\n    -p 6024:5432 \\\n    -d pgvector/pgvector:pg16\n```\n\nExplanation of the command:\n\n- `docker run`: Starts a new container.\n- `--name pgvector-container`: Assigns the name \"pgvector-container\" to the container.\n- `-e POSTGRES_USER=langchain`: Sets the PostgreSQL user to \"langchain\".\n- `-e POSTGRES_PASSWORD=langchain`: Sets the PostgreSQL password to \"langchain\".\n- `-e POSTGRES_DB=langchain`: Sets the default database name to \"langchain\".\n- `-p 6024:5432`: Maps port 6024 on your host machine to port 5432 in the container (PostgreSQL's default port).\n- `-d pgvector/pgvector:pg16`: Specifies the image to use (pgvector/pgvector:pg16), which includes PostgreSQL 16 and the pgvector extension.\n\n#### Verify the Container is Running:\n\nRun the following command to list running containers:\n\n```bash\ndocker ps\n```\n\nYou should see the \"pgvector-container\" listed with a status of \"Up\".\n\n#### Accessing the PostgreSQL Database:\n\nYou can now access the PostgreSQL database from your code using the following connection string:\n\n```\npostgresql://langchain:langchain@localhost:6024/langchain\n```\n\n### Troubleshooting Docker\n\n#### Docker Desktop Not Starting:\n\n- **Windows**: Ensure that virtualization is enabled in your BIOS settings. Check the Docker Desktop logs for any specific error messages.\n- **macOS**: Make sure you have granted Docker Desktop the necessary permissions in System Preferences.\n- **Linux**: Ensure that the Docker daemon is running and that your user has the necessary permissions to run Docker commands.\n\n#### Container Not Running:\n\nCheck the container logs for any errors:\n\n```bash\ndocker logs pgvector-container\n```\n\nLook for error messages related to PostgreSQL startup or pgvector initialization.\n\n#### Port Conflict:\n\nIf port 6024 is already in use, you can change the port mapping in the docker run command to an available port. For example, `-p 6025:5432`.\n\n#### Image Not Found:\n\nEnsure that you have an internet connection and that the pgvector/pgvector:pg16 image is available on Docker Hub.\n\n#### Permissions Issues:\n\nOn Linux, you may encounter permissions issues when running Docker commands. Ensure that your user is part of the docker group:\n\n```bash\nsudo usermod -aG docker $USER\nnewgrp docker\n```\n\n#### General Docker Troubleshooting:\n\n- Restart Docker Desktop\n- Update Docker Desktop to the latest version\n- Check the Docker documentation for troubleshooting tips specific to your operating system\n\n### Setting up Chinook.db with SQLite\n\nSome examples in Chapter 3 and Chapter 10 use the Chinook database, a sample database for a digital media store, with SQLite. Here's how to set it up:\n\n#### Download the Chinook Database Schema:\n\nOpen a terminal or command prompt and use curl to download the Chinook databas:\n\n```bash\ncurl -s https://raw.githubusercontent.com/lerocha/chinook-database/master/ChinookDatabase/DataSources/Chinook_Sqlite.sql | sqlite3 Chinook.db\n```\n\nThis will create a file called `Chinook.db` in the current directory.\n\n#### Verify the Setup:\n\nYou can verify that the database is set up correctly by connecting to it using the sqlite3 tool and running a simple query:\n\n```bash\nsqlite3 Chinook.db\n```\n\nThen, inside the sqlite3 prompt, run:\n\n```sql\nSELECT * FROM Artist LIMIT 10;\n```\n\nIf the setup is successful, you should see the first 10 rows from the Artist table.\n\n#### Place Chinook.db in the Correct Directory:\n\nEnsure that the Chinook.db file is located in the same directory as the code examples that use it.\n\n## General Troubleshooting\n\n### Dependency Conflicts:\n\nIf you encounter errors related to conflicting dependencies, try creating a fresh virtual environment and reinstalling the dependencies.\n\nEnsure that your package.json or pyproject.toml files specify compatible versions of the libraries.\n\n### PgVector Vector Store Installation or Connection Errors:\n\n#### Errors for Python:\n\nIf you can't find `psycopg` or `psycopg_binary`: Try to reinstall psycopg with the `[binary]` extra, which includes pre-compiled binaries and necessary dependencies:\n\n```bash\npip install psycopg[binary]\n```\n\nThen run the file again.\n\nIf you're having issues connecting to Postgres via Docker, you can try some alternative vector stores:\n\n1. Use the memory vector store instead: This is a simple vector store that stores vectors in memory. It is not persistent and will be lost when the program is terminated. Here's the [API for Python](https://python.langchain.com/docs/modules/data_connection/vectorstores/integrations/memory) and [docs for Javascript](https://js.langchain.com/docs/modules/data_connection/vectorstores/integrations/memory).\n\n2. You can also use Chroma-- an AI-native open-source vector database. You can install Chroma as per the instructions for [Python](https://python.langchain.com/docs/integrations/vectorstores/chroma) or [Javascript](https://js.langchain.com/docs/modules/data_connection/vectorstores/integrations/chroma).\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
  },
  {
    "path": "ch1/js/a-llm.js",
    "content": "import { ChatOpenAI } from '@langchain/openai';\n\nconst model = new ChatOpenAI({ model: 'gpt-3.5-turbo' });\n\nconst response = await model.invoke('The sky is');\nconsole.log(response);\n"
  },
  {
    "path": "ch1/js/b-chat.js",
    "content": "import { ChatOpenAI } from '@langchain/openai';\nimport { HumanMessage } from '@langchain/core/messages';\n\nconst model = new ChatOpenAI();\nconst prompt = [new HumanMessage('What is the capital of France?')];\n\nconst response = await model.invoke(prompt);\nconsole.log(response);\n"
  },
  {
    "path": "ch1/js/c-system.js",
    "content": "import { ChatOpenAI } from '@langchain/openai';\nimport { HumanMessage, SystemMessage } from '@langchain/core/messages';\n\nconst model = new ChatOpenAI();\nconst prompt = [\n  new SystemMessage(\n    'You are a helpful assistant that responds to questions with three exclamation marks.'\n  ),\n  new HumanMessage('What is the capital of France?'),\n];\n\nconst response = await model.invoke(prompt);\nconsole.log(response);\n"
  },
  {
    "path": "ch1/js/d-prompt.js",
    "content": "import { PromptTemplate } from '@langchain/core/prompts';\n\nconst template =\n  PromptTemplate.fromTemplate(`Answer the question based on the context below. If the question cannot be answered using the information provided, answer with \"I don't know\".\n\nContext: {context}\n\nQuestion: {question}\n\nAnswer: `);\n\nconst response = await template.invoke({\n  context:\n    \"The most recent advancements in NLP are being driven by Large Language Models (LLMs). These models outperform their smaller counterparts and have become invaluable for developers who are creating applications with NLP capabilities. Developers can tap into these models through Hugging Face's `transformers` library, or by utilizing OpenAI and Cohere's offerings through the `openai` and `cohere` libraries, respectively.\",\n  question: 'Which model providers offer LLMs?',\n});\n\nconsole.log(response);\n"
  },
  {
    "path": "ch1/js/e-prompt-model.js",
    "content": "import { PromptTemplate } from '@langchain/core/prompts';\nimport { OpenAI } from '@langchain/openai';\n\nconst model = new OpenAI({\n  model: 'gpt-3.5-turbo',\n});\nconst template =\n  PromptTemplate.fromTemplate(`Answer the question based on the context below. If the question cannot be answered using the information provided, answer with \"I don't know\".\n\nContext: {context}\n\nQuestion: {question}\n\nAnswer: `);\n\nconst prompt = await template.invoke({\n  context:\n    \"The most recent advancements in NLP are being driven by Large Language Models (LLMs). These models outperform their smaller counterparts and have become invaluable for developers who are creating applications with NLP capabilities. Developers can tap into these models through Hugging Face's `transformers` library, or by utilizing OpenAI and Cohere's offerings through the `openai` and `cohere` libraries, respectively.\",\n  question: 'Which model providers offer LLMs?',\n});\n\nconst response = await model.invoke(prompt);\nconsole.log(response);\n"
  },
  {
    "path": "ch1/js/f-chat-prompt.js",
    "content": "import { ChatPromptTemplate } from '@langchain/core/prompts';\n\nconst template = ChatPromptTemplate.fromMessages([\n  [\n    'system',\n    'Answer the question based on the context below. If the question cannot be answered using the information provided, answer with \"I don\\'t know\".',\n  ],\n  ['human', 'Context: {context}'],\n  ['human', 'Question: {question}'],\n]);\n\nconst response = await template.invoke({\n  context:\n    \"The most recent advancements in NLP are being driven by Large Language Models (LLMs). These models outperform their smaller counterparts and have become invaluable for developers who are creating applications with NLP capabilities. Developers can tap into these models through Hugging Face's `transformers` library, or by utilizing OpenAI and Cohere's offerings through the `openai` and `cohere` libraries, respectively.\",\n  question: 'Which model providers offer LLMs?',\n});\nconsole.log(response);\n"
  },
  {
    "path": "ch1/js/g-chat-prompt-model.js",
    "content": "import { ChatPromptTemplate } from '@langchain/core/prompts';\nimport { ChatOpenAI } from '@langchain/openai';\n\nconst model = new ChatOpenAI();\nconst template = ChatPromptTemplate.fromMessages([\n  [\n    'system',\n    'Answer the question based on the context below. If the question cannot be answered using the information provided, answer with \"I don\\'t know\".',\n  ],\n  ['human', 'Context: {context}'],\n  ['human', 'Question: {question}'],\n]);\n\nconst prompt = await template.invoke({\n  context:\n    \"The most recent advancements in NLP are being driven by Large Language Models (LLMs). These models outperform their smaller counterparts and have become invaluable for developers who are creating applications with NLP capabilities. Developers can tap into these models through Hugging Face's `transformers` library, or by utilizing OpenAI and Cohere's offerings through the `openai` and `cohere` libraries, respectively.\",\n  question: 'Which model providers offer LLMs?',\n});\n\nconst response = await model.invoke(prompt);\nconsole.log(response);\n"
  },
  {
    "path": "ch1/js/h-structured.js",
    "content": "import { ChatOpenAI } from '@langchain/openai';\nimport { z } from 'zod';\n\nconst answerSchema = z\n  .object({\n    answer: z.string().describe(\"The answer to the user's question\"),\n    justification: z.string().describe('Justification for the answer'),\n  })\n  .describe(\n    \"An answer to the user's question along with justification for the answer.\"\n  );\n\nconst model = new ChatOpenAI({\n  model: 'gpt-3.5-turbo',\n  temperature: 0,\n}).withStructuredOutput(answerSchema);\n\nconst response = await model.invoke(\n  'What weighs more, a pound of bricks or a pound of feathers'\n);\nconsole.log(response);\n"
  },
  {
    "path": "ch1/js/i-csv.js",
    "content": "import { CommaSeparatedListOutputParser } from '@langchain/core/output_parsers';\n\nconst parser = new CommaSeparatedListOutputParser();\n\nconst response = await parser.invoke('apple, banana, cherry');\nconsole.log(response);\n"
  },
  {
    "path": "ch1/js/j-methods.js",
    "content": "import { ChatOpenAI } from '@langchain/openai';\n\nconst model = new ChatOpenAI();\n\nconst response = await model.invoke('Hi there!');\nconsole.log(response);\n// Hi!\n\nconst completions = await model.batch(['Hi there!', 'Bye!']);\n// ['Hi!', 'See you!']\n\nfor await (const token of await model.stream('Bye!')) {\n  console.log(token);\n  // Good\n  // bye\n  // !\n}\n"
  },
  {
    "path": "ch1/js/k-imperative.js",
    "content": "import { ChatOpenAI } from '@langchain/openai';\nimport { ChatPromptTemplate } from '@langchain/core/prompts';\nimport { RunnableLambda } from '@langchain/core/runnables';\n\n// the building blocks\n\nconst template = ChatPromptTemplate.fromMessages([\n  ['system', 'You are a helpful assistant.'],\n  ['human', '{question}'],\n]);\n\nconst model = new ChatOpenAI({\n  model: 'gpt-3.5-turbo',\n});\n\n// combine them in a function\n// RunnableLambda adds the same Runnable interface for any function you write\n\nconst chatbot = RunnableLambda.from(async (values) => {\n  const prompt = await template.invoke(values);\n  return await model.invoke(prompt);\n});\n\n// use it\n\nconst response = await chatbot.invoke({\n  question: 'Which model providers offer LLMs?',\n});\nconsole.log(response);\n"
  },
  {
    "path": "ch1/js/ka-stream.js",
    "content": "import { ChatOpenAI } from '@langchain/openai';\nimport { ChatPromptTemplate } from '@langchain/core/prompts';\nimport { RunnableLambda } from '@langchain/core/runnables';\n\nconst template = ChatPromptTemplate.fromMessages([\n  ['system', 'You are a helpful assistant.'],\n  ['human', '{question}'],\n]);\n\nconst model = new ChatOpenAI({\n  model: 'gpt-3.5-turbo',\n});\n\nconst chatbot = RunnableLambda.from(async function* (values) {\n  const prompt = await template.invoke(values);\n  for await (const token of await model.stream(prompt)) {\n    yield token;\n  }\n});\n\nfor await (const token of await chatbot.stream({\n  question: 'Which model providers offer LLMs?',\n})) {\n  console.log(token);\n}\n"
  },
  {
    "path": "ch1/js/l-declarative.js",
    "content": "import { ChatOpenAI } from '@langchain/openai';\nimport { ChatPromptTemplate } from '@langchain/core/prompts';\nimport { RunnableLambda } from '@langchain/core/runnables';\n\n// the building blocks\n\nconst template = ChatPromptTemplate.fromMessages([\n  ['system', 'You are a helpful assistant.'],\n  ['human', '{question}'],\n]);\n\nconst model = new ChatOpenAI({\n  model: 'gpt-3.5-turbo',\n});\n\n// combine them in a function\n\nconst chatbot = template.pipe(model);\n\n// use it\n\nconst response = await chatbot.invoke({\n  question: 'Which model providers offer LLMs?',\n});\n\nconsole.log(response);\n\n//streaming\n\nfor await (const part of chatbot.stream({\n  question: 'Which model providers offer LLMs?',\n})) {\n  console.log(part);\n}\n"
  },
  {
    "path": "ch1/py/a-llm.py",
    "content": "from langchain_openai.chat_models import ChatOpenAI\n\nmodel = ChatOpenAI(model=\"gpt-3.5-turbo\")\n\nresponse = model.invoke(\"The sky is\")\nprint(response.content)\n"
  },
  {
    "path": "ch1/py/b-chat.py",
    "content": "from langchain_openai.chat_models import ChatOpenAI\nfrom langchain_core.messages import HumanMessage\n\nmodel = ChatOpenAI()\nprompt = [HumanMessage(\"What is the capital of France?\")]\n\nresponse = model.invoke(prompt)\nprint(response.content)\n"
  },
  {
    "path": "ch1/py/c-system.py",
    "content": "from langchain_core.messages import HumanMessage, SystemMessage\nfrom langchain_openai.chat_models import ChatOpenAI\n\nmodel = ChatOpenAI()\nsystem_msg = SystemMessage(\n    \"You are a helpful assistant that responds to questions with three exclamation marks.\"\n)\nhuman_msg = HumanMessage(\"What is the capital of France?\")\n\nresponse = model.invoke([system_msg, human_msg])\nprint(response.content)\n"
  },
  {
    "path": "ch1/py/d-prompt.py",
    "content": "from langchain_core.prompts import PromptTemplate\n\ntemplate = PromptTemplate.from_template(\"\"\"Answer the question based on the context below. If the question cannot be answered using the information provided, answer with \"I don't know\".\n\nContext: {context}\n\nQuestion: {question}\n\nAnswer: \"\"\")\n\nresponse = template.invoke(\n    {\n        \"context\": \"The most recent advancements in NLP are being driven by Large Language Models (LLMs). These models outperform their smaller counterparts and have become invaluable for developers who are creating applications with NLP capabilities. Developers can tap into these models through Hugging Face's `transformers` library, or by utilizing OpenAI and Cohere's offerings through the `openai` and `cohere` libraries, respectively.\",\n        \"question\": \"Which model providers offer LLMs?\",\n    }\n)\n\nprint(response)\n"
  },
  {
    "path": "ch1/py/e-prompt-model.py",
    "content": "from langchain_openai.chat_models import ChatOpenAI\nfrom langchain_core.prompts import PromptTemplate\n\n# both `template` and `model` can be reused many times\n\ntemplate = PromptTemplate.from_template(\"\"\"Answer the question based on the context below. If the question cannot be answered using the information provided, answer with \"I don't know\".\n\nContext: {context}\n\nQuestion: {question}\n\nAnswer: \"\"\")\n\nmodel = ChatOpenAI(model=\"gpt-3.5-turbo\")\n\n# `prompt` and `completion` are the results of using template and model once\n\nprompt = template.invoke(\n    {\n        \"context\": \"The most recent advancements in NLP are being driven by Large Language Models (LLMs). These models outperform their smaller counterparts and have become invaluable for developers who are creating applications with NLP capabilities. Developers can tap into these models through Hugging Face's `transformers` library, or by utilizing OpenAI and Cohere's offerings through the `openai` and `cohere` libraries, respectively.\",\n        \"question\": \"Which model providers offer LLMs?\",\n    }\n)\n\nresponse = model.invoke(prompt)\nprint(response)\n"
  },
  {
    "path": "ch1/py/f-chat-prompt.py",
    "content": "from langchain_core.prompts import ChatPromptTemplate\n\ntemplate = ChatPromptTemplate.from_messages(\n    [\n        (\n            \"system\",\n            'Answer the question based on the context below. If the question cannot be answered using the information provided, answer with \"I don\\'t know\".',\n        ),\n        (\"human\", \"Context: {context}\"),\n        (\"human\", \"Question: {question}\"),\n    ]\n)\n\nresponse = template.invoke(\n    {\n        \"context\": \"The most recent advancements in NLP are being driven by Large Language Models (LLMs). These models outperform their smaller counterparts and have become invaluable for developers who are creating applications with NLP capabilities. Developers can tap into these models through Hugging Face's `transformers` library, or by utilizing OpenAI and Cohere's offerings through the `openai` and `cohere` libraries, respectively.\",\n        \"question\": \"Which model providers offer LLMs?\",\n    }\n)\n\nprint(response)\n"
  },
  {
    "path": "ch1/py/g-chat-prompt-model.py",
    "content": "from langchain_openai.chat_models import ChatOpenAI\nfrom langchain_core.prompts import ChatPromptTemplate\n\n# both `template` and `model` can be reused many times\n\ntemplate = ChatPromptTemplate.from_messages(\n    [\n        (\n            \"system\",\n            'Answer the question based on the context below. If the question cannot be answered using the information provided, answer with \"I don\\'t know\".',\n        ),\n        (\"human\", \"Context: {context}\"),\n        (\"human\", \"Question: {question}\"),\n    ]\n)\n\nmodel = ChatOpenAI()\n\n# `prompt` and `completion` are the results of using template and model once\n\nprompt = template.invoke(\n    {\n        \"context\": \"The most recent advancements in NLP are being driven by Large Language Models (LLMs). These models outperform their smaller counterparts and have become invaluable for developers who are creating applications with NLP capabilities. Developers can tap into these models through Hugging Face's `transformers` library, or by utilizing OpenAI and Cohere's offerings through the `openai` and `cohere` libraries, respectively.\",\n        \"question\": \"Which model providers offer LLMs?\",\n    }\n)\n\nprint(model.invoke(prompt))\n"
  },
  {
    "path": "ch1/py/h-structured.py",
    "content": "from langchain_openai import ChatOpenAI\nfrom pydantic import BaseModel\n\n\nclass AnswerWithJustification(BaseModel):\n    \"\"\"An answer to the user's question along with justification for the answer.\"\"\"\n\n    answer: str\n    \"\"\"The answer to the user's question\"\"\"\n    justification: str\n    \"\"\"Justification for the answer\"\"\"\n\n\nllm = ChatOpenAI(model=\"gpt-3.5\", temperature=0)\nstructured_llm = llm.with_structured_output(AnswerWithJustification)\n\nresponse = structured_llm.invoke(\n    \"What weighs more, a pound of bricks or a pound of feathers\")\nprint(response)\n"
  },
  {
    "path": "ch1/py/i-csv.py",
    "content": "from langchain_core.output_parsers import CommaSeparatedListOutputParser\n\nparser = CommaSeparatedListOutputParser()\n\nresponse = parser.invoke(\"apple, banana, cherry\")\nprint(response)\n"
  },
  {
    "path": "ch1/py/j-methods.py",
    "content": "from langchain_openai.chat_models import ChatOpenAI\n\nmodel = ChatOpenAI(model=\"gpt-3.5-turbo\")\n\ncompletion = model.invoke(\"Hi there!\")\n# Hi!\n\ncompletions = model.batch([\"Hi there!\", \"Bye!\"])\n# ['Hi!', 'See you!']\n\nfor token in model.stream(\"Bye!\"):\n    print(token)\n    # Good\n    # bye\n    # !\n"
  },
  {
    "path": "ch1/py/k-imperative.py",
    "content": "from langchain_openai.chat_models import ChatOpenAI\nfrom langchain_core.prompts import ChatPromptTemplate\nfrom langchain_core.runnables import chain\n\n# the building blocks\n\ntemplate = ChatPromptTemplate.from_messages(\n    [\n        (\"system\", \"You are a helpful assistant.\"),\n        (\"human\", \"{question}\"),\n    ]\n)\n\nmodel = ChatOpenAI(model=\"gpt-3.5-turbo\")\n\n# combine them in a function\n# @chain decorator adds the same Runnable interface for any function you write\n\n\n@chain\ndef chatbot(values):\n    prompt = template.invoke(values)\n    return model.invoke(prompt)\n\n\n# use it\n\nresponse = chatbot.invoke({\"question\": \"Which model providers offer LLMs?\"})\nprint(response.content)\n"
  },
  {
    "path": "ch1/py/ka-stream.py",
    "content": "from langchain_core.runnables import chain\nfrom langchain_openai.chat_models import ChatOpenAI\nfrom langchain_core.prompts import ChatPromptTemplate\n\n\nmodel = ChatOpenAI(model=\"gpt-3.5-turbo\")\n\n\ntemplate = ChatPromptTemplate.from_messages(\n    [\n        (\"system\", \"You are a helpful assistant.\"),\n        (\"human\", \"{question}\"),\n    ]\n)\n\n\n@chain\ndef chatbot(values):\n    prompt = template.invoke(values)\n    for token in model.stream(prompt):\n        yield token\n\n\nfor part in chatbot.stream({\"question\": \"Which model providers offer LLMs?\"}):\n    print(part)\n"
  },
  {
    "path": "ch1/py/kb-async.py",
    "content": "from langchain_core.runnables import chain\nfrom langchain_openai.chat_models import ChatOpenAI\nfrom langchain_core.prompts import ChatPromptTemplate\n\ntemplate = ChatPromptTemplate.from_messages(\n    [\n        (\"system\", \"You are a helpful assistant.\"),\n        (\"human\", \"{question}\"),\n    ]\n)\n\nmodel = ChatOpenAI(model=\"gpt-3.5-turbo\")\n\n\n@chain\nasync def chatbot(values):\n    prompt = await template.ainvoke(values)\n    return await model.ainvoke(prompt)\n\n\nasync def main():\n    return await chatbot.ainvoke({\"question\": \"Which model providers offer LLMs?\"})\n\nif __name__ == \"__main__\":\n    import asyncio\n    print(asyncio.run(main()))\n"
  },
  {
    "path": "ch1/py/l-declarative.py",
    "content": "from langchain_openai.chat_models import ChatOpenAI\nfrom langchain_core.prompts import ChatPromptTemplate\n\n# the building blocks\n\ntemplate = ChatPromptTemplate.from_messages(\n    [\n        (\"system\", \"You are a helpful assistant.\"),\n        (\"human\", \"{question}\"),\n    ]\n)\n\nmodel = ChatOpenAI()\n\n# combine them with the | operator\n\nchatbot = template | model\n\n# use it\n\nresponse = chatbot.invoke({\"question\": \"Which model providers offer LLMs?\"})\nprint(response.content)\n\n# streaming\n\nfor part in chatbot.stream({\"question\": \"Which model providers offer LLMs?\"}):\n    print(part)\n"
  },
  {
    "path": "ch10/js/agent-evaluation-rag.js",
    "content": "import { ChatOpenAI } from '@langchain/openai';\nimport { ChatPromptTemplate } from '@langchain/core/prompts';\nimport { evaluate } from 'langsmith/evaluation';\nimport { traceable } from 'langsmith/traceable';\nimport { graph } from './rag-graph.js';\nimport { z } from 'zod';\n\nconst defaultDataset = 'langchain-blogs-qa';\n\nconst experimentPrefix = 'langchain-blogs-qa-evals';\n\nconst llm = new ChatOpenAI({ model: 'gpt-4o', temperature: 0 });\n\nconst EVALUATION_PROMPT = `You are a teacher grading a quiz.\n\nYou will be given a QUESTION, the GROUND TRUTH (correct) RESPONSE, and the STUDENT RESPONSE.\n\nHere is the grade criteria to follow:\n(1) Grade the student responses based ONLY on their factual accuracy relative to the ground truth answer.\n(2) Ensure that the student response does not contain any conflicting statements.\n(3) It is OK if the student response contains more information than the ground truth response, as long as it is factually accurate relative to the  ground truth response.\n\nCorrectness:\nTrue means that the student's response meets all of the criteria.\nFalse means that the student's response does not meet all of the criteria.\n\nExplain your reasoning in a step-by-step manner to ensure your reasoning and conclusion are correct.`;\n\nconst userPrompt = `QUESTION: {question}\nGROUND TRUTH RESPONSE: {reference}\nSTUDENT RESPONSE: {answer}`;\n\nconst prompt = ChatPromptTemplate.fromMessages([\n  ['system', EVALUATION_PROMPT],\n  ['user', userPrompt],\n]);\n\n// LLM-as-judge output schema\n\nconst grade = z\n  .object({\n    reasoning: z\n      .string()\n      .describe(\n        'Explain your reasoning for whether the actual response is correct or not.'\n      ),\n    isCorrect: z\n      .boolean()\n      .describe(\n        'True if the student response is mostly or exactly correct, otherwise False.'\n      ),\n  })\n  .describe(\n    'Compare the expected and actual answers and grade the actual answer.'\n  );\n\nconst graderLlm = prompt.pipe(llm.withStructuredOutput(grade));\n\nconst evaluateAgent = async (run, example) => {\n  const question = run.inputs.question;\n  const answer = run.outputs.answer;\n  const reference = example.outputs.answer;\n\n  const grade = await graderLlm.invoke({ question, reference, answer });\n  const isCorrect = grade.isCorrect;\n\n  return { key: 'correct', score: Number(isCorrect) };\n};\n\nconst runGraph = traceable(async (inputs) => {\n  const answer = await graph.invoke({ question: inputs.question });\n  return { answer: answer.answer };\n});\n\nawait evaluate((inputs) => runGraph(inputs), {\n  data: defaultDataset,\n  evaluators: [evaluateAgent],\n  experimentPrefix,\n  maxConcurrency: 4,\n});\n"
  },
  {
    "path": "ch10/js/agent-evaluation-sql.js",
    "content": "import { ChatOpenAI } from '@langchain/openai';\nimport { graph } from './agent-sql-graph.js';\nimport crypto from 'crypto';\nimport * as hub from 'langchain/hub';\nimport { evaluate } from 'langsmith/evaluation';\nimport { traceable } from 'langsmith/traceable';\nimport { z } from 'zod';\n\nconst thread_id = crypto.randomUUID();\nconst config = {\n  configurable: {\n    thread_id: thread_id,\n  },\n};\n\nconst llm = new ChatOpenAI({ model: 'gpt-4o-mini', temperature: 0 });\n\nconst predictSQLAgentAnswer = traceable(async (example) => {\n  const messages = await graph.invoke(\n    { messages: ['user', example.input] },\n    config\n  );\n  return { response: messages.messages[messages.messages.length - 1].content };\n});\n\nconst gradePromptAnswerAccuracy = await hub.pull(\n  'langchain-ai/rag-answer-vs-reference'\n);\n\nconst grade = z.object({\n  score: z.number(),\n});\n\nconst answerEvaluator = async (run, example) => {\n  const input_question = example.inputs['input'];\n  const reference = example.outputs['output'];\n  const prediction = run.outputs['response'];\n\n  const grader = gradePromptAnswerAccuracy.pipe(llm);\n  const score = await grader.invoke({\n    question: input_question,\n    correct_answer: reference,\n    student_answer: prediction,\n  });\n  return { key: 'answer_v_reference_score', score: score.Score };\n};\n\nconst datasetName = 'sql-agent-response';\nconst experimentPrefix = 'sql-agent-gpt4o';\n\nconst experimentResults = await evaluate(\n  (inputs) => predictSQLAgentAnswer(inputs),\n  {\n    data: datasetName,\n    evaluators: [answerEvaluator],\n    experimentPrefix,\n    maxConcurrency: 4,\n  }\n);\n\n// Single tool evaluation\nconst predictAssistant = traceable(async (example) => {\n  const result = await graph.invoke(\n    { messages: [['user', example.input]] },\n    config\n  );\n  return { response: result };\n});\n\nconst checkSpecificToolCall = async (run, example) => {\n  const response = run.outputs['response'];\n  const messages = response.messages;\n\n  let firstToolCall = null;\n  for (const message of messages) {\n    if (message.tool_calls?.length > 0) {\n      // Get the name of the first tool call in the message\n      firstToolCall = message.tool_calls[0].name;\n      break;\n    }\n  }\n\n  const expected_tool_call = 'list-tables-sql';\n  const score = firstToolCall === expected_tool_call ? 1 : 0;\n\n  return {\n    key: 'single_tool_call',\n    score: score,\n  };\n};\n\nconst singleToolCallResults = await evaluate(\n  (inputs) => predictAssistant(inputs),\n  {\n    data: datasetName,\n    evaluators: [checkSpecificToolCall],\n    experimentPrefix: `${experimentPrefix}-single-tool`,\n    maxConcurrency: 4,\n  }\n);\n\nconst EXPECTED_TOOLS = {\n  LIST_TABLES: 'list-tables-sql',\n  SCHEMA: 'info-sql',\n  QUERY_CHECK: 'query-checker',\n  QUERY_EXEC: 'query-sql',\n  RESULT_CHECK: 'checkResult',\n};\n\nconst containsAllToolCallsAnyOrder = async ({ run, example }) => {\n  const expected = [\n    EXPECTED_TOOLS.LIST_TABLES,\n    EXPECTED_TOOLS.SCHEMA,\n    EXPECTED_TOOLS.QUERY_CHECK,\n    EXPECTED_TOOLS.QUERY_EXEC,\n  ];\n\n  const messages = run.outputs?.response?.messages || [];\n  const toolCalls = Array.from(\n    new Set(\n      messages.flatMap(\n        (m) => m.tool_calls?.map((tc) => tc.name) || m.name || []\n      )\n    )\n  );\n\n  const score = expected.every((tool) => toolCalls.includes(tool)) ? 1 : 0;\n  return { key: 'multi_tool_call_any_order', score };\n};\n\nconst containsAllToolCallsInOrder = async ({ run, example }) => {\n  const expectedSequence = [\n    EXPECTED_TOOLS.LIST_TABLES,\n    EXPECTED_TOOLS.SCHEMA,\n    EXPECTED_TOOLS.QUERY_CHECK,\n    EXPECTED_TOOLS.QUERY_EXEC,\n  ];\n\n  const messages = run.outputs?.response?.messages || [];\n  const toolCalls = messages.flatMap(\n    (m) => m.tool_calls?.map((tc) => tc.name) || m.name || []\n  );\n\n  let seqIndex = 0;\n  for (const call of toolCalls) {\n    if (call === expectedSequence[seqIndex]) {\n      seqIndex++;\n      if (seqIndex === expectedSequence.length) break;\n    }\n  }\n\n  return {\n    key: 'multi_tool_call_in_order',\n    score: seqIndex === expectedSequence.length ? 1 : 0,\n  };\n};\n\nconst containsAllToolCallsExactOrder = async ({ run, example }) => {\n  const expectedSequence = [\n    EXPECTED_TOOLS.LIST_TABLES,\n    EXPECTED_TOOLS.SCHEMA,\n    EXPECTED_TOOLS.QUERY_CHECK,\n    EXPECTED_TOOLS.QUERY_EXEC,\n  ];\n\n  const messages = run.outputs?.response?.messages || [];\n  const toolCalls = messages.flatMap(\n    (m) => m.tool_calls?.map((tc) => tc.name) || m.name || []\n  );\n\n  // Find the first occurrence sequence\n  const firstOccurrences = [];\n  for (const call of toolCalls) {\n    if (call === expectedSequence[firstOccurrences.length]) {\n      firstOccurrences.push(call);\n      if (firstOccurrences.length === expectedSequence.length) break;\n    }\n  }\n\n  const score =\n    JSON.stringify(firstOccurrences) === JSON.stringify(expectedSequence)\n      ? 1\n      : 0;\n  return { key: 'multi_tool_call_exact_order', score };\n};\n\n// Prediction functions for different evaluation types\nconst predictSqlAgentMessages = traceable(async (example) => {\n  const result = await graph.invoke(\n    { messages: [['user', example.input]] },\n    config\n  );\n  return { response: result };\n});\n\n// Trajectory Evaluation Execution\nconst trajectoryResults = await evaluate(\n  (inputs) => predictSqlAgentMessages(inputs),\n  {\n    data: datasetName,\n    evaluators: [\n      containsAllToolCallsAnyOrder,\n      containsAllToolCallsInOrder,\n      containsAllToolCallsExactOrder,\n    ],\n    experimentPrefix: `${experimentPrefix}-full-trajectory`,\n    maxConcurrency: 4,\n  }\n);\n"
  },
  {
    "path": "ch10/js/agent-sql-graph.js",
    "content": "import { ChatOpenAI } from '@langchain/openai';\nimport { SqlDatabase } from 'langchain/sql_db';\nimport { DataSource } from 'typeorm';\nimport { SqlToolkit } from 'langchain/agents/toolkits/sql';\nimport { ChatPromptTemplate } from '@langchain/core/prompts';\nimport { z } from 'zod';\nimport { tool } from '@langchain/core/tools';\nimport { ToolNode } from '@langchain/langgraph/prebuilt';\nimport { SqliteSaver } from '@langchain/langgraph-checkpoint-sqlite';\nimport {\n  StateGraph,\n  MessagesAnnotation,\n  END,\n  START,\n} from '@langchain/langgraph';\nimport Database from 'better-sqlite3';\n\n// LLM\nconst llm = new ChatOpenAI({ model: 'gpt-4o', temperature: 0 });\n\n// SQL toolkit\nconst datasource = new DataSource({\n  type: 'sqlite',\n  database: 'Chinook_Sqlite.sqlite',\n});\n\nconst db = await SqlDatabase.fromDataSourceParams({\n  appDataSource: datasource,\n});\n\nconsole.log(db.allTables.map((t) => t.tableName));\n\nconst toolkit = new SqlToolkit(db, llm);\nconst tools = toolkit.getTools();\n\n// Query checking\nconst queryCheckSystemPrompt = `You are a SQL expert with a strong attention to detail.\nDouble check the SQLite query for common mistakes, including:\n- Using NOT IN with NULL values\n- Using UNION when UNION ALL should have been used\n- Using BETWEEN for exclusive ranges\n- Data type mismatch in predicates\n- Properly quoting identifiers\n- Using the correct number of arguments for functions\n- Casting to the correct data type\n- Using the proper columns for joins\n\nIf there are any of the above mistakes, rewrite the query. If there are no mistakes, just reproduce the original query.\n\nExecute the correct query with the appropriate tool.`;\n\nconst queryCheckPrompt = ChatPromptTemplate.fromMessages([\n  ['system', queryCheckSystemPrompt],\n  ['user', '{query}'],\n]);\n\nconst queryChain = queryCheckPrompt.pipe(llm);\n\nconst checkQueryTool = tool(\n  async (input) => {\n    const res = await queryChain.invoke(input.query);\n    return res.content;\n  },\n  {\n    name: 'checkQuery',\n    description:\n      'Use this tool to double check if your query is correct before executing it.',\n    schema: z.object({\n      query: z.string(),\n    }),\n  }\n);\n\n// Query result checking\nconst queryResultCheckSystemPrompt = `You are grading the result of a SQL query from a DB. \n- Check that the result is not empty.\n- If it is empty, instruct the system to re-try!`;\n\nconst queryResultCheckPrompt = ChatPromptTemplate.fromMessages([\n  ['system', queryResultCheckSystemPrompt],\n  ['user', '{query_result}'],\n]);\n\nconst queryResultChain = queryResultCheckPrompt.pipe(llm);\n\nconst checkResultTool = tool(\n  async (input) => {\n    const res = await queryResultChain.invoke(input.query);\n    return res.content;\n  },\n  {\n    name: 'checkResult',\n    description:\n      'Use this tool to check the query result from the database to confirm it is not empty and is relevant.',\n    schema: z.object({\n      query_result: z.string(),\n    }),\n  }\n);\n\ntools.push(checkQueryTool, checkResultTool);\n\n// Assistant runnable\nconst queryGenSystem = `\nROLE:\nYou are an agent designed to interact with a SQL database. You have access to tools for interacting with the database.\nGOAL:\nGiven an input question, create a syntactically correct SQLite query to run, then look at the results of the query and return the answer.\nINSTRUCTIONS:\n- Only use the below tools for the following operations.\n- Only use the information returned by the below tools to construct your final answer.\n- To start you should ALWAYS look at the tables in the database to see what you can query. Do NOT skip this step.\n- Then you should query the schema of the most relevant tables.\n- Write your query based upon the schema of the tables. You MUST double check your query before executing it. \n- Unless the user specifies a specific number of examples they wish to obtain, always limit your query to at most 5 results.\n- You can order the results by a relevant column to return the most interesting examples in the database.\n- Never query for all the columns from a specific table, only ask for the relevant columns given the question.\n- If you get an error while executing a query, rewrite the query and try again.\n- If the query returns a result, use check_result tool to check the query result.\n- If the query result result is empty, think about the table schema, rewrite the query, and try again.\n- DO NOT make any DML statements (INSERT, UPDATE, DELETE, DROP etc.) to the database.\n`;\n\nconst queryGenPrompt = ChatPromptTemplate.fromMessages([\n  ['system', queryGenSystem],\n  ['placeholder', '{messages}'],\n]);\n\nconst modelWithTools = queryGenPrompt.pipe(llm.bindTools(tools));\n\nconst handleToolError = async (state) => {\n  const { messages } = state;\n  const toolsByName = {\n    checkQuery: checkQueryTool,\n    checkResult: checkResultTool,\n  };\n  const lastMessage = messages[messages.length - 1];\n  const outputMessages = [];\n  for (const toolCall of lastMessage.tool_calls) {\n    try {\n      const toolResult = await toolsByName[toolCall.name].invoke(toolCall);\n      outputMessages.push(toolResult);\n    } catch (error) {\n      // Return the error if the tool call fails\n      outputMessages.push(\n        new ToolMessage({\n          content: error.message,\n          name: toolCall.name,\n          tool_call_id: toolCall.id,\n          additional_kwargs: { error },\n        })\n      );\n    }\n  }\n  return { messages: outputMessages };\n};\n\nconst toolNodeForGraph = new ToolNode(tools).withFallbacks([handleToolError]);\n\nconst shouldContinue = (state) => {\n  const { messages } = state;\n  const lastMessage = messages[messages.length - 1];\n  if (\n    'tool_calls' in lastMessage &&\n    Array.isArray(lastMessage.tool_calls) &&\n    lastMessage.tool_calls?.length\n  ) {\n    return 'tools';\n  }\n  return END;\n};\n\nexport const callModel = async (state) => {\n  const { messages } = state;\n  const response = await modelWithTools.invoke({ messages });\n  return { messages: response };\n};\n\nconst builder = new StateGraph(MessagesAnnotation)\n  // Define the two nodes we will cycle between\n  .addNode('agent', callModel)\n  .addNode('tools', toolNodeForGraph)\n  .addEdge(START, 'agent')\n  .addConditionalEdges('agent', shouldContinue, ['tools', END])\n  .addEdge('tools', 'agent');\n\nconst memory = new SqliteSaver(new Database(':memory:'));\nexport const graph = builder.compile({ checkpointer: memory });\n"
  },
  {
    "path": "ch10/js/create-rag-dataset.js",
    "content": "import { Client } from 'langsmith';\nconst client = new Client();\n\nconst exampleInputs = [\n  [\n    'Which companies are highlighted as top LangGraph agent adopters in 2024?',\n    'The top adopters include Uber (code migration tools), AppFolio (property management copilot), LinkedIn (SQL Bot), Elastic (AI assistant), and Replit (multi-agent development platform) :cite[3].',\n  ],\n  [\n    \"How did AppFolio's AI copilot impact property managers?\",\n    \"AppFolio's Realm-X AI copilot saved property managers over 10 hours per week by automating queries, bulk actions, and scheduling :cite[3].\",\n  ],\n  [\n    'What infrastructure trends dominated LLM usage in 2024?',\n    'OpenAI remained the top LLM provider (6x more usage than Ollama), while open-source models via Ollama and Groq surged. Chroma and FAISS led vector stores, with MongoDB and Elastic gaining traction :cite[2]:cite[5].',\n  ],\n  [\n    'How did LangGraph improve agent workflows compared to 2023?',\n    'LangGraph usage grew to 43% of LangSmith organizations, with 21.9% of traces involving tool calls (up from 0.5% in 2023), enabling complex multi-step tasks like database writes :cite[2]:cite[7].',\n  ],\n  [\n    \"What distinguishes Replit's LangGraph implementation?\",\n    \"Replit's agent emphasizes human-in-the-loop validation and a multi-agent architecture for code generation, combining autonomy with controlled outputs :cite[3].\",\n  ],\n];\n\nconst datasetName = 'langchain-blogs-qa';\n\n// Create dataset\nconst dataset = await client.createDataset(datasetName, {\n  description: 'Langchain blogs QA.',\n});\n\n// Prepare inputs, outputs, and metadata for bulk creation\nconst inputs = exampleInputs.map(([inputPrompt]) => ({\n  question: inputPrompt,\n}));\n\nconst outputs = exampleInputs.map(([, outputAnswer]) => ({\n  answer: outputAnswer,\n}));\n\nconst metadata = exampleInputs.map(() => ({ source: 'LangChain Blog' }));\n\n// Use the bulk createExamples method\nawait client.createExamples({\n  inputs,\n  outputs,\n  metadata,\n  datasetId: dataset.id,\n});\n\nconsole.log(\n  `Dataset created in langsmith with ID: ${dataset.id}\\n Navigate to ${dataset.url}.`\n);\n"
  },
  {
    "path": "ch10/js/create-sql-dataset.js",
    "content": "import { Client } from 'langsmith';\nconst client = new Client();\n\nconst exampleInputs = [\n  [\n    \"Which country's customers spent the most? And how much did they spend?\",\n    'The country whose customers spent the most is the USA, with a total expenditure of $523.06',\n  ],\n  [\n    'What was the most purchased track of 2013?',\n    'The most purchased track of 2013 was Hot Girl.',\n  ],\n  [\n    'How many albums does the artist Led Zeppelin have?',\n    'Led Zeppelin has 14 albums',\n  ],\n  [\n    \"What is the total price for the album 'Big Ones'?\",\n    'The total price for the album \"Big Ones\" is 14.85',\n  ],\n  [\n    'Which sales agent made the most in sales in 2009?',\n    'Steve Johnson made the most sales in 2009',\n  ],\n];\n\nconst datasetName = 'sql-agent-response';\n\nif (!(await client.hasDataset({ datasetName }))) {\n  client.createDataset(datasetName);\n\n  // Prepare inputs, outputs, and metadata for bulk creation\n  const inputs = exampleInputs.map(([inputPrompt]) => ({\n    question: inputPrompt,\n  }));\n\n  const outputs = exampleInputs.map(([, outputAnswer]) => ({\n    answer: outputAnswer,\n  }));\n\n  await client.createExamples({\n    inputs,\n    outputs,\n    datasetId: dataset.id,\n  });\n}\n"
  },
  {
    "path": "ch10/js/rag-graph.js",
    "content": "import { Annotation, StateGraph } from '@langchain/langgraph';\nimport { CheerioWebBaseLoader } from '@langchain/community/document_loaders/web/cheerio';\nimport { RecursiveCharacterTextSplitter } from 'langchain/text_splitter';\nimport { MemoryVectorStore } from 'langchain/vectorstores/memory';\nimport { ChatOpenAI, OpenAIEmbeddings } from '@langchain/openai';\nimport * as hub from 'langchain/hub';\nimport { StringOutputParser } from '@langchain/core/output_parsers';\n\nconst GraphState = Annotation.Root({\n  question: Annotation(),\n  scrapedDocuments: Annotation(),\n  vectorstore: Annotation(),\n  answer: Annotation(),\n});\n\nconst scrapeBlogPosts = async (state) => {\n  const urls = [\n    'https://blog.langchain.dev/top-5-langgraph-agents-in-production-2024/',\n    'https://blog.langchain.dev/langchain-state-of-ai-2024/',\n    'https://blog.langchain.dev/introducing-ambient-agents/',\n  ];\n\n  const loadDocs = async (urls) => {\n    const docs = [];\n    for (const url of urls) {\n      const loader = new CheerioWebBaseLoader(url);\n      const loadedDocs = await loader.load();\n      docs.push(...loadedDocs);\n    }\n    return docs;\n  };\n\n  const scrapedDocuments = await loadDocs(urls);\n\n  return { scrapedDocuments };\n};\n\nconst indexing = async (state) => {\n  const textSplitter = new RecursiveCharacterTextSplitter({\n    chunkSize: 1000,\n    chunkOverlap: 0,\n  });\n\n  const docSplits = await textSplitter.splitDocuments(state.scrapedDocuments);\n\n  const vectorstore = new MemoryVectorStore(new OpenAIEmbeddings());\n\n  await vectorstore.addDocuments(docSplits);\n\n  console.log('vectorstore: ', vectorstore);\n\n  return { vectorstore };\n};\n\nconst retrieveAndGenerate = async (state) => {\n  const { question, vectorstore } = state;\n\n  const retriever = vectorstore.asRetriever();\n\n  const prompt = await hub.pull('rlm/rag-prompt');\n\n  const llm = new ChatOpenAI({ model: 'gpt-3.5-turbo', temperature: 0 });\n\n  const docs = await retriever.invoke(question);\n\n  const chain = prompt.pipe(llm).pipe(new StringOutputParser());\n\n  const answer = await chain.invoke({ context: docs, question });\n\n  console.log('answer: ', answer);\n\n  return { answer };\n};\n\nconst workflow = new StateGraph(GraphState)\n  .addNode('retrieve_and_generate', retrieveAndGenerate)\n  .addNode('scrape_blog_posts', scrapeBlogPosts)\n  .addNode('indexing', indexing)\n  .addEdge('__start__', 'scrape_blog_posts')\n  .addEdge('scrape_blog_posts', 'indexing')\n  .addEdge('indexing', 'retrieve_and_generate')\n  .addEdge('retrieve_and_generate', '__end__');\n\nconst graph = workflow.compile();\n\nawait graph.invoke({ question: 'What are ambient agents?' });\n"
  },
  {
    "path": "ch10/js/retrieve-and-grade.js",
    "content": "import { RecursiveCharacterTextSplitter } from '@langchain/textsplitters';\nimport { CheerioWebBaseLoader } from '@langchain/community/document_loaders/web/cheerio';\nimport { InMemoryVectorStore } from '@langchain/community/vectorstores/in_memory';\nimport { OpenAIEmbeddings } from '@langchain/openai';\nimport { ChatPromptTemplate } from '@langchain/core/prompts';\nimport { z } from 'zod';\nimport { ChatOpenAI } from '@langchain/openai';\n\nconst urls = [\n  'https://blog.langchain.dev/top-5-langgraph-agents-in-production-2024/',\n  'https://blog.langchain.dev/langchain-state-of-ai-2024/',\n  'https://blog.langchain.dev/introducing-ambient-agents/',\n];\n\n// Load documents from URLs\nconst loadDocs = async (urls) => {\n  const docs = [];\n  for (const url of urls) {\n    const loader = new CheerioWebBaseLoader(url);\n    const loadedDocs = await loader.load();\n    docs.push(...loadedDocs);\n  }\n  return docs;\n};\n\nconst docsList = await loadDocs(urls);\n\n// Initialize the text splitter\nconst textSplitter = new RecursiveCharacterTextSplitter({\n  chunkSize: 250,\n  chunkOverlap: 0,\n});\n\n// Split the documents into smaller chunks\nconst docSplits = textSplitter.splitDocuments(docsList);\n\n// Add to vector database\nconst vectorstore = await InMemoryVectorStore.fromDocuments(\n  docSplits,\n  new OpenAIEmbeddings()\n);\n\nconst retriever = vectorstore.asRetriever(); // The `retriever` object can now be used for querying\n\nconst question = 'What are 2 LangGraph agents used in production in 2024?';\n\nconst docs = retriever.invoke(question);\n\nconsole.log('Retrieved documents: \\n', docs[0].page_content);\n\n// Define the schema using Zod\nconst GradeDocumentsSchema = z.object({\n  binary_score: z\n    .string()\n    .describe(\"Documents are relevant to the question, 'yes' or 'no'\"),\n});\n\n// Initialize LLM with structured output using Zod schema\nconst llm = new ChatOpenAI({ model: 'gpt-3.5-turbo', temperature: 0 });\nconst structuredLLMGrader = llm.withStructuredOutput(GradeDocumentsSchema);\n\n// System and prompt template\nconst systemMessage = `You are a grader assessing relevance of a retrieved document to a user question. If the document contains keyword(s) or semantic meaning related to the question, grade it as relevant. Give a binary score 'yes' or 'no' to indicate whether the document is relevant to the question.`;\nconst gradePrompt = ChatPromptTemplate.fromMessages([\n  { role: 'system', content: systemMessage },\n  {\n    role: 'human',\n    content:\n      'Retrieved document: \\n\\n {document} \\n\\n User question: {question}',\n  },\n]);\n\n// Combine prompt with the structured output\nconst retrievalGrader = gradePrompt.pipe(structuredLLMGrader);\n\n// Grade retrieved documents\nconst results = await retrievalGrader.invoke({\n  question,\n  document: docs[0].page_content,\n});\n\nconsole.log('\\n\\nGrading results: \\n', results);\n"
  },
  {
    "path": "ch10/js/search-graph.js",
    "content": "import { Annotation, StateGraph, START, END } from '@langchain/langgraph';\nimport { StringOutputParser } from '@langchain/core/output_parsers';\nimport { ChatPromptTemplate } from '@langchain/core/prompts';\nimport { ChatOpenAI } from '@langchain/openai';\nimport { DuckDuckGoSearch } from '@langchain/community/tools/duckduckgo_search';\nimport * as hub from 'langchain/hub';\nimport { retriever, retrievalGrader } from './retrieve-and-grade.js';\nimport { Document } from '@langchain/core/documents';\n\n// LLM setup\nconst prompt = await hub.pull('rlm/rag-prompt');\nconst llm = new ChatOpenAI({ modelName: 'gpt-4', temperature: 0 }); // Fixed model name\nconst ragChain = prompt.pipe(llm).pipe(new StringOutputParser());\nconst webSearchTool = new DuckDuckGoSearch();\n// Question rewriting prompt\nconst rewritePrompt = ChatPromptTemplate.fromMessages([\n  [\n    'system',\n    `You are a question re-writer that converts an input question to a better version that is optimized \n     for web search. Look at the input and try to reason about the underlying semantic intent / meaning.`,\n  ],\n  [\n    'human',\n    'Here is the initial question: \\n\\n {question} \\n Formulate an improved question.',\n  ],\n]);\n\nconst questionRewriter = rewritePrompt.pipe(llm).pipe(new StringOutputParser());\n\n// Create the graph state\nconst GraphState = Annotation.Root({\n  question: Annotation(),\n  generation: Annotation(),\n  webSearch: Annotation(),\n  documents: Annotation({\n    reducer: (currentState, updateValue) => currentState.concat(updateValue),\n    default: () => [],\n  }),\n});\n\n// Node functions\nconst retrieve = async (state) => {\n  const documents = await retriever.invoke(state.question);\n  return { question: state.question, documents };\n};\n\nconst generate = async (state) => {\n  const { question, documents } = state;\n  const context = documents.map((doc) => doc.pageContent).join('\\n');\n  const generation = await ragChain.invoke({ context, question });\n  console.log('Final answer:', generation);\n  return { documents, question, generation };\n};\n\nconst gradeDocuments = async (state) => {\n  const { question, documents } = state;\n  const filteredDocs = [];\n  let webSearch = 'No';\n\n  for (const doc of documents) {\n    try {\n      const score = await retrievalGrader.invoke({\n        question: question,\n        document: doc.pageContent,\n      });\n\n      if (score.binary_score === 'yes') {\n        console.log('---GRADE: DOCUMENT RELEVANT---');\n        filteredDocs.push(doc);\n      } else {\n        console.log('---GRADE: DOCUMENT NOT RELEVANT---');\n        webSearch = 'Yes';\n      }\n    } catch (error) {\n      console.error('Error grading document:', error);\n      webSearch = 'Yes';\n    }\n  }\n\n  return {\n    documents: filteredDocs,\n    question,\n    webSearch,\n  };\n};\n\nconst transformQuery = async (state) => {\n  const betterQuestion = await questionRewriter.invoke({\n    question: state.question,\n  });\n  console.log('Transformed question:', betterQuestion);\n  return { documents: state.documents, question: betterQuestion };\n};\n\nconst webSearch = async (state) => {\n  console.log('---WEB SEARCH---');\n  const webResult = await webSearchTool.invoke(state.question);\n  const webResultsDocument = new Document({ pageContent: webResult });\n\n  // Fixed document concatenation\n  const updatedDocuments = [...state.documents, webResultsDocument];\n\n  return { documents: updatedDocuments, question: state.question };\n};\n\n// Routing function\nconst generateRoute = (state) => {\n  return state.webSearch === 'Yes' ? 'transform_query' : 'generate';\n};\n\n// Create and compile the graph\nconst workflow = new StateGraph(GraphState)\n  .addNode('retrieve', retrieve)\n  .addNode('grade_documents', gradeDocuments)\n  .addNode('transform_query', transformQuery)\n  .addNode('generate', generate)\n  .addNode('web_search_node', webSearch)\n  .addEdge(START, 'retrieve')\n  .addEdge('retrieve', 'grade_documents')\n  .addConditionalEdges('grade_documents', generateRoute)\n  .addEdge('transform_query', 'web_search_node')\n  .addEdge('web_search_node', 'generate')\n  .addEdge('generate', END);\n\nconst graph = workflow.compile();\n\nconst result = await graph.invoke({\n  question: 'What are the Top 5 LangGraph Agents in Production 2024?',\n});\n\nconsole.log(result);\n"
  },
  {
    "path": "ch10/py/agent_evaluation_rag.py",
    "content": "from typing import Optional\n\nfrom langchain_openai import ChatOpenAI\nfrom langsmith import Client, evaluate, aevaluate\nfrom langsmith.evaluation import EvaluationResults\nfrom pydantic import BaseModel, Field\nfrom typing_extensions import Annotated, TypedDict\nfrom rag_graph import graph\n\nclient = Client()\n\nDEFAULT_DATASET_NAME = \"langchain-blogs-qa\"\n\nllm = ChatOpenAI(model=\"gpt-4o\", temperature=0)\n\nEVALUATION_PROMPT = f\"\"\"You are a teacher grading a quiz.\n\nYou will be given a QUESTION, the GROUND TRUTH (correct) RESPONSE, and the STUDENT RESPONSE.\n\nHere is the grade criteria to follow:\n(1) Grade the student responses based ONLY on their factual accuracy relative to the ground truth answer.\n(2) Ensure that the student response does not contain any conflicting statements.\n(3) It is OK if the student response contains more information than the ground truth response, as long as it is factually accurate relative to the  ground truth response.\n\nCorrectness:\nTrue means that the student's response meets all of the criteria.\nFalse means that the student's response does not meet all of the criteria.\n\nExplain your reasoning in a step-by-step manner to ensure your reasoning and conclusion are correct.\"\"\"\n\n# LLM-as-judge output schema\n\n\nclass Grade(TypedDict):\n    \"\"\"Compare the expected and actual answers and grade the actual answer.\"\"\"\n    reasoning: Annotated[str, ...,\n                         \"Explain your reasoning for whether the actual response is correct or not.\"]\n    is_correct: Annotated[bool, ...,\n                          \"True if the student response is mostly or exactly correct, otherwise False.\"]\n\n\ngrader_llm = llm.with_structured_output(Grade)\n# PUBLIC API\n\n\ndef transform_dataset_inputs(inputs: dict) -> dict:\n    \"\"\"Transform LangSmith dataset inputs to match the agent's input schema before invoking the agent.\"\"\"\n    # see the `Example input` in the README for reference on what `inputs` dict should look like\n    # the dataset inputs already match the agent's input schema, but you can add any additional processing here\n    return inputs\n\n\ndef transform_agent_outputs(outputs: dict) -> dict:\n    \"\"\"Transform agent outputs to match the LangSmith dataset output schema.\"\"\"\n    # see the `Example output` in the README for reference on what the output should look like\n    return {\"info\": outputs[\"info\"]}\n\n# Evaluator function\n\n\nasync def evaluate_agent(inputs: dict, outputs: dict, reference_outputs: dict) -> bool:\n    \"\"\"Evaluate if the final response is equivalent to reference response.\"\"\"\n\n    # Note that we assume the outputs has a 'response' dictionary. We'll need to make sure\n    # that the target function we define includes this key.\n    user = f\"\"\"QUESTION: {inputs['question']}\n    GROUND TRUTH RESPONSE: {reference_outputs['answer']}\n    STUDENT RESPONSE: {outputs['answer']}\"\"\"\n\n    grade = await grader_llm.ainvoke([{\"role\": \"system\", \"content\": EVALUATION_PROMPT}, {\"role\": \"user\", \"content\": user}])\n    is_correct = grade[\"is_correct\"]\n    return is_correct\n\n\n# Target function\nasync def run_graph(inputs: dict) -> dict:\n    \"\"\"Run graph and track the trajectory it takes along with the final response.\"\"\"\n    result = await graph.ainvoke({\n        \"question\": inputs[\"question\"]\n    })\n    return {\"answer\": result[\"answer\"].content}\n\n# run evaluation\n\n\nasync def run_eval(\n    dataset_name: str,\n    experiment_prefix: Optional[str] = None,\n) -> EvaluationResults:\n    dataset = client.read_dataset(dataset_name=dataset_name)\n    results = await aevaluate(\n        run_graph,\n        data=dataset,\n        evaluators=[evaluate_agent],\n        experiment_prefix=experiment_prefix,\n    )\n    return results\n\n\nasync def main():\n    experiment_results = await run_eval(dataset_name=DEFAULT_DATASET_NAME,\n                                        experiment_prefix=\"langchain-blogs-qa-evals\")\n\nif __name__ == \"__main__\":\n    import asyncio\n    asyncio.run(main())\n"
  },
  {
    "path": "ch10/py/agent_evaluation_sql.py",
    "content": "from agent_sql_graph import builder\nfrom langchain import hub\nfrom langchain_openai import ChatOpenAI\nfrom langsmith.evaluation import evaluate\nfrom langsmith.schemas import Example, Run\nfrom langchain_core.runnables import Runnable\nfrom agent_sql_graph import assistant_runnable\nimport uuid\n_printed = set()\nthread_id = str(uuid.uuid4())\nexperiment_prefix = \"sql-agent-gpt4o\"\nmetadata = \"chinook-gpt-4o-base-case-agent\"\nconfig = {\n    \"configurable\": {\n        # Checkpoints are accessed by thread_id\n        \"thread_id\": thread_id,\n    }\n}\n\n\ndef predict_sql_agent_answer(example: dict):\n    \"\"\"Use this for answer evaluation\"\"\"\n    msg = {\"messages\": (\"user\", example[\"input\"])}\n    messages = graph.invoke(msg, config)\n    return {\"response\": messages['messages'][-1].content}\n\n\n# Grade prompt\ngrade_prompt_answer_accuracy = hub.pull(\n    \"langchain-ai/rag-answer-vs-reference\")\n\n\ndef answer_evaluator(run, example) -> dict:\n    \"\"\"\n    A simple evaluator for RAG answer accuracy\n    \"\"\"\n\n    # Get question, ground truth answer, chain answer\n    input_question = example.inputs[\"input\"]\n    reference = example.outputs[\"output\"]\n    prediction = run.outputs[\"response\"]\n\n    # LLM grader\n    llm = ChatOpenAI(model=\"gpt-4o\", temperature=0)\n\n    # Structured prompt\n    answer_grader = grade_prompt_answer_accuracy | llm\n\n    # Run evaluator\n    score = answer_grader.invoke({\"question\": input_question,\n                                  \"correct_answer\": reference,\n                                  \"student_answer\": prediction})\n    score = score[\"Score\"]\n\n    return {\"key\": \"answer_v_reference_score\", \"score\": score}\n\n\ndataset_name = \"sql-agent-response\"\nexperiment_results = evaluate(\n    predict_sql_agent_answer,\n    data=dataset_name,\n    evaluators=[answer_evaluator],\n    num_repetitions=3,\n    experiment_prefix=experiment_prefix,\n    metadata={\"version\": metadata},\n)\n\n\n\"\"\"\nSingle tool evaluation\n\n\"\"\"\n\n\ndef predict_assistant(example: dict):\n    \"\"\"Invoke assistant for single tool call evaluation\"\"\"\n    msg = [(\"user\", example[\"input\"])]\n    result = assistant_runnable.invoke({\"messages\": msg})\n    return {\"response\": result}\n\n\ndef check_specific_tool_call(root_run: Run, example: Example) -> dict:\n    \"\"\"\n    Check if the first tool call in the response matches the expected tool call.\n    \"\"\"\n\n    # Exepected tool call\n    expected_tool_call = 'sql_db_list_tables'\n\n    # Run\n    response = root_run.outputs[\"response\"]\n\n    # Get tool call\n    try:\n        tool_call = getattr(response, 'tool_calls', [])[0]['name']\n\n    except (IndexError, KeyError):\n        tool_call = None\n\n    score = 1 if tool_call == expected_tool_call else 0\n    return {\"score\": score, \"key\": \"single_tool_call\"}\n\n\nexperiment_results = evaluate(\n    predict_assistant,\n    data=dataset_name,\n    evaluators=[check_specific_tool_call],\n    experiment_prefix=experiment_prefix + \"-single-tool\",\n    num_repetitions=3,\n    metadata={\"version\": metadata},\n)\n\n\n\"\"\"\nAgent trajectory evaluation\n\"\"\"\n\n\ndef predict_sql_agent_messages(example: dict):\n    \"\"\"Use this for answer evaluation\"\"\"\n    msg = {\"messages\": (\"user\", example[\"input\"])}\n    graph = builder.compile()\n    messages = graph.invoke(msg, config)\n    return {\"response\": messages}\n\n\ndef find_tool_calls(messages):\n    \"\"\"  \n    Find all tool calls in the messages returned \n    \"\"\"\n    tool_calls = [tc['name'] for m in messages['messages']\n                  for tc in getattr(m, 'tool_calls', [])]\n    return tool_calls\n\n\ndef contains_all_tool_calls_any_order(root_run: Run, example: Example) -> dict:\n    \"\"\"\n    Check if all expected tools are called in any order.\n    \"\"\"\n    expected = ['sql_db_list_tables', 'sql_db_schema',\n                'sql_db_query_checker', 'sql_db_query', 'check_result']\n    messages = root_run.outputs[\"response\"]\n    tool_calls = find_tool_calls(messages)\n    # Optionally, log the tool calls -\n    # print(\"Here are my tool calls:\")\n    # print(tool_calls)\n    if set(expected) <= set(tool_calls):\n        score = 1\n    else:\n        score = 0\n    return {\"score\": int(score), \"key\": \"multi_tool_call_any_order\"}\n\n\ndef contains_all_tool_calls_in_order(root_run: Run, example: Example) -> dict:\n    \"\"\"\n    Check if all expected tools are called in exact order.\n    \"\"\"\n    messages = root_run.outputs[\"response\"]\n    tool_calls = find_tool_calls(messages)\n    # Optionally, log the tool calls -\n    # print(\"Here are my tool calls:\")\n    # print(tool_calls)\n    it = iter(tool_calls)\n    expected = ['sql_db_list_tables', 'sql_db_schema',\n                'sql_db_query_checker', 'sql_db_query', 'check_result']\n    if all(elem in it for elem in expected):\n        score = 1\n    else:\n        score = 0\n    return {\"score\": int(score), \"key\": \"multi_tool_call_in_order\"}\n\n\ndef contains_all_tool_calls_in_order_exact_match(root_run: Run, example: Example) -> dict:\n    \"\"\"\n    Check if all expected tools are called in exact order and without any additional tool calls.\n    \"\"\"\n    expected = ['sql_db_list_tables', 'sql_db_schema',\n                'sql_db_query_checker', 'sql_db_query', 'check_result']\n    messages = root_run.outputs[\"response\"]\n    tool_calls = find_tool_calls(messages)\n    # Optionally, log the tool calls -\n    # print(\"Here are my tool calls:\")\n    # print(tool_calls)\n    if tool_calls == expected:\n        score = 1\n    else:\n        score = 0\n\n    return {\"score\": int(score), \"key\": \"multi_tool_call_in_exact_order\"}\n\n\nexperiment_results = evaluate(\n    predict_sql_agent_messages,\n    data=dataset_name,\n    evaluators=[contains_all_tool_calls_any_order, contains_all_tool_calls_in_order,\n                contains_all_tool_calls_in_order_exact_match],\n    experiment_prefix=experiment_prefix + \"-trajectory\",\n    num_repetitions=3,\n    metadata={\"version\": metadata},\n)\n"
  },
  {
    "path": "ch10/py/agent_sql_graph.py",
    "content": "from langgraph.checkpoint.sqlite import SqliteSaver\nfrom langgraph.graph import END, StateGraph\nfrom langgraph.prebuilt import ToolNode, tools_condition\nfrom langchain_core.messages import ToolMessage\nfrom langchain_core.runnables import RunnableLambda, Runnable, RunnableConfig\nfrom typing import Annotated\nfrom typing_extensions import TypedDict\nfrom langgraph.graph.message import AnyMessage, add_messages\nimport json\nfrom langchain_community.agent_toolkits import SQLDatabaseToolkit\nfrom langchain_core.messages import AIMessage\nfrom langchain_core.prompts import ChatPromptTemplate\nfrom langchain.agents import tool\nfrom langchain_openai import ChatOpenAI\nfrom langchain_community.utilities import SQLDatabase\n\ndb = SQLDatabase.from_uri(\"sqlite:///Chinook.db\")\nprint(db.dialect)\nprint(db.get_usable_table_names())\ndb.run(\"SELECT * FROM Artist LIMIT 10;\")\n# gpt4o\nllm = ChatOpenAI(model=\"gpt-4o\", temperature=0)\nexperiment_prefix = \"sql-agent-gpt4o\"\nmetadata = \"Chinook, gpt-4o agent\"\n# SQL toolkit\ntoolkit = SQLDatabaseToolkit(db=db, llm=llm)\ntools = toolkit.get_tools()\n\n# Query checking\nquery_check_system = \"\"\"You are a SQL expert with a strong attention to detail.\nDouble check the SQLite query for common mistakes, including:\n- Using NOT IN with NULL values\n- Using UNION when UNION ALL should have been used\n- Using BETWEEN for exclusive ranges\n- Data type mismatch in predicates\n- Properly quoting identifiers\n- Using the correct number of arguments for functions\n- Casting to the correct data type\n- Using the proper columns for joins\n\nIf there are any of the above mistakes, rewrite the query. If there are no mistakes, just reproduce the original query.\n\nExecute the correct query with the appropriate tool.\"\"\"\nquery_check_prompt = ChatPromptTemplate.from_messages(\n    [(\"system\", query_check_system), (\"user\", \"{query}\")])\nquery_check = query_check_prompt | llm\n\n\n@tool\ndef check_query_tool(query: str) -> str:\n    \"\"\"\n    Use this tool to double check if your query is correct before executing it.\n    \"\"\"\n    return query_check.invoke({\"query\": query}).content\n\n\n# Query result checking\nquery_result_check_system = \"\"\"You are grading the result of a SQL query from a DB. \n- Check that the result is not empty.\n- If it is empty, instruct the system to re-try!\"\"\"\nquery_result_check_prompt = ChatPromptTemplate.from_messages(\n    [(\"system\", query_result_check_system), (\"user\", \"{query_result}\")])\nquery_result_check = query_result_check_prompt | llm\n\n\n@tool\ndef check_result(query_result: str) -> str:\n    \"\"\"\n    Use this tool to check the query result from the database to confirm it is not empty and is relevant.\n    \"\"\"\n    return query_result_check.invoke({\"query_result\": query_result}).content\n\n\ntools.append(check_query_tool)\ntools.append(check_result)\n\n\nclass State(TypedDict):\n    messages: Annotated[list[AnyMessage], add_messages]\n\n\ndef create_tool_node_with_fallback(tools: list) -> dict:\n    return ToolNode(tools).with_fallbacks(\n        [RunnableLambda(handle_tool_error)], exception_key=\"error\"\n    )\n\n\ndef _print_event(event: dict, _printed: set, max_length=1500):\n    current_state = event.get(\"dialog_state\")\n    if current_state:\n        print(f\"Currently in: \", current_state[-1])\n    message = event.get(\"messages\")\n    if message:\n        if isinstance(message, list):\n            message = message[-1]\n        if message.id not in _printed:\n            msg_repr = message.pretty_repr(html=True)\n            if len(msg_repr) > max_length:\n                msg_repr = msg_repr[:max_length] + \" ... (truncated)\"\n            print(msg_repr)\n            _printed.add(message.id)\n\n\ndef handle_tool_error(state) -> dict:\n    error = state.get(\"error\")\n    tool_calls = state[\"messages\"][-1].tool_calls\n    return {\n        \"messages\": [\n            ToolMessage(\n                content=f\"Error: {repr(error)}\\n please fix your mistakes.\",\n                tool_call_id=tc[\"id\"],\n            )\n            for tc in tool_calls\n        ]\n    }\n\n\n# Assistant\nclass Assistant:\n\n    def __init__(self, runnable: Runnable):\n        self.runnable = runnable\n\n    def __call__(self, state: State, config: RunnableConfig):\n        while True:\n            # Append to state\n            state = {**state}\n            # Invoke the tool-calling LLM\n            result = self.runnable.invoke(state)\n            # If it is a tool call -> response is valid\n            # If it has meaninful text -> response is valid\n            # Otherwise, we re-prompt it b/c response is not meaninful\n            if not result.tool_calls and (\n                not result.content\n                or isinstance(result.content, list)\n                and not result.content[0].get(\"text\")\n            ):\n                messages = state[\"messages\"] + \\\n                    [(\"user\", \"Respond with a real output.\")]\n                state = {**state, \"messages\": messages}\n            else:\n                break\n        return {\"messages\": result}\n\n\n# Assistant runnable\nquery_gen_system = \"\"\"\nROLE:\nYou are an agent designed to interact with a SQL database. You have access to tools for interacting with the database.\nGOAL:\nGiven an input question, create a syntactically correct SQLite query to run, then look at the results of the query and return the answer.\nINSTRUCTIONS:\n- Only use the below tools for the following operations.\n- Only use the information returned by the below tools to construct your final answer.\n- To start you should ALWAYS look at the tables in the database to see what you can query. Do NOT skip this step.\n- Then you should query the schema of the most relevant tables.\n- Write your query based upon the schema of the tables. You MUST double check your query before executing it. \n- Unless the user specifies a specific number of examples they wish to obtain, always limit your query to at most 5 results.\n- You can order the results by a relevant column to return the most interesting examples in the database.\n- Never query for all the columns from a specific table, only ask for the relevant columns given the question.\n- If you get an error while executing a query, rewrite the query and try again.\n- If the query returns a result, use check_result tool to check the query result.\n- If the query result result is empty, think about the table schema, rewrite the query, and try again.\n- DO NOT make any DML statements (INSERT, UPDATE, DELETE, DROP etc.) to the database.\"\"\"\n\nquery_gen_prompt = ChatPromptTemplate.from_messages(\n    [(\"system\", query_gen_system), (\"placeholder\", \"{messages}\")])\nassistant_runnable = query_gen_prompt | llm.bind_tools(tools)\n\n\n# Graph\nbuilder = StateGraph(State)\n\n# Define nodes: these do the work\nbuilder.add_node(\"assistant\", Assistant(assistant_runnable))\nbuilder.add_node(\"tools\", create_tool_node_with_fallback(tools))\n\n# Define edges: these determine how the control flow moves\nbuilder.set_entry_point(\"assistant\")\nbuilder.add_conditional_edges(\n    \"assistant\",\n    # If the latest message (result) from assistant is a tool call -> tools_condition routes to tools\n    # If the latest message (result) from assistant is a not a tool call -> tools_condition routes to END\n    tools_condition,\n    # \"tools\" calls one of our tools. END causes the graph to terminate (and respond to the user)\n    {\"tools\": \"tools\", END: END},\n)\nbuilder.add_edge(\"tools\", \"assistant\")\n\n# The checkpointer lets the graph persist its state\nmemory = SqliteSaver.from_conn_string(\":memory:\")\ngraph = builder.compile(checkpointer=memory)\n"
  },
  {
    "path": "ch10/py/create_rag_dataset.py",
    "content": "from langsmith import wrappers, Client\nfrom pydantic import BaseModel, Field\nfrom openai import OpenAI\n\nclient = Client()\nopenai_client = wrappers.wrap_openai(OpenAI())\n\nexamples = [\n    {\n        \"question\": \"Which companies are highlighted as top LangGraph agent adopters in 2024?\",\n        \"answer\": \"The top adopters include Uber (code migration tools), AppFolio (property management copilot), LinkedIn (SQL Bot), Elastic (AI assistant), and Replit (multi-agent development platform) :cite[3].\"\n    },\n    {\n        \"question\": \"How did AppFolio's AI copilot impact property managers?\",\n        \"answer\": \"AppFolio's Realm-X AI copilot saved property managers over 10 hours per week by automating queries, bulk actions, and scheduling :cite[3].\"\n    },\n    {\n        \"question\": \"What infrastructure trends dominated LLM usage in 2024?\",\n        \"answer\": \"OpenAI remained the top LLM provider (6x more usage than Ollama), while open-source models via Ollama and Groq surged. Chroma and FAISS led vector stores, with MongoDB and Elastic gaining traction :cite[2]:cite[5].\"\n    },\n    {\n        \"question\": \"How did LangGraph improve agent workflows compared to 2023?\",\n        \"answer\": \"LangGraph usage grew to 43% of LangSmith organizations, with 21.9% of traces involving tool calls (up from 0.5% in 2023), enabling complex multi-step tasks like database writes :cite[2]:cite[7].\"\n    },\n    {\n        \"question\": \"What distinguishes Replit's LangGraph implementation?\",\n        \"answer\": \"Replit's agent emphasizes human-in-the-loop validation and a multi-agent architecture for code generation, combining autonomy with controlled outputs :cite[3].\"\n    }\n]\n\ninputs = [{\"question\": example[\"question\"]} for example in examples]\noutputs = [{\"answer\": example[\"answer\"]} for example in examples]\n\n# Programmatically create a dataset in LangSmith\ndataset = client.create_dataset(\n    dataset_name=\"langchain-blogs-qa\", description=\"Langchain blogs QA.\"\n)\n\n# Add examples to the dataset\nclient.create_examples(inputs=inputs, outputs=outputs, dataset_id=dataset.id)\n\nprint(\n    f\"Dataset created in langsmith with ID: {dataset.id}\\n Navigate to {dataset.url}.\")\n"
  },
  {
    "path": "ch10/py/create_sql_dataset.py",
    "content": "from langsmith import Client\n\nclient = Client()\n\n# Create a dataset\nexamples = [\n    (\"Which country's customers spent the most? And how much did they spend?\",\n     \"The country whose customers spent the most is the USA, with a total expenditure of $523.06\"),\n    (\"What was the most purchased track of 2013?\",\n     \"The most purchased track of 2013 was Hot Girl.\"),\n    (\"How many albums does the artist Led Zeppelin have?\",\n     \"Led Zeppelin has 14 albums\"),\n    (\"What is the total price for the album “Big Ones”?\",\n     \"The total price for the album 'Big Ones' is 14.85\"),\n    (\"Which sales agent made the most in sales in 2009?\",\n     \"Steve Johnson made the most sales in 2009\"),\n]\n\ndataset_name = \"sql-agent-response\"\nif not client.has_dataset(dataset_name=dataset_name):\n    dataset = client.create_dataset(dataset_name=dataset_name)\n    inputs, outputs = zip(\n        *[({\"input\": text}, {\"output\": label}) for text, label in examples]\n    )\n    client.create_examples(\n        inputs=inputs, outputs=outputs, dataset_id=dataset.id)\n"
  },
  {
    "path": "ch10/py/rag_graph.py",
    "content": "from typing import List, TypedDict\nfrom langchain_community.document_loaders import WebBaseLoader\nfrom langchain.schema import Document\nfrom langgraph.graph import END, StateGraph, START\nfrom langchain_community.vectorstores import InMemoryVectorStore\nfrom langchain_text_splitters import RecursiveCharacterTextSplitter\nfrom langchain_openai import OpenAIEmbeddings\nfrom langchain import hub\nfrom langchain_openai import ChatOpenAI\n\n\nclass GraphState(TypedDict):\n    \"\"\"\n    Represents the state of our graph.\n\n    Attributes:\n        question: question\n        scraped_documents: list of documents\n        vectorstore: vectorstore\n    \"\"\"\n\n    question: str\n    scraped_documents: List[str]\n    vectorstore: InMemoryVectorStore\n    answer: str\n\n\ndef scrape_blog_posts(state) -> List[Document]:\n    \"\"\"\n    Scrape the blog posts and create a list of documents\n    \"\"\"\n\n    urls = [\n        \"https://blog.langchain.dev/top-5-langgraph-agents-in-production-2024/\",\n        \"https://blog.langchain.dev/langchain-state-of-ai-2024/\",\n        \"https://blog.langchain.dev/introducing-ambient-agents/\",\n    ]\n\n    docs = [WebBaseLoader(url).load() for url in urls]\n    docs_list = [item for sublist in docs for item in sublist]\n\n    return {\"scraped_documents\": docs_list}\n\n\ndef indexing(state):\n    \"\"\"\n    Index the documents\n    \"\"\"\n    text_splitter = RecursiveCharacterTextSplitter.from_tiktoken_encoder(\n        chunk_size=250, chunk_overlap=0\n    )\n    doc_splits = text_splitter.split_documents(state[\"scraped_documents\"])\n\n# Add to vectorDB\n    vectorstore = InMemoryVectorStore.from_documents(\n        documents=doc_splits,\n        embedding=OpenAIEmbeddings(),\n    )\n    return {\"vectorstore\": vectorstore}\n\n\ndef retrieve_and_generate(state):\n    \"\"\"\n    Retrieve documents from vectorstore and generate answer\n    \"\"\"\n    question = state[\"question\"]\n    vectorstore = state[\"vectorstore\"]\n\n    retriever = vectorstore.as_retriever()\n\n    prompt = hub.pull(\"rlm/rag-prompt\")\n    llm = ChatOpenAI(model_name=\"gpt-3.5-turbo\", temperature=0)\n\n    # fetch relevant documents\n    docs = retriever.invoke(question)  # format prompt\n    formatted = prompt.invoke(\n        {\"context\": docs, \"question\": question})  # generate answer\n    answer = llm.invoke(formatted)\n    return {\"answer\": answer}\n\n\n# Graph\nworkflow = StateGraph(GraphState)\n\n# Define the nodes\nworkflow.add_node(\"retrieve_and_generate\", retrieve_and_generate)  # retrieve\nworkflow.add_node(\"scrape_blog_posts\", scrape_blog_posts)  # scrape web\nworkflow.add_node(\"indexing\", indexing)  # index\n\n# Build graph\nworkflow.add_edge(START, \"scrape_blog_posts\")\nworkflow.add_edge(\"scrape_blog_posts\", \"indexing\")\nworkflow.add_edge(\"indexing\", \"retrieve_and_generate\")\n\nworkflow.add_edge(\"retrieve_and_generate\", END)\n\n# Compile\ngraph = workflow.compile()\n"
  },
  {
    "path": "ch10/py/retrieve_and_grade.py",
    "content": "from langchain.text_splitter import RecursiveCharacterTextSplitter\nfrom langchain_community.document_loaders import WebBaseLoader\nfrom langchain_community.vectorstores import InMemoryVectorStore\nfrom langchain_openai import OpenAIEmbeddings\nfrom langchain_core.prompts import ChatPromptTemplate\nfrom pydantic import BaseModel, Field\nfrom langchain_openai import ChatOpenAI\n\n\n# --- Create an index of documents ---\n\nurls = [\n    \"https://blog.langchain.dev/top-5-langgraph-agents-in-production-2024/\",\n    \"https://blog.langchain.dev/langchain-state-of-ai-2024/\",\n    \"https://blog.langchain.dev/introducing-ambient-agents/\",\n]\n\ndocs = [WebBaseLoader(url).load() for url in urls]\ndocs_list = [item for sublist in docs for item in sublist]\n\ntext_splitter = RecursiveCharacterTextSplitter.from_tiktoken_encoder(\n    chunk_size=250, chunk_overlap=0\n)\ndoc_splits = text_splitter.split_documents(docs_list)\n\n# Add to vectorDB\nvectorstore = InMemoryVectorStore.from_documents(\n    documents=doc_splits,\n    embedding=OpenAIEmbeddings(),\n)\nretriever = vectorstore.as_retriever()\n\n# Retrieve the relevant documents\nresults = retriever.invoke(\n    \"What are 2 LangGraph agents used in production in 2024?\")\n\nprint(\"Results: \\n\", results)\n\n\n# --- Create a grader for retrieved documents ---\n\n# Data model\nclass GradeDocuments(BaseModel):\n    \"\"\"Binary score for relevance check on retrieved documents.\"\"\"\n\n    binary_score: str = Field(\n        description=\"Documents are relevant to the question, 'yes' or 'no'\"\n    )\n\n\n# LLM with structured output\nllm = ChatOpenAI(temperature=0)\nstructured_llm_grader = llm.with_structured_output(GradeDocuments)\n\n# Prompt\nsystem = \"\"\"You are a grader assessing relevance of a retrieved document to a user question.\nIf the document contains keyword(s) or semantic meaning related to the question, grade it as relevant.\nGive a binary score 'yes' or 'no' score to indicate whether the document is relevant to the question.\"\"\"\n\ngrade_prompt = ChatPromptTemplate.from_messages(\n    [\n        (\"system\", system),\n        (\"human\",\n         \"Retrieved document: \\n\\n {document} \\n\\n User question: {question}\"),\n    ]\n)\n\nretrieval_grader = grade_prompt | structured_llm_grader\n\n# --- Grade retrieved documents ---\n\nquestion = \"What are 2 LangGraph agents used in production in 2024?\"\n\n# as an example retrieval_grader.invoke({\"question\": question, \"document\": doc_txt})\ndocs = retriever.invoke(question)\n\ndoc_txt = docs[0].page_content\n\nresult = retrieval_grader.invoke({\"question\": question, \"document\": doc_txt})\n\nprint(\"\\n\\nGrade Result: \\n\", result)\n"
  },
  {
    "path": "ch10/py/search_graph.py",
    "content": "from typing import List, TypedDict\n\nfrom langchain_core.documents import Document\nfrom langchain_community.tools import DuckDuckGoSearchRun\nfrom langgraph.graph import END, StateGraph, START\n\nfrom retrieve_and_grade import retrieval_grader\nfrom retrieve_and_grade import retriever\nfrom langchain_core.output_parsers import StrOutputParser\nfrom langchain_openai import ChatOpenAI\nfrom langchain_core.prompts import ChatPromptTemplate\nfrom langchain_core.output_parsers import StrOutputParser\nfrom langchain import hub  # Prompt\n\nprompt = hub.pull(\"rlm/rag-prompt\")\n\n# LLM\nllm = ChatOpenAI(model_name=\"gpt-3.5-turbo\", temperature=0)\n\nrag_chain = prompt | llm | StrOutputParser()\n\n# Prompt\nsystem = \"\"\"You a question re-writer that converts an input question to a better version that is optimized \\n \n     for web search. Look at the input and try to reason about the underlying semantic intent / meaning.\"\"\"\nre_write_prompt = ChatPromptTemplate.from_messages(\n    [\n        (\"system\", system),\n        (\n            \"human\",\n            \"Here is the initial question: \\n\\n {question} \\n Formulate an improved question.\",\n        ),\n    ]\n)\n\nquestion_rewriter = re_write_prompt | llm | StrOutputParser()\n\n# --- Create the graph ---\n\nweb_search_tool = DuckDuckGoSearchRun()\n\n\nclass GraphState(TypedDict):\n    \"\"\"\n    Represents the state of our graph.\n\n    Attributes:\n        question: question\n        generation: LLM generation\n        web_search: whether to add search\n        documents: list of documents\n    \"\"\"\n\n    question: str\n    generation: str\n    web_search: str\n    documents: List[str]\n\n\ndef retrieve(state):\n    \"\"\"\n    Retrieve documents\n\n    Args:\n        state (dict): The current graph state\n\n    Returns:\n        state (dict): New key added to state, documents, that contains retrieved documents\n    \"\"\"\n    question = state[\"question\"]\n\n    # Retrieval\n    documents = retriever.invoke(question)\n    return {\"documents\": documents, \"question\": question}\n\n\ndef generate(state):\n    \"\"\"\n    Generate answer\n\n    Args:\n        state (dict): The current graph state\n\n    Returns:\n        state (dict): New key added to state, generation, that contains LLM generation\n    \"\"\"\n    question = state[\"question\"]\n    documents = state[\"documents\"]\n\n    # RAG generation\n    generation = rag_chain.invoke({\"context\": documents, \"question\": question})\n    return {\"documents\": documents, \"question\": question, \"generation\": generation}\n\n\ndef grade_documents(state):\n    \"\"\"\n    Determines whether the retrieved documents are relevant to the question.\n\n    Args:\n        state (dict): The current graph state\n\n    Returns:\n        state (dict): Updates documents key with only filtered relevant documents\n    \"\"\"\n\n    question = state[\"question\"]\n    documents = state[\"documents\"]\n\n    # Score each doc\n    filtered_docs = []\n    web_search = \"No\"\n    for d in documents:\n        score = retrieval_grader.invoke(\n            {\"question\": question, \"document\": d.page_content}\n        )\n        grade = score.binary_score\n        if grade == \"yes\":\n            print(\"---GRADE: DOCUMENT RELEVANT---\")\n            filtered_docs.append(d)\n        else:\n            print(\"---GRADE: DOCUMENT NOT RELEVANT---\")\n            web_search = \"Yes\"\n            continue\n    return {\"documents\": filtered_docs, \"question\": question, \"web_search\": web_search}\n\n\ndef transform_query(state):\n    \"\"\"\n    Transform the query to produce a better question.\n\n    Args:\n        state (dict): The current graph state\n\n    Returns:\n        state (dict): Updates question key with a re-phrased question\n    \"\"\"\n\n    question = state[\"question\"]\n    documents = state[\"documents\"]\n\n    # Re-write question\n    better_question = question_rewriter.invoke({\"question\": question})\n    return {\"documents\": documents, \"question\": better_question}\n\n\ndef web_search(state):\n    \"\"\"\n    Web search based on the re-phrased question.\n\n    Args:\n        state (dict): The current graph state\n\n    Returns:\n        state (dict): Updates documents key with appended web results\n    \"\"\"\n\n    print(\"---WEB SEARCH---\")\n    question = state[\"question\"]\n    documents = state[\"documents\"]\n\n    # Web search\n    docs = web_search_tool.invoke({\"query\": question})\n    web_results = \"\\n\".join([d[\"content\"] for d in docs])\n    web_results = Document(page_content=web_results)\n    documents.append(web_results)\n\n    return {\"documents\": documents, \"question\": question}\n\n\n# Edges\n\n\ndef decide_to_generate(state):\n    \"\"\"\n    Determines whether to generate an answer, or re-generate a question.\n\n    Args:\n        state (dict): The current graph state\n\n    Returns:\n        str: Binary decision for next node to call\n    \"\"\"\n\n    state[\"question\"]\n    web_search = state[\"web_search\"]\n    state[\"documents\"]\n\n    if web_search == \"Yes\":\n        # All documents have been filtered check_relevance\n        # We will re-generate a new query\n        return \"transform_query\"\n    else:\n        # We have relevant documents, so generate answer\n        return \"generate\"\n\n\n# Graph\n\nworkflow = StateGraph(GraphState)\n\n# Define the nodes\nworkflow.add_node(\"retrieve\", retrieve)  # retrieve\nworkflow.add_node(\"grade_documents\", grade_documents)  # grade documents\nworkflow.add_node(\"generate\", generate)  # generatae\nworkflow.add_node(\"transform_query\", transform_query)  # transform_query\nworkflow.add_node(\"web_search_node\", web_search)  # web search\n\n# Build graph\nworkflow.add_edge(START, \"retrieve\")\nworkflow.add_edge(\"retrieve\", \"grade_documents\")\nworkflow.add_conditional_edges(\n    \"grade_documents\",\n    decide_to_generate,\n    {\n        \"transform_query\": \"transform_query\",\n        \"generate\": \"generate\",\n    },\n)\nworkflow.add_edge(\"transform_query\", \"web_search_node\")\nworkflow.add_edge(\"web_search_node\", \"generate\")\nworkflow.add_edge(\"generate\", END)\n\n# Compile\napp = workflow.compile()\n"
  },
  {
    "path": "ch2/js/a-text-loader.js",
    "content": "import { TextLoader } from 'langchain/document_loaders/fs/text';\n\nconst loader = new TextLoader('./test.txt');\nconst docs = await loader.load();\n\nconsole.log(docs);\n"
  },
  {
    "path": "ch2/js/b-web-loader.js",
    "content": "import { CheerioWebBaseLoader } from '@langchain/community/document_loaders/web/cheerio';\n\nconst loader = new CheerioWebBaseLoader('https://www.langchain.com/');\nconst docs = await loader.load();\n\nconsole.log(docs);\n"
  },
  {
    "path": "ch2/js/c-pdf-loader.js",
    "content": "// install the pdf parsing library: npm install pdf-parse\nimport { PDFLoader } from '@langchain/community/document_loaders/fs/pdf';\n\nconst loader = new PDFLoader('./test.pdf');\nconst docs = await loader.load();\n\nconsole.log(docs);\n"
  },
  {
    "path": "ch2/js/d-rec-text-splitter.js",
    "content": "import { TextLoader } from 'langchain/document_loaders/fs/text';\nimport { RecursiveCharacterTextSplitter } from '@langchain/textsplitters';\n\nconst loader = new TextLoader('./test.txt'); // or any other loader\nconst docs = await loader.load();\n\nconst splitter = new RecursiveCharacterTextSplitter({\n  chunkSize: 1000,\n  chunkOverlap: 200,\n});\n\nconst splittedDocs = await splitter.splitDocuments(docs);\n\nconsole.log(splittedDocs);\n"
  },
  {
    "path": "ch2/js/e-rec-text-splitter-code.js",
    "content": "import { RecursiveCharacterTextSplitter } from '@langchain/textsplitters';\n\nconst PYTHON_CODE = ` def hello_world(): print(\"Hello, World!\") # Call the function hello_world() `;\n\nconst pythonSplitter = RecursiveCharacterTextSplitter.fromLanguage('python', {\n  chunkSize: 50,\n  chunkOverlap: 0,\n});\n\nconst pythonDocs = await pythonSplitter.createDocuments([PYTHON_CODE]);\n\nconsole.log(pythonDocs);\n"
  },
  {
    "path": "ch2/js/f-markdown-splitter.js",
    "content": "import { RecursiveCharacterTextSplitter } from '@langchain/textsplitters';\n\nconst markdownText = ` # 🦜🔗 LangChain ⚡ Building applications with LLMs through composability ⚡ ## Quick Install \\`\\`\\`bash pip install langchain \\`\\`\\` As an open source project in a rapidly developing field, we are extremely open to contributions. `;\n\nconst mdSplitter = RecursiveCharacterTextSplitter.fromLanguage('markdown', {\n  chunkSize: 60,\n  chunkOverlap: 0,\n});\n\nconst mdDocs = await mdSplitter.createDocuments(\n  [markdownText],\n  [{ source: 'https://www.langchain.com' }]\n);\n\nconsole.log(mdDocs);\n"
  },
  {
    "path": "ch2/js/g-embeddings.js",
    "content": "import { OpenAIEmbeddings } from '@langchain/openai';\n\nconst model = new OpenAIEmbeddings();\nconst embeddings = await model.embedDocuments([\n  'Hi there!',\n  'Oh, hello!',\n  \"What's your name?\",\n  'My friends call me World',\n  'Hello World!',\n]);\n\nconsole.log(embeddings);\n"
  },
  {
    "path": "ch2/js/h-load-split-embed.js",
    "content": "import { TextLoader } from 'langchain/document_loaders/fs/text';\nimport { RecursiveCharacterTextSplitter } from '@langchain/textsplitters';\nimport { OpenAIEmbeddings } from '@langchain/openai';\n\nconst loader = new TextLoader('./test.txt');\nconst docs = await loader.load();\n\n// Split the document\nconst splitter = new RecursiveCharacterTextSplitter({\n  chunkSize: 1000,\n  chunkOverlap: 200,\n});\nconst chunks = await splitter.splitDocuments(docs);\n\nconsole.log(chunks);\n\n// Generate embeddings\nconst model = new OpenAIEmbeddings();\nconst embeddings = await model.embedDocuments(chunks.map((c) => c.pageContent));\n\nconsole.log(embeddings);\n"
  },
  {
    "path": "ch2/js/i-pg-vector.js",
    "content": "/** \n1. Ensure docker is installed and running (https://docs.docker.com/get-docker/)\n2. Run the following command to start the postgres container:\n   \ndocker run \\\n    --name pgvector-container \\\n    -e POSTGRES_USER=langchain \\\n    -e POSTGRES_PASSWORD=langchain \\\n    -e POSTGRES_DB=langchain \\\n    -p 6024:5432 \\\n    -d pgvector/pgvector:pg16\n3. Use the connection string below for the postgres container\n*/\n\nimport { TextLoader } from 'langchain/document_loaders/fs/text';\nimport { RecursiveCharacterTextSplitter } from '@langchain/textsplitters';\nimport { OpenAIEmbeddings } from '@langchain/openai';\nimport { PGVectorStore } from '@langchain/community/vectorstores/pgvector';\nimport { v4 as uuidv4 } from 'uuid';\n\nconst connectionString =\n  'postgresql://langchain:langchain@localhost:6024/langchain';\n// Load the document, split it into chunks\nconst loader = new TextLoader('./test.txt');\nconst raw_docs = await loader.load();\nconst splitter = new RecursiveCharacterTextSplitter({\n  chunkSize: 1000,\n  chunkOverlap: 200,\n});\nconst docs = await splitter.splitDocuments(raw_docs);\n\n// embed each chunk and insert it into the vector store\nconst model = new OpenAIEmbeddings();\nconst db = await PGVectorStore.fromDocuments(docs, model, {\n  postgresConnectionOptions: {\n    connectionString,\n  },\n});\n\nconsole.log('Vector store created successfully');\n\nconst results = await db.similaritySearch('query', 4);\n\nconsole.log(`Similarity search results: ${JSON.stringify(results)}`);\n\nconsole.log('Adding documents to the vector store');\n\nconst ids = [uuidv4(), uuidv4()];\n\nawait db.addDocuments(\n  [\n    {\n      pageContent: 'there are cats in the pond',\n      metadata: { location: 'pond', topic: 'animals' },\n    },\n    {\n      pageContent: 'ducks are also found in the pond',\n      metadata: { location: 'pond', topic: 'animals' },\n    },\n  ],\n  { ids }\n);\n\nconsole.log('Documents added successfully');\n\nawait db.delete({ ids: [ids[1]] });\n\nconsole.log('second document deleted successfully');\n"
  },
  {
    "path": "ch2/js/j-record-manager.js",
    "content": "/** \n1. Ensure docker is installed and running (https://docs.docker.com/get-docker/)\n2. Run the following command to start the postgres container:\n   \ndocker run \\\n    --name pgvector-container \\\n    -e POSTGRES_USER=langchain \\\n    -e POSTGRES_PASSWORD=langchain \\\n    -e POSTGRES_DB=langchain \\\n    -p 6024:5432 \\\n    -d pgvector/pgvector:pg16\n3. Use the connection string below for the postgres container\n*/\n\nimport { PostgresRecordManager } from '@langchain/community/indexes/postgres';\nimport { index } from 'langchain/indexes';\nimport { OpenAIEmbeddings } from '@langchain/openai';\nimport { PGVectorStore } from '@langchain/community/vectorstores/pgvector';\nimport { v4 as uuidv4 } from 'uuid';\n\nconst tableName = 'test_langchain';\nconst connectionString =\n  'postgresql://langchain:langchain@localhost:6024/langchain';\n// Load the document, split it into chunks\n\nconst config = {\n  postgresConnectionOptions: {\n    connectionString,\n  },\n  tableName: tableName,\n  columns: {\n    idColumnName: 'id',\n    vectorColumnName: 'vector',\n    contentColumnName: 'content',\n    metadataColumnName: 'metadata',\n  },\n};\n\nconst vectorStore = await PGVectorStore.initialize(\n  new OpenAIEmbeddings(),\n  config\n);\n\n// Create a new record manager\nconst recordManagerConfig = {\n  postgresConnectionOptions: {\n    connectionString,\n  },\n  tableName: 'upsertion_records',\n};\nconst recordManager = new PostgresRecordManager(\n  'test_namespace',\n  recordManagerConfig\n);\n\n// Create the schema if it doesn't exist\nawait recordManager.createSchema();\n\nconst docs = [\n  {\n    pageContent: 'there are cats in the pond',\n    metadata: { id: uuidv4(), source: 'cats.txt' },\n  },\n  {\n    pageContent: 'ducks are also found in the pond',\n    metadata: { id: uuidv4(), source: 'ducks.txt' },\n  },\n];\n\n// the first attempt will index both documents\nconst index_attempt_1 = await index({\n  docsSource: docs,\n  recordManager,\n  vectorStore,\n  options: {\n    cleanup: 'incremental', // prevent duplicate documents by id from being indexed\n    sourceIdKey: 'source', // the key in the metadata that will be used to identify the document\n  },\n});\n\nconsole.log(index_attempt_1);\n\n// the second attempt will skip indexing because the identical documents already exist\nconst index_attempt_2 = await index({\n  docsSource: docs,\n  recordManager,\n  vectorStore,\n  options: {\n    cleanup: 'incremental',\n    sourceIdKey: 'source',\n  },\n});\n\nconsole.log(index_attempt_2);\n\n// If we mutate a document, the new version will be written and all old versions sharing the same source will be deleted.\ndocs[0].pageContent = 'I modified the first document content';\nconst index_attempt_3 = await index({\n  docsSource: docs,\n  recordManager,\n  vectorStore,\n  options: {\n    cleanup: 'incremental',\n    sourceIdKey: 'source',\n  },\n});\n\nconsole.log(index_attempt_3);\n"
  },
  {
    "path": "ch2/js/k-multi-vector-retriever.js",
    "content": "import * as uuid from 'uuid';\nimport { MultiVectorRetriever } from 'langchain/retrievers/multi_vector';\nimport { OpenAIEmbeddings } from '@langchain/openai';\nimport { RecursiveCharacterTextSplitter } from '@langchain/textsplitters';\nimport { InMemoryStore } from '@langchain/core/stores';\nimport { TextLoader } from 'langchain/document_loaders/fs/text';\nimport { Document } from '@langchain/core/documents';\nimport { PGVectorStore } from '@langchain/community/vectorstores/pgvector';\nimport { ChatOpenAI } from '@langchain/openai';\nimport { PromptTemplate } from '@langchain/core/prompts';\nimport { RunnableSequence } from '@langchain/core/runnables';\nimport { StringOutputParser } from '@langchain/core/output_parsers';\n\nconst connectionString =\n  'postgresql://langchain:langchain@localhost:6024/langchain';\nconst collectionName = 'summaries';\n\nconst textLoader = new TextLoader('./test.txt');\nconst parentDocuments = await textLoader.load();\nconst splitter = new RecursiveCharacterTextSplitter({\n  chunkSize: 10000,\n  chunkOverlap: 20,\n});\nconst docs = await splitter.splitDocuments(parentDocuments);\n\nconst prompt = PromptTemplate.fromTemplate(\n  `Summarize the following document:\\n\\n{doc}`\n);\n\nconst llm = new ChatOpenAI({ modelName: 'gpt-3.5-turbo' });\n\nconst chain = RunnableSequence.from([\n  { doc: (doc) => doc.pageContent },\n  prompt,\n  llm,\n  new StringOutputParser(),\n]);\n\n// batch summarization chain across the chunks\nconst summaries = await chain.batch(docs, {\n  maxConcurrency: 5,\n});\n\nconst idKey = 'doc_id';\nconst docIds = docs.map((_) => uuid.v4());\n// create summary docs with metadata linking to the original docs\nconst summaryDocs = summaries.map((summary, i) => {\n  const summaryDoc = new Document({\n    pageContent: summary,\n    metadata: {\n      [idKey]: docIds[i],\n    },\n  });\n  return summaryDoc;\n});\n\n// The byteStore to use to store the original chunks\nconst byteStore = new InMemoryStore();\n\n// vector store for the summaries\nconst vectorStore = await PGVectorStore.fromDocuments(\n  docs,\n  new OpenAIEmbeddings(),\n  {\n    postgresConnectionOptions: {\n      connectionString,\n    },\n  }\n);\n\nconst retriever = new MultiVectorRetriever({\n  vectorstore: vectorStore,\n  byteStore,\n  idKey,\n});\n\nconst keyValuePairs = docs.map((originalDoc, i) => [docIds[i], originalDoc]);\n\n// Use the retriever to add the original chunks to the document store\nawait retriever.docstore.mset(keyValuePairs);\n\n// Vectorstore alone retrieves the small chunks\nconst vectorstoreResult = await retriever.vectorstore.similaritySearch(\n  'chapter on philosophy',\n  2\n);\nconsole.log(`summary: ${vectorstoreResult[0].pageContent}`);\nconsole.log(\n  `summary retrieved length: ${vectorstoreResult[0].pageContent.length}`\n);\n\n// Retriever returns larger chunk result\nconst retrieverResult = await retriever.invoke('chapter on philosophy');\nconsole.log(\n  `multi-vector retrieved chunk length: ${retrieverResult[0].pageContent.length}`\n);\n"
  },
  {
    "path": "ch2/py/a-text-loader.py",
    "content": "from langchain_community.document_loaders import TextLoader\n\nloader = TextLoader('./test.txt', encoding=\"utf-8\")\ndocs = loader.load()\n\nprint(docs)\n"
  },
  {
    "path": "ch2/py/b-web-loader.py",
    "content": "\"\"\"\nInstall the beautifulsoup4 package:\n\n```bash\npip install beautifulsoup4\n```\n\"\"\"\n\nfrom langchain_community.document_loaders import WebBaseLoader\n\nloader = WebBaseLoader('https://www.langchain.com/')\ndocs = loader.load()\n\nprint(docs)\n"
  },
  {
    "path": "ch2/py/c-pdf-loader.py",
    "content": "# install the pdf parsing library !pip install pypdf\n\nfrom langchain_community.document_loaders import PyPDFLoader\n\nloader = PyPDFLoader('./test.pdf')\npages = loader.load()\n\nprint(pages)\n"
  },
  {
    "path": "ch2/py/d-rec-text-splitter.py",
    "content": "from langchain_text_splitters import RecursiveCharacterTextSplitter\n\nfrom langchain_community.document_loaders import TextLoader\n\nloader = TextLoader('./test.txt', encoding=\"utf-8\")\ndocs = loader.load()\n\nsplitter = RecursiveCharacterTextSplitter(chunk_size=1000, chunk_overlap=200)\nsplitted_docs = splitter.split_documents(docs)\n\nprint(splitted_docs)\n"
  },
  {
    "path": "ch2/py/e-rec-text-splitter-code.py",
    "content": "from langchain_text_splitters import (\n    Language,\n    RecursiveCharacterTextSplitter,\n)\n\nPYTHON_CODE = \"\"\" def hello_world(): print(\"Hello, World!\") # Call the function hello_world() \"\"\"\n\npython_splitter = RecursiveCharacterTextSplitter.from_language(\n    language=Language.PYTHON, chunk_size=50, chunk_overlap=0\n)\n\npython_docs = python_splitter.create_documents([PYTHON_CODE])\n\nprint(python_docs)\n"
  },
  {
    "path": "ch2/py/f-markdown-splitter.py",
    "content": "from langchain_text_splitters import (\n    Language,\n    RecursiveCharacterTextSplitter,\n)\nmarkdown_text = \"\"\" # 🦜🔗 LangChain ⚡ Building applications with LLMs through composability ⚡ ## Quick Install ```bash pip install langchain ``` As an open source project in a rapidly developing field, we are extremely open     to contributions. \"\"\"\n\nmd_splitter = RecursiveCharacterTextSplitter.from_language(\n    language=Language.MARKDOWN, chunk_size=60, chunk_overlap=0\n)\n\nmd_docs = md_splitter.create_documents(\n    [markdown_text], [{\"source\": \"https://www.langchain.com\"}])\n\nprint(md_docs)\n"
  },
  {
    "path": "ch2/py/g-embeddings.py",
    "content": "from langchain_openai import OpenAIEmbeddings\n\nmodel = OpenAIEmbeddings(model=\"text-embedding-3-small\")\nembeddings = model.embed_documents([\n    \"Hi there!\",\n    \"Oh, hello!\",\n    \"What's your name?\",\n    \"My friends call me World\",\n    \"Hello World!\"\n])\n\nprint(embeddings)\n"
  },
  {
    "path": "ch2/py/h-load-split-embed.py",
    "content": "from langchain_community.document_loaders import TextLoader\nfrom langchain_text_splitters import RecursiveCharacterTextSplitter\nfrom langchain_openai import OpenAIEmbeddings\n\n# Load the document\nloader = TextLoader(\"./test.txt\", encoding=\"utf-8\")\ndoc = loader.load()\n\n# Split the document\nsplitter = RecursiveCharacterTextSplitter(chunk_size=1000, chunk_overlap=200)\nchunks = splitter.split_documents(doc)\n\n# Generate embeddings\nembeddings_model = OpenAIEmbeddings(model=\"text-embedding-3-small\")\nembeddings = embeddings_model.embed_documents(\n    [chunk.page_content for chunk in chunks]\n)\n\nprint(embeddings)\n"
  },
  {
    "path": "ch2/py/i-pg-vector.py",
    "content": "\"\"\"\n1. Ensure docker is installed and running (https://docs.docker.com/get-docker/)\n2. pip install -qU langchain_postgres\n3. Run the following command to start the postgres container:\n   \ndocker run \\\n    --name pgvector-container \\\n    -e POSTGRES_USER=langchain \\\n    -e POSTGRES_PASSWORD=langchain \\\n    -e POSTGRES_DB=langchain \\\n    -p 6024:5432 \\\n    -d pgvector/pgvector:pg16\n4. Use the connection string below for the postgres container\n\n\"\"\"\n\nfrom langchain_community.document_loaders import TextLoader\nfrom langchain_openai import OpenAIEmbeddings\nfrom langchain_text_splitters import RecursiveCharacterTextSplitter\nfrom langchain_postgres.vectorstores import PGVector\nfrom langchain_core.documents import Document\nimport uuid\n\n\n# See docker command above to launch a postgres instance with pgvector enabled.\nconnection = \"postgresql+psycopg://langchain:langchain@localhost:6024/langchain\"\n\n# Load the document, split it into chunks\nraw_documents = TextLoader('./test.txt', encoding=\"utf-8\").load()\ntext_splitter = RecursiveCharacterTextSplitter(\n    chunk_size=1000, chunk_overlap=200)\ndocuments = text_splitter.split_documents(raw_documents)\n\n# Create embeddings for the documents\nembeddings_model = OpenAIEmbeddings()\n\ndb = PGVector.from_documents(\n    documents, embeddings_model, connection=connection)\n\nresults = db.similarity_search(\"query\", k=4)\n\nprint(results)\n\nprint(\"Adding documents to the vector store\")\nids = [str(uuid.uuid4()), str(uuid.uuid4())]\ndb.add_documents(\n    [\n        Document(\n            page_content=\"there are cats in the pond\",\n            metadata={\"location\": \"pond\", \"topic\": \"animals\"},\n        ),\n        Document(\n            page_content=\"ducks are also found in the pond\",\n            metadata={\"location\": \"pond\", \"topic\": \"animals\"},\n        ),\n    ],\n    ids=ids,\n)\n\nprint(\"Documents added successfully.\\n Fetched documents count:\",\n      len(db.get_by_ids(ids)))\n\nprint(\"Deleting document with id\", ids[1])\ndb.delete({\"ids\": ids})\n\nprint(\"Document deleted successfully.\\n Fetched documents count:\",\n      len(db.get_by_ids(ids)))\n"
  },
  {
    "path": "ch2/py/j-record-manager.py",
    "content": "from langchain.indexes import SQLRecordManager, index\nfrom langchain_postgres.vectorstores import PGVector\nfrom langchain_openai import OpenAIEmbeddings\nfrom langchain.docstore.document import Document\n\nconnection = \"postgresql+psycopg://langchain:langchain@localhost:6024/langchain\"\ncollection_name = \"my_docs\"\nembeddings_model = OpenAIEmbeddings(model=\"text-embedding-3-small\")\nnamespace = \"my_docs_namespace\"\n\nvectorstore = PGVector(\n    embeddings=embeddings_model,\n    collection_name=collection_name,\n    connection=connection,\n    use_jsonb=True,\n)\n\nrecord_manager = SQLRecordManager(\n    namespace,\n    db_url=\"postgresql+psycopg://langchain:langchain@localhost:6024/langchain\",\n)\n\n# Create the schema if it doesn't exist\nrecord_manager.create_schema()\n\n# Create documents\ndocs = [\n    Document(page_content='there are cats in the pond', metadata={\n             \"id\": 1, \"source\": \"cats.txt\"}),\n    Document(page_content='ducks are also found in the pond', metadata={\n             \"id\": 2, \"source\": \"ducks.txt\"}),\n]\n\n# Index the documents\nindex_1 = index(\n    docs,\n    record_manager,\n    vectorstore,\n    cleanup=\"incremental\",  # prevent duplicate documents\n    source_id_key=\"source\",  # use the source field as the source_id\n)\n\nprint(\"Index attempt 1:\", index_1)\n\n# second time you attempt to index, it will not add the documents again\nindex_2 = index(\n    docs,\n    record_manager,\n    vectorstore,\n    cleanup=\"incremental\",\n    source_id_key=\"source\",\n)\n\nprint(\"Index attempt 2:\", index_2)\n\n# If we mutate a document, the new version will be written and all old versions sharing the same source will be deleted.\n\ndocs[0].page_content = \"I just modified this document!\"\n\nindex_3 = index(\n    docs,\n    record_manager,\n    vectorstore,\n    cleanup=\"incremental\",\n    source_id_key=\"source\",\n)\n\nprint(\"Index attempt 3:\", index_3)\n"
  },
  {
    "path": "ch2/py/k-multi-vector-retriever.py",
    "content": "from langchain_community.document_loaders import TextLoader\nfrom langchain_text_splitters import RecursiveCharacterTextSplitter\nfrom langchain_openai import OpenAIEmbeddings\nfrom langchain_postgres.vectorstores import PGVector\nfrom langchain_core.output_parsers import StrOutputParser\nfrom langchain_core.prompts import ChatPromptTemplate\nfrom pydantic import BaseModel\nfrom langchain_core.runnables import RunnablePassthrough\nfrom langchain_openai import ChatOpenAI\nfrom langchain_core.documents import Document\nfrom langchain.retrievers.multi_vector import MultiVectorRetriever\nfrom langchain.storage import InMemoryStore\nimport uuid\n\nconnection = \"postgresql+psycopg://langchain:langchain@localhost:6024/langchain\"\ncollection_name = \"summaries\"\nembeddings_model = OpenAIEmbeddings()\n# Load the document\nloader = TextLoader(\"./test.txt\", encoding=\"utf-8\")\ndocs = loader.load()\n\nprint(\"length of loaded docs: \", len(docs[0].page_content))\n# Split the document\nsplitter = RecursiveCharacterTextSplitter(chunk_size=1000, chunk_overlap=200)\nchunks = splitter.split_documents(docs)\n\n# The rest of your code remains the same, starting from:\nprompt_text = \"Summarize the following document:\\n\\n{doc}\"\n\nprompt = ChatPromptTemplate.from_template(prompt_text)\nllm = ChatOpenAI(temperature=0, model=\"gpt-3.5-turbo\")\nsummarize_chain = {\n    \"doc\": lambda x: x.page_content} | prompt | llm | StrOutputParser()\n\n# batch the chain across the chunks\nsummaries = summarize_chain.batch(chunks, {\"max_concurrency\": 5})\n\n# The vectorstore to use to index the child chunks\nvectorstore = PGVector(\n    embeddings=embeddings_model,\n    collection_name=collection_name,\n    connection=connection,\n    use_jsonb=True,\n)\n# The storage layer for the parent documents\nstore = InMemoryStore()\nid_key = \"doc_id\"\n\n# indexing the summaries in our vector store, whilst retaining the original documents in our document store:\nretriever = MultiVectorRetriever(\n    vectorstore=vectorstore,\n    docstore=store,\n    id_key=id_key,\n)\n\n# Changed from summaries to chunks since we need same length as docs\ndoc_ids = [str(uuid.uuid4()) for _ in chunks]\n\n# Each summary is linked to the original document by the doc_id\nsummary_docs = [\n    Document(page_content=s, metadata={id_key: doc_ids[i]})\n    for i, s in enumerate(summaries)\n]\n\n# Add the document summaries to the vector store for similarity search\nretriever.vectorstore.add_documents(summary_docs)\n\n# Store the original documents in the document store, linked to their summaries via doc_ids\n# This allows us to first search summaries efficiently, then fetch the full docs when needed\nretriever.docstore.mset(list(zip(doc_ids, chunks)))\n\n# vector store retrieves the summaries\nsub_docs = retriever.vectorstore.similarity_search(\n    \"chapter on philosophy\", k=2)\n\nprint(\"sub docs: \", sub_docs[0].page_content)\n\nprint(\"length of sub docs:\\n\", len(sub_docs[0].page_content))\n\n# Whereas the retriever will return the larger source document chunks:\nretrieved_docs = retriever.invoke(\"chapter on philosophy\")\n\nprint(\"length of retrieved docs: \", len(retrieved_docs[0].page_content))\n"
  },
  {
    "path": "ch2/py/l-rag-colbert.py",
    "content": "\"\"\"\n- Windows is not supported. RAGatouille doesn't appear to work outside WSL and has issues with WSL1. Some users have had success running RAGatouille in WSL2.\n- Only on python.\n- Read full docs here: https://github.com/AnswerDotAI/RAGatouille/blob/8183aad64a9a6ba805d4066dcab489d97615d316/README.md\n\n- To install run:\n\n```bash\npip install -U ragatouille transformers\n```\n\"\"\"\nfrom ragatouille import RAGPretrainedModel\nimport requests\n\nRAG = RAGPretrainedModel.from_pretrained(\"colbert-ir/colbertv2.0\")\n\n\ndef get_wikipedia_page(title: str):\n    \"\"\"\n    Retrieve the full text content of a Wikipedia page.\n    :param title: str - Title of the Wikipedia page.\n    :return: str - Full text content of the page as raw string.\n    \"\"\"\n    # Wikipedia API endpoint\n    URL = \"https://en.wikipedia.org/w/api.php\"\n    # Parameters for the API request\n    params = {\n        \"action\": \"query\",\n        \"format\": \"json\",\n        \"titles\": title,\n        \"prop\": \"extracts\",\n        \"explaintext\": True,\n    }\n    # Custom User-Agent header to comply with Wikipedia's best practices\n    headers = {\"User-Agent\": \"RAGatouille_tutorial/0.0.1\"}\n    response = requests.get(URL, params=params, headers=headers)\n    data = response.json()\n    # Extracting page content\n    page = next(iter(data[\"query\"][\"pages\"].values()))\n    return page[\"extract\"] if \"extract\" in page else None\n\n\nfull_document = get_wikipedia_page(\"Hayao_Miyazaki\")\n# Create an index\nRAG.index(\n    collection=[full_document],\n    index_name=\"Miyazaki-123\",\n    max_document_length=180,\n    split_documents=True,\n)\n# query\nresults = RAG.search(query=\"What animation studio did Miyazaki found?\", k=3)\n\nprint(results)\n\n# Alternative: Utilize langchain retriever\nretriever = RAG.as_langchain_retriever(k=3)\nretriever.invoke(\"What animation studio did Miyazaki found?\")\n"
  },
  {
    "path": "ch3/js/a-basic-rag.js",
    "content": "/** \n1. Ensure docker is installed and running (https://docs.docker.com/get-docker/)\n2. Run the following command to start the postgres container:\n   \ndocker run \\\n    --name pgvector-container \\\n    -e POSTGRES_USER=langchain \\\n    -e POSTGRES_PASSWORD=langchain \\\n    -e POSTGRES_DB=langchain \\\n    -p 6024:5432 \\\n    -d pgvector/pgvector:pg16\n3. Use the connection string below for the postgres container\n*/\n\nimport { TextLoader } from 'langchain/document_loaders/fs/text';\nimport { RecursiveCharacterTextSplitter } from '@langchain/textsplitters';\nimport { OpenAIEmbeddings } from '@langchain/openai';\nimport { PGVectorStore } from '@langchain/community/vectorstores/pgvector';\nimport { ChatPromptTemplate } from '@langchain/core/prompts';\nimport { ChatOpenAI } from '@langchain/openai';\nimport { RunnableLambda } from '@langchain/core/runnables';\nconst connectionString =\n  'postgresql://langchain:langchain@localhost:6024/langchain';\n// Load the document, split it into chunks\nconst loader = new TextLoader('./test.txt');\nconst raw_docs = await loader.load();\nconst splitter = new RecursiveCharacterTextSplitter({\n  chunkSize: 1000,\n  chunkOverlap: 200,\n});\nconst splitDocs = await splitter.splitDocuments(raw_docs);\n\n// embed each chunk and insert it into the vector store\nconst model = new OpenAIEmbeddings();\n\nconst db = await PGVectorStore.fromDocuments(splitDocs, model, {\n  postgresConnectionOptions: {\n    connectionString,\n  },\n});\n\n// retrieve 2 relevant documents from the vector store\nconst retriever = db.asRetriever({ k: 2 });\n\nconst query =\n  'Who are the key figures in the ancient greek history of philosophy?';\n\n// fetch relevant documents\nconst docs = await retriever.invoke(query);\n\nconsole.log(\n  `fetched document based on similarity search query:\\n ${docs[0].pageContent}\\n\\n`\n);\n\n/**\n * Provide retrieved docs as context to the LLM to answer a user's question\n */\nconst prompt = ChatPromptTemplate.fromTemplate(\n  'Answer the question based only on the following context:\\n {context}\\n\\nQuestion: {question}'\n);\n\nconst llm = new ChatOpenAI({ temperature: 0, modelName: 'gpt-3.5-turbo' });\nconst chain = prompt.pipe(llm);\n\nconst result = await chain.invoke({\n  context: docs,\n  question: query,\n});\n\nconsole.log(result);\nconsole.log('\\n\\n');\n\n// run again but this time encapsulate the logic for efficiency\n\nconsole.log(\n  'Running again but this time encapsulate the logic for efficiency\\n'\n);\nconst qa = RunnableLambda.from(async (input) => {\n  // fetch relevant documents\n  const docs = await retriever.invoke(input);\n  // format prompt\n  const formatted = await prompt.invoke({ context: docs, question: input });\n  // generate answer\n  const answer = await llm.invoke(formatted);\n  return answer;\n});\n\nconst finalResult = await qa.invoke(query);\nconsole.log(finalResult);\n"
  },
  {
    "path": "ch3/js/b-rewrite.js",
    "content": "/** \n1. Ensure docker is installed and running (https://docs.docker.com/get-docker/)\n2. Run the following command to start the postgres container:\n   \ndocker run \\\n    --name pgvector-container \\\n    -e POSTGRES_USER=langchain \\\n    -e POSTGRES_PASSWORD=langchain \\\n    -e POSTGRES_DB=langchain \\\n    -p 6024:5432 \\\n    -d pgvector/pgvector:pg16\n3. Use the connection string below for the postgres container\n*/\n\nimport { TextLoader } from 'langchain/document_loaders/fs/text';\nimport { RecursiveCharacterTextSplitter } from '@langchain/textsplitters';\nimport { OpenAIEmbeddings } from '@langchain/openai';\nimport { PGVectorStore } from '@langchain/community/vectorstores/pgvector';\nimport { ChatPromptTemplate } from '@langchain/core/prompts';\nimport { ChatOpenAI } from '@langchain/openai';\nimport { RunnableLambda } from '@langchain/core/runnables';\nconst connectionString =\n  'postgresql://langchain:langchain@localhost:6024/langchain';\n// Load the document, split it into chunks\nconst loader = new TextLoader('./test.txt');\nconst raw_docs = await loader.load();\nconst splitter = new RecursiveCharacterTextSplitter({\n  chunkSize: 1000,\n  chunkOverlap: 200,\n});\nconst splitDocs = await splitter.splitDocuments(raw_docs);\n\n// embed each chunk and insert it into the vector store\nconst model = new OpenAIEmbeddings();\n\nconst db = await PGVectorStore.fromDocuments(splitDocs, model, {\n  postgresConnectionOptions: {\n    connectionString,\n  },\n});\n\n// retrieve 2 relevant documents from the vector store\nconst retriever = db.asRetriever({ k: 2 });\n\n/**\n * Query starts with irrelevant information before asking the relevant question\n */\nconst query =\n  'Today I woke up and brushed my teeth, then I sat down to read the news. But then I forgot the food on the cooker. Who are some key figures in the ancient greek history of philosophy?';\n/**\n * Provide retrieved docs as context to the LLM to answer a user's question\n */\nconst prompt = ChatPromptTemplate.fromTemplate(\n  'Answer the question based only on the following context:\\n {context}\\n\\nQuestion: {question}'\n);\n\nconst llm = new ChatOpenAI({ temperature: 0, modelName: 'gpt-3.5-turbo' });\n\nconst qa = RunnableLambda.from(async (input) => {\n  // fetch relevant documents\n  const docs = await retriever.invoke(input);\n  // format prompt\n  const formatted = await prompt.invoke({ context: docs, question: input });\n  // generate answer\n  const answer = await llm.invoke(formatted);\n  return { answer, docs };\n});\n\nconst result = await qa.invoke(query);\nconsole.log(result);\nconsole.log('\\n\\nCall model again with rewritten query\\n\\n');\n\nconst rewritePrompt = ChatPromptTemplate.fromTemplate(\n  `Provide a better search query for web search engine to answer the given question, end the queries with '**'. Question: {question} Answer:`\n);\nconst rewriter = rewritePrompt.pipe(llm).pipe((message) => {\n  return message.content.replaceAll('\"', '').replaceAll('**');\n});\nconst rewriterQA = RunnableLambda.from(async (input) => {\n  const newQuery = await rewriter.invoke({ question: input }); // fetch relevant documents  console.log('New query: ', newQuery);\n  const docs = await retriever.invoke(newQuery); // format prompt\n  const formatted = await prompt.invoke({ context: docs, question: input }); // generate answer\n  const answer = await llm.invoke(formatted);\n  return answer;\n});\n\nconst finalResult = await rewriterQA.invoke(query);\nconsole.log(finalResult);\n"
  },
  {
    "path": "ch3/js/c-multi-query.js",
    "content": "/** \n1. Ensure docker is installed and running (https://docs.docker.com/get-docker/)\n2. Run the following command to start the postgres container:\n   \ndocker run \\\n    --name pgvector-container \\\n    -e POSTGRES_USER=langchain \\\n    -e POSTGRES_PASSWORD=langchain \\\n    -e POSTGRES_DB=langchain \\\n    -p 6024:5432 \\\n    -d pgvector/pgvector:pg16\n3. Use the connection string below for the postgres container\n*/\n\nimport { TextLoader } from 'langchain/document_loaders/fs/text';\nimport { RecursiveCharacterTextSplitter } from '@langchain/textsplitters';\nimport { OpenAIEmbeddings } from '@langchain/openai';\nimport { PGVectorStore } from '@langchain/community/vectorstores/pgvector';\nimport { ChatPromptTemplate } from '@langchain/core/prompts';\nimport { ChatOpenAI } from '@langchain/openai';\nimport { RunnableLambda } from '@langchain/core/runnables';\n\nconst connectionString =\n  'postgresql://langchain:langchain@localhost:6024/langchain';\n// Load the document, split it into chunks\nconst loader = new TextLoader('./test.txt');\nconst raw_docs = await loader.load();\nconst splitter = new RecursiveCharacterTextSplitter({\n  chunkSize: 1000,\n  chunkOverlap: 200,\n});\nconst splitDocs = await splitter.splitDocuments(raw_docs);\n\n// embed each chunk and insert it into the vector store\nconst model = new OpenAIEmbeddings();\n\nconst db = await PGVectorStore.fromDocuments(splitDocs, model, {\n  postgresConnectionOptions: {\n    connectionString,\n  },\n});\n\n// retrieve 2 relevant documents from the vector store\nconst retriever = db.asRetriever({ k: 2 });\n/**\n * Provide retrieved docs as context to the LLM to answer a user's question\n */\nconst llm = new ChatOpenAI({ temperature: 0, modelName: 'gpt-3.5-turbo' });\n\nconst perspectivesPrompt = ChatPromptTemplate.fromTemplate(\n  `You are an AI language model assistant. Your task is to generate five different versions of the given user question to retrieve relevant documents from a vector database. By generating multiple perspectives on the user question, your goal is to help the user overcome some of the limitations of the distance-based similarity search. Provide these alternative questions separated by newlines. Original question: {question}`\n);\n\nconst queryGen = perspectivesPrompt.pipe(llm).pipe((message) => {\n  return message.content.split('\\n');\n});\n\n/**\n * This chain retrieves and combines the documents from the vector store for each query\n */\nconst retrievalChain = queryGen\n  .pipe(retriever.batch.bind(retriever))\n  .pipe((documentLists) => {\n    const dedupedDocs = {};\n    documentLists.flat().forEach((doc) => {\n      dedupedDocs[doc.pageContent] = doc;\n    });\n    return Object.values(dedupedDocs);\n  });\n\nconst prompt = ChatPromptTemplate.fromTemplate(\n  'Answer the question based only on the following context:\\n {context}\\n\\nQuestion: {question}'\n);\n\nconsole.log('Running multi query qa\\n');\nconst multiQueryQa = RunnableLambda.from(async (input) => {\n  // fetch relevant documents\n  const docs = await retrievalChain.invoke({ question: input });\n  // format prompt\n  const formatted = await prompt.invoke({ context: docs, question: input });\n  // generate answer\n  const answer = await llm.invoke(formatted);\n  return answer;\n});\n\nconst result = await multiQueryQa.invoke(\n  'Who are the key figures in the ancient greek history of philosophy?'\n);\n\nconsole.log(result);\n"
  },
  {
    "path": "ch3/js/d-rag-fusion.js",
    "content": "/** \n1. Ensure docker is installed and running (https://docs.docker.com/get-docker/)\n2. Run the following command to start the postgres container:\n   \ndocker run \\\n    --name pgvector-container \\\n    -e POSTGRES_USER=langchain \\\n    -e POSTGRES_PASSWORD=langchain \\\n    -e POSTGRES_DB=langchain \\\n    -p 6024:5432 \\\n    -d pgvector/pgvector:pg16\n3. Use the connection string below for the postgres container\n*/\n\nimport { TextLoader } from 'langchain/document_loaders/fs/text';\nimport { RecursiveCharacterTextSplitter } from '@langchain/textsplitters';\nimport { OpenAIEmbeddings } from '@langchain/openai';\nimport { PGVectorStore } from '@langchain/community/vectorstores/pgvector';\nimport { ChatPromptTemplate } from '@langchain/core/prompts';\nimport { ChatOpenAI } from '@langchain/openai';\nimport { RunnableLambda } from '@langchain/core/runnables';\n\nconst connectionString =\n  'postgresql://langchain:langchain@localhost:6024/langchain';\n// Load the document, split it into chunks\nconst loader = new TextLoader('./test.txt');\nconst raw_docs = await loader.load();\nconst splitter = new RecursiveCharacterTextSplitter({\n  chunkSize: 1000,\n  chunkOverlap: 200,\n});\nconst splitDocs = await splitter.splitDocuments(raw_docs);\n\n// embed each chunk and insert it into the vector store\nconst model = new OpenAIEmbeddings();\n\nconst db = await PGVectorStore.fromDocuments(splitDocs, model, {\n  postgresConnectionOptions: {\n    connectionString,\n  },\n});\n\n// retrieve 2 relevant documents from the vector store\nconst retriever = db.asRetriever({ k: 2 });\n/**\n * Provide retrieved docs as context to the LLM to answer a user's question\n */\nconst llm = new ChatOpenAI({ temperature: 0, modelName: 'gpt-3.5-turbo' });\n\nconst perspectivesPrompt = ChatPromptTemplate.fromTemplate(\n  `You are a helpful assistant that generates multiple search queries based on a single input query. \\n Generate multiple search queries related to: {question} \\n Output (4 queries):`\n);\nconst queryGen = perspectivesPrompt.pipe(llm).pipe((message) => {\n  return message.content.split('\\n');\n});\n\nfunction reciprocalRankFusion(results, k = 60) {\n  // Initialize a dictionary to hold fused scores for each document\n  // Documents will be keyed by their contents to ensure uniqueness\n  const fusedScores = {};\n  const documents = {};\n  results.forEach((docs) => {\n    docs.forEach((doc, rank) => {\n      // Use the document contents as the key for uniqueness\n      const key = doc.pageContent;\n      // If the document hasn't been seen yet,\n      // - initialize score to 0\n      // - save it for later\n      if (!(key in fusedScores)) {\n        fusedScores[key] = 0;\n        documents[key] = 0;\n      }\n      // Update the score of the document using the RRF formula:\n      // 1 / (rank + k)\n      fusedScores[key] += 1 / (rank + k);\n    });\n  });\n  // Sort the documents based on their fused scores in descending order to get the final reranked results\n  const sorted = Object.entries(fusedScores).sort((a, b) => b[1] - a[1]);\n  // retrieve the corresponding doc for each key\n  return sorted.map(([key]) => documents[key]);\n}\n\nconst prompt = ChatPromptTemplate.fromTemplate(\n  'Answer the question based only on the following context:\\n {context}\\n\\nQuestion: {question}'\n);\n\nconst retrievalChain = queryGen\n  .pipe(retriever.batch.bind(retriever))\n  .pipe(reciprocalRankFusion);\n\nconsole.log('Running rag fusion\\n');\nconst ragFusion = RunnableLambda.from(async (input) => {\n  // fetch relevant documents\n  const docs = await retrievalChain.invoke({ question: input });\n  // format prompt\n  const formatted = await prompt.invoke({ context: docs, question: input });\n  // generate answer\n  const answer = await llm.invoke(formatted);\n  return answer;\n});\n\nconst result = await ragFusion.invoke(\n  'Who are the key figures in the ancient greek history of philosophy?'\n);\n\nconsole.log(result);\n"
  },
  {
    "path": "ch3/js/e-hyde.js",
    "content": "/** \n1. Ensure docker is installed and running (https://docs.docker.com/get-docker/)\n2. Run the following command to start the postgres container:\n   \ndocker run \\\n    --name pgvector-container \\\n    -e POSTGRES_USER=langchain \\\n    -e POSTGRES_PASSWORD=langchain \\\n    -e POSTGRES_DB=langchain \\\n    -p 6024:5432 \\\n    -d pgvector/pgvector:pg16\n3. Use the connection string below for the postgres container\n*/\n\nimport { TextLoader } from 'langchain/document_loaders/fs/text';\nimport { RecursiveCharacterTextSplitter } from '@langchain/textsplitters';\nimport { OpenAIEmbeddings } from '@langchain/openai';\nimport { PGVectorStore } from '@langchain/community/vectorstores/pgvector';\nimport { ChatPromptTemplate } from '@langchain/core/prompts';\nimport { ChatOpenAI } from '@langchain/openai';\nimport { RunnableLambda } from '@langchain/core/runnables';\n\nconst connectionString =\n  'postgresql://langchain:langchain@localhost:6024/langchain';\n// Load the document, split it into chunks\nconst loader = new TextLoader('./test.txt');\nconst raw_docs = await loader.load();\nconst splitter = new RecursiveCharacterTextSplitter({\n  chunkSize: 1000,\n  chunkOverlap: 200,\n});\nconst splitDocs = await splitter.splitDocuments(raw_docs);\n\n// embed each chunk and insert it into the vector store\nconst model = new OpenAIEmbeddings();\n\nconst db = await PGVectorStore.fromDocuments(splitDocs, model, {\n  postgresConnectionOptions: {\n    connectionString,\n  },\n});\n\n// retrieve 2 relevant documents from the vector store\nconst retriever = db.asRetriever({ k: 2 });\n/**\n * Provide retrieved docs as context to the LLM to answer a user's question\n */\nconst llm = new ChatOpenAI({ temperature: 0, modelName: 'gpt-3.5-turbo' });\n\nconst hydePrompt = ChatPromptTemplate.fromTemplate(\n  `Please write a passage to answer the question.\\n Question: {question} \\n Passage:`\n);\n\nconst generatedDoc = hydePrompt.pipe(llm).pipe((msg) => msg.content);\n\n/**\n * This chain retrieves and combines the documents from the vector store for each query\n */\nconst retrievalChain = generatedDoc.pipe(retriever);\n\nconst prompt = ChatPromptTemplate.fromTemplate(\n  'Answer the question based only on the following context:\\n {context}\\n\\nQuestion: {question}'\n);\n\nconsole.log('Running hyde\\n');\nconst hydeQa = RunnableLambda.from(async (input) => {\n  // fetch relevant documents\n  const docs = await retrievalChain.invoke(input);\n  // format prompt\n  const formatted = await prompt.invoke({ context: docs, question: input });\n  // generate answer\n  const answer = await llm.invoke(formatted);\n  return answer;\n});\n\nconst result = await hydeQa.invoke(\n  'Who are some lesser known philosophers in the ancient greek history of philosophy?'\n);\n\nconsole.log(result);\n"
  },
  {
    "path": "ch3/js/f-router.js",
    "content": "import { ChatOpenAI } from '@langchain/openai';\nimport { z } from 'zod';\nimport { ChatPromptTemplate } from '@langchain/core/prompts';\n\nconst routeQuery = z\n  .object({\n    datasource: z\n      .enum(['python_docs', 'js_docs'])\n      .describe(\n        'Given a user question, choose which datasource would be most relevant for answering their question'\n      ),\n  })\n  .describe('Route a user query to the most relevant datasource.');\n\nconst llm = new ChatOpenAI({ model: 'gpt-3.5-turbo', temperature: 0 });\n// withStructuredOutput is a method that allows us to use the structured output of the model\nconst structuredLlm = llm.withStructuredOutput(routeQuery, {\n  name: 'RouteQuery',\n});\n\nconst prompt = ChatPromptTemplate.fromMessages([\n  [\n    'system',\n    `You are an expert at routing a user question to the appropriate data source. Based on the programming language the question is referring to, route it to the relevant data source.`,\n  ],\n  ['human', '{question}'],\n]);\n\nconst router = prompt.pipe(structuredLlm);\n\nconst question = `Why doesn't the following code work: \nfrom langchain_core.prompts \nimport ChatPromptTemplate \nprompt = ChatPromptTemplate.from_messages([\"human\", \"speak in {language}\"]) \nprompt.invoke(\"french\") `;\n\nconst result = await router.invoke({ question });\n\nconsole.log('Routing to: ', result);\n\n/** Once we’ve extracted the relevant data source, we can pass the value into another function to execute additional logic as required: */\n\nconst chooseRoute = (result) => {\n  if (result.datasource.toLowerCase().includes('python_docs')) {\n    return 'chain for python_docs';\n  } else {\n    return 'chain for js_docs';\n  }\n};\n\nconst fullChain = router.pipe(chooseRoute);\n\nconst finalResult = await fullChain.invoke({ question });\n\nconsole.log('Choose route: ', finalResult);\n"
  },
  {
    "path": "ch3/js/g-semantic-router.js",
    "content": "import { cosineSimilarity } from '@langchain/core/utils/math';\nimport { ChatOpenAI, OpenAIEmbeddings } from '@langchain/openai';\nimport { PromptTemplate } from '@langchain/core/prompts';\nimport { RunnableLambda } from '@langchain/core/runnables';\n\nconst physicsTemplate = `You are a very smart physics professor. You are great     at answering questions about physics in a concise and easy-to-understand     manner. When you don't know the answer to a question, you admit that you don't know. Here is a question: {query}`;\n\nconst mathTemplate = `You are a very good mathematician. You are great at answering     math questions. You are so good because you are able to break down hard     problems into their component parts, answer the component parts, and then     put them together to answer the broader question. Here is a question: {query}`;\n\nconst embeddings = new OpenAIEmbeddings();\n\nconst promptTemplates = [physicsTemplate, mathTemplate];\n\nconst promptEmbeddings = await embeddings.embedDocuments(promptTemplates);\n\nconst promptRouter = RunnableLambda.from(async (query) => {\n  // Embed question\n  const queryEmbedding = await embeddings.embedQuery(query);\n  // Compute similarity\n  const similarities = cosineSimilarity([queryEmbedding], promptEmbeddings)[0];\n  // Pick the prompt most similar to the input question\n  const mostSimilar =\n    similarities[0] > similarities[1] ? promptTemplates[0] : promptTemplates[1];\n  console.log(\n    `Using ${mostSimilar === promptTemplates[0] ? 'PHYSICS' : 'MATH'}`\n  );\n  return PromptTemplate.fromTemplate(mostSimilar).invoke({ query });\n});\n\nconst semanticRouter = promptRouter.pipe(\n  new ChatOpenAI({ modelName: 'gpt-3.5-turbo', temperature: 0 })\n);\n\nconst result = await semanticRouter.invoke('What is a black hole');\nconsole.log('\\nSemantic router result: ', result);\n"
  },
  {
    "path": "ch3/js/h-self-query.js",
    "content": "import { ChatOpenAI } from '@langchain/openai';\nimport { SelfQueryRetriever } from 'langchain/retrievers/self_query';\nimport { FunctionalTranslator } from '@langchain/core/structured_query';\nimport { MemoryVectorStore } from 'langchain/vectorstores/memory';\nimport { Document } from 'langchain/document';\nimport { AttributeInfo } from 'langchain/chains/query_constructor';\nimport { OpenAIEmbeddings } from '@langchain/openai';\n/**\n * First, we create a bunch of documents. You can load your own documents here instead.\n * Each document has a pageContent and a metadata field. Make sure your metadata matches the AttributeInfo below.\n */\nconst docs = [\n  new Document({\n    pageContent:\n      'A bunch of scientists bring back dinosaurs and mayhem breaks loose',\n    metadata: {\n      year: 1993,\n      rating: 7.7,\n      genre: 'science fiction',\n      length: 122,\n    },\n  }),\n  new Document({\n    pageContent:\n      'Leo DiCaprio gets lost in a dream within a dream within a dream within a ...',\n    metadata: {\n      year: 2010,\n      director: 'Christopher Nolan',\n      rating: 8.2,\n      length: 148,\n    },\n  }),\n  new Document({\n    pageContent:\n      'A psychologist / detective gets lost in a series of dreams within dreams within dreams and Inception reused the idea',\n    metadata: { year: 2006, director: 'Satoshi Kon', rating: 8.6 },\n  }),\n  new Document({\n    pageContent:\n      'A bunch of normal-sized women are supremely wholesome and some men pine after them',\n    metadata: {\n      year: 2019,\n      director: 'Greta Gerwig',\n      rating: 8.3,\n      length: 135,\n    },\n  }),\n  new Document({\n    pageContent: 'Toys come alive and have a blast doing so',\n    metadata: { year: 1995, genre: 'animated', length: 77 },\n  }),\n  new Document({\n    pageContent: 'Three men walk into the Zone, three men walk out of the Zone',\n    metadata: {\n      year: 1979,\n      director: 'Andrei Tarkovsky',\n      genre: 'science fiction',\n      rating: 9.9,\n    },\n  }),\n];\n\nconst llm = new ChatOpenAI({ modelName: 'gpt-3.5-turbo', temperature: 0 });\n\nconst embeddings = new OpenAIEmbeddings();\n\nconst vectorStore = await MemoryVectorStore.fromDocuments(docs, embeddings);\n\n/** * First, we define the attributes we want to be able to query on. * in this case, we want to be able to query on the genre, year, director,     rating, and length of the movie. * We also provide a description of each attribute and the type of the attribute. * This is used to generate the query prompts. */\n\nconst fields = [\n  {\n    name: 'genre',\n    description: 'The genre of the movie',\n    type: 'string or array of strings',\n  },\n  {\n    name: 'year',\n    description: 'The year the movie was released',\n    type: 'number',\n  },\n  {\n    name: 'director',\n    description: 'The director of the movie',\n    type: 'string',\n  },\n  {\n    name: 'rating',\n    description: 'The rating of the movie (1-10)',\n    type: 'number',\n  },\n  {\n    name: 'length',\n    description: 'The length of the movie in minutes',\n    type: 'number',\n  },\n];\n\nconst attributeInfos = fields.map(\n  (field) => new AttributeInfo(field.name, field.description, field.type)\n);\nconst description = 'Brief summary of a movie';\nconst selfQueryRetriever = SelfQueryRetriever.fromLLM({\n  llm,\n  vectorStore,\n  description,\n  attributeInfo: attributeInfos,\n  /**\n   * We need to use a translator that translates the queries into a\n   * filter format that the vector store can understand. LangChain provides one\n   * here.\n   */\n  structuredQueryTranslator: new FunctionalTranslator(),\n});\n\nconst result = await selfQueryRetriever.invoke(\n  'Which movies are less than 90 minutes?'\n);\nconsole.log(result);\n"
  },
  {
    "path": "ch3/js/i-sql-example.js",
    "content": "/*\nThe below example will use a SQLite connection with the Chinook database, which is a sample database that represents a digital media store. Follow these installation steps to create Chinook.db in the same directory as this notebook. You can also download and build the database via the command line:\n\n```bash\ncurl -s https://raw.githubusercontent.com/lerocha/chinook-database/master/ChinookDatabase/DataSources/Chinook_Sqlite.sql | sqlite3 Chinook.db\n\n```\n\nAfterwards, place `Chinook.db` in the same directory where this code is running.\n\n*/\n\nimport { ChatOpenAI } from '@langchain/openai';\nimport { createSqlQueryChain } from 'langchain/chains/sql_db';\nimport { SqlDatabase } from 'langchain/sql_db';\nimport { DataSource } from 'typeorm';\nimport { QuerySqlTool } from 'langchain/tools/sql';\n\nconst datasource = new DataSource({\n  type: 'sqlite',\n  database: 'Chinook.db', //this should be the path to the db\n});\nconst db = await SqlDatabase.fromDataSourceParams({\n  appDataSource: datasource,\n});\n//test that the db is working\nawait db.run('SELECT * FROM Artist LIMIT 10;');\n\nconst llm = new ChatOpenAI({ modelName: 'gpt-4o', temperature: 0 });\n// convert question to sql query\nconst writeQuery = await createSqlQueryChain({ llm, db, dialect: 'sqlite' });\n// execute query\nconst executeQuery = new QuerySqlTool(db);\n// combined\nconst chain = writeQuery.pipe(executeQuery);\n\nconst result = await chain.invoke({\n  question: 'How many employees are there?',\n});\nconsole.log(result);\n"
  },
  {
    "path": "ch3/py/a-basic-rag.py",
    "content": "\"\"\"\n1. Ensure docker is installed and running (https://docs.docker.com/get-docker/)\n2. pip install -qU langchain_postgres\n3. Run the following command to start the postgres container:\n   \ndocker run \\\n    --name pgvector-container \\\n    -e POSTGRES_USER=langchain \\\n    -e POSTGRES_PASSWORD=langchain \\\n    -e POSTGRES_DB=langchain \\\n    -p 6024:5432 \\\n    -d pgvector/pgvector:pg16\n4. Use the connection string below for the postgres container\n\n\"\"\"\n\nfrom langchain_community.document_loaders import TextLoader\nfrom langchain_openai import OpenAIEmbeddings\nfrom langchain_text_splitters import RecursiveCharacterTextSplitter\nfrom langchain_postgres.vectorstores import PGVector\nfrom langchain_openai import ChatOpenAI\nfrom langchain_core.prompts import ChatPromptTemplate\nfrom langchain_core.runnables import chain\n\n\n# See docker command above to launch a postgres instance with pgvector enabled.\nconnection = \"postgresql+psycopg://langchain:langchain@localhost:6024/langchain\"\n\n# Load the document, split it into chunks\nraw_documents = TextLoader('./test.txt', encoding='utf-8').load()\ntext_splitter = RecursiveCharacterTextSplitter(\n    chunk_size=1000, chunk_overlap=200)\ndocuments = text_splitter.split_documents(raw_documents)\n\n# Create embeddings for the documents\nembeddings_model = OpenAIEmbeddings()\n\ndb = PGVector.from_documents(\n    documents, embeddings_model, connection=connection)\n\n# create retriever to retrieve 2 relevant documents\nretriever = db.as_retriever(search_kwargs={\"k\": 2})\n\nquery = 'Who are the key figures in the ancient greek history of philosophy?'\n\n# fetch relevant documents\ndocs = retriever.invoke(query)\n\nprint(docs[0].page_content)\n\nprompt = ChatPromptTemplate.from_template(\n    \"\"\"Answer the question based only on the following context: {context} Question: {question} \"\"\"\n)\nllm = ChatOpenAI(model_name=\"gpt-3.5-turbo\", temperature=0)\nllm_chain = prompt | llm\n\n# answer the question based on relevant documents\nresult = llm_chain.invoke({\"context\": docs, \"question\": query})\n\nprint(result)\nprint(\"\\n\\n\")\n\n# Run again but this time encapsulate the logic for efficiency\n\n# @chain decorator transforms this function into a LangChain runnable,\n# making it compatible with LangChain's chain operations and pipeline\n\nprint(\"Running again but this time encapsulate the logic for efficiency\\n\")\n\n\n@chain\ndef qa(input):\n    # fetch relevant documents\n    docs = retriever.invoke(input)\n    # format prompt\n    formatted = prompt.invoke({\"context\": docs, \"question\": input})\n    # generate answer\n    answer = llm.invoke(formatted)\n    return answer\n\n\n# run it\nresult = qa.invoke(query)\nprint(result.content)\n"
  },
  {
    "path": "ch3/py/b-rewrite.py",
    "content": "\"\"\"\n1. Ensure docker is installed and running (https://docs.docker.com/get-docker/)\n2. pip install -qU langchain_postgres\n3. Run the following command to start the postgres container:\n   \ndocker run \\\n    --name pgvector-container \\\n    -e POSTGRES_USER=langchain \\\n    -e POSTGRES_PASSWORD=langchain \\\n    -e POSTGRES_DB=langchain \\\n    -p 6024:5432 \\\n    -d pgvector/pgvector:pg16\n4. Use the connection string below for the postgres container\n\n\"\"\"\n\nfrom langchain_community.document_loaders import TextLoader\nfrom langchain_openai import OpenAIEmbeddings\nfrom langchain_text_splitters import RecursiveCharacterTextSplitter\nfrom langchain_postgres.vectorstores import PGVector\nfrom langchain_openai import ChatOpenAI\nfrom langchain_core.prompts import ChatPromptTemplate\nfrom langchain_core.runnables import chain\n\n\n# See docker command above to launch a postgres instance with pgvector enabled.\nconnection = \"postgresql+psycopg://langchain:langchain@localhost:6024/langchain\"\n\n# Load the document, split it into chunks\nraw_documents = TextLoader('./test.txt', encoding='utf-8').load()\ntext_splitter = RecursiveCharacterTextSplitter(\n    chunk_size=1000, chunk_overlap=200)\ndocuments = text_splitter.split_documents(raw_documents)\n\n# Create embeddings for the documents\nembeddings_model = OpenAIEmbeddings()\n\ndb = PGVector.from_documents(\n    documents, embeddings_model, connection=connection)\n\n# create retriever to retrieve 2 relevant documents\nretriever = db.as_retriever(search_kwargs={\"k\": 2})\n\n# Query starts with irrelevant information before asking the relevant question\nquery = 'Today I woke up and brushed my teeth, then I sat down to read the news. But then I forgot the food on the cooker. Who are some key figures in the ancient greek history of philosophy?'\n\n# fetch relevant documents\ndocs = retriever.invoke(query)\n\nprint(docs[0].page_content)\nprint(\"\\n\\n\")\n\nprompt = ChatPromptTemplate.from_template(\n    \"\"\"Answer the question based only on the following context: {context} Question: {question} \"\"\"\n)\nllm = ChatOpenAI(model_name=\"gpt-3.5-turbo\", temperature=0)\n\n\n# Run again but this time encapsulate the logic for efficiency\n\n# @chain decorator transforms this function into a LangChain runnable,\n# making it compatible with LangChain's chain operations and pipeline\n\n@chain\ndef qa(input):\n    # fetch relevant documents\n    docs = retriever.invoke(input)\n    # format prompt\n    formatted = prompt.invoke({\"context\": docs, \"question\": input})\n    # generate answer\n    answer = llm.invoke(formatted)\n    return answer\n\n\n# run it\nresult = qa.invoke(query)\nprint(result.content)\n\nprint(\"\\nRewrite the query to improve accuracy\\n\")\n\nrewrite_prompt = ChatPromptTemplate.from_template(\n    \"\"\"Provide a better search query for web search engine to answer the given question, end the queries with ’**’. Question: {x} Answer:\"\"\")\n\n\ndef parse_rewriter_output(message):\n    return message.content.strip('\"').strip(\"**\")\n\n\nrewriter = rewrite_prompt | llm | parse_rewriter_output\n\n\n@chain\ndef qa_rrr(input):\n    # rewrite the query\n    new_query = rewriter.invoke(input)\n    print(\"Rewritten query: \", new_query)\n    # fetch relevant documents\n    docs = retriever.invoke(new_query)\n    # format prompt\n    formatted = prompt.invoke({\"context\": docs, \"question\": input})\n    # generate answer\n    answer = llm.invoke(formatted)\n    return answer\n\n\nprint(\"\\nCall model again with rewritten query\\n\")\n\n# call model again with rewritten query\nresult = qa_rrr.invoke(query)\nprint(result.content)\n"
  },
  {
    "path": "ch3/py/c-multi-query.py",
    "content": "from langchain_community.document_loaders import TextLoader\nfrom langchain_openai import OpenAIEmbeddings\nfrom langchain_text_splitters import RecursiveCharacterTextSplitter\nfrom langchain_postgres.vectorstores import PGVector\nfrom langchain_openai import ChatOpenAI\nfrom langchain_core.prompts import ChatPromptTemplate\nfrom langchain_core.runnables import chain\n\n\n# See docker command above to launch a postgres instance with pgvector enabled.\nconnection = \"postgresql+psycopg://langchain:langchain@localhost:6024/langchain\"\n\n# Load the document, split it into chunks\nraw_documents = TextLoader('./test.txt', encoding='utf-8').load()\ntext_splitter = RecursiveCharacterTextSplitter(\n    chunk_size=1000, chunk_overlap=200)\ndocuments = text_splitter.split_documents(raw_documents)\n\n# Create embeddings for the documents\nembeddings_model = OpenAIEmbeddings()\n\ndb = PGVector.from_documents(\n    documents, embeddings_model, connection=connection)\n\n# create retriever to retrieve 2 relevant documents\nretriever = db.as_retriever(search_kwargs={\"k\": 5})\n\n# instruction to generate multiple queries\nperspectives_prompt = ChatPromptTemplate.from_template(\n    \"\"\"You are an AI language model assistant. Your task is to generate five different versions of the given user question to retrieve relevant documents from a vector database. \n    By generating multiple perspectives on the user question, your goal is to help the user overcome some of the limitations of the distance-based  similarity search. \n    Provide these alternative questions separated by newlines. \n    Original question: {question}\"\"\")\n\nllm = ChatOpenAI(model=\"gpt-3.5-turbo\")\n\n\ndef parse_queries_output(message):\n    return message.content.split('\\n')\n\n\nquery_gen = perspectives_prompt | llm | parse_queries_output\n\n\ndef get_unique_union(document_lists):\n    # Flatten list of lists, and dedupe them\n    deduped_docs = {\n        doc.page_content: doc for sublist in document_lists for doc in sublist}\n    # return a flat list of unique docs\n    return list(deduped_docs.values())\n\n\nretrieval_chain = query_gen | retriever.batch | get_unique_union\n\nprompt = ChatPromptTemplate.from_template(\n    \"\"\"Answer the question based only on the following context: {context} Question: {question} \"\"\"\n)\n\nquery = \"Who are the key figures in the ancient greek history of philosophy?\"\n\n\n@chain\ndef multi_query_qa(input):\n    # fetch relevant documents\n    docs = retrieval_chain.invoke(input)  # format prompt\n    formatted = prompt.invoke(\n        {\"context\": docs, \"question\": input})  # generate answer\n    answer = llm.invoke(formatted)\n    return answer\n\n\n# run\nprint(\"Running multi query qa\\n\")\nresult = multi_query_qa.invoke(query)\nprint(result.content)\n"
  },
  {
    "path": "ch3/py/d-rag-fusion.py",
    "content": "from langchain_community.document_loaders import TextLoader\nfrom langchain_openai import OpenAIEmbeddings\nfrom langchain_text_splitters import RecursiveCharacterTextSplitter\nfrom langchain_postgres.vectorstores import PGVector\nfrom langchain_openai import ChatOpenAI\nfrom langchain_core.prompts import ChatPromptTemplate\nfrom langchain_core.runnables import chain\n\n# See docker command above to launch a postgres instance with pgvector enabled.\nconnection = \"postgresql+psycopg://langchain:langchain@localhost:6024/langchain\"\n\n# Load the document, split it into chunks\nraw_documents = TextLoader('./test.txt', encoding='utf-8').load()\ntext_splitter = RecursiveCharacterTextSplitter(\n    chunk_size=1000, chunk_overlap=200)\ndocuments = text_splitter.split_documents(raw_documents)\n\n# Create embeddings for the documents\nembeddings_model = OpenAIEmbeddings()\n\ndb = PGVector.from_documents(\n    documents, embeddings_model, connection=connection)\n\n# create retriever to retrieve 2 relevant documents\nretriever = db.as_retriever(search_kwargs={\"k\": 5})\n\nprompt_rag_fusion = ChatPromptTemplate.from_template(\n    \"\"\"You are a helpful assistant that generates multiple search queries based on a single input query. \\n Generate multiple search queries related to: {question} \\n Output (4 queries):\"\"\")\n\n\ndef parse_queries_output(message):\n    return message.content.split('\\n')\n\n\nllm = ChatOpenAI(model=\"gpt-3.5-turbo\", temperature=0)\nquery_gen = prompt_rag_fusion | llm | parse_queries_output\n\nquery = \"Who are the key figures in the ancient greek history of philosophy?\"\n\ngenerated_queries = query_gen.invoke(query)\n\nprint(\"generated queries: \", generated_queries)\n\n\n\"\"\"\nwe fetch relevant documents for each query and pass them into a function to rerank (that is, reorder according to relevancy) the final list of relevant documents.\n\"\"\"\n\n\ndef reciprocal_rank_fusion(results: list[list], k=60):\n    \"\"\"reciprocal rank fusion on multiple lists of ranked documents and an optional parameter k used in the RRF formula\"\"\"\n    # Initialize a dictionary to hold fused scores for each document\n    # Documents will be keyed by their contents to ensure uniqueness\n    fused_scores = {}\n    documents = {}\n    for docs in results:\n        # Iterate through each document in the list, with its rank (position in the list)\n        for rank, doc in enumerate(docs):\n            doc_str = doc.page_content\n            if doc_str not in fused_scores:\n                fused_scores[doc_str] = 0\n                documents[doc_str] = doc\n            fused_scores[doc_str] += 1 / (rank + k)\n    # sort the documents based on their fused scores in descending order to get the final reranked results\n    reranked_doc_strs = sorted(\n        fused_scores, key=lambda d: fused_scores[d], reverse=True)\n    return [documents[doc_str] for doc_str in reranked_doc_strs]\n\n\nretrieval_chain = query_gen | retriever.batch | reciprocal_rank_fusion\n\nresult = retrieval_chain.invoke(query)\n\nprint(\"retrieved context using rank fusion: \", result[0].page_content)\nprint(\"\\n\\n\")\n\nprint(\"Use model to answer question based on retrieved docs\\n\")\n\n\nprompt = ChatPromptTemplate.from_template(\n    \"\"\"Answer the question based only on the following context: {context} Question: {question} \"\"\"\n)\n\nquery = \"Who are the some important yet not well known philosophers in the ancient greek history of philosophy?\"\n\n\n@chain\ndef rag_fusion(input):\n    # fetch relevant documents\n    docs = retrieval_chain.invoke(input)  # format prompt\n    formatted = prompt.invoke(\n        {\"context\": docs, \"question\": input})  # generate answer\n    answer = llm.invoke(formatted)\n    return answer\n\n\n# run\nprint(\"Running rag fusion\\n\")\nresult = rag_fusion.invoke(query)\nprint(result.content)\n"
  },
  {
    "path": "ch3/py/e-hyde.py",
    "content": "from langchain_community.document_loaders import TextLoader\nfrom langchain_openai import OpenAIEmbeddings\nfrom langchain_text_splitters import RecursiveCharacterTextSplitter\nfrom langchain_postgres.vectorstores import PGVector\nfrom langchain_openai import ChatOpenAI\nfrom langchain_core.prompts import ChatPromptTemplate\nfrom langchain_core.runnables import chain\nfrom langchain_core.output_parsers import StrOutputParser\n\n# See docker command above to launch a postgres instance with pgvector enabled.\nconnection = \"postgresql+psycopg://langchain:langchain@localhost:6024/langchain\"\n\n# Load the document, split it into chunks\nraw_documents = TextLoader('./test.txt', encoding='utf-8').load()\ntext_splitter = RecursiveCharacterTextSplitter(\n    chunk_size=1000, chunk_overlap=200)\ndocuments = text_splitter.split_documents(raw_documents)\n\n# Create embeddings for the documents\nembeddings_model = OpenAIEmbeddings()\n\ndb = PGVector.from_documents(\n    documents, embeddings_model, connection=connection)\n\n# create retriever to retrieve 2 relevant documents\nretriever = db.as_retriever(search_kwargs={\"k\": 5})\n\nprompt_hyde = ChatPromptTemplate.from_template(\n    \"\"\"Please write a passage to answer the question.\\n Question: {question} \\n Passage:\"\"\")\n\ngenerate_doc = (prompt_hyde | ChatOpenAI(temperature=0) | StrOutputParser())\n\n\"\"\"\nNext, we take the hypothetical document generated above and use it as input to the retriever, \nwhich will generate its embedding and search for similar documents in the vector store:\n\"\"\"\nretrieval_chain = generate_doc | retriever\n\nquery = \"Who are some lesser known philosophers in the ancient greek history of philosophy?\"\n\nprompt = ChatPromptTemplate.from_template(\n    \"\"\"Answer the question based only on the following context: {context} Question: {question} \"\"\"\n)\n\nllm = ChatOpenAI(model=\"gpt-3.5-turbo\", temperature=0)\n\n\n@chain\ndef qa(input):\n    # fetch relevant documents from the hyde retrieval chain defined earlier\n    docs = retrieval_chain.invoke(input)\n    # format prompt\n    formatted = prompt.invoke({\"context\": docs, \"question\": input})\n    # generate answer\n    answer = llm.invoke(formatted)\n    return answer\n\n\nprint(\"Running hyde\\n\")\nresult = qa.invoke(query)\nprint(\"\\n\\n\")\nprint(result.content)\n"
  },
  {
    "path": "ch3/py/f-router.py",
    "content": "\nfrom typing import Literal\nfrom langchain_core.prompts import ChatPromptTemplate\nfrom pydantic import BaseModel, Field\nfrom langchain_openai import ChatOpenAI\nfrom langchain_core.runnables import RunnableLambda\n\n\n# Data model class\nclass RouteQuery(BaseModel):\n    \"\"\"Route a user query to the most relevant datasource.\"\"\"\n    datasource: Literal[\"python_docs\", \"js_docs\"] = Field(\n        ...,\n        description=\"Given a user question, choose which datasource would be most relevant for answering their question\",\n    )\n\n\n# Prompt template\n# LLM with function call\nllm = ChatOpenAI(model=\"gpt-4o\", temperature=0)\n\n\"\"\"\nwith_structured_output: Model wrapper that returns outputs formatted to match the given schema.\n\n\"\"\"\nstructured_llm = llm.with_structured_output(RouteQuery)\n\n# Prompt\nsystem = \"\"\"You are an expert at routing a user question to the appropriate data source. Based on the programming language the question is referring to, route it to the relevant data source.\"\"\"\nprompt = ChatPromptTemplate.from_messages(\n    [(\"system\", system), (\"human\", \"{question}\")]\n)\n\n# Define router\nrouter = prompt | structured_llm\n\n# Run\nquestion = \"\"\"Why doesn't the following code work: \nfrom langchain_core.prompts \nimport ChatPromptTemplate \nprompt = ChatPromptTemplate.from_messages([\"human\", \"speak in {language}\"]) \nprompt.invoke(\"french\") \"\"\"\n\nresult = router.invoke({\"question\": question})\nprint(\"\\nRouting to: \", result)\n\n\"\"\"\nOnce we extracted the relevant data source, we can pass the value into another function to execute additional logic as required:\n\"\"\"\n\n\ndef choose_route(result):\n    if \"python_docs\" in result.datasource.lower():\n        return \"chain for python_docs\"\n    else:\n        return \"chain for js_docs\"\n\n\nfull_chain = router | RunnableLambda(choose_route)\n\nresult = full_chain.invoke({\"question\": question})\nprint(\"\\nChoose route: \", result)\n"
  },
  {
    "path": "ch3/py/g-semantic-router.py",
    "content": "from langchain.utils.math import cosine_similarity\nfrom langchain_core.output_parsers import StrOutputParser\nfrom langchain_core.prompts import PromptTemplate\nfrom langchain_core.runnables import chain\nfrom langchain_openai import ChatOpenAI, OpenAIEmbeddings\n\nphysics_template = \"\"\"You are a very smart physics professor. You are great at     answering questions about physics in a concise and easy-to-understand manner.     When you don't know the answer to a question, you admit that you don't know. Here is a question: {query}\"\"\"\nmath_template = \"\"\"You are a very good mathematician. You are great at answering     math questions. You are so good because you are able to break down hard     problems into their component parts, answer the component parts, and then     put them together to answer the broader question. Here is a question: {query}\"\"\"\n\n# Embed prompts\nembeddings = OpenAIEmbeddings()\nprompt_templates = [physics_template, math_template]\nprompt_embeddings = embeddings.embed_documents(prompt_templates)\n\n# Route question to prompt\n\n\n@chain\ndef prompt_router(query):\n    query_embedding = embeddings.embed_query(query)\n    similarity = cosine_similarity([query_embedding], prompt_embeddings)[0]\n    most_similar = prompt_templates[similarity.argmax()]\n    print(\"Using MATH\" if most_similar == math_template else \"Using PHYSICS\")\n    return PromptTemplate.from_template(most_similar)\n\n\nsemantic_router = (prompt_router | ChatOpenAI() | StrOutputParser())\n\nresult = semantic_router.invoke(\"What's a black hole\")\nprint(\"\\nSemantic router result: \", result)\n"
  },
  {
    "path": "ch3/py/h-self-query.py",
    "content": "# pip install lark\n\nfrom langchain.chains.query_constructor.base import AttributeInfo\nfrom langchain.retrievers.self_query.base import SelfQueryRetriever\nfrom langchain_openai import ChatOpenAI\nfrom langchain_community.document_loaders import TextLoader\nfrom langchain_openai import OpenAIEmbeddings\nfrom langchain_text_splitters import RecursiveCharacterTextSplitter\nfrom langchain_postgres.vectorstores import PGVector\nfrom langchain_core.documents import Document\n\n# See docker command above to launch a postgres instance with pgvector enabled.\nconnection = \"postgresql+psycopg://langchain:langchain@localhost:6024/langchain\"\n\ndocs = [\n    Document(\n        page_content=\"A bunch of scientists bring back dinosaurs and mayhem breaks loose\",\n        metadata={\"year\": 1993, \"rating\": 7.7, \"genre\": \"science fiction\"},\n    ),\n    Document(\n        page_content=\"Leo DiCaprio gets lost in a dream within a dream within a dream within a ...\",\n        metadata={\"year\": 2010, \"director\": \"Christopher Nolan\", \"rating\": 8.2},\n    ),\n    Document(\n        page_content=\"A psychologist / detective gets lost in a series of dreams within dreams within dreams and Inception reused the idea\",\n        metadata={\"year\": 2006, \"director\": \"Satoshi Kon\", \"rating\": 8.6},\n    ),\n    Document(\n        page_content=\"A bunch of normal-sized women are supremely wholesome and some men pine after them\",\n        metadata={\"year\": 2019, \"director\": \"Greta Gerwig\", \"rating\": 8.3},\n    ),\n    Document(\n        page_content=\"Toys come alive and have a blast doing so\",\n        metadata={\"year\": 1995, \"genre\": \"animated\"},\n    ),\n    Document(\n        page_content=\"Three men walk into the Zone, three men walk out of the Zone\",\n        metadata={\n            \"year\": 1979,\n            \"director\": \"Andrei Tarkovsky\",\n            \"genre\": \"thriller\",\n            \"rating\": 9.9,\n        },\n    ),\n]\n\n# Create embeddings for the documents\nembeddings_model = OpenAIEmbeddings()\n\nvectorstore = PGVector.from_documents(\n    docs, embeddings_model, connection=connection)\n\n# Define the fields for the query\nfields = [\n    AttributeInfo(\n        name=\"genre\",\n        description=\"The genre of the movie\",\n        type=\"string or list[string]\",\n    ),\n    AttributeInfo(\n        name=\"year\",\n        description=\"The year the movie was released\",\n        type=\"integer\",\n    ),\n    AttributeInfo(\n        name=\"director\",\n        description=\"The name of the movie director\",\n        type=\"string\",\n    ),\n    AttributeInfo(\n        name=\"rating\",\n        description=\"A 1-10 rating for the movie\",\n        type=\"float\",\n    ),\n]\n\ndescription = \"Brief summary of a movie\"\nllm = ChatOpenAI(model=\"gpt-3.5-turbo\", temperature=0)\nretriever = SelfQueryRetriever.from_llm(llm, vectorstore, description, fields)\n\n# This example only specifies a filter\nprint(retriever.invoke(\"I want to watch a movie rated higher than 8.5\"))\n\nprint('\\n')\n\n# This example specifies multiple filters\nprint(retriever.invoke(\n    \"What's a highly rated (above 8.5) science fiction film?\"))\n"
  },
  {
    "path": "ch3/py/i-sql-example.py",
    "content": "\"\"\"\nThe below example will use a SQLite connection with the Chinook database, which is a sample database that represents a digital media store. Follow these installation steps to create Chinook.db in the same directory as this notebook. You can also download and build the database via the command line:\n\n```bash\ncurl -s https://raw.githubusercontent.com/lerocha/chinook-database/master/ChinookDatabase/DataSources/Chinook_Sqlite.sql | sqlite3 Chinook.db\n\n```\n\nAfterwards, place `Chinook.db` in the same directory where this code is running.\n\n\"\"\"\n\nfrom langchain_community.tools import QuerySQLDatabaseTool\nfrom langchain_community.utilities import SQLDatabase\nfrom langchain.chains import create_sql_query_chain\n# replace this with the connection details of your db\nfrom langchain_openai import ChatOpenAI\n\ndb = SQLDatabase.from_uri(\"sqlite:///Chinook.db\")\nprint(db.get_usable_table_names())\nllm = ChatOpenAI(model=\"gpt-3.5-turbo\", temperature=0)\n\n# convert question to sql query\nwrite_query = create_sql_query_chain(llm, db)\n\n# Execute SQL query\nexecute_query = QuerySQLDatabaseTool(db=db)\n\n# combined chain = write_query | execute_query\ncombined_chain = write_query | execute_query\n\n# run the chain\nresult = combined_chain.invoke({\"question\": \"How many employees are there?\"})\n\nprint(result)\n"
  },
  {
    "path": "ch4/js/a-simple-memory.js",
    "content": "import { ChatPromptTemplate } from '@langchain/core/prompts';\nimport { ChatOpenAI } from '@langchain/openai';\n\nconst prompt = ChatPromptTemplate.fromMessages([\n  [\n    'system',\n    'You are a helpful assistant. Answer all questions to the best of your ability.',\n  ],\n  ['placeholder', '{messages}'],\n]);\nconst model = new ChatOpenAI();\nconst chain = prompt.pipe(model);\n\nconst response = await chain.invoke({\n  messages: [\n    [\n      'human',\n      'Translate this sentence from English to French: I love programming.',\n    ],\n    ['ai', \"J'adore programmer.\"],\n    ['human', 'What did you just say?'],\n  ],\n});\n\nconsole.log(response.content);\n"
  },
  {
    "path": "ch4/js/b-state-graph.js",
    "content": "import {\n  StateGraph,\n  Annotation,\n  messagesStateReducer,\n  START,\n  END,\n} from '@langchain/langgraph';\nimport { ChatOpenAI } from '@langchain/openai';\nimport { HumanMessage } from '@langchain/core/messages';\n\nconst State = {\n  messages: Annotation({\n    reducer: messagesStateReducer,\n    default: () => [],\n  }),\n};\n\nlet builder = new StateGraph(State);\n\nconst model = new ChatOpenAI();\n\nasync function chatbot(state) {\n  const answer = await model.invoke(state.messages);\n  return { messages: answer };\n}\n\nbuilder = builder.addNode('chatbot', chatbot);\n\nbuilder = builder.addEdge(START, 'chatbot').addEdge('chatbot', END);\n\nlet graph = builder.compile();\n\n// Run the graph\nconst input = { messages: [new HumanMessage('hi!')] };\nfor await (const chunk of await graph.stream(input)) {\n  console.log(chunk);\n}\n"
  },
  {
    "path": "ch4/js/c-persistent-memory.js",
    "content": "import {\n  StateGraph,\n  Annotation,\n  messagesStateReducer,\n  START,\n} from \"@langchain/langgraph\";\nimport { ChatOpenAI } from \"@langchain/openai\";\nimport { MemorySaver } from \"@langchain/langgraph\";\nimport { HumanMessage } from \"@langchain/core/messages\";\n\nconst State = {\n  messages: Annotation({\n    reducer: messagesStateReducer,\n    default: () => [],\n  }),\n};\n\nlet builder = new StateGraph(State);\n\nconst model = new ChatOpenAI();\n\nasync function chatbot(state) {\n  const answer = await model.invoke(state.messages);\n  return { messages: answer };\n}\n\nbuilder = builder.addNode(\"chatbot\", chatbot);\n\nbuilder = builder.addEdge(START, \"chatbot\").addEdge(\"chatbot\", END);\n\n// Add persistence\nconst graph = builder.compile({ checkpointer: new MemorySaver() });\n\n// Configure thread\nconst thread1 = { configurable: { thread_id: \"1\" } };\n\n// Run with persistence\nconst result_1 = await graph.invoke(\n  {\n    messages: [new HumanMessage(\"hi, my name is Jack!\")],\n  },\n  thread1,\n);\nconsole.log(result_1);\n\nconst result_2 = await graph.invoke(\n  {\n    messages: [new HumanMessage(\"what is my name?\")],\n  },\n  thread1,\n);\nconsole.log(result_2);\n\n// Get state\nawait graph.getState(thread1);\n"
  },
  {
    "path": "ch4/js/d-trim-messages.js",
    "content": "import {\n  AIMessage,\n  HumanMessage,\n  SystemMessage,\n  trimMessages,\n} from \"@langchain/core/messages\";\nimport { ChatOpenAI } from \"@langchain/openai\";\n\nconst messages = [\n  new SystemMessage(\"you're a good assistant\"),\n  new HumanMessage(\"hi! I'm bob\"),\n  new AIMessage(\"hi!\"),\n  new HumanMessage(\"I like vanilla ice cream\"),\n  new AIMessage(\"nice\"),\n  new HumanMessage(\"whats 2 + 2\"),\n  new AIMessage(\"4\"),\n  new HumanMessage(\"thanks\"),\n  new AIMessage(\"no problem!\"),\n  new HumanMessage(\"having fun?\"),\n  new AIMessage(\"yes!\"),\n];\n\nconst trimmer = trimMessages({\n  maxTokens: 65,\n  strategy: \"last\",\n  tokenCounter: new ChatOpenAI({ modelName: \"gpt-4o\" }),\n  includeSystem: true,\n  allowPartial: false,\n  startOn: \"human\",\n});\n\nconst trimmed = await trimmer.invoke(messages);\nconsole.log(trimmed);\n"
  },
  {
    "path": "ch4/js/e-filter-messages.js",
    "content": "import {\n  HumanMessage,\n  SystemMessage,\n  AIMessage,\n  filterMessages,\n} from '@langchain/core/messages';\n\nconst messages = [\n  new SystemMessage({ content: 'you are a good assistant', id: '1' }),\n  new HumanMessage({ content: 'example input', id: '2', name: 'example_user' }),\n  new AIMessage({\n    content: 'example output',\n    id: '3',\n    name: 'example_assistant',\n  }),\n  new HumanMessage({ content: 'real input', id: '4', name: 'bob' }),\n  new AIMessage({ content: 'real output', id: '5', name: 'alice' }),\n];\n\n// Filter for human messages\nconst filterByHumanMessages = filterMessages(messages, {\n  includeTypes: ['human'],\n});\nconsole.log(`Human messages: ${JSON.stringify(filterByHumanMessages)}`);\n\n// Filter to exclude names\nconst filterByExcludedNames = filterMessages(messages, {\n  excludeNames: ['example_user', 'example_assistant'],\n});\nconsole.log(\n  `\\nExcluding example names: ${JSON.stringify(filterByExcludedNames)}`\n);\n\n// Filter by types and IDs\nconst filterByTypesAndIDs = filterMessages(messages, {\n  includeTypes: ['human', 'ai'],\n  excludeIds: ['3'],\n});\nconsole.log(\n  `\\nFiltered by types and IDs: ${JSON.stringify(filterByTypesAndIDs)}`\n);\n"
  },
  {
    "path": "ch4/js/f-merge-messages.js",
    "content": "import {\n  HumanMessage,\n  SystemMessage,\n  AIMessage,\n  mergeMessageRuns,\n} from '@langchain/core/messages';\n\nconst messages = [\n  new SystemMessage(\"you're a good assistant.\"),\n  new SystemMessage('you always respond with a joke.'),\n  new HumanMessage({\n    content: [{ type: 'text', text: \"i wonder why it's called langchain\" }],\n  }),\n  new HumanMessage('and who is harrison chasing anyways'),\n  new AIMessage(\n    'Well, I guess they thought \"WordRope\" and \"SentenceString\" just didn\\'t have the same ring to it!'\n  ),\n  new AIMessage(\n    \"Why, he's probably chasing after the last cup of coffee in the office!\"\n  ),\n];\n\n// Merge consecutive messages\nconst mergedMessages = mergeMessageRuns(messages);\nconsole.log(mergedMessages);\n"
  },
  {
    "path": "ch4/py/a-simple-memory.py",
    "content": "from langchain_core.prompts import ChatPromptTemplate\nfrom langchain_openai import ChatOpenAI\n\nprompt = ChatPromptTemplate.from_messages([\n    (\"system\", \"You are a helpful assistant. Answer all questions to the best of         your ability.\"),\n    (\"placeholder\", \"{messages}\"),\n])\n\nmodel = ChatOpenAI()\n\nchain = prompt | model\n\nresponse = chain.invoke({\n    \"messages\": [\n        (\"human\", \"Translate this sentence from English to French: I love programming.\"),\n        (\"ai\", \"J'adore programmer.\"),\n        (\"human\", \"What did you just say?\"),\n    ],\n})\n\nprint(response.content)\n"
  },
  {
    "path": "ch4/py/b-state-graph.py",
    "content": "from typing import Annotated, TypedDict\n\nfrom langchain_core.messages import HumanMessage\nfrom langchain_openai import ChatOpenAI\nfrom langgraph.graph import StateGraph, START, END, add_messages\nfrom langgraph.checkpoint.memory import MemorySaver\n\n\nclass State(TypedDict):\n    messages: Annotated[list, add_messages]\n\n\nbuilder = StateGraph(State)\n\nmodel = ChatOpenAI()\n\n\ndef chatbot(state: State):\n    answer = model.invoke(state[\"messages\"])\n    return {\"messages\": [answer]}\n\n\n# Add the chatbot node\nbuilder.add_node(\"chatbot\", chatbot)\n\n# Add edges\nbuilder.add_edge(START, \"chatbot\")\nbuilder.add_edge(\"chatbot\", END)\n\ngraph = builder.compile()\n\n# Run the graph\ninput = {\"messages\": [HumanMessage(\"hi!\")]}\nfor chunk in graph.stream(input):\n    print(chunk)\n"
  },
  {
    "path": "ch4/py/c-persistent-memory.py",
    "content": "from typing import Annotated, TypedDict\n\nfrom langchain_core.messages import HumanMessage\nfrom langchain_openai import ChatOpenAI\nfrom langgraph.graph import StateGraph, START, END, add_messages\nfrom langgraph.checkpoint.memory import MemorySaver\n\n\nclass State(TypedDict):\n    messages: Annotated[list, add_messages]\n\n\nbuilder = StateGraph(State)\n\nmodel = ChatOpenAI()\n\n\ndef chatbot(state: State):\n    answer = model.invoke(state[\"messages\"])\n    return {\"messages\": [answer]}\n\n\nbuilder.add_node(\"chatbot\", chatbot)\nbuilder.add_edge(START, \"chatbot\")\nbuilder.add_edge(\"chatbot\", END)\n\n# Add persistence with MemorySaver\ngraph = builder.compile(checkpointer=MemorySaver())\n\n# Configure thread\nthread1 = {\"configurable\": {\"thread_id\": \"1\"}}\n\n# Run with persistence\nresult_1 = graph.invoke({\"messages\": [HumanMessage(\"hi, my name is Jack!\")]}, thread1)\nprint(result_1)\n\nresult_2 = graph.invoke({\"messages\": [HumanMessage(\"what is my name?\")]}, thread1)\nprint(result_2)\n\n# Get state\nprint(graph.get_state(thread1))\n"
  },
  {
    "path": "ch4/py/d-trim-messages.py",
    "content": "from langchain_core.messages import (\n    SystemMessage,\n    HumanMessage,\n    AIMessage,\n    trim_messages,\n)\nfrom langchain_openai import ChatOpenAI\n\n# Define sample messages\nmessages = [\n    SystemMessage(content=\"you're a good assistant\"),\n    HumanMessage(content=\"hi! I'm bob\"),\n    AIMessage(content=\"hi!\"),\n    HumanMessage(content=\"I like vanilla ice cream\"),\n    AIMessage(content=\"nice\"),\n    HumanMessage(content=\"whats 2 + 2\"),\n    AIMessage(content=\"4\"),\n    HumanMessage(content=\"thanks\"),\n    AIMessage(content=\"no problem!\"),\n    HumanMessage(content=\"having fun?\"),\n    AIMessage(content=\"yes!\"),\n]\n\n# Create trimmer\ntrimmer = trim_messages(\n    max_tokens=65,\n    strategy=\"last\",\n    token_counter=ChatOpenAI(model=\"gpt-4o\"),\n    include_system=True,\n    allow_partial=False,\n    start_on=\"human\",\n)\n\n# Apply trimming\ntrimmed = trimmer.invoke(messages)\nprint(trimmed)\n"
  },
  {
    "path": "ch4/py/e-filter-messages.py",
    "content": "from langchain_core.messages import (\n    AIMessage,\n    HumanMessage,\n    SystemMessage,\n    filter_messages,\n)\n\n# Sample messages\nmessages = [\n    SystemMessage(content=\"you are a good assistant\", id=\"1\"),\n    HumanMessage(content=\"example input\", id=\"2\", name=\"example_user\"),\n    AIMessage(content=\"example output\", id=\"3\", name=\"example_assistant\"),\n    HumanMessage(content=\"real input\", id=\"4\", name=\"bob\"),\n    AIMessage(content=\"real output\", id=\"5\", name=\"alice\"),\n]\n\n# Filter for human messages\nhuman_messages = filter_messages(messages, include_types=\"human\")\nprint(\"Human messages:\", human_messages)\n\n# Filter to exclude certain names\nexcluded_names = filter_messages(\n    messages, exclude_names=[\"example_user\", \"example_assistant\"]\n)\nprint(\"\\nExcluding example names:\", excluded_names)\n\n# Filter by types and IDs\nfiltered_messages = filter_messages(\n    messages, include_types=[\"human\", \"ai\"], exclude_ids=[\"3\"]\n)\nprint(\"\\nFiltered by types and IDs:\", filtered_messages)\n"
  },
  {
    "path": "ch4/py/f-merge-messages.py",
    "content": "from langchain_core.messages import (\n    AIMessage,\n    HumanMessage,\n    SystemMessage,\n    merge_message_runs,\n)\n\n# Sample messages with consecutive messages of same type\nmessages = [\n    SystemMessage(content=\"you're a good assistant.\"),\n    SystemMessage(content=\"you always respond with a joke.\"),\n    HumanMessage(\n        content=[{\"type\": \"text\", \"text\": \"i wonder why it's called langchain\"}]\n    ),\n    HumanMessage(content=\"and who is harrison chasing anyways\"),\n    AIMessage(\n        content='Well, I guess they thought \"WordRope\" and \"SentenceString\" just didn\\'t have the same ring to it!'\n    ),\n    AIMessage(\n        content=\"Why, he's probably chasing after the last cup of coffee in the office!\"\n    ),\n]\n\n# Merge consecutive messages\nmerged = merge_message_runs(messages)\nprint(merged)\n"
  },
  {
    "path": "ch5/js/a-chatbot.js",
    "content": "import {\n  StateGraph,\n  Annotation,\n  messagesStateReducer,\n  START,\n  END,\n} from '@langchain/langgraph';\n\nimport { ChatOpenAI } from '@langchain/openai';\nimport { HumanMessage } from '@langchain/core/messages';\n\nconst model = new ChatOpenAI();\n\nconst State = {\n  // Messages have the type \"list\". The `add_messages`\n  // function in the annotation defines how this state should\n  // be updated (in this case, it appends new messages to the\n  // list, rather than replacing the previous messages)\n  messages: Annotation({\n    reducer: messagesStateReducer,\n    default: () => [],\n  }),\n};\n\nasync function chatbot(state) {\n  const answer = await model.invoke(state.messages);\n  return { messages: answer };\n}\n\nconst builder = new StateGraph(State)\n  .addNode('chatbot', chatbot)\n  .addEdge(START, 'chatbot')\n  .addEdge('chatbot', END);\n\nconst graph = builder.compile();\n\n// Example usage\nconst input = { messages: [new HumanMessage('hi!')] };\nfor await (const chunk of await graph.stream(input)) {\n  console.log(chunk);\n}\n"
  },
  {
    "path": "ch5/js/b-sql-generator.js",
    "content": "import { HumanMessage, SystemMessage } from \"@langchain/core/messages\";\nimport { ChatOpenAI } from \"@langchain/openai\";\nimport {\n  StateGraph,\n  Annotation,\n  messagesStateReducer,\n  START,\n  END,\n} from \"@langchain/langgraph\";\n\n// useful to generate SQL query\nconst modelLowTemp = new ChatOpenAI({ temperature: 0.1 });\n// useful to generate natural language outputs\nconst modelHighTemp = new ChatOpenAI({ temperature: 0.7 });\n\nconst annotation = Annotation.Root({\n  messages: Annotation({ reducer: messagesStateReducer, default: () => [] }),\n  user_query: Annotation(),\n  sql_query: Annotation(),\n  sql_explanation: Annotation(),\n});\n\nconst generatePrompt = new SystemMessage(\n  \"You are a helpful data analyst, who generates SQL queries for users based on their questions.\",\n);\n\nasync function generateSql(state) {\n  const userMessage = new HumanMessage(state.user_query);\n  const messages = [generatePrompt, ...state.messages, userMessage];\n  const res = await modelLowTemp.invoke(messages);\n  return {\n    sql_query: res.content,\n    // update conversation history\n    messages: [userMessage, res],\n  };\n}\n\nconst explainPrompt = new SystemMessage(\n  \"You are a helpful data analyst, who explains SQL queries to users.\",\n);\n\nasync function explainSql(state) {\n  const messages = [explainPrompt, ...state.messages];\n  const res = await modelHighTemp.invoke(messages);\n  return {\n    sql_explanation: res.content,\n    // update conversation history\n    messages: res,\n  };\n}\n\nconst builder = new StateGraph(annotation)\n  .addNode(\"generate_sql\", generateSql)\n  .addNode(\"explain_sql\", explainSql)\n  .addEdge(START, \"generate_sql\")\n  .addEdge(\"generate_sql\", \"explain_sql\")\n  .addEdge(\"explain_sql\", END);\n\nconst graph = builder.compile();\n\n// Example usage\nconst result = await graph.invoke({\n  user_query: \"What is the total sales for each product?\",\n});\nconsole.log(result);\n"
  },
  {
    "path": "ch5/js/c-multi-rag.js",
    "content": "import { HumanMessage, SystemMessage } from \"@langchain/core/messages\";\nimport { ChatOpenAI, OpenAIEmbeddings } from \"@langchain/openai\";\nimport { MemoryVectorStore } from \"langchain/vectorstores/memory\";\nimport {\n  StateGraph,\n  Annotation,\n  messagesStateReducer,\n  START,\n  END,\n} from \"@langchain/langgraph\";\n\nconst embeddings = new OpenAIEmbeddings();\n// useful to generate SQL query\nconst modelLowTemp = new ChatOpenAI({ temperature: 0.1 });\n// useful to generate natural language outputs\nconst modelHighTemp = new ChatOpenAI({ temperature: 0.7 });\n\nconst annotation = Annotation.Root({\n  messages: Annotation({ reducer: messagesStateReducer, default: () => [] }),\n  user_query: Annotation(),\n  domain: Annotation(),\n  documents: Annotation(),\n  answer: Annotation(),\n});\n\n// Sample documents for testing\nconst sampleDocs = [\n  { pageContent: \"Patient medical record...\", metadata: { domain: \"records\" } },\n  {\n    pageContent: \"Insurance policy details...\",\n    metadata: { domain: \"insurance\" },\n  },\n];\n\n// Initialize vector stores\nconst medicalRecordsStore = await MemoryVectorStore.fromDocuments(\n  sampleDocs,\n  embeddings,\n);\nconst medicalRecordsRetriever = medicalRecordsStore.asRetriever();\n\nconst insuranceFaqsStore = await MemoryVectorStore.fromDocuments(\n  sampleDocs,\n  embeddings,\n);\nconst insuranceFaqsRetriever = insuranceFaqsStore.asRetriever();\n\nconst routerPrompt = new SystemMessage(\n  `You need to decide which domain to route the user query to. You have two domains to choose from:\n- records: contains medical records of the patient, such as diagnosis, treatment, and prescriptions.\n- insurance: contains frequently asked questions about insurance policies, claims, and coverage.\n\nOutput only the domain name.`,\n);\n\nasync function routerNode(state) {\n  const userMessage = new HumanMessage(state.user_query);\n  const messages = [routerPrompt, ...state.messages, userMessage];\n  const res = await modelLowTemp.invoke(messages);\n  return {\n    domain: res.content,\n    // update conversation history\n    messages: [userMessage, res],\n  };\n}\n\nfunction pickRetriever(state) {\n  if (state.domain === \"records\") {\n    return \"retrieve_medical_records\";\n  } else {\n    return \"retrieve_insurance_faqs\";\n  }\n}\n\nasync function retrieveMedicalRecords(state) {\n  const documents = await medicalRecordsRetriever.invoke(state.user_query);\n  return {\n    documents,\n  };\n}\n\nasync function retrieveInsuranceFaqs(state) {\n  const documents = await insuranceFaqsRetriever.invoke(state.user_query);\n  return {\n    documents,\n  };\n}\n\nconst medicalRecordsPrompt = new SystemMessage(\n  \"You are a helpful medical chatbot, who answers questions based on the patient's medical records, such as diagnosis, treatment, and prescriptions.\",\n);\n\nconst insuranceFaqsPrompt = new SystemMessage(\n  \"You are a helpful medical insurance chatbot, who answers frequently asked questions about insurance policies, claims, and coverage.\",\n);\n\nasync function generateAnswer(state) {\n  const prompt =\n    state.domain === \"records\" ? medicalRecordsPrompt : insuranceFaqsPrompt;\n  const messages = [\n    prompt,\n    ...state.messages,\n    new HumanMessage(`Documents: ${state.documents}`),\n  ];\n  const res = await modelHighTemp.invoke(messages);\n  return {\n    answer: res.content,\n    // update conversation history\n    messages: res,\n  };\n}\n\nconst builder = new StateGraph(annotation)\n  .addNode(\"router\", routerNode)\n  .addNode(\"retrieve_medical_records\", retrieveMedicalRecords)\n  .addNode(\"retrieve_insurance_faqs\", retrieveInsuranceFaqs)\n  .addNode(\"generate_answer\", generateAnswer)\n  .addEdge(START, \"router\")\n  .addConditionalEdges(\"router\", pickRetriever)\n  .addEdge(\"retrieve_medical_records\", \"generate_answer\")\n  .addEdge(\"retrieve_insurance_faqs\", \"generate_answer\")\n  .addEdge(\"generate_answer\", END);\n\nconst graph = builder.compile();\n\n// Example usage\nconst input = {\n  user_query: \"Am I covered for COVID-19 treatment?\",\n};\n\nfor await (const chunk of await graph.stream(input)) {\n  console.log(chunk);\n}\n"
  },
  {
    "path": "ch5/py/a-chatbot.py",
    "content": "from typing import Annotated, TypedDict\n\nfrom langgraph.graph import StateGraph, START, END\nfrom langgraph.graph.message import add_messages\nfrom langchain_openai import ChatOpenAI\nfrom langchain_core.messages import HumanMessage\n\nmodel = ChatOpenAI()\n\n\nclass State(TypedDict):\n    # Messages have the type \"list\". The `add_messages`\n    # function in the annotation defines how this state should\n    # be updated (in this case, it appends new messages to the\n    # list, rather than replacing the previous messages)\n    messages: Annotated[list, add_messages]\n\n\ndef chatbot(state: State):\n    answer = model.invoke(state[\"messages\"])\n    return {\"messages\": [answer]}\n\n\nbuilder = StateGraph(State)\n\nbuilder.add_node(\"chatbot\", chatbot)\n\nbuilder.add_edge(START, \"chatbot\")\nbuilder.add_edge(\"chatbot\", END)\n\ngraph = builder.compile()\n\n# Example usage\n\ninput = {\"messages\": [HumanMessage(\"hi!\")]}\nfor chunk in graph.stream(input):\n    print(chunk)\n"
  },
  {
    "path": "ch5/py/b-sql-generator.py",
    "content": "from typing import Annotated, TypedDict\n\nfrom langchain_core.messages import HumanMessage, SystemMessage\nfrom langchain_openai import ChatOpenAI\nfrom langgraph.graph import END, START, StateGraph\nfrom langgraph.graph.message import add_messages\n\n# useful to generate SQL query\nmodel_low_temp = ChatOpenAI(temperature=0.1)\n# useful to generate natural language outputs\nmodel_high_temp = ChatOpenAI(temperature=0.7)\n\n\nclass State(TypedDict):\n    # to track conversation history\n    messages: Annotated[list, add_messages]\n    # input\n    user_query: str\n    # output\n    sql_query: str\n    sql_explanation: str\n\n\nclass Input(TypedDict):\n    user_query: str\n\n\nclass Output(TypedDict):\n    sql_query: str\n    sql_explanation: str\n\n\ngenerate_prompt = SystemMessage(\n    \"You are a helpful data analyst, who generates SQL queries for users based on their questions.\"\n)\n\n\ndef generate_sql(state: State) -> State:\n    user_message = HumanMessage(state[\"user_query\"])\n    messages = [generate_prompt, *state[\"messages\"], user_message]\n    res = model_low_temp.invoke(messages)\n    return {\n        \"sql_query\": res.content,\n        # update conversation history\n        \"messages\": [user_message, res],\n    }\n\n\nexplain_prompt = SystemMessage(\n    \"You are a helpful data analyst, who explains SQL queries to users.\"\n)\n\n\ndef explain_sql(state: State) -> State:\n    messages = [\n        explain_prompt,\n        # contains user's query and SQL query from prev step\n        *state[\"messages\"],\n    ]\n    res = model_high_temp.invoke(messages)\n    return {\n        \"sql_explanation\": res.content,\n        # update conversation history\n        \"messages\": res,\n    }\n\n\nbuilder = StateGraph(State, input=Input, output=Output)\nbuilder.add_node(\"generate_sql\", generate_sql)\nbuilder.add_node(\"explain_sql\", explain_sql)\nbuilder.add_edge(START, \"generate_sql\")\nbuilder.add_edge(\"generate_sql\", \"explain_sql\")\nbuilder.add_edge(\"explain_sql\", END)\n\ngraph = builder.compile()\n\n# Example usage\nresult = graph.invoke({\"user_query\": \"What is the total sales for each product?\"})\nprint(result)\n"
  },
  {
    "path": "ch5/py/c-multi-rag.py",
    "content": "from typing import Annotated, Literal, TypedDict\n\nfrom langchain_core.documents import Document\nfrom langchain_core.messages import HumanMessage, SystemMessage\nfrom langchain_core.vectorstores.in_memory import InMemoryVectorStore\nfrom langchain_openai import ChatOpenAI, OpenAIEmbeddings\nfrom langgraph.graph import END, START, StateGraph\nfrom langgraph.graph.message import add_messages\n\nembeddings = OpenAIEmbeddings()\n# useful to generate SQL query\nmodel_low_temp = ChatOpenAI(temperature=0.1)\n# useful to generate natural language outputs\nmodel_high_temp = ChatOpenAI(temperature=0.7)\n\n\nclass State(TypedDict):\n    # to track conversation history\n    messages: Annotated[list, add_messages]\n    # input\n    user_query: str\n    # output\n    domain: Literal[\"records\", \"insurance\"]\n    documents: list[Document]\n    answer: str\n\n\nclass Input(TypedDict):\n    user_query: str\n\n\nclass Output(TypedDict):\n    documents: list[Document]\n    answer: str\n\n\n# Sample documents for testing\nsample_docs = [\n    Document(page_content=\"Patient medical record...\", metadata={\"domain\": \"records\"}),\n    Document(\n        page_content=\"Insurance policy details...\", metadata={\"domain\": \"insurance\"}\n    ),\n]\n\n# Initialize vector stores\nmedical_records_store = InMemoryVectorStore.from_documents(sample_docs, embeddings)\nmedical_records_retriever = medical_records_store.as_retriever()\n\ninsurance_faqs_store = InMemoryVectorStore.from_documents(sample_docs, embeddings)\ninsurance_faqs_retriever = insurance_faqs_store.as_retriever()\n\nrouter_prompt = SystemMessage(\n    \"\"\"You need to decide which domain to route the user query to. You have two domains to choose from:\n- records: contains medical records of the patient, such as diagnosis, treatment, and prescriptions.\n- insurance: contains frequently asked questions about insurance policies, claims, and coverage.\n\nOutput only the domain name.\"\"\"\n)\n\n\ndef router_node(state: State) -> State:\n    user_message = HumanMessage(state[\"user_query\"])\n    messages = [router_prompt, *state[\"messages\"], user_message]\n    res = model_low_temp.invoke(messages)\n    return {\n        \"domain\": res.content,\n        # update conversation history\n        \"messages\": [user_message, res],\n    }\n\n\ndef pick_retriever(\n    state: State,\n) -> Literal[\"retrieve_medical_records\", \"retrieve_insurance_faqs\"]:\n    if state[\"domain\"] == \"records\":\n        return \"retrieve_medical_records\"\n    else:\n        return \"retrieve_insurance_faqs\"\n\n\ndef retrieve_medical_records(state: State) -> State:\n    documents = medical_records_retriever.invoke(state[\"user_query\"])\n    return {\n        \"documents\": documents,\n    }\n\n\ndef retrieve_insurance_faqs(state: State) -> State:\n    documents = insurance_faqs_retriever.invoke(state[\"user_query\"])\n    return {\n        \"documents\": documents,\n    }\n\n\nmedical_records_prompt = SystemMessage(\n    \"You are a helpful medical chatbot, who answers questions based on the patient's medical records, such as diagnosis, treatment, and prescriptions.\"\n)\n\ninsurance_faqs_prompt = SystemMessage(\n    \"You are a helpful medical insurance chatbot, who answers frequently asked questions about insurance policies, claims, and coverage.\"\n)\n\n\ndef generate_answer(state: State) -> State:\n    if state[\"domain\"] == \"records\":\n        prompt = medical_records_prompt\n    else:\n        prompt = insurance_faqs_prompt\n    messages = [\n        prompt,\n        *state[\"messages\"],\n        HumanMessage(f\"Documents: {state['documents']}\"),\n    ]\n    res = model_high_temp.invoke(messages)\n    return {\n        \"answer\": res.content,\n        # update conversation history\n        \"messages\": res,\n    }\n\n\nbuilder = StateGraph(State, input=Input, output=Output)\nbuilder.add_node(\"router\", router_node)\nbuilder.add_node(\"retrieve_medical_records\", retrieve_medical_records)\nbuilder.add_node(\"retrieve_insurance_faqs\", retrieve_insurance_faqs)\nbuilder.add_node(\"generate_answer\", generate_answer)\nbuilder.add_edge(START, \"router\")\nbuilder.add_conditional_edges(\"router\", pick_retriever)\nbuilder.add_edge(\"retrieve_medical_records\", \"generate_answer\")\nbuilder.add_edge(\"retrieve_insurance_faqs\", \"generate_answer\")\nbuilder.add_edge(\"generate_answer\", END)\n\ngraph = builder.compile()\n\n# Example usage\ninput = {\"user_query\": \"Am I covered for COVID-19 treatment?\"}\nfor chunk in graph.stream(input):\n    print(chunk)\n"
  },
  {
    "path": "ch6/js/a-basic-agent.js",
    "content": "import { DuckDuckGoSearch } from \"@langchain/community/tools/duckduckgo_search\";\nimport { Calculator } from \"@langchain/community/tools/calculator\";\nimport {\n  StateGraph,\n  Annotation,\n  messagesStateReducer,\n  START,\n} from \"@langchain/langgraph\";\nimport { ToolNode, toolsCondition } from \"@langchain/langgraph/prebuilt\";\nimport { ChatOpenAI } from \"@langchain/openai\";\nimport { HumanMessage } from \"@langchain/core/messages\";\n\nconst search = new DuckDuckGoSearch();\nconst calculator = new Calculator();\nconst tools = [search, calculator];\nconst model = new ChatOpenAI({\n  temperature: 0.1,\n}).bindTools(tools);\n\nconst annotation = Annotation.Root({\n  messages: Annotation({\n    reducer: messagesStateReducer,\n    default: () => [],\n  }),\n});\n\nasync function modelNode(state) {\n  const res = await model.invoke(state.messages);\n  return { messages: res };\n}\n\nconst builder = new StateGraph(annotation)\n  .addNode(\"model\", modelNode)\n  .addNode(\"tools\", new ToolNode(tools))\n  .addEdge(START, \"model\")\n  .addConditionalEdges(\"model\", toolsCondition)\n  .addEdge(\"tools\", \"model\");\n\nconst graph = builder.compile();\n\n// Example usage\nconst input = {\n  messages: [\n    new HumanMessage(\n      \"How old was the 30th president of the United States when he died?\",\n    ),\n  ],\n};\n\nfor await (const c of await graph.stream(input)) {\n  console.log(c);\n}\n"
  },
  {
    "path": "ch6/js/b-force-first-tool.js",
    "content": "import { DuckDuckGoSearch } from \"@langchain/community/tools/duckduckgo_search\";\nimport { Calculator } from \"@langchain/community/tools/calculator\";\nimport { AIMessage, HumanMessage } from \"@langchain/core/messages\";\nimport {\n  StateGraph,\n  Annotation,\n  messagesStateReducer,\n  START,\n} from \"@langchain/langgraph\";\nimport { ToolNode, toolsCondition } from \"@langchain/langgraph/prebuilt\";\nimport { ChatOpenAI } from \"@langchain/openai\";\n\nconst search = new DuckDuckGoSearch();\nconst calculator = new Calculator();\nconst tools = [search, calculator];\nconst model = new ChatOpenAI({ temperature: 0.1 }).bindTools(tools);\n\nconst annotation = Annotation.Root({\n  messages: Annotation({ reducer: messagesStateReducer, default: () => [] }),\n});\n\nasync function firstModelNode(state) {\n  const query = state.messages[state.messages.length - 1].content;\n  const searchToolCall = {\n    name: \"duckduckgo_search\",\n    args: { query },\n    id: Math.random().toString(),\n  };\n  return {\n    messages: [new AIMessage({ content: \"\", tool_calls: [searchToolCall] })],\n  };\n}\n\nasync function modelNode(state) {\n  const res = await model.invoke(state.messages);\n  return { messages: res };\n}\n\nconst builder = new StateGraph(annotation)\n  .addNode(\"first_model\", firstModelNode)\n  .addNode(\"model\", modelNode)\n  .addNode(\"tools\", new ToolNode(tools))\n  .addEdge(START, \"first_model\")\n  .addEdge(\"first_model\", \"tools\")\n  .addEdge(\"tools\", \"model\")\n  .addConditionalEdges(\"model\", toolsCondition);\n\nconst graph = builder.compile();\n\n// Example usage\nconst input = {\n  messages: [\n    new HumanMessage(\n      \"How old was the 30th president of the United States when he died?\",\n    ),\n  ],\n};\n\nfor await (const c of await graph.stream(input)) {\n  console.log(c);\n}\n"
  },
  {
    "path": "ch6/js/c-many-tools.js",
    "content": "import { DuckDuckGoSearch } from '@langchain/community/tools/duckduckgo_search';\nimport { Calculator } from '@langchain/community/tools/calculator';\nimport { ChatOpenAI } from '@langchain/openai';\nimport { OpenAIEmbeddings } from '@langchain/openai';\nimport { Document } from '@langchain/core/documents';\nimport { MemoryVectorStore } from 'langchain/vectorstores/memory';\nimport {\n  StateGraph,\n  Annotation,\n  messagesStateReducer,\n  START,\n} from '@langchain/langgraph';\nimport { ToolNode, toolsCondition } from '@langchain/langgraph/prebuilt';\nimport { HumanMessage } from '@langchain/core/messages';\n\nconst search = new DuckDuckGoSearch();\nconst calculator = new Calculator();\nconst tools = [search, calculator];\n\nconst embeddings = new OpenAIEmbeddings();\nconst model = new ChatOpenAI({ temperature: 0.1 });\n\n// Create vector store and retriever\nconst toolsStore = await MemoryVectorStore.fromDocuments(\n  tools.map(\n    (tool) =>\n      new Document({\n        pageContent: tool.description,\n        metadata: { name: tool.constructor.name },\n      })\n  ),\n  embeddings\n);\nconst toolsRetriever = toolsStore.asRetriever();\n\nconst annotation = Annotation.Root({\n  messages: Annotation({ reducer: messagesStateReducer, default: () => [] }),\n  selected_tools: Annotation(),\n});\n\nasync function modelNode(state) {\n  const selectedTools = tools.filter((tool) =>\n    state.selected_tools.includes(tool.constructor.name)\n  );\n  const res = await model.bindTools(selectedTools).invoke(state.messages);\n  return { messages: res };\n}\n\nasync function selectTools(state) {\n  const query = state.messages[state.messages.length - 1].content;\n  const toolDocs = await toolsRetriever.invoke(query);\n  return {\n    selected_tools: toolDocs.map((doc) => doc.metadata.name),\n  };\n}\n\nconst builder = new StateGraph(annotation)\n  .addNode('select_tools', selectTools)\n  .addNode('model', modelNode)\n  .addNode('tools', new ToolNode(tools))\n  .addEdge(START, 'select_tools')\n  .addEdge('select_tools', 'model')\n  .addConditionalEdges('model', toolsCondition)\n  .addEdge('tools', 'model');\n\nconst graph = builder.compile();\n\n// Example usage\nconst input = {\n  messages: [\n    new HumanMessage(\n      'How old was the 30th president of the United States when he died?'\n    ),\n  ],\n};\n\nfor await (const c of await graph.stream(input)) {\n  console.log(c);\n}\n"
  },
  {
    "path": "ch6/py/a-basic-agent.py",
    "content": "import ast\nfrom typing import Annotated, TypedDict\n\nfrom langchain_community.tools import DuckDuckGoSearchRun\nfrom langchain_core.messages import HumanMessage\nfrom langchain_core.tools import tool\nfrom langchain_openai import ChatOpenAI\nfrom langgraph.graph import START, StateGraph\nfrom langgraph.graph.message import add_messages\nfrom langgraph.prebuilt import ToolNode, tools_condition\n\n\n@tool\ndef calculator(query: str) -> str:\n    \"\"\"A simple calculator tool. Input should be a mathematical expression.\"\"\"\n    return ast.literal_eval(query)\n\n\nsearch = DuckDuckGoSearchRun()\ntools = [search, calculator]\nmodel = ChatOpenAI(temperature=0.1).bind_tools(tools)\n\n\nclass State(TypedDict):\n    messages: Annotated[list, add_messages]\n\n\ndef model_node(state: State) -> State:\n    res = model.invoke(state[\"messages\"])\n    return {\"messages\": res}\n\n\nbuilder = StateGraph(State)\nbuilder.add_node(\"model\", model_node)\nbuilder.add_node(\"tools\", ToolNode(tools))\nbuilder.add_edge(START, \"model\")\nbuilder.add_conditional_edges(\"model\", tools_condition)\nbuilder.add_edge(\"tools\", \"model\")\n\ngraph = builder.compile()\n\n# Example usage\n\ninput = {\n    \"messages\": [\n        HumanMessage(\n            \"How old was the 30th president of the United States when he died?\"\n        )\n    ]\n}\n\nfor c in graph.stream(input):\n    print(c)\n"
  },
  {
    "path": "ch6/py/b-force-first-tool.py",
    "content": "import ast\nfrom typing import Annotated, TypedDict\nfrom uuid import uuid4\n\nfrom langchain_community.tools import DuckDuckGoSearchRun\nfrom langchain_core.messages import AIMessage, HumanMessage, ToolCall\nfrom langchain_core.tools import tool\nfrom langchain_openai import ChatOpenAI\n\nfrom langgraph.graph import START, StateGraph\nfrom langgraph.graph.message import add_messages\nfrom langgraph.prebuilt import ToolNode, tools_condition\n\n\n@tool\ndef calculator(query: str) -> str:\n    \"\"\"A simple calculator tool. Input should be a mathematical expression.\"\"\"\n    return ast.literal_eval(query)\n\n\nsearch = DuckDuckGoSearchRun()\ntools = [search, calculator]\nmodel = ChatOpenAI(temperature=0.1).bind_tools(tools)\n\n\nclass State(TypedDict):\n    messages: Annotated[list, add_messages]\n\n\ndef model_node(state: State) -> State:\n    res = model.invoke(state[\"messages\"])\n    return {\"messages\": res}\n\n\ndef first_model(state: State) -> State:\n    query = state[\"messages\"][-1].content\n    search_tool_call = ToolCall(\n        name=\"duckduckgo_search\", args={\"query\": query}, id=uuid4().hex\n    )\n    return {\"messages\": AIMessage(content=\"\", tool_calls=[search_tool_call])}\n\n\nbuilder = StateGraph(State)\nbuilder.add_node(\"first_model\", first_model)\nbuilder.add_node(\"model\", model_node)\nbuilder.add_node(\"tools\", ToolNode(tools))\nbuilder.add_edge(START, \"first_model\")\nbuilder.add_edge(\"first_model\", \"tools\")\nbuilder.add_conditional_edges(\"model\", tools_condition)\nbuilder.add_edge(\"tools\", \"model\")\n\ngraph = builder.compile()\n\n# Example usage\ninput = {\n    \"messages\": [\n        HumanMessage(\n            \"How old was the 30th president of the United States when he died?\"\n        )\n    ]\n}\n\nfor c in graph.stream(input):\n    print(c)\n"
  },
  {
    "path": "ch6/py/c-many-tools.py",
    "content": "import ast\nfrom typing import Annotated, TypedDict\n\nfrom langchain_community.tools import DuckDuckGoSearchRun\nfrom langchain_core.documents import Document\nfrom langchain_core.messages import HumanMessage\nfrom langchain_core.tools import tool\nfrom langchain_core.vectorstores.in_memory import InMemoryVectorStore\nfrom langchain_openai import ChatOpenAI, OpenAIEmbeddings\n\nfrom langgraph.graph import START, StateGraph\nfrom langgraph.graph.message import add_messages\nfrom langgraph.prebuilt import ToolNode, tools_condition\n\n\n@tool\ndef calculator(query: str) -> str:\n    \"\"\"A simple calculator tool. Input should be a mathematical expression.\"\"\"\n    return ast.literal_eval(query)\n\n\nsearch = DuckDuckGoSearchRun()\ntools = [search, calculator]\n\nembeddings = OpenAIEmbeddings()\nmodel = ChatOpenAI(temperature=0.1)\n\ntools_retriever = InMemoryVectorStore.from_documents(\n    [Document(tool.description, metadata={\"name\": tool.name}) for tool in tools],\n    embeddings,\n).as_retriever()\n\n\nclass State(TypedDict):\n    messages: Annotated[list, add_messages]\n    selected_tools: list[str]\n\n\ndef model_node(state: State) -> State:\n    selected_tools = [tool for tool in tools if tool.name in state[\"selected_tools\"]]\n    res = model.bind_tools(selected_tools).invoke(state[\"messages\"])\n    return {\"messages\": res}\n\n\ndef select_tools(state: State) -> State:\n    query = state[\"messages\"][-1].content\n    tool_docs = tools_retriever.invoke(query)\n    return {\"selected_tools\": [doc.metadata[\"name\"] for doc in tool_docs]}\n\n\nbuilder = StateGraph(State)\nbuilder.add_node(\"select_tools\", select_tools)\nbuilder.add_node(\"model\", model_node)\nbuilder.add_node(\"tools\", ToolNode(tools))\nbuilder.add_edge(START, \"select_tools\")\nbuilder.add_edge(\"select_tools\", \"model\")\nbuilder.add_conditional_edges(\"model\", tools_condition)\nbuilder.add_edge(\"tools\", \"model\")\n\ngraph = builder.compile()\n\n# Example usage\ninput = {\n    \"messages\": [\n        HumanMessage(\n            \"How old was the 30th president of the United States when he died?\"\n        )\n    ]\n}\n\nfor c in graph.stream(input):\n    print(c)\n"
  },
  {
    "path": "ch7/js/a-reflection.js",
    "content": "import {\n  AIMessage,\n  SystemMessage,\n  HumanMessage,\n} from '@langchain/core/messages';\nimport { ChatOpenAI } from '@langchain/openai';\nimport {\n  StateGraph,\n  Annotation,\n  messagesStateReducer,\n  START,\n  END,\n} from '@langchain/langgraph';\n\nconst model = new ChatOpenAI();\n\nconst annotation = Annotation.Root({\n  messages: Annotation({ reducer: messagesStateReducer, default: () => [] }),\n});\n\nconst generatePrompt = new SystemMessage(\n  `You are an essay assistant tasked with writing excellent 3-paragraph essays.\nGenerate the best essay possible for the user's request.\nIf the user provides critique, respond with a revised version of your previous attempts.`\n);\n\nasync function generate(state) {\n  const answer = await model.invoke([generatePrompt, ...state.messages]);\n  return { messages: [answer] };\n}\n\nconst reflectionPrompt = new SystemMessage(\n  `You are a teacher grading an essay submission. Generate critique and recommendations for the user's submission.\nProvide detailed recommendations, including requests for length, depth, style, etc.`\n);\n\nasync function reflect(state) {\n  // Invert the messages to get the LLM to reflect on its own output\n  const clsMap = {\n    ai: HumanMessage,\n    human: AIMessage,\n  };\n  // First message is the original user request. We hold it the same for all nodes\n  const translated = [\n    reflectionPrompt,\n    state.messages[0],\n    ...state.messages\n      .slice(1)\n      .map((msg) => new clsMap[msg._getType()](msg.content)),\n  ];\n  const answer = await model.invoke(translated);\n  // We treat the output of this as human feedback for the generator\n  return { messages: [new HumanMessage({ content: answer.content })] };\n}\n\nfunction shouldContinue(state) {\n  if (state.messages.length > 6) {\n    // End after 3 iterations, each with 2 messages\n    return END;\n  } else {\n    return 'reflect';\n  }\n}\n\nconst builder = new StateGraph(annotation)\n  .addNode('generate', generate)\n  .addNode('reflect', reflect)\n  .addEdge(START, 'generate')\n  .addConditionalEdges('generate', shouldContinue)\n  .addEdge('reflect', 'generate');\n\nconst graph = builder.compile();\n\n// Example usage\nconst initialState = {\n  messages: [\n    new HumanMessage(\n      \"Write an essay about the relevance of 'The Little Prince' today.\"\n    ),\n  ],\n};\n\nfor await (const output of await graph.stream(initialState)) {\n  const messageType = output.generate ? 'generate' : 'reflect';\n  console.log(\n    '\\nNew message:',\n    output[messageType].messages[\n      output[messageType].messages.length - 1\n    ].content.slice(0, 100),\n    '...'\n  );\n}\n"
  },
  {
    "path": "ch7/js/b-subgraph-direct.js",
    "content": "import { StateGraph, START, Annotation } from '@langchain/langgraph';\n\nconst StateAnnotation = Annotation.Root({\n  foo: Annotation(), // string type\n});\n\nconst SubgraphStateAnnotation = Annotation.Root({\n  foo: Annotation(), // shared with parent graph state\n  bar: Annotation(),\n});\n\n// Define subgraph\nconst subgraphNode = async (state) => {\n  // note that this subgraph node can communicate with\n  // the parent graph via the shared \"foo\" key\n  return { foo: state.foo + 'bar' };\n};\n\nconst subgraph = new StateGraph(SubgraphStateAnnotation)\n  .addNode('subgraph', subgraphNode)\n  .addEdge(START, 'subgraph')\n  // Additional subgraph setup would go here\n  .compile();\n\n// Define parent graph\nconst parentGraph = new StateGraph(StateAnnotation)\n  .addNode('subgraph', subgraph)\n  .addEdge(START, 'subgraph')\n  // Additional parent graph setup would go here\n  .compile();\n\n// Example usage\nconst initialState = { foo: 'hello' };\nconst result = await parentGraph.invoke(initialState);\nconsole.log(`Result: ${JSON.stringify(result)}`); // Should append \"bar\" to the foo value\n"
  },
  {
    "path": "ch7/js/c-subgraph-function.js",
    "content": "import { StateGraph, START, Annotation } from '@langchain/langgraph';\n\nconst StateAnnotation = Annotation.Root({\n  foo: Annotation(),\n});\n\nconst SubgraphStateAnnotation = Annotation.Root({\n  // note that none of these keys are shared with the parent graph state\n  bar: Annotation(),\n  baz: Annotation(),\n});\n\n// Define subgraph\nconst subgraphNode = async (state) => {\n  return { bar: state.bar + 'baz' };\n};\n\nconst subgraph = new StateGraph(SubgraphStateAnnotation)\n  .addNode('subgraph', subgraphNode)\n  .addEdge(START, 'subgraph')\n  // Additional subgraph setup would go here\n  .compile();\n\n// Define parent graph\nconst subgraphWrapperNode = async (state) => {\n  // transform the state to the subgraph state\n  const response = await subgraph.invoke({\n    bar: state.foo,\n  });\n  // transform response back to the parent state\n  return {\n    foo: response.bar,\n  };\n};\n\nconst parentGraph = new StateGraph(StateAnnotation)\n  .addNode('subgraph', subgraphWrapperNode)\n  .addEdge(START, 'subgraph')\n  // Additional parent graph setup would go here\n  .compile();\n\n// Example usage\n\nconst initialState = { foo: 'hello' };\nconst result = await parentGraph.invoke(initialState);\nconsole.log(`Result: ${JSON.stringify(result)}`); // Should transform foo->bar, append \"baz\", then transform bar->foo\n"
  },
  {
    "path": "ch7/js/d-supervisor.js",
    "content": "import { ChatOpenAI } from \"langchain-openai\";\nimport {\n  StateGraph,\n  Annotation,\n  MessagesAnnotation,\n  START,\n  END,\n} from \"@langchain/langgraph\";\nimport { z } from \"zod\";\n\n// Define decision schema\nconst SupervisorDecision = z.object({\n  next: z.enum([\"researcher\", \"coder\", \"FINISH\"]),\n});\n\n// Initialize model\nconst model = new ChatOpenAI({ model: \"gpt-4\", temperature: 0 });\nconst modelWithStructuredOutput =\n  model.withStructuredOutput(SupervisorDecision);\n\n// Define available agents\nconst agents = [\"researcher\", \"coder\"];\n\n// Define system prompts\nconst systemPromptPart1 = `You are a supervisor tasked with managing a conversation between the following workers: ${agents.join(\n  \", \",\n)}. Given the following user request, respond with the worker to act next. Each worker will perform a task and respond with their results and status. When finished, respond with FINISH.`;\n\nconst systemPromptPart2 = `Given the conversation above, who should act next? Or should we FINISH? Select one of: ${agents.join(\n  \", \",\n)}, FINISH`;\n\n// Define supervisor\nconst supervisor = async (state) => {\n  const messages = [\n    { role: \"system\", content: systemPromptPart1 },\n    ...state.messages,\n    { role: \"system\", content: systemPromptPart2 },\n  ];\n\n  return await modelWithStructuredOutput.invoke({ messages });\n};\n\n// Define state type\nconst StateAnnotation = Annotation.Root({\n  ...MessagesAnnotation.spec,\n  next: Annotation(\"researcher\" | \"coder\" | \"FINISH\"),\n});\n\n// Define agent functions\nconst researcher = async (state) => {\n  const response = await model.invoke([\n    {\n      role: \"system\",\n      content:\n        \"You are a research assistant. Analyze the request and provide relevant information.\",\n    },\n    state.messages[0],\n  ]);\n  return { messages: [response] };\n};\n\nconst coder = async (state) => {\n  const response = await model.invoke([\n    {\n      role: \"system\",\n      content:\n        \"You are a coding assistant. Implement the requested functionality.\",\n    },\n    state.messages[0],\n  ]);\n  return { messages: [response] };\n};\n\n// Build the graph\nconst graph = new StateGraph(StateAnnotation)\n  .addNode(\"supervisor\", supervisor)\n  .addNode(\"researcher\", researcher)\n  .addNode(\"coder\", coder)\n  .addEdge(START, \"supervisor\")\n  // Route to one of the agents or exit based on the supervisor's decision\n  .addConditionalEdges(\"supervisor\", async (state) =>\n    state.next === \"FINISH\" ? END : state.next,\n  )\n  .addEdge(\"researcher\", \"supervisor\")\n  .addEdge(\"coder\", \"supervisor\")\n  .compile();\n\n// Example usage\n\nconst initialState = {\n  messages: [\n    {\n      role: \"user\",\n      content: \"I need help analyzing some data and creating a visualization.\",\n    },\n  ],\n  next: \"supervisor\",\n};\n\nfor await (const output of graph.stream(initialState)) {\n  console.log(`\\nStep decision: ${output.next || \"N/A\"}`);\n  if (output.messages) {\n    console.log(\n      `Response: ${output.messages[output.messages.length - 1].content.slice(\n        0,\n        100,\n      )}...`,\n    );\n  }\n}\n"
  },
  {
    "path": "ch7/py/a-reflection.py",
    "content": "from typing import Annotated, TypedDict\n\nfrom langchain_core.messages import (\n    AIMessage,\n    BaseMessage,\n    HumanMessage,\n    SystemMessage,\n)\nfrom langchain_openai import ChatOpenAI\nfrom langgraph.graph import END, START, StateGraph\nfrom langgraph.graph.message import add_messages\n\n# Initialize chat model\nmodel = ChatOpenAI()\n\n\n# Define state type\nclass State(TypedDict):\n    messages: Annotated[list[BaseMessage], add_messages]\n\n\n# Define prompts\ngenerate_prompt = SystemMessage(\n    \"You are an essay assistant tasked with writing excellent 3-paragraph essays.\"\n    \" Generate the best essay possible for the user's request.\"\n    \" If the user provides critique, respond with a revised version of your previous attempts.\"\n)\n\nreflection_prompt = SystemMessage(\n    \"You are a teacher grading an essay submission. Generate critique and recommendations for the user's submission.\"\n    \" Provide detailed recommendations, including requests for length, depth, style, etc.\"\n)\n\n\ndef generate(state: State) -> State:\n    answer = model.invoke([generate_prompt] + state[\"messages\"])\n    return {\"messages\": [answer]}\n\n\ndef reflect(state: State) -> State:\n    # Invert the messages to get the LLM to reflect on its own output\n    cls_map = {AIMessage: HumanMessage, HumanMessage: AIMessage}\n    # First message is the original user request. We hold it the same for all nodes\n    translated = [reflection_prompt, state[\"messages\"][0]] + [\n        cls_map[msg.__class__](content=msg.content) for msg in state[\"messages\"][1:]\n    ]\n    answer = model.invoke(translated)\n    # We treat the output of this as human feedback for the generator\n    return {\"messages\": [HumanMessage(content=answer.content)]}\n\n\ndef should_continue(state: State):\n    if len(state[\"messages\"]) > 6:\n        # End after 3 iterations, each with 2 messages\n        return END\n    else:\n        return \"reflect\"\n\n\n# Build the graph\nbuilder = StateGraph(State)\nbuilder.add_node(\"generate\", generate)\nbuilder.add_node(\"reflect\", reflect)\nbuilder.add_edge(START, \"generate\")\nbuilder.add_conditional_edges(\"generate\", should_continue)\nbuilder.add_edge(\"reflect\", \"generate\")\n\ngraph = builder.compile()\n\n# Example usage\ninitial_state = {\n    \"messages\": [\n        HumanMessage(\n            content=\"Write an essay about the relevance of 'The Little Prince' today.\"\n        )\n    ]\n}\n\n# Run the graph\nfor output in graph.stream(initial_state):\n    message_type = \"generate\" if \"generate\" in output else \"reflect\"\n    print(\"\\nNew message:\", output[message_type]\n          [\"messages\"][-1].content[:100], \"...\")\n"
  },
  {
    "path": "ch7/py/b-subgraph-direct.py",
    "content": "from typing import TypedDict\n\nfrom langgraph.graph import START, StateGraph\n\n\n# Define the state types for parent and subgraph\nclass State(TypedDict):\n    foo: str  # this key is shared with the subgraph\n\n\nclass SubgraphState(TypedDict):\n    foo: str  # this key is shared with the parent graph\n    bar: str\n\n\n# Define subgraph\ndef subgraph_node(state: SubgraphState):\n    # note that this subgraph node can communicate with the parent graph via the shared \"foo\" key\n    return {\"foo\": state[\"foo\"] + \"bar\"}\n\n\nsubgraph_builder = StateGraph(SubgraphState)\nsubgraph_builder.add_node(\"subgraph_node\", subgraph_node)\n# Additional subgraph setup would go here\nsubgraph = subgraph_builder.compile()\n\n# Define parent graph\nbuilder = StateGraph(State)\nbuilder.add_node(\"subgraph\", subgraph)\nbuilder.add_edge(START, \"subgraph\")\n# Additional parent graph setup would go here\ngraph = builder.compile()\n\n# Example usage\ninitial_state = {\"foo\": \"hello\"}\nresult = graph.invoke(initial_state)\nprint(f\"Result: {result}\")  # Should append \"bar\" to the foo value\n"
  },
  {
    "path": "ch7/py/c-subgraph-function.py",
    "content": "from typing import TypedDict\nfrom langgraph.graph import START, StateGraph\n\n\nclass State(TypedDict):\n    foo: str\n\n\nclass SubgraphState(TypedDict):\n    # none of these keys are shared with the parent graph state\n    bar: str\n    baz: str\n\n\n# Define subgraph\ndef subgraph_node(state: SubgraphState):\n    return {\"bar\": state[\"bar\"] + \"baz\"}\n\n\nsubgraph_builder = StateGraph(SubgraphState)\nsubgraph_builder.add_node(\"subgraph_node\", subgraph_node)\nsubgraph_builder.add_edge(START, \"subgraph_node\")\n# Additional subgraph setup would go here\nsubgraph = subgraph_builder.compile()\n\n\n# Define parent graph node that invokes subgraph\ndef node(state: State):\n    # transform the state to the subgraph state\n    response = subgraph.invoke({\"bar\": state[\"foo\"]})\n    # transform response back to the parent state\n    return {\"foo\": response[\"bar\"]}\n\n\nbuilder = StateGraph(State)\n# note that we are using `node` function instead of a compiled subgraph\nbuilder.add_node(\"node\", node)\nbuilder.add_edge(START, \"node\")\n# Additional parent graph setup would go here\ngraph = builder.compile()\n\n# Example usage\ninitial_state = {\"foo\": \"hello\"}\nresult = graph.invoke(initial_state)\nprint(\n    f\"Result: {result}\"\n)  # Should transform foo->bar, append \"baz\", then transform bar->foo\n"
  },
  {
    "path": "ch7/py/d-supervisor.py",
    "content": "from typing import Literal\n\nfrom langchain_openai import ChatOpenAI\nfrom langgraph.graph import StateGraph, MessagesState, START\nfrom pydantic import BaseModel\n\n\nclass SupervisorDecision(BaseModel):\n    next: Literal[\"researcher\", \"coder\", \"FINISH\"]\n\n\n# Initialize model\nmodel = ChatOpenAI(model=\"gpt-4\", temperature=0)\nmodel = model.with_structured_output(SupervisorDecision)\n\n# Define available agents\nagents = [\"researcher\", \"coder\"]\n\n# Define system prompts\nsystem_prompt_part_1 = f\"\"\"You are a supervisor tasked with managing a conversation between the  \nfollowing workers: {agents}. Given the following user request,  \nrespond with the worker to act next. Each worker will perform a  \ntask and respond with their results and status. When finished,  \nrespond with FINISH.\"\"\"\n\nsystem_prompt_part_2 = f\"\"\"Given the conversation above, who should act next? Or should we FINISH? Select one of: {\", \".join(agents)}, FINISH\"\"\"\n\n\ndef supervisor(state):\n    messages = [\n        (\"system\", system_prompt_part_1),\n        *state[\"messages\"],\n        (\"system\", system_prompt_part_2),\n    ]\n    return model.invoke(messages)\n\n\n# Define agent state\nclass AgentState(MessagesState):\n    next: Literal[\"researcher\", \"coder\", \"FINISH\"]\n\n\n# Define agent functions\ndef researcher(state: AgentState):\n    # In a real implementation, this would do research tasks\n    response = model.invoke(\n        [\n            {\n                \"role\": \"system\",\n                \"content\": \"You are a research assistant. Analyze the request and provide relevant information.\",\n            },\n            {\"role\": \"user\", \"content\": state[\"messages\"][0].content},\n        ]\n    )\n    return {\"messages\": [response]}\n\n\ndef coder(state: AgentState):\n    # In a real implementation, this would write code\n    response = model.invoke(\n        [\n            {\n                \"role\": \"system\",\n                \"content\": \"You are a coding assistant. Implement the requested functionality.\",\n            },\n            {\"role\": \"user\", \"content\": state[\"messages\"][0].content},\n        ]\n    )\n    return {\"messages\": [response]}\n\n\n# Build the graph\nbuilder = StateGraph(AgentState)\nbuilder.add_node(\"supervisor\", supervisor)\nbuilder.add_node(\"researcher\", researcher)\nbuilder.add_node(\"coder\", coder)\n\nbuilder.add_edge(START, \"supervisor\")\n# Route to one of the agents or exit based on the supervisor's decision\nbuilder.add_conditional_edges(\"supervisor\", lambda state: state[\"next\"])\nbuilder.add_edge(\"researcher\", \"supervisor\")\nbuilder.add_edge(\"coder\", \"supervisor\")\n\ngraph = builder.compile()\n\n# Example usage\ninitial_state = {\n    \"messages\": [\n        {\n            \"role\": \"user\",\n            \"content\": \"I need help analyzing some data and creating a visualization.\",\n        }\n    ],\n    \"next\": \"supervisor\",\n}\n\nfor output in graph.stream(initial_state):\n    print(f\"\\nStep decision: {output.get('next', 'N/A')}\")\n    if output.get(\"messages\"):\n        print(f\"Response: {output['messages'][-1].content[:100]}...\")\n"
  },
  {
    "path": "ch8/js/a-structured-output.js",
    "content": "import { z } from \"zod\";\nimport { ChatOpenAI } from \"@langchain/openai\";\n\nconst joke = z.object({\n  setup: z.string().describe(\"The setup of the joke\"),\n  punchline: z.string().describe(\"The punchline to the joke\"),\n});\n\nlet model = new ChatOpenAI({\n  model: \"gpt-3.5-turbo-0125\",\n  temperature: 0,\n});\n\nmodel = model.withStructuredOutput(joke);\n\nconst result = await model.invoke(\"Tell me a joke about cats\");\nconsole.log(result);\n"
  },
  {
    "path": "ch8/js/b-streaming-output.js",
    "content": "import { HumanMessage } from \"@langchain/core/messages\";\n\n// Assuming graph is already created and configured\nconst graph = new StateGraph().compile();\n\nconst input = {\n  messages: [\n    new HumanMessage(\n      \"How old was the 30th president of the United States when he died?\",\n    ),\n  ],\n};\n\nconst config = { configurable: { thread_id: \"1\" } };\n\n// Assuming graph is already created and configured\nconst output = await graph.stream(input, config);\n\nfor await (const chunk of output) {\n  console.log(chunk);\n}\n"
  },
  {
    "path": "ch8/js/c-interrupt.js",
    "content": "import { HumanMessage } from \"@langchain/core/messages\";\nimport { MemorySaver } from \"@langchain/langgraph\";\n\nconst controller = new AbortController();\n\nconst input = {\n  messages: [\n    new HumanMessage(\n      \"How old was the 30th president of the United States when he died?\",\n    ),\n  ],\n};\n\nconst config = { configurable: { thread_id: \"1\" } };\n\n// Assuming graph is already created and configured\nconst graph = new StateGraph().compile({ checkpointer: new MemorySaver() });\n\n// Simulate interruption after 2 seconds\nsetTimeout(() => {\n  controller.abort();\n}, 2000);\n\ntry {\n  const output = await graph.stream(input, {\n    ...config,\n    signal: controller.signal,\n  });\n\n  for await (const chunk of output) {\n    console.log(chunk); // do something with the output\n  }\n} catch (e) {\n  console.log(e);\n}\n"
  },
  {
    "path": "ch8/js/d-authorize.js",
    "content": "import { HumanMessage } from \"@langchain/core/messages\";\nimport { MemorySaver } from \"@langchain/langgraph\";\n\n// Assuming graph is already created and configured\nconst graph = new StateGraph().compile({ checkpointer: new MemorySaver() });\n\nconst input = {\n  messages: [\n    new HumanMessage(\n      \"How old was the 30th president of the United States when he died?\",\n    ),\n  ],\n};\n\nconst config = { configurable: { thread_id: \"1\" } };\n\nconst output = await graph.stream(input, {\n  ...config,\n  interruptBefore: [\"tools\"],\n});\n\nfor await (const chunk of output) {\n  console.log(chunk); // do something with the output\n}\n"
  },
  {
    "path": "ch8/js/e-resume.js",
    "content": "import { MemorySaver } from \"@langchain/langgraph\";\n\n// Assuming graph is already created and configured\nconst graph = new StateGraph().compile({ checkpointer: new MemorySaver() });\n\nconst config = { configurable: { thread_id: \"1\" } };\n\nconst output = await graph.stream(null, {\n  ...config,\n  interruptBefore: [\"tools\"],\n});\n\nfor await (const chunk of output) {\n  console.log(chunk); // do something with the output\n}\n"
  },
  {
    "path": "ch8/js/f-edit-state.js",
    "content": "import { MemorySaver } from \"@langchain/langgraph\";\n\n// Assuming graph is already created and configured\nconst graph = new StateGraph().compile({ checkpointer: new MemorySaver() });\n\nconst config = { configurable: { thread_id: \"1\" } };\n\nconst state = await graph.getState(config);\nconsole.log(\"Current state:\", state);\n\n// something you want to add or replace\nconst update = {};\n\nawait graph.updateState(config, update);\nconsole.log(\"State updated\");\n"
  },
  {
    "path": "ch8/js/g-fork.js",
    "content": "import { MemorySaver } from \"@langchain/langgraph\";\n\n// Assuming graph is already created and configured\nconst graph = new StateGraph().compile({ checkpointer: new MemorySaver() });\n\nconst config = { configurable: { thread_id: \"1\" } };\n\nconst history = await Array.fromAsync(graph.getStateHistory(config));\nconsole.log(\"History states:\", history.length);\n\n// replay a past state\nif (history.length >= 3) {\n  const result = await graph.invoke(null, history[2].config);\n  console.log(\"Replayed state result:\", result);\n}\n"
  },
  {
    "path": "ch8/py/a-structured-output.py",
    "content": "from pydantic import BaseModel, Field\nfrom langchain_openai import ChatOpenAI\n\n\nclass Joke(BaseModel):\n    setup: str = Field(description=\"The setup of the joke\")\n    punchline: str = Field(description=\"The punchline to the joke\")\n\n\nmodel = ChatOpenAI(model=\"gpt-4o\", temperature=0)\nmodel = model.with_structured_output(Joke)\n\nresult = model.invoke(\"Tell me a joke about cats\")\nprint(result)\n"
  },
  {
    "path": "ch8/py/b-streaming-output.py",
    "content": "from langchain_core.messages import HumanMessage\nfrom langgraph.graph import StateGraph\n\n\ndef create_simple_graph():\n    # Create a simple graph for demonstration\n    builder = StateGraph()\n    # Add nodes and edges as needed\n    return builder.compile()\n\n\ngraph = create_simple_graph()\n\ninput = {\n    \"messages\": [\n        HumanMessage(\n            \"How old was the 30th president of the United States when he died?\"\n        )\n    ]\n}\n\nfor c in graph.stream(input, stream_mode=\"updates\"):\n    print(c)\n"
  },
  {
    "path": "ch8/py/c-interrupt.py",
    "content": "import asyncio\nfrom contextlib import aclosing\n\nfrom langchain.schema import HumanMessage\nfrom langgraph.graph import StateGraph\nfrom langgraph.checkpoint.memory import MemorySaver\n\n\nasync def main():\n    # Create a simple graph\n    builder = StateGraph()\n    # Add nodes and edges as needed\n    graph = builder.compile(checkpointer=MemorySaver())\n\n    event = asyncio.Event()\n\n    input = {\n        \"messages\": [\n            HumanMessage(\n                \"How old was the 30th president of the United States when he died?\"\n            )\n        ]\n    }\n\n    config = {\"configurable\": {\"thread_id\": \"1\"}}\n\n    async with aclosing(graph.astream(input, config)) as stream:\n        async for chunk in stream:\n            if event.is_set():\n                break\n            else:\n                print(chunk)  # do something with the output\n\n    # Simulate interruption after 2 seconds\n    await asyncio.sleep(2)\n    event.set()\n\n\nif __name__ == \"__main__\":\n    asyncio.run(main())\n"
  },
  {
    "path": "ch8/py/d-authorize.py",
    "content": "from langchain.schema import HumanMessage\nfrom langgraph.graph import StateGraph\nfrom langgraph.checkpoint.memory import MemorySaver\n\n\nasync def main():\n    # Create a simple graph\n    builder = StateGraph()\n    # Add nodes and edges as needed\n    graph = builder.compile(checkpointer=MemorySaver())\n\n    input = {\n        \"messages\": [\n            HumanMessage(\n                \"How old was the 30th president of the United States when he died?\"\n            )\n        ]\n    }\n\n    config = {\"configurable\": {\"thread_id\": \"1\"}}\n\n    output = graph.astream(input, config, interrupt_before=[\"tools\"])\n\n    async for c in output:\n        print(c)  # do something with the output\n\n\nif __name__ == \"__main__\":\n    import asyncio\n\n    asyncio.run(main())\n"
  },
  {
    "path": "ch8/py/e-resume.py",
    "content": "from langgraph.graph import StateGraph\nfrom langgraph.checkpoint.memory import MemorySaver\n\n\nasync def main():\n    # Create a simple graph\n    builder = StateGraph()\n    # Add nodes and edges as needed\n    graph = builder.compile(checkpointer=MemorySaver())\n\n    config = {\"configurable\": {\"thread_id\": \"1\"}}\n\n    output = graph.astream(None, config, interrupt_before=[\"tools\"])\n\n    async for c in output:\n        print(c)  # do something with the output\n\n\nif __name__ == \"__main__\":\n    import asyncio\n\n    asyncio.run(main())\n"
  },
  {
    "path": "ch8/py/f-edit-state.py",
    "content": "from langgraph.graph import StateGraph\nfrom langgraph.checkpoint.memory import MemorySaver\n\n\ndef main():\n    # Create a simple graph\n    builder = StateGraph()\n    # Add nodes and edges as needed\n    graph = builder.compile(checkpointer=MemorySaver())\n\n    config = {\"configurable\": {\"thread_id\": \"1\"}}\n\n    state = graph.get_state(config)\n    print(\"Current state:\", state)\n\n    # something you want to add or replace\n    update = {}\n\n    graph.update_state(config, update)\n    print(\"State updated\")\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "ch8/py/g-fork.py",
    "content": "from langgraph.graph import StateGraph\nfrom langgraph.checkpoint.memory import MemorySaver\n\n\ndef main():\n    # Create a simple graph\n    builder = StateGraph()\n    # Add nodes and edges as needed\n    graph = builder.compile(checkpointer=MemorySaver())\n\n    config = {\"configurable\": {\"thread_id\": \"1\"}}\n\n    history = [state for state in graph.get_state_history(config)]\n\n    print(\"History states:\", len(history))\n\n    # replay a past state\n    if len(history) >= 3:\n        result = graph.invoke(None, history[2].config)\n        print(\"Replayed state result:\", result)\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "ch9/README.md",
    "content": "# Chapter 9: Deployment - RAG AI Agent Example\n\nThis directory contains the code for deploying a Retrieval-Augmented Generation (RAG) AI chatbot agent, as discussed in Chapter 9 of \"Learning LangChain.\" This agent is designed to ingest documents and then answer questions based on the content of those documents.\n\n## Overview\n\nThis example demonstrates how to deploy a LangGraph application that consists of two main components:\n\n1.  **Ingestion Graph:** Responsible for loading, embedding and indexing documents.\n2.  **Retrieval Graph:** Responsible for answering questions based on the indexed documents.\n\nBoth Python and JavaScript implementations are provided.\n\n**Note:** If you'd like to see a full ai app (frontend and backend) that incorporates the concepts discussed in this chapter, check it out [here](https://github.com/mayooear/ai-pdf-chatbot-langchain/tree/main).\n\n## Prerequisites\n\nBefore running the code, ensure you have:\n\n1.  **Environment Variables at the root of the learning-langchain repository:** If you haven't already, set up the required environment variables in a `.env` file at the root of the learning-langchain repository. See `.env.example` for the list of variables.\n\n2.  **Supabase account and a Supabase API key:**\n    *   To register for a Supabase account, go to [supabase.com](https://supabase.com) and sign up.\n    *   Once you have an account, create a new project then navigate to the settings section.\n    *   In the settings section, navigate to the API section to see your keys.\n    *   Copy the project URL and service_role key and add them to the `.env` file as values for `SUPABASE_URL` and `SUPABASE_SERVICE_ROLE_KEY`.\n\n3.  **Docker (optional):** Docker is required to run the Chroma vector database in the js implementation. Follow the instructions in the [README](../../README.md#docker-setup-and-usage) to install and set up Docker. After setting up Docker, run the following command to start the Chroma server:\n\n```bash \ndocker pull chromadb/chroma\ndocker run -p 8000:8000 chromadb/chroma\n\n```\n\nThis will start the Chroma server on port 8000.\n\n## Repository Structure\n\nThis directory contains the following structure:\n\n```\n├── js # JavaScript implementation\n│ ├── src # Source code\n│ │ ├── ingestion_graph # Ingestion graph components\n│ │ ├── retrieval_graph # Retrieval graph components\n│ │ ├── shared # Shared components\n│ │ ├── configuration.ts # Configuration files\n│ │ ├── graph.ts # Graph definition files\n│ │ ├── state.ts # State definition files\n│ │ └── utils.ts # Utility functions\n│ ├── demo.ts # Demo script\n│ ├── langgraph.json # LangGraph configuration file\n│ ├── package.json # JavaScript dependencies\n│ └── tsconfig.json # TypeScript configuration\n└── py # Python implementation\n    ├── src # Source code\n    │ ├── ingestion_graph # Ingestion graph components\n    │ ├── retrieval_graph # Retrieval graph components\n    │ ├── shared # Shared components\n    │ ├── configuration.py # Configuration files\n    │ ├── graph.py # Graph definition files\n    │ ├── state.py # State definition files\n    │ └── utils.py # Utility functions\n    ├── demo.py # Demo script\n    ├── langgraph.json # LangGraph configuration file\n    └── pyproject.toml # Python dependencies\n```\n\n## Setting up the Environment\n\n### Python\n\n1.  **Create a virtual environment:**\n\n    ```bash\n    python -m venv .venv\n    ```\n\n2.  **Activate the virtual environment:**\n\n    *   macOS/Linux:\n\n    ```bash\n    source .venv/bin/activate\n    ```\n\n    *   Windows:\n\n    ```bash\n    .venv\\Scripts\\activate\n    ```\n\n3.  **Install dependencies:**\n\n    ```bash\n    pip install -e .\n    ```\n\n### JavaScript\n\n1.  **Install dependencies:**\n\n    ```bash\n    npm install\n    ```\n\n## Running the Application\n\n### Python\n\n1.  **Navigate to the `py` directory:**\n\n    ```bash\n    cd ch9/py\n    ```\n\n2.  **Run the demo script:**\n\n    ```bash\n    python demo.py\n    ```\n\n### JavaScript\n\n1.  **Navigate to the `js` directory:**\n\n    ```bash\n    cd ch9/js\n    ```\n\n2.  **Run the demo script:**\n\n    ```bash\n    node demo.ts\n    ```\n\n## Local Development Server\n\nYou can run the local development server for either JavaScript or Python implementations from the root directory of the learning-langchain repository:\n\n##### For JavaScript:\n```bash\n# Using npm script\nnpm run langgraph:dev\n```\n\n##### For Python:\nYou have two options:\n\n1. Using the CLI directly:\n```bash\nlanggraph dev -c ch9/py/langgraph.json --verbose\n```\n\n2. Using the installed script command:\n```bash\nlanggraph-dev\n```\n\nNote: To use the script command, make sure you have installed the package in development mode (`pip install -e .`).\n\nThis will start the local development server on port 2024 and redirect you to the langsmith UI for debugging and tracing.\n\n## Deploying the Application\n\nTo deploy your LangGraph agent to a cloud service, you can either use LangGraph's cloud as per this [guide](https://langchain-ai.github.io/langgraph/cloud/quick_start/?h=studio#deploy-to-langgraph-cloud) or self-host it as per this [guide](https://langchain-ai.github.io/langgraph/how-tos/deploy-self-hosted/).\n\n### Using LangGraph CLI\n\n1.  **Configure LangGraph:**\n\n    *   Ensure that the `langgraph.json` file is correctly configured to point to the entry points of your graphs.\n\n2.  **Deploy the application:**\n\n    *   Run the following command from the root of the repository:\n\n    ```bash\n    npx @langchain/langgraph-cli deploy -c ch9/js/langgraph.json\n    ```\n\n    *   Or, for python:\n\n    ```bash\n    npx @langchain/langgraph-cli deploy -c ch9/py/langgraph.json\n    ```\n\n    *   Follow the prompts to deploy your application.\n\n## Interacting with the Deployed Application\n\nOnce deployed, you can interact with the application using the LangGraph SDK. The `demo.ts` and `demo.py` files provide examples of how to create threads and invoke the deployed graphs.\n\n## Troubleshooting\n\n*   **Dependency Issues:** Ensure all dependencies are installed correctly using `pip install -e .` (Python) or `npm install` (JavaScript).\n*   **Environment Variables:** Verify that all required environment variables are set correctly in the `.env` file in the root of the learning-langchain repository.\n*   **Docker:** Ensure that Docker is running and that the container is set up correctly.\n*   **API URL:** Ensure that the `LANGGRAPH_API_URL` environment variable is set to the correct URL of your LangGraph server.\n*   **File Paths:** Double-check that all file paths in the configuration files are correct.\n"
  },
  {
    "path": "ch9/js/.gitignore",
    "content": "\n# LangGraph API\n.langgraph_api\n"
  },
  {
    "path": "ch9/js/demo.ts",
    "content": "// demo of the compiled graph running using the sdk\nimport { Client } from '@langchain/langgraph-sdk';\nimport { graph } from './src/retrieval_graph/graph.js';\nimport dotenv from 'dotenv';\n\n// Load environment variables from .env file\ndotenv.config();\n\n// Environment variables needed:\n// LANGGRAPH_API_URL: The URL where your LangGraph server is running\n//   - For local development: http://localhost:2024 (or your local server port)\n//   - For LangSmith cloud: https://api.smith.langchain.com\n//\n\nconst assistant_id = 'retrieval_graph';\nasync function runDemo() {\n  // Initialize the LangGraph client\n  const client = new Client({\n    apiUrl: process.env.LANGGRAPH_API_URL || 'http://localhost:2024',\n  });\n\n  // Create a new thread for this conversation\n  console.log('Creating new thread...');\n  const thread = await client.threads.create({\n    metadata: {\n      demo: 'retrieval-graph',\n    },\n  });\n  console.log('Thread created with ID:', thread.thread_id);\n\n  // Example question\n  const question = 'What is this document about?';\n\n  console.log('\\n=== Streaming Example ===');\n  console.log('Question:', question);\n\n  // Run the graph with streaming\n  try {\n    console.log('\\nStarting stream...');\n    const stream = await client.runs.stream(thread.thread_id, assistant_id, {\n      input: { query: question },\n      streamMode: ['values', 'messages', 'updates'], // Include all stream types\n    });\n\n    // Process the stream chunks\n    console.log('\\nWaiting for stream chunks...');\n    for await (const chunk of stream) {\n      console.log('\\nReceived chunk:');\n      console.log('Event type:', chunk.event);\n      if (chunk.event === 'values') {\n        console.log('Values data:', JSON.stringify(chunk.data, null, 2));\n      } else if (chunk.event === 'messages/partial') {\n        console.log('Messages data:', JSON.stringify(chunk, null, 2));\n      } else if (chunk.event === 'updates') {\n        console.log('Update data:', JSON.stringify(chunk.data, null, 2));\n      }\n    }\n    console.log('\\nStream completed.');\n  } catch (error) {\n    console.error('Error in streaming run:', error);\n    // Log more details about the error\n    if (error instanceof Error) {\n      console.error('Error message:', error.message);\n      console.error('Error stack:', error.stack);\n    }\n  }\n}\n\n// Run the demo\nrunDemo().catch((error) => {\n  console.error('Fatal error:', error);\n  process.exit(1);\n});\n"
  },
  {
    "path": "ch9/js/langgraph.json",
    "content": "{\n    \"node_version\": \"20\",\n    \"graphs\": {\n      \"ingestion_graph\": \"./src/ingestion_graph/graph.ts:graph\",\n      \"retrieval_graph\": \"./src/retrieval_graph/graph.ts:graph\"\n    },\n    \"env\": \"../../.env\",\n    \"dependencies\": [\".\"]\n  }"
  },
  {
    "path": "ch9/js/package.json",
    "content": "{\n    \"type\": \"module\",\n    \"dependencies\": {\n        \"@langchain/community\": \"^0.3.26\",\n        \"@langchain/core\": \"^0.3.33\",\n        \"@langchain/langgraph\": \"^0.2.41\",\n        \"@langchain/openai\": \"^0.3.17\",\n        \"@supabase/supabase-js\": \"^2.44.0\",\n        \"langchain\": \"^0.3.12\",\n        \"pdf-parse\": \"^1.1.1\",\n        \"chromadb\": \"^1.10.4\"\n    },\n    \"devDependencies\": {\n        \"@types/node\": \"^20.0.0\",\n        \"typescript\": \"^5.0.0\",\n        \"@types/pdf-parse\": \"^1.1.4\"\n    }\n}"
  },
  {
    "path": "ch9/js/src/ingestion_graph/configuration.ts",
    "content": "import { Annotation } from '@langchain/langgraph';\nimport { RunnableConfig } from '@langchain/core/runnables';\n\n// This path points to the directory containing the documents to index.\nconst DEFAULT_DOCS_PATH = 'src/sample_docs.json';\n\n/**\n * The configuration for the indexing process.\n */\nexport const IndexConfigurationAnnotation = Annotation.Root({\n  /**\n   * Path to folder containing default documents to index.\n   */\n  docsPath: Annotation<string>,\n\n  /**\n   * Name of the openai embedding model to use. Must be a valid embedding model name.\n   */\n  embeddingModel: Annotation<'text-embedding-3-small'>,\n\n  /**\n   * The vector store provider to store the embeddings.\n   * Options are 'supabase', 'chroma'.\n   */\n  retrieverProvider: Annotation<'supabase' | 'chroma'>,\n\n  /**\n   * Whether to index sample documents specified in the docsPath.\n   */\n  useSampleDocs: Annotation<boolean>,\n});\n\n/**\n * Create an typeof IndexConfigurationAnnotation.State instance from a RunnableConfig object.\n *\n * @param config - The configuration object to use.\n * @returns An instance of typeof IndexConfigurationAnnotation.State with the specified configuration.\n */\nexport function ensureIndexConfiguration(\n  config: RunnableConfig\n): typeof IndexConfigurationAnnotation.State {\n  const configurable = (config?.configurable || {}) as Partial<\n    typeof IndexConfigurationAnnotation.State\n  >;\n  return {\n    docsPath: configurable.docsPath || DEFAULT_DOCS_PATH,\n    embeddingModel: configurable.embeddingModel || 'text-embedding-3-small',\n    retrieverProvider: configurable.retrieverProvider || 'supabase',\n    useSampleDocs: configurable.useSampleDocs || false,\n  };\n}\n"
  },
  {
    "path": "ch9/js/src/ingestion_graph/graph.ts",
    "content": "/**\n * This \"graph\" simply exposes an endpoint for a user to upload docs to be indexed.\n */\nimport path from 'path';\nimport fs from 'fs/promises';\nimport { RunnableConfig } from '@langchain/core/runnables';\nimport { StateGraph, END, START } from '@langchain/langgraph';\nimport { IndexStateAnnotation } from './state.js';\nimport { DirectoryLoader } from 'langchain/document_loaders/fs/directory';\nimport {\n  ensureIndexConfiguration,\n  IndexConfigurationAnnotation,\n} from './configuration.js';\nimport { makeRetriever } from '../shared/retrieval.js';\nimport { reduceDocs } from '../shared/state.js';\n\nasync function ingestDocs(\n  state: typeof IndexStateAnnotation.State,\n  config?: RunnableConfig\n): Promise<typeof IndexStateAnnotation.Update> {\n  if (!config) {\n    throw new Error('Configuration required to run index_docs.');\n  }\n\n  const configuration = ensureIndexConfiguration(config);\n  let docs = state.docs;\n\n  if (!docs || docs.length === 0) {\n    if (configuration.useSampleDocs) {\n      const fileContent = await fs.readFile(configuration.docsPath, 'utf-8');\n      const serializedDocs = JSON.parse(fileContent);\n      docs = reduceDocs([], serializedDocs);\n    } else {\n      throw new Error('No sample documents to index.');\n    }\n  } else {\n    docs = reduceDocs([], docs);\n  }\n\n  const retriever = await makeRetriever(config);\n  await retriever.addDocuments(docs);\n\n  return { docs: 'delete' };\n}\n\n// Define the graph\nconst builder = new StateGraph(\n  IndexStateAnnotation,\n  IndexConfigurationAnnotation\n)\n  .addNode('ingestDocs', ingestDocs)\n  .addEdge(START, 'ingestDocs')\n  .addEdge('ingestDocs', END);\n\n// Compile into a graph object that you can invoke and deploy.\nexport const graph = builder\n  .compile()\n  .withConfig({ runName: 'IngestionGraph' });\n"
  },
  {
    "path": "ch9/js/src/ingestion_graph/state.ts",
    "content": "import { Annotation } from '@langchain/langgraph';\nimport { Document } from '@langchain/core/documents';\nimport { reduceDocs } from '../shared/state.js';\n\n/**\n * Represents the state for document indexing and retrieval.\n *\n * This interface defines the structure of the index state, which includes\n * the documents to be indexed and the retriever used for searching\n * these documents.\n */\nexport const IndexStateAnnotation = Annotation.Root({\n  /**\n   * A list of documents that the agent can index.\n   */\n  docs: Annotation<\n    Document[],\n    Document[] | { [key: string]: any }[] | string[] | string | 'delete'\n  >({\n    default: () => [],\n    reducer: reduceDocs,\n  }),\n});\n\nexport type IndexStateType = typeof IndexStateAnnotation.State;\n"
  },
  {
    "path": "ch9/js/src/retrieval_graph/configuration.ts",
    "content": "import { Annotation } from '@langchain/langgraph';\nimport {\n  BaseConfigurationAnnotation,\n  ensureBaseConfiguration,\n} from '../shared/configuration.js';\nimport { RunnableConfig } from '@langchain/core/runnables';\n\nexport const AgentConfigurationAnnotation = Annotation.Root({\n  ...BaseConfigurationAnnotation.spec,\n\n  // models\n  /**\n   * The language model used for processing and refining queries.\n   * Should be in the form: provider/model-name.\n   */\n  queryModel: Annotation<string>,\n});\n\n/**\n * Create a typeof ConfigurationAnnotation.State instance from a RunnableConfig object.\n *\n * @param config - The configuration object to use.\n * @returns An instance of typeof ConfigurationAnnotation.State with the specified configuration.\n */\nexport function ensureAgentConfiguration(\n  config: RunnableConfig\n): typeof AgentConfigurationAnnotation.State {\n  const configurable = (config?.configurable || {}) as Partial<\n    typeof AgentConfigurationAnnotation.State\n  >;\n  const baseConfig = ensureBaseConfiguration(config);\n  return {\n    ...baseConfig,\n    queryModel: configurable.queryModel || 'openai/gpt-4o',\n  };\n}\n"
  },
  {
    "path": "ch9/js/src/retrieval_graph/graph.ts",
    "content": "import {\n  StateGraph,\n  START,\n  END,\n  MessagesAnnotation,\n} from '@langchain/langgraph';\nimport { AgentStateAnnotation } from './state.js';\nimport { makeRetriever, makeSupabaseRetriever } from '../shared/retrieval.js';\nimport { ChatOpenAI } from '@langchain/openai';\nimport { formatDocs } from './utils.js';\nimport { ChatPromptTemplate } from '@langchain/core/prompts';\nimport { pull } from 'langchain/hub';\nimport { AIMessage, BaseMessage, HumanMessage } from '@langchain/core/messages';\nimport { z } from 'zod';\nimport { RunnableConfig } from '@langchain/core/runnables';\nimport { loadChatModel } from '../shared/utils.js';\nimport {\n  AgentConfigurationAnnotation,\n  ensureAgentConfiguration,\n} from './configuration.js';\nasync function checkQueryType(\n  state: typeof AgentStateAnnotation.State,\n  config: RunnableConfig\n): Promise<{\n  route: 'retrieve' | 'direct';\n  messages?: BaseMessage[];\n}> {\n  //schema for routing\n  const schema = z.object({\n    route: z.enum(['retrieve', 'direct']),\n    directAnswer: z.string().optional(),\n  });\n\n  const configuration = ensureAgentConfiguration(config);\n  const model = await loadChatModel(configuration.queryModel);\n\n  const routingPrompt = ChatPromptTemplate.fromMessages([\n    [\n      'system',\n      \"You are a routing assistant. Your job is to determine if a question needs document retrieval or can be answered directly.\\n\\nRespond with either:\\n'retrieve' - if the question requires retrieving documents\\n'direct' - if the question can be answered directly AND your direct answer\",\n    ],\n    ['human', '{query}'],\n  ]);\n\n  const formattedPrompt = await routingPrompt.invoke({\n    query: state.query,\n  });\n\n  const response = await model\n    .withStructuredOutput(schema)\n    .invoke(formattedPrompt.toString());\n\n  const route = response.route;\n\n  return { route };\n}\n\nasync function answerQueryDirectly(\n  state: typeof AgentStateAnnotation.State,\n  config: RunnableConfig\n): Promise<typeof AgentStateAnnotation.Update> {\n  const configuration = ensureAgentConfiguration(config);\n  const model = await loadChatModel(configuration.queryModel);\n  const userHumanMessage = new HumanMessage(state.query);\n\n  const response = await model.invoke([userHumanMessage]);\n  return { messages: [userHumanMessage, response] };\n}\n\nasync function routeQuery(\n  state: typeof AgentStateAnnotation.State\n): Promise<'retrieveDocuments' | 'directAnswer'> {\n  const route = state.route;\n  if (!route) {\n    throw new Error('Route is not set');\n  }\n  if (route === 'retrieve') {\n    return 'retrieveDocuments';\n  } else if (route === 'direct') {\n    return 'directAnswer';\n  } else {\n    throw new Error('Invalid route');\n  }\n}\n\nasync function retrieveDocuments(\n  state: typeof AgentStateAnnotation.State,\n  config: RunnableConfig\n): Promise<typeof AgentStateAnnotation.Update> {\n  const retriever = await makeRetriever(config);\n  const response = await retriever.invoke(state.query, config);\n  return { documents: response };\n}\n\nasync function generateResponse(\n  state: typeof AgentStateAnnotation.State,\n  config: RunnableConfig\n): Promise<typeof AgentStateAnnotation.Update> {\n  const context = formatDocs(state.documents);\n  const configuration = ensureAgentConfiguration(config);\n\n  const model = await loadChatModel(configuration.queryModel);\n  const promptTemplate = await pull<ChatPromptTemplate>('rlm/rag-prompt');\n\n  const formattedPrompt = await promptTemplate.invoke({\n    context: context,\n    question: state.query,\n  });\n\n  const userHumanMessage = new HumanMessage(state.query);\n\n  // Create a human message with the formatted prompt that includes context\n  const formattedPromptMessage = new HumanMessage(formattedPrompt.toString());\n\n  const messageHistory = [...state.messages, formattedPromptMessage];\n\n  // Let MessagesAnnotation handle the message history\n  const response = await model.invoke(messageHistory);\n\n  // Return both the current query and the AI response to be handled by MessagesAnnotation's reducer\n  return { messages: [userHumanMessage, response] };\n}\n\nconst builder = new StateGraph(\n  AgentStateAnnotation,\n  AgentConfigurationAnnotation\n)\n  .addNode('retrieveDocuments', retrieveDocuments)\n  .addNode('generateResponse', generateResponse)\n  .addNode('checkQueryType', checkQueryType)\n  .addNode('directAnswer', answerQueryDirectly)\n  .addEdge(START, 'checkQueryType')\n  .addConditionalEdges('checkQueryType', routeQuery, [\n    'retrieveDocuments',\n    'directAnswer',\n  ])\n  .addEdge('retrieveDocuments', 'generateResponse')\n  .addEdge('generateResponse', END)\n  .addEdge('directAnswer', END);\n\nexport const graph = builder.compile().withConfig({\n  runName: 'RetrievalGraph',\n});\n"
  },
  {
    "path": "ch9/js/src/retrieval_graph/state.ts",
    "content": "import { Annotation, MessagesAnnotation } from '@langchain/langgraph';\nimport { reduceDocs } from '../shared/state.js';\nimport { Document } from '@langchain/core/documents';\n/**\n * Represents the state of the retrieval graph / agent.\n */\nexport const AgentStateAnnotation = Annotation.Root({\n  query: Annotation<string>(),\n  route: Annotation<string>(),\n  ...MessagesAnnotation.spec,\n\n  /**\n   * Populated by the retriever. This is a list of documents that the agent can reference.\n   * @type {Document[]}\n   */\n  documents: Annotation<\n    Document[],\n    Document[] | { [key: string]: any }[] | string[] | string | 'delete'\n  >({\n    default: () => [],\n    // @ts-ignore\n    reducer: reduceDocs,\n  }),\n\n  // Additional attributes can be added here as needed\n});\n"
  },
  {
    "path": "ch9/js/src/retrieval_graph/utils.ts",
    "content": "import { Document } from '@langchain/core/documents';\n\nexport function formatDoc(doc: Document): string {\n  const metadata = doc.metadata || {};\n  const meta = Object.entries(metadata)\n    .map(([k, v]) => ` ${k}=${v}`)\n    .join('');\n  const metaStr = meta ? ` ${meta}` : '';\n\n  return `<document${metaStr}>\\n${doc.pageContent}\\n</document>`;\n}\n\nexport function formatDocs(docs?: Document[]): string {\n  /**Format a list of documents as XML. */\n  if (!docs || docs.length === 0) {\n    return '<documents></documents>';\n  }\n  const formatted = docs.map(formatDoc).join('\\n');\n  return `<documents>\\n${formatted}\\n</documents>`;\n}\n"
  },
  {
    "path": "ch9/js/src/shared/configuration.ts",
    "content": "/**\n * Define the configurable parameters for the agent.\n */\n\nimport { Annotation } from '@langchain/langgraph';\nimport { RunnableConfig } from '@langchain/core/runnables';\n\n/**\n * typeof ConfigurationAnnotation.State class for indexing and retrieval operations.\n *\n * @property embeddingModel - The name of the openai embedding model to use.\n * @property retrieverProvider - The vector store provider to use for retrieval.\n * @property filter - Optional filter criteria to limit the items retrieved based on the specified filter type.\n * @property k - The number of results to return from the retriever.\n */\n\nexport const BaseConfigurationAnnotation = Annotation.Root({\n  /**\n   * Name of the openai embedding model to use. Must be a valid embedding model name.\n   */\n  embeddingModel: Annotation<'text-embedding-3-small'>,\n\n  /**\n   * The vector store provider to use for retrieval.\n   * Options are 'supabase', 'chroma'.\n   */\n  retrieverProvider: Annotation<'supabase' | 'chroma'>,\n\n  /**\n   * Optional filter criteria to limit the items retrieved.\n   * Can be any metadata object that matches document metadata structure.\n   */\n  filter: Annotation<Record<string, any> | undefined>,\n\n  /**\n   * The number of results to return from the retriever.\n   */\n  k: Annotation<number>,\n});\n\n/**\n * Create an typeof BaseConfigurationAnnotation.State instance from a RunnableConfig object.\n *\n * @param config - The configuration object to use.\n * @returns An instance of typeof BaseConfigurationAnnotation.State with the specified configuration.\n */\nexport function ensureBaseConfiguration(\n  config: RunnableConfig\n): typeof BaseConfigurationAnnotation.State {\n  const configurable = (config?.configurable || {}) as Partial<\n    typeof BaseConfigurationAnnotation.State\n  >;\n  return {\n    embeddingModel: configurable.embeddingModel || 'text-embedding-3-small',\n    retrieverProvider: configurable.retrieverProvider || 'supabase',\n    filter: configurable.filter,\n    k: configurable.k || 4,\n  };\n}\n"
  },
  {
    "path": "ch9/js/src/shared/retrieval.ts",
    "content": "import { VectorStoreRetriever } from '@langchain/core/vectorstores';\nimport { OpenAIEmbeddings } from '@langchain/openai';\nimport { SupabaseVectorStore } from '@langchain/community/vectorstores/supabase';\nimport { createClient } from '@supabase/supabase-js';\nimport { RunnableConfig } from '@langchain/core/runnables';\nimport { Embeddings } from '@langchain/core/embeddings';\nimport { ensureBaseConfiguration } from './configuration.js';\nimport { Chroma } from '@langchain/community/vectorstores/chroma';\n\nexport async function makeSupabaseRetriever(\n  configuration: ReturnType<typeof ensureBaseConfiguration>,\n  embeddingModel: Embeddings\n): Promise<VectorStoreRetriever> {\n  if (!process.env.SUPABASE_URL || !process.env.SUPABASE_SERVICE_ROLE_KEY) {\n    throw new Error(\n      'SUPABASE_URL or SUPABASE_SERVICE_ROLE_KEY environment variables are not defined'\n    );\n  }\n  const supabaseClient = createClient(\n    process.env.SUPABASE_URL ?? '',\n    process.env.SUPABASE_SERVICE_ROLE_KEY ?? ''\n  );\n  const vectorStore = new SupabaseVectorStore(embeddingModel, {\n    client: supabaseClient,\n    tableName: 'documents',\n    queryName: 'match_documents',\n  });\n  return vectorStore.asRetriever({\n    filter: configuration.filter,\n    k: configuration.k,\n  });\n}\n\nexport async function makeChromaRetriever(\n  configuration: ReturnType<typeof ensureBaseConfiguration>,\n  embeddingModel: Embeddings\n) {\n  const vectorStore = new Chroma(embeddingModel, {\n    collectionName: 'documents',\n  });\n  return vectorStore.asRetriever({\n    filter: configuration.filter,\n    k: configuration.k,\n  });\n}\n\nexport async function makeRetriever(\n  config: RunnableConfig\n): Promise<VectorStoreRetriever> {\n  const configuration = ensureBaseConfiguration(config);\n  const embeddingModel = new OpenAIEmbeddings({\n    model: configuration.embeddingModel,\n  });\n  switch (configuration.retrieverProvider) {\n    case 'supabase':\n      return makeSupabaseRetriever(configuration, embeddingModel);\n    case 'chroma':\n      return makeChromaRetriever(configuration, embeddingModel);\n    default:\n      throw new Error(\n        `Unrecognized retrieverProvider in configuration: ${configuration.retrieverProvider}`\n      );\n  }\n}\n"
  },
  {
    "path": "ch9/js/src/shared/state.ts",
    "content": "import { Document } from '@langchain/core/documents';\nimport { v4 as uuidv4 } from 'uuid';\n\n/**\n * Reduces the document array based on the provided new documents or actions.\n *\n * @param existing - The existing array of documents.\n * @param newDocs - The new documents or actions to apply.\n * @returns The updated array of documents.\n */\nexport function reduceDocs(\n  existing?: Document[],\n  newDocs?: Document[] | { [key: string]: any }[] | string[] | string | 'delete'\n): Document[] {\n  if (newDocs === 'delete') {\n    return [];\n  }\n\n  const existingList = existing || [];\n  const existingIds = new Set(existingList.map((doc) => doc.metadata?.uuid));\n\n  if (typeof newDocs === 'string') {\n    const docId = uuidv4();\n    return [\n      ...existingList,\n      { pageContent: newDocs, metadata: { uuid: docId } },\n    ];\n  }\n\n  const newList: Document[] = [];\n  if (Array.isArray(newDocs)) {\n    for (const item of newDocs) {\n      if (typeof item === 'string') {\n        const itemId = uuidv4();\n        newList.push({ pageContent: item, metadata: { uuid: itemId } });\n        existingIds.add(itemId);\n      } else if (typeof item === 'object') {\n        const metadata = (item as Document).metadata ?? {};\n        let itemId = metadata.uuid ?? uuidv4();\n\n        if (!existingIds.has(itemId)) {\n          if ('pageContent' in item) {\n            // It's a Document-like object\n            newList.push({\n              ...(item as Document),\n              metadata: { ...metadata, uuid: itemId },\n            });\n          } else {\n            // It's a generic object, treat it as metadata\n            newList.push({\n              pageContent: '',\n              metadata: { ...(item as { [key: string]: any }), uuid: itemId },\n            });\n          }\n          existingIds.add(itemId);\n        }\n      }\n    }\n  }\n\n  return [...existingList, ...newList];\n}\n"
  },
  {
    "path": "ch9/js/src/shared/utils.ts",
    "content": "import { BaseChatModel } from '@langchain/core/language_models/chat_models';\nimport { initChatModel } from 'langchain/chat_models/universal';\n\nconst SUPPORTED_PROVIDERS = [\n  'openai',\n  'anthropic',\n  'azure_openai',\n  'cohere',\n  'google-vertexai',\n  'google-vertexai-web',\n  'google-genai',\n  'ollama',\n  'together',\n  'fireworks',\n  'mistralai',\n  'groq',\n  'bedrock',\n  'cerebras',\n  'deepseek',\n  'xai',\n] as const;\n/**\n * Load a chat model from a fully specified name.\n * @param fullySpecifiedName - String in the format 'provider/model' or 'provider/account/provider/model'.\n * @returns A Promise that resolves to a BaseChatModel instance.\n */\nexport async function loadChatModel(\n  fullySpecifiedName: string,\n  temperature: number = 0.2\n): Promise<BaseChatModel> {\n  const index = fullySpecifiedName.indexOf('/');\n  if (index === -1) {\n    // If there's no \"/\", assume it's just the model\n    if (\n      !SUPPORTED_PROVIDERS.includes(\n        fullySpecifiedName as (typeof SUPPORTED_PROVIDERS)[number]\n      )\n    ) {\n      throw new Error(`Unsupported model: ${fullySpecifiedName}`);\n    }\n    return await initChatModel(fullySpecifiedName, {\n      temperature: temperature,\n    });\n  } else {\n    const provider = fullySpecifiedName.slice(0, index);\n    const model = fullySpecifiedName.slice(index + 1);\n    if (\n      !SUPPORTED_PROVIDERS.includes(\n        provider as (typeof SUPPORTED_PROVIDERS)[number]\n      )\n    ) {\n      throw new Error(`Unsupported provider: ${provider}`);\n    }\n    return await initChatModel(model, {\n      modelProvider: provider,\n      temperature: temperature,\n    });\n  }\n}\n"
  },
  {
    "path": "ch9/js/tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"target\": \"ES2020\",\n    \"module\": \"NodeNext\",\n    \"outDir\": \"./dist\",\n    \"rootDir\": \"./src\",\n    \"strict\": false,\n    \"esModuleInterop\": true,\n    \"skipLibCheck\": true,\n    \"forceConsistentCasingInFileNames\": true,\n    \"resolveJsonModule\": true\n  },\n  \"include\": [\"src/**/*\"],\n  \"exclude\": [\"node_modules\"]\n}"
  },
  {
    "path": "ch9/py/demo.py",
    "content": "import asyncio\nfrom langgraph_sdk import get_client\n\n\nasync def invoke_retrieval_assistant():\n    # Initialize the LangGraph client\n    # Replace <DEPLOYMENT_URL> with your actual LangGraph deployment URL\n    deployment_url = \"http://localhost:2024\"\n    client = get_client(url=deployment_url)\n\n    try:\n        # Create a new thread\n        thread = await client.threads.create(\n            # Optional: Add metadata if needed\n            metadata={\n                \"user_id\": \"example_user\",\n                \"session\": \"retrieval_session\"\n            }\n        )\n\n        # Prepare the input for the retrieval graph\n        input_data = {\n            # You can add additional state keys if your graph expects them\n            \"query\": \"What is this document about?\",\n        }\n\n        # Invoke the assistant on the created thread\n        # Replace \"retrieval_graph\" with your actual assistant ID\n        async for event in client.runs.stream(\n            thread_id=thread[\"thread_id\"],\n            assistant_id=\"retrieval_graph\",\n            input=input_data,\n            stream_mode=\"updates\"  # Stream updates as they occur\n        ):\n            # Process and print each event\n            print(f\"Receiving event of type: {event.event}\")\n            print(event.data)\n            print(\"\\n\")\n\n    except Exception as e:\n        print(f\"An error occurred: {e}\")\n\n# If you're running this in a script, you'll need to use asyncio to run the async function\n\nasyncio.run(invoke_retrieval_assistant())\n"
  },
  {
    "path": "ch9/py/langgraph.json",
    "content": "{\r\n  \"dependencies\": [\".\"],\r\n  \"graphs\": {\r\n    \"indexer\": \"./src/ingestion_graph/graph.py:graph\",\r\n    \"retrieval_graph\": \"./src/retrieval_graph/graph.py:graph\"\r\n  },\r\n  \"env\": \"../../.env\"\r\n}\r\n"
  },
  {
    "path": "ch9/py/pyproject.toml",
    "content": "[project]\r\nname = \"rag-langgraph-template\"\r\nversion = \"0.0.1\"\r\ndescription = \"A RAG agentin LangGraph.\"\r\nauthors = []\r\nlicense = { text = \"MIT\" }\r\nreadme = \"README.md\"\r\nrequires-python = \">=3.9,<4.0\"\r\ndependencies = [\r\n    \"langgraph>=0.2.6\",\r\n    \"langchain-openai>=0.1.22\",\r\n    \"langchain>=0.2.14\",\r\n    \"python-dotenv>=1.0.1\",\r\n    \"msgspec>=0.18.6\",\r\n    \"langchain-community>=0.3.15\",\r\n    \"supabase (>=2.13.0,<3.0.0)\",\r\n    \"langchain-chroma>=0.2.0\",\r\n    \"langgraph-sdk>=0.1.51\"\r\n]\r\n\r\n[project.optional-dependencies]\r\ndev = [\"mypy>=1.11.1\", \"ruff>=0.6.1\"]\r\n\r\n[build-system]\r\nrequires = [\"setuptools>=73.0.0\", \"wheel\"]\r\nbuild-backend = \"setuptools.build_meta\"\r\n\r\n[tool.setuptools]\r\npackages = [\"retrieval_graph\", \"ingestion_graph\", \"shared\"]\r\n[tool.setuptools.package-dir]\r\n\"langgraph.templates.retrieval_graph\" = \"src/retrieval_graph\"\r\n\"langgraph.templates.ingestion_graph\" = \"src/ingestion_graph\"\r\n\"retrieval_graph\" = \"src/retrieval_graph\"\r\n\"ingestion_graph\" = \"src/ingestion_graph\"\r\n\"shared\" = \"src/shared\"\r\n\r\n\r\n[tool.setuptools.package-data]\r\n\"*\" = [\"py.typed\"]\r\n\r\n[tool.ruff]\r\nlint.select = [\r\n    \"E\",    # pycodestyle\r\n    \"F\",    # pyflakes\r\n    \"I\",    # isort\r\n    \"D\",    # pydocstyle\r\n    \"D401\", # First line should be in imperative mood\r\n    \"T201\",\r\n    \"UP\",\r\n]\r\nlint.ignore = [\r\n    \"UP006\",\r\n    \"UP007\",\r\n    # We actually do want to import from typing_extensions\r\n    \"UP035\",\r\n    # Relax the convention by _not_ requiring documentation for every function parameter.\r\n    \"D417\",\r\n    \"E501\",\r\n]\r\n[tool.ruff.lint.per-file-ignores]\r\n\"tests/*\" = [\"D\", \"UP\"]\r\n[tool.ruff.lint.pydocstyle]\r\nconvention = \"google\"\r\n[tool.pytest.ini_options]\r\npythonpath = [\r\n  \"src\"\r\n]\r\n"
  },
  {
    "path": "ch9/py/src/docSplits.json",
    "content": "[\n  {\n    \"pageContent\": \"UNITED\\tSTATES\\nSECURITIES\\tAND\\tEXCHANGE\\tCOMMISSION\\nWashington,\\tD.C.\\t20549\\nFORM\\t10-K\\n(Mark\\tOne)\\nxANNUAL\\tREPORT\\tPURSUANT\\tTO\\tSECTION\\t13\\tOR\\t15(d)\\tOF\\tTHE\\tSECURITIES\\tEXCHANGE\\tACT\\tOF\\t1934\\nFor\\tthe\\tfiscal\\tyear\\tended\\tDecember\\t31,\\t2023\\nOR\\noTRANSITION\\tREPORT\\tPURSUANT\\tTO\\tSECTION\\t13\\tOR\\t15(d)\\tOF\\tTHE\\tSECURITIES\\tEXCHANGE\\tACT\\tOF\\t1934\\nFor\\tthe\\ttransition\\tperiod\\tfrom\\t_________\\tto\\t_________\\nCommission\\tFile\\tNumber:\\t001-34756\\nTesla,\\tInc.\\n(Exact\\tname\\tof\\tregistrant\\tas\\tspecified\\tin\\tits\\tcharter)\\nDelaware91-2197729\\n(State\\tor\\tother\\tjurisdiction\\tof\\nincorporation\\tor\\torganization)\\n(I.R.S.\\tEmployer\\nIdentification\\tNo.)\\n1\\tTesla\\tRoad\\nAustin,\\tTexas78725\\n(Address\\tof\\tprincipal\\texecutive\\toffices)(Zip\\tCode)\\n(512)\\t516-8177\\n(Registrant’s\\ttelephone\\tnumber,\\tincluding\\tarea\\tcode)\\nSecurities\\tregistered\\tpursuant\\tto\\tSection\\t12(b)\\tof\\tthe\\tAct:\\nTitle\\tof\\teach\\tclassTrading\\tSymbol(s)Name\\tof\\teach\\texchange\\ton\\twhich\\tregistered\\nCommon\\tstockTSLAThe\\tNasdaq\\tGlobal\\tSelect\\tMarket\\nSecurities\\tregistered\\tpursuant\\tto\\tSection\\t12(g)\\tof\\tthe\\tAct:\\nNone\\nIndicate\\tby\\tcheck\\tmark\\twhether\\tthe\\tregistrant\\tis\\ta\\twell-known\\tseasoned\\tissuer,\\tas\\tdefined\\tin\\tRule\\t405\\tof\\tthe\\tSecurities\\tAct.\\tYes\\tx\\tNo\\to\\nIndicate\\tby\\tcheck\\tmark\\tif\\tthe\\tregistrant\\tis\\tnot\\trequired\\tto\\tfile\\treports\\tpursuant\\tto\\tSection\\t13\\tor\\t15(d)\\tof\\tthe\\tAct.\\tYes\\to\\tNo\\tx\\nIndicate\\tby\\tcheck\\tmark\\twhether\\tthe\\tregistrant\\t(1)\\thas\\tfiled\\tall\\treports\\trequired\\tto\\tbe\\tfiled\\tby\\tSection\\t13\\tor\\t15(d)\\tof\\tthe\\tSecurities\\tExchange\\tAct\\tof\\t1934\\t(“Exchange\\tAct”)\\nduring\\tthe\\tpreceding\\t12\\tmonths\\t(or\\tfor\\tsuch\\tshorter\\tperiod\\tthat\\tthe\\tregistrant\\twas\\trequired\\tto\\tfile\\tsuch\\treports),\\tand\\t(2)\\thas\\tbeen\\tsubject\\tto\\tsuch\\tfiling\\trequirements\\tfor\\tthe\\tpast\\t90\\ndays.\\tYes\\tx\\tNo\\to\\nIndicate\\tby\\tcheck\\tmark\\twhether\\tthe\\tregistrant\\thas\\tsubmitted\\telectronically\\tevery\\tInteractive\\tData\\tFile\\trequired\\tto\\tbe\\tsubmitted\\tpursuant\\tto\\tRule\\t405\\tof\\tRegulation\\tS-T\\n(§232.405\\tof\\tthis\\tchapter)\\tduring\\tthe\\tpreceding\\t12\\tmonths\\t(or\\tfor\\tsuch\\tshorter\\tperiod\\tthat\\tthe\\tregistrant\\twas\\trequired\\tto\\tsubmit\\tsuch\\tfiles).\\tYes\\tx\\tNo\\to\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 1,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 35\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Indicate\\tby\\tcheck\\tmark\\twhether\\tthe\\tregistrant\\tis\\ta\\tlarge\\taccelerated\\tfiler,\\tan\\taccelerated\\tfiler,\\ta\\tnon-accelerated\\tfiler,\\ta\\tsmaller\\treporting\\tcompany,\\tor\\tan\\temerging\\tgrowth\\ncompany.\\tSee\\tthe\\tdefinitions\\tof\\t“large\\taccelerated\\tfiler,”\\t“accelerated\\tfiler,”\\t“smaller\\treporting\\tcompany”\\tand\\t“emerging\\tgrowth\\tcompany”\\tin\\tRule\\t12b-2\\tof\\tthe\\tExchange\\tAct:\\nLarge\\taccelerated\\tfilerx\\tAccelerated\\tfilero\\nNon-accelerated\\tfilero\\tSmaller\\treporting\\tcompanyo\\nEmerging\\tgrowth\\tcompanyo\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 1,\n        \"lines\": {\n          \"from\": 36,\n          \"to\": 40\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"If\\tan\\temerging\\tgrowth\\tcompany,\\tindicate\\tby\\tcheck\\tmark\\tif\\tthe\\tregistrant\\thas\\telected\\tnot\\tto\\tuse\\tthe\\textended\\ttransition\\tperiod\\tfor\\tcomplying\\twith\\tany\\tnew\\tor\\trevised\\tfinancial\\naccounting\\tstandards\\tprovided\\tpursuant\\tto\\tSection\\t13(a)\\tof\\tthe\\tExchange\\tAct.\\to\\nIndicate\\tby\\tcheck\\tmark\\twhether\\tthe\\tRegistrant\\thas\\tfiled\\ta\\treport\\ton\\tand\\tattestation\\tto\\tits\\tmanagement’s\\tassessment\\tof\\tthe\\teffectiveness\\tof\\tits\\tinternal\\tcontrol\\tover\\tfinancial\\nreporting\\tunder\\tSection\\t404(b)\\tof\\tthe\\tSarbanes-Oxley\\tAct\\t(15\\tU.S.C.\\t7262(b))\\tby\\tthe\\tregistered\\tpublic\\taccounting\\tfirm\\tthat\\tprepared\\tor\\tissued\\tits\\taudit\\treport.\\tx\\nIf\\tsecurities\\tare\\tregistered\\tpursuant\\tto\\tSection\\t12(b)\\tof\\tthe\\tAct,\\tindicate\\tby\\tcheck\\tmark\\twhether\\tthe\\tfinancial\\tstatements\\tof\\tthe\\tregistrant\\tincluded\\tin\\tthe\\tfiling\\treflect\\tthe\\ncorrection\\tof\\tan\\terror\\tto\\tpreviously\\tissued\\tfinancial\\tstatements.\\to\\nIndicate\\tby\\tcheck\\tmark\\twhether\\tany\\tof\\tthose\\terror\\tcorrections\\tare\\trestatements\\tthat\\trequired\\ta\\trecovery\\tanalysis\\tof\\tincentive-based\\tcompensation\\treceived\\tby\\tany\\tof\\tthe\\nregistrant’s\\texecutive\\tofficers\\tduring\\tthe\\trelevant\\trecovery\\tperiod\\tpursuant\\tto\\t§240.10D-1(b).\\to\\nIndicate\\tby\\tcheck\\tmark\\twhether\\tthe\\tregistrant\\tis\\ta\\tshell\\tcompany\\t(as\\tdefined\\tin\\tRule\\t12b-2\\tof\\tthe\\tExchange\\tAct).\\tYes\\to\\tNo\\tx\\nThe\\taggregate\\tmarket\\tvalue\\tof\\tvoting\\tstock\\theld\\tby\\tnon-affiliates\\tof\\tthe\\tregistrant,\\tas\\tof\\tJune\\t30,\\t2023,\\tthe\\tlast\\tday\\tof\\tthe\\tregistrant’s\\tmost\\trecently\\tcompleted\\tsecond\\tfiscal\\nquarter,\\twas\\t$722.52\\tbillion\\t(based\\ton\\tthe\\tclosing\\tprice\\tfor\\tshares\\tof\\tthe\\tregistrant’s\\tCommon\\tStock\\tas\\treported\\tby\\tthe\\tNASDAQ\\tGlobal\\tSelect\\tMarket\\ton\\tJune\\t30,\\t2023).\\tShares\\tof\\nCommon\\tStock\\theld\\tby\\teach\\texecutive\\tofficer\\tand\\tdirector\\thave\\tbeen\\texcluded\\tin\\tthat\\tsuch\\tpersons\\tmay\\tbe\\tdeemed\\tto\\tbe\\taffiliates.\\tThis\\tdetermination\\tof\\taffiliate\\tstatus\\tis\\tnot\\nnecessarily\\ta\\tconclusive\\tdetermination\\tfor\\tother\\tpurposes.\\nAs\\tof\\tJanuary\\t22,\\t2024,\\tthere\\twere\\t3,184,790,415\\tshares\\tof\\tthe\\tregistrant’s\\tcommon\\tstock\\toutstanding.\\nDOCUMENTS\\tINCORPORATED\\tBY\\tREFERENCE\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 2,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 15\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"DOCUMENTS\\tINCORPORATED\\tBY\\tREFERENCE\\nPortions\\tof\\tthe\\tregistrant’s\\tProxy\\tStatement\\tfor\\tthe\\t2024\\tAnnual\\tMeeting\\tof\\tStockholders\\tare\\tincorporated\\therein\\tby\\treference\\tin\\tPart\\tIII\\tof\\tthis\\tAnnual\\tReport\\ton\\tForm\\t10-K\\tto\\nthe\\textent\\tstated\\therein.\\tSuch\\tproxy\\tstatement\\twill\\tbe\\tfiled\\twith\\tthe\\tSecurities\\tand\\tExchange\\tCommission\\twithin\\t120\\tdays\\tof\\tthe\\tregistrant’s\\tfiscal\\tyear\\tended\\tDecember\\t31,\\t2023.\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 2,\n        \"lines\": {\n          \"from\": 15,\n          \"to\": 17\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"TESLA,\\tINC.\\nANNUAL\\tREPORT\\tON\\tFORM\\t10-K\\tFOR\\tTHE\\tYEAR\\tENDED\\tDECEMBER\\t31,\\t2023\\nINDEX\\n\\t\\tPage\\nPART\\tI.\\n\\t\\t\\nItem\\t1.Business4\\nItem\\t1A.Risk\\tFactors14\\nItem\\t1B.Unresolved\\tStaff\\tComments28\\nItem\\t1C.Cybersecurity29\\nItem\\t2.Properties30\\nItem\\t3.Legal\\tProceedings30\\nItem\\t4.Mine\\tSafety\\tDisclosures30\\n\\t\\nPART\\tII.\\n\\t\\nItem\\t5.Market\\tfor\\tRegistrant's\\tCommon\\tEquity,\\tRelated\\tStockholder\\tMatters\\tand\\tIssuer\\tPurchases\\tof\\tEquity\\tSecurities31\\nItem\\t6.[Reserved]32\\nItem\\t7.Management's\\tDiscussion\\tand\\tAnalysis\\tof\\tFinancial\\tCondition\\tand\\tResults\\tof\\tOperations33\\nItem\\t7A.Quantitative\\tand\\tQualitative\\tDisclosures\\tabout\\tMarket\\tRisk45\\nItem\\t8.Financial\\tStatements\\tand\\tSupplementary\\tData46\\nItem\\t9.Changes\\tin\\tand\\tDisagreements\\twith\\tAccountants\\ton\\tAccounting\\tand\\tFinancial\\tDisclosure93\\nItem\\t9A.Controls\\tand\\tProcedures93\\nItem\\t9B.Other\\tInformation94\\nItem\\t9C.Disclosure\\tRegarding\\tForeign\\tJurisdictions\\tthat\\tPrevent\\tInspections94\\n\\t\\nPART\\tIII.\\n\\t\\nItem\\t10.Directors,\\tExecutive\\tOfficers\\tand\\tCorporate\\tGovernance95\\nItem\\t11.Executive\\tCompensation95\\nItem\\t12.Security\\tOwnership\\tof\\tCertain\\tBeneficial\\tOwners\\tand\\tManagement\\tand\\tRelated\\tStockholder\\tMatters95\\nItem\\t13.Certain\\tRelationships\\tand\\tRelated\\tTransactions,\\tand\\tDirector\\tIndependence95\\nItem\\t14.Principal\\tAccountant\\tFees\\tand\\tServices95\\n\\t\\nPART\\tIV.\\n\\t\\nItem\\t15.Exhibits\\tand\\tFinancial\\tStatement\\tSchedules96\\nItem\\t16.Summary111\\n\\t\\nSignatures\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 3,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 40\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Table\\tof\\tContents\\nForward-Looking\\tStatements\\nThe\\tdiscussions\\tin\\tthis\\tAnnual\\tReport\\ton\\tForm\\t10-K\\tcontain\\tforward-looking\\tstatements\\treflecting\\tour\\tcurrent\\texpectations\\tthat\\tinvolve\\trisks\\tand\\nuncertainties.\\tThese\\tforward-looking\\tstatements\\tinclude,\\tbut\\tare\\tnot\\tlimited\\tto,\\tstatements\\tconcerning\\tsupply\\tchain\\tconstraints,\\tour\\tstrategy,\\ncompetition,\\tfuture\\toperations\\tand\\tproduction\\tcapacity,\\tfuture\\tfinancial\\tposition,\\tfuture\\trevenues,\\tprojected\\tcosts,\\tprofitability,\\texpected\\tcost\\treductions,\\ncapital\\tadequacy,\\texpectations\\tregarding\\tdemand\\tand\\tacceptance\\tfor\\tour\\ttechnologies,\\tgrowth\\topportunities\\tand\\ttrends\\tin\\tthe\\tmarkets\\tin\\twhich\\twe\\noperate,\\tprospects\\tand\\tplans\\tand\\tobjectives\\tof\\tmanagement.\\tThe\\twords\\t“anticipates,”\\t“believes,”\\t“could,”\\t“estimates,”\\t“expects,”\\t“intends,”\\t“may,”\\n“plans,”\\t“projects,”\\t“will,”\\t“would”\\tand\\tsimilar\\texpressions\\tare\\tintended\\tto\\tidentify\\tforward-looking\\tstatements,\\talthough\\tnot\\tall\\tforward-looking\\nstatements\\tcontain\\tthese\\tidentifying\\twords.\\tWe\\tmay\\tnot\\tactually\\tachieve\\tthe\\tplans,\\tintentions\\tor\\texpectations\\tdisclosed\\tin\\tour\\tforward-looking\\nstatements\\tand\\tyou\\tshould\\tnot\\tplace\\tundue\\treliance\\ton\\tour\\tforward-looking\\tstatements.\\tActual\\tresults\\tor\\tevents\\tcould\\tdiffer\\tmaterially\\tfrom\\tthe\\tplans,\\nintentions\\tand\\texpectations\\tdisclosed\\tin\\tthe\\tforward-looking\\tstatements\\tthat\\twe\\tmake.\\tThese\\tforward-looking\\tstatements\\tinvolve\\trisks\\tand\\tuncertainties\\nthat\\tcould\\tcause\\tour\\tactual\\tresults\\tto\\tdiffer\\tmaterially\\tfrom\\tthose\\tin\\tthe\\tforward-looking\\tstatements,\\tincluding,\\twithout\\tlimitation,\\tthe\\trisks\\tset\\tforth\\tin\\tPart\\nI,\\tItem\\t1A,\\t“Risk\\tFactors”\\tof\\tthe\\tAnnual\\tReport\\ton\\tForm\\t10-K\\tfor\\tthe\\tfiscal\\tyear\\tended\\tDecember\\t31,\\t2023\\tand\\tthat\\tare\\totherwise\\tdescribed\\tor\\tupdated\\nfrom\\ttime\\tto\\ttime\\tin\\tour\\tother\\tfilings\\twith\\tthe\\tSecurities\\tand\\tExchange\\tCommission\\t(the\\t“SEC”).\\tThe\\tdiscussion\\tof\\tsuch\\trisks\\tis\\tnot\\tan\\tindication\\tthat\\tany\\nsuch\\trisks\\thave\\toccurred\\tat\\tthe\\ttime\\tof\\tthis\\tfiling.\\tWe\\tdo\\tnot\\tassume\\tany\\tobligation\\tto\\tupdate\\tany\\tforward-looking\\tstatements.\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 4,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 15\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Table\\tof\\tContents\\nPART\\tI\\nITEM\\t1.\\tBUSINESS\\nOverview\\nWe\\tdesign,\\tdevelop,\\tmanufacture,\\tsell\\tand\\tlease\\thigh-performance\\tfully\\telectric\\tvehicles\\tand\\tenergy\\tgeneration\\tand\\tstorage\\tsystems,\\tand\\toffer\\nservices\\trelated\\tto\\tour\\tproducts.\\tWe\\tgenerally\\tsell\\tour\\tproducts\\tdirectly\\tto\\tcustomers,\\tand\\tcontinue\\tto\\tgrow\\tour\\tcustomer-facing\\tinfrastructure\\tthrough\\ta\\nglobal\\tnetwork\\tof\\tvehicle\\tshowrooms\\tand\\tservice\\tcenters,\\tMobile\\tService,\\tbody\\tshops,\\tSupercharger\\tstations\\tand\\tDestination\\tChargers\\tto\\taccelerate\\tthe\\nwidespread\\tadoption\\tof\\tour\\tproducts.\\tWe\\temphasize\\tperformance,\\tattractive\\tstyling\\tand\\tthe\\tsafety\\tof\\tour\\tusers\\tand\\tworkforce\\tin\\tthe\\tdesign\\tand\\nmanufacture\\tof\\tour\\tproducts\\tand\\tare\\tcontinuing\\tto\\tdevelop\\tfull\\tself-driving\\ttechnology\\tfor\\timproved\\tsafety.\\tWe\\talso\\tstrive\\tto\\tlower\\tthe\\tcost\\tof\\townership\\nfor\\tour\\tcustomers\\tthrough\\tcontinuous\\tefforts\\tto\\treduce\\tmanufacturing\\tcosts\\tand\\tby\\toffering\\tfinancial\\tand\\tother\\tservices\\ttailored\\tto\\tour\\tproducts.\\nOur\\tmission\\tis\\tto\\taccelerate\\tthe\\tworld’s\\ttransition\\tto\\tsustainable\\tenergy.\\tWe\\tbelieve\\tthat\\tthis\\tmission,\\talong\\twith\\tour\\tengineering\\texpertise,\\nvertically\\tintegrated\\tbusiness\\tmodel\\tand\\tfocus\\ton\\tuser\\texperience\\tdifferentiate\\tus\\tfrom\\tother\\tcompanies.\\nSegment\\tInformation\\nWe\\toperate\\tas\\ttwo\\treportable\\tsegments:\\t(i)\\tautomotive\\tand\\t(ii)\\tenergy\\tgeneration\\tand\\tstorage.\\nThe\\tautomotive\\tsegment\\tincludes\\tthe\\tdesign,\\tdevelopment,\\tmanufacturing,\\tsales\\tand\\tleasing\\tof\\thigh-performance\\tfully\\telectric\\tvehicles\\tas\\twell\\tas\\nsales\\tof\\tautomotive\\tregulatory\\tcredits.\\tAdditionally,\\tthe\\tautomotive\\tsegment\\talso\\tincludes\\tservices\\tand\\tother,\\twhich\\tincludes\\tsales\\tof\\tused\\tvehicles,\\tnon-\\nwarranty\\tafter-sales\\tvehicle\\tservices,\\tbody\\tshop\\tand\\tparts,\\tpaid\\tSupercharging,\\tvehicle\\tinsurance\\trevenue\\tand\\tretail\\tmerchandise.\\tThe\\tenergy\\tgeneration\\nand\\tstorage\\tsegment\\tincludes\\tthe\\tdesign,\\tmanufacture,\\tinstallation,\\tsales\\tand\\tleasing\\tof\\tsolar\\tenergy\\tgeneration\\tand\\tenergy\\tstorage\\tproducts\\tand\\trelated\\nservices\\tand\\tsales\\tof\\tsolar\\tenergy\\tsystems\\tincentives.\\nOur\\tProducts\\tand\\tServices\\nAutomotive\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 5,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 21\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Our\\tProducts\\tand\\tServices\\nAutomotive\\nWe\\tcurrently\\tmanufacture\\tfive\\tdifferent\\tconsumer\\tvehicles\\t–\\tthe\\tModel\\t3,\\tY,\\tS,\\tX\\tand\\tCybertruck.\\tModel\\t3\\tis\\ta\\tfour-door\\tmid-size\\tsedan\\tthat\\twe\\ndesigned\\tfor\\tmanufacturability\\twith\\ta\\tbase\\tprice\\tfor\\tmass-market\\tappeal.\\tModel\\tY\\tis\\ta\\tcompact\\tsport\\tutility\\tvehicle\\t(“SUV”)\\tbuilt\\ton\\tthe\\tModel\\t3\\tplatform\\nwith\\tseating\\tfor\\tup\\tto\\tseven\\tadults.\\tModel\\tS\\tis\\ta\\tfour-door\\tfull-size\\tsedan\\tand\\tModel\\tX\\tis\\ta\\tmid-size\\tSUV\\twith\\tseating\\tfor\\tup\\tto\\tseven\\tadults.\\tModel\\tS\\tand\\nModel\\tX\\tfeature\\tthe\\thighest\\tperformance\\tcharacteristics\\tand\\tlongest\\tranges\\tthat\\twe\\toffer\\tin\\ta\\tsedan\\tand\\tSUV,\\trespectively.\\tIn\\tNovember\\t2023,\\twe\\nentered\\tthe\\tconsumer\\tpickup\\ttruck\\tmarket\\twith\\tfirst\\tdeliveries\\tof\\tthe\\tCybertruck,\\ta\\tfull-size\\telectric\\tpickup\\ttruck\\twith\\ta\\tstainless\\tsteel\\texterior\\tthat\\thas\\nthe\\tutility\\tand\\tstrength\\tof\\ta\\ttruck\\twhile\\tfeaturing\\tthe\\tspeed\\tof\\ta\\tsports\\tcar.\\nIn\\t2022,\\twe\\talso\\tbegan\\tearly\\tproduction\\tand\\tdeliveries\\tof\\ta\\tcommercial\\telectric\\tvehicle,\\tthe\\tTesla\\tSemi.\\tWe\\thave\\tplanned\\telectric\\tvehicles\\tto\\naddress\\tadditional\\tvehicle\\tmarkets,\\tand\\tto\\tcontinue\\tleveraging\\tdevelopments\\tin\\tour\\tproprietary\\tFull\\tSelf-Driving\\t(“FSD”)\\tCapability\\tfeatures,\\tbattery\\tcell\\nand\\tother\\ttechnologies.\\nEnergy\\tGeneration\\tand\\tStorage\\nEnergy\\tStorage\\tProducts\\nPowerwall\\tand\\tMegapack\\tare\\tour\\tlithium-ion\\tbattery\\tenergy\\tstorage\\tproducts.\\tPowerwall,\\twhich\\twe\\tsell\\tdirectly\\tto\\tcustomers,\\tas\\twell\\tas\\tthrough\\nchannel\\tpartners,\\tis\\tdesigned\\tto\\tstore\\tenergy\\tat\\ta\\thome\\tor\\tsmall\\tcommercial\\tfacility.\\tMegapack\\tis\\tan\\tenergy\\tstorage\\tsolution\\tfor\\tcommercial,\\tindustrial,\\nutility\\tand\\tenergy\\tgeneration\\tcustomers,\\tmultiple\\tof\\twhich\\tmay\\tbe\\tgrouped\\ttogether\\tto\\tform\\tlarger\\tinstallations\\tof\\tgigawatt\\thours\\t(“GWh”)\\tor\\tgreater\\ncapacity.\\nWe\\talso\\tcontinue\\tto\\tdevelop\\tsoftware\\tcapabilities\\tfor\\tremotely\\tcontrolling\\tand\\tdispatching\\tour\\tenergy\\tstorage\\tsystems\\tacross\\ta\\twide\\trange\\tof\\nmarkets\\tand\\tapplications,\\tincluding\\tthrough\\tour\\treal-time\\tenergy\\tcontrol\\tand\\toptimization\\tplatforms.\\n4\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 5,\n        \"lines\": {\n          \"from\": 20,\n          \"to\": 39\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Table\\tof\\tContents\\nSolar\\tEnergy\\tOfferings\\nWe\\tsell\\tretrofit\\tsolar\\tenergy\\tsystems\\tto\\tcustomers\\tand\\tchannel\\tpartners\\tand\\talso\\tmake\\tthem\\tavailable\\tthrough\\tpower\\tpurchase\\tagreement\\t(“PPA”)\\narrangements.\\tWe\\tpurchase\\tmost\\tof\\tthe\\tcomponents\\tfor\\tour\\tretrofit\\tsolar\\tenergy\\tsystems\\tfrom\\tmultiple\\tsources\\tto\\tensure\\tcompetitive\\tpricing\\tand\\nadequate\\tsupply.\\tWe\\talso\\tdesign\\tand\\tmanufacture\\tcertain\\tcomponents\\tfor\\tour\\tsolar\\tenergy\\tproducts.\\nWe\\tsell\\tour\\tSolar\\tRoof,\\twhich\\tcombines\\tpremium\\tglass\\troof\\ttiles\\twith\\tenergy\\tgeneration,\\tdirectly\\tto\\tcustomers,\\tas\\twell\\tas\\tthrough\\tchannel\\ncustomers.\\tWe\\tcontinue\\tto\\timprove\\tour\\tinstallation\\tcapability\\tand\\tefficiency,\\tincluding\\tthrough\\tcollaboration\\twith\\treal\\testate\\tdevelopers\\tand\\tbuilders\\ton\\nnew\\thomes.\\nTechnology\\nAutomotive\\nBattery\\tand\\tPowertrain\\nOur\\tcore\\tvehicle\\ttechnology\\tcompetencies\\tinclude\\tpowertrain\\tengineering\\tand\\tmanufacturing\\tand\\tour\\tability\\tto\\tdesign\\tvehicles\\tthat\\tutilize\\tthe\\nunique\\tadvantages\\tof\\tan\\telectric\\tpowertrain.\\tWe\\thave\\tdesigned\\tour\\tproprietary\\tpowertrain\\tsystems\\tto\\tbe\\tadaptable,\\tefficient,\\treliable\\tand\\tcost-effective\\nwhile\\twithstanding\\tthe\\trigors\\tof\\tan\\tautomotive\\tenvironment.\\tWe\\toffer\\tdual\\tmotor\\tpowertrain\\tvehicles,\\twhich\\tuse\\ttwo\\telectric\\tmotors\\tto\\tmaximize\\ttraction\\nand\\tperformance\\tin\\tan\\tall-wheel\\tdrive\\tconfiguration,\\tas\\twell\\tas\\tvehicle\\tpowertrain\\ttechnology\\tfeaturing\\tthree\\telectric\\tmotors\\tfor\\tfurther\\tincreased\\nperformance\\tin\\tcertain\\tversions\\tof\\tModel\\tS\\tand\\tModel\\tX,\\tCybertruck\\tand\\tthe\\tTesla\\tSemi.\\nWe\\tmaintain\\textensive\\ttesting\\tand\\tR&D\\tcapabilities\\tfor\\tbattery\\tcells,\\tpacks\\tand\\tsystems,\\tand\\thave\\tbuilt\\tan\\texpansive\\tbody\\tof\\tknowledge\\ton\\tlithium-\\nion\\tcell\\tchemistry\\ttypes\\tand\\tperformance\\tcharacteristics.\\tIn\\torder\\tto\\tenable\\ta\\tgreater\\tsupply\\tof\\tcells\\tfor\\tour\\tproducts\\twith\\thigher\\tenergy\\tdensity\\tat\\tlower\\ncosts,\\twe\\thave\\tdeveloped\\ta\\tnew\\tproprietary\\tlithium-ion\\tbattery\\tcell\\tand\\timproved\\tmanufacturing\\tprocesses.\\nVehicle\\tControl\\tand\\tInfotainment\\tSoftware\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 6,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 20\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Vehicle\\tControl\\tand\\tInfotainment\\tSoftware\\nThe\\tperformance\\tand\\tsafety\\tsystems\\tof\\tour\\tvehicles\\tand\\ttheir\\tbattery\\tpacks\\tutilize\\tsophisticated\\tcontrol\\tsoftware.\\tControl\\tsystems\\tin\\tour\\tvehicles\\noptimize\\tperformance,\\tcustomize\\tvehicle\\tbehavior,\\tmanage\\tcharging\\tand\\tcontrol\\tall\\tinfotainment\\tfunctions.\\tWe\\tdevelop\\talmost\\tall\\tof\\tthis\\tsoftware,\\nincluding\\tmost\\tof\\tthe\\tuser\\tinterfaces,\\tinternally\\tand\\tupdate\\tour\\tvehicles’\\tsoftware\\tregularly\\tthrough\\tover-the-air\\tupdates.\\nSelf-Driving\\tDevelopment\\tand\\tArtificial\\tIntelligence\\nWe\\thave\\texpertise\\tin\\tdeveloping\\ttechnologies,\\tsystems\\tand\\tsoftware\\tto\\tenable\\tself-driving\\tvehicles\\tusing\\tprimarily\\tvision-based\\ttechnologies.\\tOur\\nFSD\\tComputer\\truns\\tour\\tneural\\tnetworks\\tin\\tour\\tvehicles,\\tand\\twe\\tare\\talso\\tdeveloping\\tadditional\\tcomputer\\thardware\\tto\\tbetter\\tenable\\tthe\\tmassive\\tamounts\\nof\\tfield\\tdata\\tcaptured\\tby\\tour\\tvehicles\\tto\\tcontinually\\ttrain\\tand\\timprove\\tthese\\tneural\\tnetworks\\tfor\\treal-world\\tperformance.\\nCurrently,\\twe\\toffer\\tin\\tour\\tvehicles\\tcertain\\tadvanced\\tdriver\\tassist\\tsystems\\tunder\\tour\\tAutopilot\\tand\\tFSD\\tCapability\\toptions.\\tAlthough\\tat\\tpresent\\tthe\\ndriver\\tis\\tultimately\\tresponsible\\tfor\\tcontrolling\\tthe\\tvehicle,\\tour\\tsystems\\tprovide\\tsafety\\tand\\tconvenience\\tfunctionality\\tthat\\trelieves\\tdrivers\\tof\\tthe\\tmost\\ntedious\\tand\\tpotentially\\tdangerous\\taspects\\tof\\troad\\ttravel\\tmuch\\tlike\\tthe\\tsystem\\tthat\\tairplane\\tpilots\\tuse,\\twhen\\tconditions\\tpermit.\\tAs\\twith\\tother\\tvehicle\\nsystems,\\twe\\timprove\\tthese\\tfunctions\\tin\\tour\\tvehicles\\tover\\ttime\\tthrough\\tover-the-air\\tupdates.\\nWe\\tintend\\tto\\testablish\\tin\\tthe\\tfuture\\tan\\tautonomous\\tTesla\\tride-hailing\\tnetwork,\\twhich\\twe\\texpect\\twould\\talso\\tallow\\tus\\tto\\taccess\\ta\\tnew\\tcustomer\\tbase\\neven\\tas\\tmodes\\tof\\ttransportation\\tevolve.\\nWe\\tare\\talso\\tapplying\\tour\\tartificial\\tintelligence\\tlearnings\\tfrom\\tself-driving\\ttechnology\\tto\\tthe\\tfield\\tof\\trobotics,\\tsuch\\tas\\tthrough\\tOptimus,\\ta\\trobotic\\nhumanoid\\tin\\tdevelopment,\\twhich\\tis\\tcontrolled\\tby\\tthe\\tsame\\tAI\\tsystem.\\n5\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 6,\n        \"lines\": {\n          \"from\": 20,\n          \"to\": 36\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Table\\tof\\tContents\\nEnergy\\tGeneration\\tand\\tStorage\\nEnergy\\tStorage\\tProducts\\nWe\\tleverage\\tmany\\tof\\tthe\\tcomponent-level\\ttechnologies\\tfrom\\tour\\tvehicles\\tin\\tour\\tenergy\\tstorage\\tproducts.\\tBy\\ttaking\\ta\\tmodular\\tapproach\\tto\\tthe\\ndesign\\tof\\tbattery\\tsystems,\\twe\\tcan\\toptimize\\tmanufacturing\\tcapacity\\tof\\tour\\tenergy\\tstorage\\tproducts.\\tAdditionally,\\tour\\texpertise\\tin\\tpower\\telectronics\\nenables\\tour\\tbattery\\tsystems\\tto\\tinterconnect\\twith\\telectricity\\tgrids\\twhile\\tproviding\\tfast-acting\\tsystems\\tfor\\tpower\\tinjection\\tand\\tabsorption.\\tWe\\thave\\talso\\ndeveloped\\tsoftware\\tto\\tremotely\\tcontrol\\tand\\tdispatch\\tour\\tenergy\\tstorage\\tsystems.\\nSolar\\tEnergy\\tSystems\\nWe\\thave\\tengineered\\tSolar\\tRoof\\tover\\tnumerous\\titerations\\tto\\tcombine\\taesthetic\\tappeal\\tand\\tdurability\\twith\\tpower\\tgeneration.\\tThe\\tefficiency\\tof\\tour\\nsolar\\tenergy\\tproducts\\tis\\taided\\tby\\tour\\town\\tsolar\\tinverter,\\twhich\\tincorporates\\tour\\tpower\\telectronics\\ttechnologies.\\tWe\\tdesigned\\tboth\\tproducts\\tto\\tintegrate\\nwith\\tPowerwall.\\nDesign\\tand\\tEngineering\\nAutomotive\\nWe\\thave\\testablished\\tsignificant\\tin-house\\tcapabilities\\tin\\tthe\\tdesign\\tand\\ttest\\tengineering\\tof\\telectric\\tvehicles\\tand\\ttheir\\tcomponents\\tand\\tsystems.\\tOur\\nteam\\thas\\tsignificant\\texperience\\tin\\tcomputer-aided\\tdesign\\tas\\twell\\tas\\tdurability,\\tstrength\\tand\\tcrash\\ttest\\tsimulations,\\twhich\\treduces\\tthe\\tproduct\\ndevelopment\\ttime\\tof\\tnew\\tmodels.\\tWe\\thave\\talso\\tachieved\\tcomplex\\tengineering\\tfeats\\tin\\tstamping,\\tcasting\\tand\\tthermal\\tsystems,\\tand\\tdeveloped\\ta\\tmethod\\nto\\tintegrate\\tbatteries\\tdirectly\\twith\\tvehicle\\tbody\\tstructures\\twithout\\tseparate\\tbattery\\tpacks\\tto\\toptimize\\tmanufacturability,\\tweight,\\trange\\tand\\tcost\\ncharacteristics.\\nWe\\tare\\talso\\texpanding\\tour\\tmanufacturing\\toperations\\tglobally\\twhile\\ttaking\\taction\\tto\\tlocalize\\tour\\tvehicle\\tdesigns\\tand\\tproduction\\tfor\\tparticular\\nmarkets,\\tincluding\\tcountry-specific\\tmarket\\tdemands\\tand\\tfactory\\toptimizations\\tfor\\tlocal\\tworkforces.\\tAs\\twe\\tincrease\\tour\\tcapabilities,\\tparticularly\\tin\\tthe\\nareas\\tof\\tautomation,\\tdie-making\\tand\\tline-building,\\twe\\tare\\talso\\tmaking\\tstrides\\tin\\tthe\\tsimulations\\tmodeling\\tthese\\tcapabilities\\tprior\\tto\\tconstruction.\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 7,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 21\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Energy\\tGeneration\\tand\\tStorage\\nOur\\texpertise\\tin\\telectrical,\\tmechanical,\\tcivil\\tand\\tsoftware\\tengineering\\tallows\\tus\\tto\\tdesign,\\tengineer,\\tmanufacture\\tand\\tinstall\\tenergy\\tgenerating\\tand\\nstorage\\tproducts\\tand\\tcomponents,\\tincluding\\tat\\tthe\\tresidential\\tthrough\\tutility\\tscale.\\tFor\\texample,\\tthe\\tmodular\\tdesign\\tof\\tour\\tMegapack\\tutility-scale\\tbattery\\nline\\tis\\tintended\\tto\\tsignificantly\\treduce\\tthe\\tamount\\tof\\tassembly\\trequired\\tin\\tthe\\tfield.\\tWe\\talso\\tcustomize\\tsolutions\\tincluding\\tour\\tenergy\\tstorage\\tproducts,\\nsolar\\tenergy\\tsystems\\tand/or\\tSolar\\tRoof\\tfor\\tcustomers\\tto\\tmeet\\ttheir\\tspecific\\tneeds.\\nSales\\tand\\tMarketing\\nHistorically,\\twe\\thave\\tbeen\\table\\tto\\tachieve\\tsales\\twithout\\ttraditional\\tadvertising\\tand\\tat\\trelatively\\tlow\\tmarketing\\tcosts.\\tWe\\tcontinue\\tto\\tmonitor\\tour\\npublic\\tnarrative\\tand\\tbrand,\\tand\\ttailor\\tour\\tmarketing\\tefforts\\taccordingly,\\tincluding\\tthrough\\tinvestments\\tin\\tcustomer\\teducation\\tand\\tadvertising\\tas\\nnecessary.\\nAutomotive\\nDirect\\tSales\\nOur\\tvehicle\\tsales\\tchannels\\tcurrently\\tinclude\\tour\\twebsite\\tand\\tan\\tinternational\\tnetwork\\tof\\tcompany-owned\\tstores.\\tIn\\tsome\\tjurisdictions,\\twe\\talso\\thave\\ngalleries\\tto\\teducate\\tand\\tinform\\tcustomers\\tabout\\tour\\tproducts,\\tbut\\tsuch\\tlocations\\tdo\\tnot\\ttransact\\tin\\tthe\\tsale\\tof\\tvehicles.\\tWe\\tbelieve\\tthis\\tinfrastructure\\nenables\\tus\\tto\\tbetter\\tcontrol\\tcosts\\tof\\tinventory,\\tmanage\\twarranty\\tservice\\tand\\tpricing,\\teducate\\tconsumers\\tabout\\telectric\\tvehicles,\\tmake\\tour\\tvehicles\\tmore\\naffordable,\\tmaintain\\tand\\tstrengthen\\tthe\\tTesla\\tbrand\\tand\\tobtain\\trapid\\tcustomer\\tfeedback.\\nWe\\treevaluate\\tour\\tsales\\tstrategy\\tboth\\tglobally\\tand\\tat\\ta\\tlocation-by-location\\tlevel\\tfrom\\ttime\\tto\\ttime\\tto\\toptimize\\tour\\tsales\\tchannels.\\tHowever,\\tsales\\nof\\tvehicles\\tin\\tthe\\tautomobile\\tindustry\\ttend\\tto\\tbe\\tcyclical\\tin\\tmany\\tmarkets,\\twhich\\tmay\\texpose\\tus\\tto\\tvolatility\\tfrom\\ttime\\tto\\ttime.\\n6\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 7,\n        \"lines\": {\n          \"from\": 22,\n          \"to\": 39\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Table\\tof\\tContents\\nUsed\\tVehicle\\tSales\\nOur\\tused\\tvehicle\\tbusiness\\tsupports\\tnew\\tvehicle\\tsales\\tby\\tintegrating\\tthe\\ttrade-in\\tof\\ta\\tcustomer’s\\texisting\\tTesla\\tor\\tnon-Tesla\\tvehicle\\twith\\tthe\\tsale\\tof\\na\\tnew\\tor\\tused\\tTesla\\tvehicle.\\tThe\\tTesla\\tand\\tnon-Tesla\\tvehicles\\twe\\tacquire\\tas\\ttrade-ins\\tare\\tsubsequently\\tremarketed,\\teither\\tdirectly\\tby\\tus\\tor\\tthrough\\tthird\\nparties.\\tWe\\talso\\tremarket\\tused\\tTesla\\tvehicles\\tacquired\\tfrom\\tother\\tsources\\tincluding\\tlease\\treturns.\\nPublic\\tCharging\\nWe\\thave\\ta\\tgrowing\\tglobal\\tnetwork\\tof\\tTesla\\tSuperchargers,\\twhich\\tare\\tour\\tindustrial-grade,\\thigh-speed\\tvehicle\\tchargers.\\tWhere\\tpossible,\\twe\\tco-\\nlocate\\tSuperchargers\\twith\\tour\\tsolar\\tand\\tenergy\\tstorage\\tsystems\\tto\\treduce\\tcosts\\tand\\tpromote\\trenewable\\tpower.\\tSupercharger\\tstations\\tare\\ttypically\\nplaced\\talong\\twell-traveled\\troutes\\tand\\tin\\tand\\taround\\tdense\\tcity\\tcenters\\tto\\tallow\\tvehicle\\towners\\tthe\\tability\\tto\\tenjoy\\tquick,\\treliable\\tcharging\\talong\\tan\\nextensive\\tnetwork\\twith\\tconvenient\\tstops.\\tUse\\tof\\tthe\\tSupercharger\\tnetwork\\teither\\trequires\\tpayment\\tof\\ta\\tfee\\tor\\tis\\tfree\\tunder\\tcertain\\tsales\\tprograms.\\tIn\\nNovember\\t2021,\\twe\\tbegan\\tto\\toffer\\tSupercharger\\taccess\\tto\\tnon-Tesla\\tvehicles\\tin\\tcertain\\tlocations\\tin\\tsupport\\tof\\tour\\tmission\\tto\\taccelerate\\tthe\\tworld’s\\ntransition\\tto\\tsustainable\\tenergy,\\tand\\tin\\tNovember\\t2022,\\twe\\topened\\tup\\tour\\tpreviously\\tproprietary\\tcharging\\tconnector\\tas\\tthe\\tNorth\\tAmerican\\tCharging\\nStandard\\t(NACS).\\tThis\\tenables\\tall\\telectric\\tvehicles\\tand\\tcharging\\tstations\\tto\\tinteroperate\\t—\\twhich\\tmakes\\tcharging\\teasier\\tand\\tmore\\tefficient\\tfor\\teveryone\\nand\\tadvances\\tour\\tmission\\tto\\taccelerate\\tthe\\tworld’s\\ttransition\\tto\\tsustainable\\tenergy.\\tFollowing\\tthis,\\ta\\tnumber\\tof\\tmajor\\tautomotive\\tcompanies\\tannounced\\ntheir\\tadoption\\tof\\tNACS,\\twith\\ttheir\\taccess\\tto\\tthe\\tSupercharger\\tnetwork\\tbeginning\\tin\\tphases\\tin\\t2024\\tand\\ttheir\\tproduction\\tof\\tNACS\\tvehicles\\tbeginning\\tno\\nlater\\tthan\\t2025.\\tWe\\talso\\tengaged\\tSAE\\tInternational\\tto\\tgovern\\tNACS\\tas\\tan\\tindustry\\tstandard,\\tnow\\tnamed\\tJ3400.\\tWe\\tcontinue\\tto\\tmonitor\\tand\\tincrease\\tour\\nnetwork\\tof\\tTesla\\tSuperchargers\\tin\\tanticipation\\tof\\tfuture\\tdemand.\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 8,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 17\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"We\\talso\\twork\\twith\\ta\\twide\\tvariety\\tof\\thospitality,\\tretail\\tand\\tpublic\\tdestinations,\\tas\\twell\\tas\\tbusinesses\\twith\\tcommuting\\temployees,\\tto\\toffer\\tadditional\\ncharging\\toptions\\tfor\\tour\\tcustomers,\\tas\\twell\\tas\\tsingle-family\\thomeowners\\tand\\tmulti-family\\tresidential\\tentities,\\tto\\tdeploy\\thome\\tcharging\\tsolutions.\\nIn-App\\tUpgrades\\nAs\\tour\\tvehicles\\tare\\tcapable\\tof\\tbeing\\tupdated\\tremotely\\tover-the-air,\\tour\\tcustomers\\tmay\\tpurchase\\tadditional\\tpaid\\toptions\\tand\\tfeatures\\tthrough\\tthe\\nTesla\\tapp\\tor\\tthrough\\tthe\\tin-vehicle\\tuser\\tinterface.\\tWe\\texpect\\tthat\\tthis\\tfunctionality\\twill\\talso\\tallow\\tus\\tto\\toffer\\tcertain\\toptions\\tand\\tfeatures\\ton\\ta\\nsubscription\\tbasis\\tin\\tthe\\tfuture.\\nEnergy\\tGeneration\\tand\\tStorage\\nWe\\tmarket\\tand\\tsell\\tour\\tsolar\\tand\\tenergy\\tstorage\\tproducts\\tto\\tresidential,\\tcommercial\\tand\\tindustrial\\tcustomers\\tand\\tutilities\\tthrough\\ta\\tvariety\\tof\\nchannels,\\tincluding\\tthrough\\tour\\twebsite,\\tstores\\tand\\tgalleries,\\tas\\twell\\tas\\tthrough\\tour\\tnetwork\\tof\\tchannel\\tpartners,\\tand\\tin\\tthe\\tcase\\tof\\tsome\\tcommercial\\ncustomers,\\tthrough\\tPPA\\ttransactions.\\tWe\\temphasize\\tsimplicity,\\tstandardization\\tand\\taccessibility\\tto\\tmake\\tit\\teasy\\tand\\tcost-effective\\tfor\\tcustomers\\tto\\tadopt\\nclean\\tenergy,\\twhile\\treducing\\tour\\tcustomer\\tacquisition\\tcosts.\\nService\\tand\\tWarranty\\nAutomotive\\nService\\nWe\\tprovide\\tservice\\tfor\\tour\\telectric\\tvehicles\\tat\\tour\\tcompany-owned\\tservice\\tlocations\\tand\\tthrough\\tTesla\\tMobile\\tService\\ttechnicians\\twho\\tperform\\twork\\nremotely\\tat\\tcustomers’\\thomes\\tor\\tother\\tlocations.\\tServicing\\tthe\\tvehicles\\tourselves\\tallows\\tus\\tto\\tidentify\\tproblems\\tand\\timplement\\tsolutions\\tand\\nimprovements\\tfaster\\tthan\\ttraditional\\tautomobile\\tmanufacturers\\tand\\ttheir\\tdealer\\tnetworks.\\tThe\\tconnectivity\\tof\\tour\\tvehicles\\talso\\tallows\\tus\\tto\\tdiagnose\\tand\\nremedy\\tmany\\tproblems\\tremotely\\tand\\tproactively.\\nVehicle\\tLimited\\tWarranties\\tand\\tExtended\\tService\\tPlans\\nWe\\tprovide\\ta\\tmanufacturer’s\\tlimited\\twarranty\\ton\\tall\\tnew\\tand\\tused\\tTesla\\tvehicles\\twe\\tsell\\tdirectly\\tto\\tconsumers,\\twhich\\tmay\\tinclude\\tlimited\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 8,\n        \"lines\": {\n          \"from\": 18,\n          \"to\": 37\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"warranties\\ton\\tcertain\\tcomponents,\\tspecific\\ttypes\\tof\\tdamage\\tor\\tbattery\\tcapacity\\tretention.\\tWe\\talso\\tcurrently\\toffer\\toptional\\textended\\tservice\\tplans\\tthat\\nprovide\\tcoverage\\tbeyond\\tthe\\tnew\\tvehicle\\tlimited\\twarranties\\tfor\\tcertain\\tmodels\\tin\\tspecified\\tregions.\\n7\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 8,\n        \"lines\": {\n          \"from\": 38,\n          \"to\": 40\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Table\\tof\\tContents\\nEnergy\\tGeneration\\tand\\tStorage\\nWe\\tprovide\\tservice\\tand\\trepairs\\tto\\tour\\tenergy\\tproduct\\tcustomers,\\tincluding\\tunder\\twarranty\\twhere\\tapplicable.\\tWe\\tgenerally\\tprovide\\tmanufacturer’s\\nlimited\\twarranties\\twith\\tour\\tenergy\\tstorage\\tproducts\\tand\\toffer\\tcertain\\textended\\tlimited\\twarranties\\tthat\\tare\\tavailable\\tat\\tthe\\ttime\\tof\\tpurchase\\tof\\tthe\\nsystem.\\tIf\\twe\\tinstall\\ta\\tsystem,\\twe\\talso\\tprovide\\tcertain\\tlimited\\twarranties\\ton\\tour\\tinstallation\\tworkmanship.\\nFor\\tretrofit\\tsolar\\tenergy\\tsystems,\\twe\\tprovide\\tseparate\\tlimited\\twarranties\\tfor\\tworkmanship\\tand\\tagainst\\troof\\tleaks,\\tand\\tfor\\tSolar\\tRoof,\\twe\\talso\\nprovide\\tlimited\\twarranties\\tfor\\tdefects\\tand\\tweatherization.\\tFor\\tcomponents\\tnot\\tmanufactured\\tby\\tus,\\twe\\tgenerally\\tpass-through\\tthe\\tapplicable\\nmanufacturers’\\twarranties.\\nAs\\tpart\\tof\\tour\\tsolar\\tenergy\\tsystem\\tand\\tenergy\\tstorage\\tcontracts,\\twe\\tmay\\tprovide\\tthe\\tcustomer\\twith\\tperformance\\tguarantees\\tthat\\tcommit\\tthat\\tthe\\nunderlying\\tsystem\\twill\\tmeet\\tor\\texceed\\tthe\\tminimum\\tenergy\\tgeneration\\tor\\tperformance\\trequirements\\tspecified\\tin\\tthe\\tcontract.\\nFinancial\\tServices\\nAutomotive\\nPurchase\\tFinancing\\tand\\tLeases\\nWe\\toffer\\tleasing\\tand/or\\tloan\\tfinancing\\tarrangements\\tfor\\tour\\tvehicles\\tin\\tcertain\\tjurisdictions\\tin\\tNorth\\tAmerica,\\tEurope\\tand\\tAsia\\tourselves\\tand\\nthrough\\tvarious\\tfinancial\\tinstitutions.\\tUnder\\tcertain\\tof\\tsuch\\tprograms,\\twe\\thave\\tprovided\\tresale\\tvalue\\tguarantees\\tor\\tbuyback\\tguarantees\\tthat\\tmay\\nobligate\\tus\\tto\\tcover\\ta\\tresale\\tloss\\tup\\tto\\ta\\tcertain\\tlimit\\tor\\trepurchase\\tthe\\tsubject\\tvehicles\\tat\\tpre-determined\\tvalues.\\nInsurance\\nIn\\t2021,\\twe\\tlaunched\\tour\\tinsurance\\tproduct\\tusing\\treal-time\\tdriving\\tbehavior\\tin\\tselect\\tstates,\\twhich\\toffers\\trates\\tthat\\tare\\toften\\tbetter\\tthan\\tother\\nalternatives\\tand\\tpromotes\\tsafer\\tdriving.\\tOur\\tinsurance\\tproducts\\tare\\tcurrently\\tavailable\\tin\\t12\\tstates\\tand\\twe\\tplan\\tto\\texpand\\tthe\\tmarkets\\tin\\twhich\\twe\\toffer\\ninsurance\\tproducts,\\tas\\tpart\\tof\\tour\\tongoing\\teffort\\tto\\tdecrease\\tthe\\ttotal\\tcost\\tof\\townership\\tfor\\tour\\tcustomers.\\nEnergy\\tGeneration\\tand\\tStorage\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 9,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 21\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Energy\\tGeneration\\tand\\tStorage\\nWe\\toffer\\tcertain\\tfinancing\\toptions\\tto\\tour\\tsolar\\tcustomers,\\twhich\\tenable\\tthe\\tcustomer\\tto\\tpurchase\\tand\\town\\ta\\tsolar\\tenergy\\tsystem,\\tSolar\\tRoof\\tor\\nintegrated\\tsolar\\tand\\tPowerwall\\tsystem.\\tOur\\tsolar\\tPPAs,\\toffered\\tprimarily\\tto\\tcommercial\\tcustomers,\\tcharge\\ta\\tfee\\tper\\tkilowatt-hour\\tbased\\ton\\tthe\\tamount\\tof\\nelectricity\\tproduced\\tby\\tour\\tsolar\\tenergy\\tsystems.\\nManufacturing\\nWe\\tcurrently\\thave\\tmanufacturing\\tfacilities\\tin\\tthe\\tU.S.\\tin\\tNorthern\\tCalifornia,\\tin\\tBuffalo,\\tNew\\tYork,\\tGigafactory\\tNew\\tYork;\\tin\\tAustin,\\tTexas,\\nGigafactory\\tTexas\\tand\\tnear\\tReno,\\tNevada,\\tGigafactory\\tNevada.\\tAt\\tthese\\tfacilities,\\twe\\tmanufacture\\tand\\tassemble,\\tamong\\tother\\tthings,\\tvehicles,\\tcertain\\nvehicle\\tparts\\tand\\tcomponents,\\tsuch\\tas\\tour\\tbattery\\tpacks\\tand\\tbattery\\tcells,\\tenergy\\tstorage\\tcomponents\\tand\\tsolar\\tproducts\\tand\\tcomponents.\\nInternationally,\\twe\\talso\\thave\\tmanufacturing\\tfacilities\\tin\\tChina\\t(Gigafactory\\tShanghai)\\tand\\tGermany\\t(Gigafactory\\tBerlin-Brandenburg),\\twhich\\tallows\\nus\\tto\\tincrease\\tthe\\taffordability\\tof\\tour\\tvehicles\\tfor\\tcustomers\\tin\\tlocal\\tmarkets\\tby\\treducing\\ttransportation\\tand\\tmanufacturing\\tcosts\\tand\\teliminating\\tthe\\nimpact\\tof\\tunfavorable\\ttariffs.\\tIn\\tMarch\\t2023,\\twe\\tannounced\\tthe\\tlocation\\tof\\tour\\tnext\\tGigafactory\\tin\\tMonterrey,\\tMexico.\\tGenerally,\\twe\\tcontinue\\tto\\texpand\\nproduction\\tcapacity\\tat\\tour\\texisting\\tfacilities.\\tWe\\talso\\tintend\\tto\\tfurther\\tincrease\\tcost-competitiveness\\tin\\tour\\tsignificant\\tmarkets\\tby\\tstrategically\\tadding\\nlocal\\tmanufacturing.\\nSupply\\tChain\\nOur\\tproducts\\tuse\\tthousands\\tof\\tparts\\tthat\\tare\\tsourced\\tfrom\\thundreds\\tof\\tsuppliers\\tacross\\tthe\\tworld.\\tWe\\thave\\tdeveloped\\tclose\\trelationships\\twith\\nvendors\\tof\\tkey\\tparts\\tsuch\\tas\\tbattery\\tcells,\\telectronics\\tand\\tcomplex\\tvehicle\\tassemblies.\\tCertain\\tcomponents\\tpurchased\\tfrom\\tthese\\tsuppliers\\tare\\tshared\\tor\\nare\\tsimilar\\tacross\\tmany\\tproduct\\tlines,\\tallowing\\tus\\tto\\ttake\\tadvantage\\tof\\tpricing\\tefficiencies\\tfrom\\teconomies\\tof\\tscale.\\n8\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 9,\n        \"lines\": {\n          \"from\": 21,\n          \"to\": 38\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Table\\tof\\tContents\\nAs\\tis\\tthe\\tcase\\tfor\\tsome\\tautomotive\\tcompanies,\\tsome\\tof\\tour\\tprocured\\tcomponents\\tand\\tsystems\\tare\\tsourced\\tfrom\\tsingle\\tsuppliers.\\tWhere\\tmultiple\\nsources\\tare\\tavailable\\tfor\\tcertain\\tkey\\tcomponents,\\twe\\twork\\tto\\tqualify\\tmultiple\\tsuppliers\\tfor\\tthem\\twhere\\tit\\tis\\tsensible\\tto\\tdo\\tso\\tin\\torder\\tto\\tminimize\\npotential\\tproduction\\trisks\\tdue\\tto\\tdisruptions\\tin\\ttheir\\tsupply.\\tWe\\talso\\tmitigate\\trisk\\tby\\tmaintaining\\tsafety\\tstock\\tfor\\tkey\\tparts\\tand\\tassemblies\\tand\\tdie\\tbanks\\nfor\\tcomponents\\twith\\tlengthy\\tprocurement\\tlead\\ttimes.\\nOur\\tproducts\\tuse\\tvarious\\traw\\tmaterials\\tincluding\\taluminum,\\tsteel,\\tcobalt,\\tlithium,\\tnickel\\tand\\tcopper.\\tPricing\\tfor\\tthese\\tmaterials\\tis\\tgoverned\\tby\\nmarket\\tconditions\\tand\\tmay\\tfluctuate\\tdue\\tto\\tvarious\\tfactors\\toutside\\tof\\tour\\tcontrol,\\tsuch\\tas\\tsupply\\tand\\tdemand\\tand\\tmarket\\tspeculation.\\tWe\\tstrive\\tto\\nexecute\\tlong-term\\tsupply\\tcontracts\\tfor\\tsuch\\tmaterials\\tat\\tcompetitive\\tpricing\\twhen\\tfeasible,\\tand\\twe\\tcurrently\\tbelieve\\tthat\\twe\\thave\\tadequate\\taccess\\tto\\nraw\\tmaterials\\tsupplies\\tto\\tmeet\\tthe\\tneeds\\tof\\tour\\toperations.\\nGovernmental\\tPrograms,\\tIncentives\\tand\\tRegulations\\nGlobally,\\tthe\\townership\\tof\\tour\\tproducts\\tby\\tour\\tcustomers\\tis\\timpacted\\tby\\tvarious\\tgovernment\\tcredits,\\tincentives,\\tand\\tpolicies.\\tOur\\tbusiness\\tand\\nproducts\\tare\\talso\\tsubject\\tto\\tnumerous\\tgovernmental\\tregulations\\tthat\\tvary\\tamong\\tjurisdictions.\\nThe\\toperation\\tof\\tour\\tbusiness\\tis\\talso\\timpacted\\tby\\tvarious\\tgovernment\\tprograms,\\tincentives,\\tand\\tother\\tarrangements.\\tSee\\tNote\\t2,\\tSummary\\tof\\nSignificant\\tAccounting\\tPolicies,\\tto\\tthe\\tconsolidated\\tfinancial\\tstatements\\tincluded\\telsewhere\\tin\\tthis\\tAnnual\\tReport\\ton\\tForm\\t10-K\\tfor\\tfurther\\tdetails.\\nPrograms\\tand\\tIncentives\\nInflation\\tReduction\\tAct\\nOn\\tAugust\\t16,\\t2022,\\tthe\\tInflation\\tReduction\\tAct\\tof\\t2022\\t(“IRA”)\\twas\\tenacted\\tinto\\tlaw\\tand\\tis\\teffective\\tfor\\ttaxable\\tyears\\tbeginning\\tafter\\tDecember\\n31,\\t2022,\\tand\\tremains\\tsubject\\tto\\tfuture\\tguidance\\treleases.\\tThe\\tIRA\\tincludes\\tmultiple\\tincentives\\tto\\tpromote\\tclean\\tenergy,\\telectric\\tvehicles,\\tbattery\\tand\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 10,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 18\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"energy\\tstorage\\tmanufacture\\tor\\tpurchase,\\tincluding\\tthrough\\tproviding\\ttax\\tcredits\\tto\\tconsumers.\\tFor\\texample,\\tqualifying\\tTesla\\tcustomers\\tmay\\treceive\\tup\\nto\\t$7,500\\tin\\tfederal\\ttax\\tcredits\\tfor\\tthe\\tpurchase\\tof\\tqualified\\telectric\\tvehicles\\tin\\tthe\\tU.S.\\tthrough\\t2032.\\nAutomotive\\tRegulatory\\tCredits\\nWe\\tearn\\ttradable\\tcredits\\tin\\tthe\\toperation\\tof\\tour\\tbusiness\\tunder\\tvarious\\tregulations\\trelated\\tto\\tzero-emission\\tvehicles\\t(“ZEVs”),\\tgreenhouse\\tgas,\\tfuel\\neconomy\\tand\\tclean\\tfuel.\\tWe\\tsell\\tthese\\tcredits\\tto\\tother\\tregulated\\tentities\\twho\\tcan\\tuse\\tthe\\tcredits\\tto\\tcomply\\twith\\temission\\tstandards\\tand\\tother\\tregulatory\\nrequirements.\\tSales\\tof\\tthese\\tcredits\\tare\\trecognized\\twithin\\tautomotive\\tregulatory\\tcredits\\trevenue\\tin\\tour\\tconsolidated\\tstatements\\tof\\toperations\\tincluded\\nelsewhere\\tin\\tthis\\tAnnual\\tReport\\ton\\tForm\\t10-K.\\nEnergy\\tStorage\\tSystem\\tIncentives\\tand\\tPolicies\\nWhile\\tthe\\tregulatory\\tregime\\tfor\\tenergy\\tstorage\\tprojects\\tis\\tstill\\tunder\\tdevelopment,\\tthere\\tare\\tvarious\\tpolicies,\\tincentives\\tand\\tfinancial\\tmechanisms\\nat\\tthe\\tfederal,\\tstate\\tand\\tlocal\\tlevels\\tthat\\tsupport\\tthe\\tadoption\\tof\\tenergy\\tstorage.\\nFor\\texample,\\tenergy\\tstorage\\tsystems\\tthat\\tare\\tcharged\\tusing\\tsolar\\tenergy\\tmay\\tbe\\teligible\\tfor\\tthe\\tsolar\\tenergy-related\\tU.S.\\tfederal\\ttax\\tcredits\\ndescribed\\tbelow.\\tThe\\tFederal\\tEnergy\\tRegulatory\\tCommission\\t(“FERC”)\\thas\\talso\\ttaken\\tsteps\\tto\\tenable\\tthe\\tparticipation\\tof\\tenergy\\tstorage\\tin\\twholesale\\nenergy\\tmarkets.\\tIn\\taddition,\\tCalifornia\\tand\\ta\\tnumber\\tof\\tother\\tstates\\thave\\tadopted\\tprocurement\\ttargets\\tfor\\tenergy\\tstorage,\\tand\\tbehind-the-meter\\tenergy\\nstorage\\tsystems\\tqualify\\tfor\\tfunding\\tunder\\tthe\\tCalifornia\\tSelf\\tGeneration\\tIncentive\\tProgram.\\tOur\\tcustomers\\tprimarily\\tbenefit\\tdirectly\\tunder\\tthese\\nprograms.\\tIn\\tcertain\\tinstances\\tour\\tcustomers\\tmay\\ttransfer\\tsuch\\tcredits\\tto\\tus\\tas\\tcontract\\tconsideration.\\tIn\\tsuch\\ttransactions,\\tthey\\tare\\tincluded\\tas\\ta\\ncomponent\\tof\\tenergy\\tgeneration\\tand\\tstorage\\trevenues\\tin\\tour\\tconsolidated\\tstatements\\tof\\toperations\\tincluded\\telsewhere\\tin\\tthis\\tAnnual\\tReport\\ton\\tForm\\n10-K.\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 10,\n        \"lines\": {\n          \"from\": 19,\n          \"to\": 35\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"10-K.\\nPursuant\\tto\\tthe\\tIRA,\\tunder\\tSections\\t48,\\t48E\\tand\\t25D\\tof\\tthe\\tInternal\\tRevenue\\tCode\\t(”IRC”),\\tstandalone\\tenergy\\tstorage\\ttechnology\\tis\\teligible\\tfor\\ta\\ttax\\ncredit\\tbetween\\t6%\\tand\\t50%\\tof\\tqualified\\texpenditures,\\tregardless\\tof\\tthe\\tsource\\tof\\tenergy,\\twhich\\tmay\\tbe\\tclaimed\\tby\\tour\\tcustomers\\tfor\\tstorage\\tsystems\\nthey\\tpurchase\\tor\\tby\\tus\\tfor\\tarrangements\\twhere\\twe\\town\\tthe\\tsystems.\\tThese\\ttax\\tcredits\\tare\\tprimarily\\tfor\\tthe\\tbenefit\\tof\\tour\\tcustomers\\tand\\tare\\tcurrently\\nscheduled\\tto\\tphase-out\\tstarting\\tin\\t2032\\tor\\tlater.\\n9\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 10,\n        \"lines\": {\n          \"from\": 35,\n          \"to\": 40\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Table\\tof\\tContents\\nSolar\\tEnergy\\tSystem\\tIncentives\\tand\\tPolicies\\nU.S.\\tfederal,\\tstate\\tand\\tlocal\\tgovernments\\thave\\testablished\\tvarious\\tpolicies,\\tincentives\\tand\\tfinancial\\tmechanisms\\tto\\treduce\\tthe\\tcost\\tof\\tsolar\\tenergy\\nand\\tto\\taccelerate\\tthe\\tadoption\\tof\\tsolar\\tenergy.\\tThese\\tincentives\\tinclude\\ttax\\tcredits,\\tcash\\tgrants,\\ttax\\tabatements\\tand\\trebates.\\nIn\\tparticular,\\tpursuant\\tto\\tthe\\tIRA,\\tSections\\t48,\\t48E\\tand\\t25D\\tof\\tthe\\tIRC\\tprovides\\ta\\ttax\\tcredit\\tbetween\\t6%\\tand\\t70%\\tof\\tqualified\\tcommercial\\tor\\nresidential\\texpenditures\\tfor\\tsolar\\tenergy\\tsystems,\\twhich\\tmay\\tbe\\tclaimed\\tby\\tour\\tcustomers\\tfor\\tsystems\\tthey\\tpurchase,\\tor\\tby\\tus\\tfor\\tarrangements\\twhere\\nwe\\town\\tthe\\tsystems\\tfor\\tproperties\\tthat\\tmeet\\tstatutory\\trequirements.\\tThese\\ttax\\tcredits\\tare\\tprimarily\\tfor\\tthe\\tdirect\\tbenefit\\tof\\tour\\tcustomers\\tand\\tare\\ncurrently\\tscheduled\\tto\\tphase-out\\tstarting\\tin\\t2032\\tor\\tlater.\\nRegulations\\nVehicle\\tSafety\\tand\\tTesting\\nIn\\tthe\\tU.S.,\\tour\\tvehicles\\tare\\tsubject\\tto\\tregulation\\tby\\tthe\\tNational\\tHighway\\tTraffic\\tSafety\\tAdministration\\t(“NHTSA”),\\tincluding\\tall\\tapplicable\\tFederal\\nMotor\\tVehicle\\tSafety\\tStandards\\t(“FMVSS”)\\tand\\tthe\\tNHTSA\\tbumper\\tstandard.\\tNumerous\\tFMVSS\\tapply\\tto\\tour\\tvehicles,\\tsuch\\tas\\tcrash-worthiness\\tand\\noccupant\\tprotection\\trequirements.\\tOur\\tcurrent\\tvehicles\\tfully\\tcomply\\tand\\twe\\texpect\\tthat\\tour\\tvehicles\\tin\\tthe\\tfuture\\twill\\tfully\\tcomply\\twith\\tall\\tapplicable\\nFMVSS\\twith\\tlimited\\tor\\tno\\texemptions,\\thowever,\\tFMVSS\\tare\\tsubject\\tto\\tchange\\tfrom\\ttime\\tto\\ttime.\\tAs\\ta\\tmanufacturer,\\twe\\tmust\\tself-certify\\tthat\\tour\\tvehicles\\nmeet\\tall\\tapplicable\\tFMVSS\\tand\\tthe\\tNHTSA\\tbumper\\tstandard,\\tor\\totherwise\\tare\\texempt,\\tbefore\\tthe\\tvehicles\\tmay\\tbe\\timported\\tor\\tsold\\tin\\tthe\\tU.S.\\nWe\\tare\\talso\\trequired\\tto\\tcomply\\twith\\tother\\tfederal\\tlaws\\tadministered\\tby\\tNHTSA,\\tincluding\\tthe\\tCorporate\\tAverage\\tFuel\\tEconomy\\tstandards,\\tTheft\\nPrevention\\tAct\\trequirements,\\tlabeling\\trequirements\\tand\\tother\\tinformation\\tprovided\\tto\\tcustomers\\tin\\twriting,\\tEarly\\tWarning\\tReporting\\trequirements\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 11,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 17\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"regarding\\twarranty\\tclaims,\\tfield\\treports,\\tdeath\\tand\\tinjury\\treports\\tand\\tforeign\\trecalls,\\ta\\tStanding\\tGeneral\\tOrder\\trequiring\\treports\\tregarding\\tcrashes\\ninvolving\\tvehicles\\tequipped\\twith\\tadvanced\\tdriver\\tassistance\\tsystems,\\tand\\tadditional\\trequirements\\tfor\\tcooperating\\twith\\tcompliance\\tand\\tsafety\\ninvestigations\\tand\\trecall\\treporting.\\tThe\\tU.S.\\tAutomobile\\tInformation\\tand\\tDisclosure\\tAct\\talso\\trequires\\tmanufacturers\\tof\\tmotor\\tvehicles\\tto\\tdisclose\\tcertain\\ninformation\\tregarding\\tthe\\tmanufacturer’s\\tsuggested\\tretail\\tprice,\\toptional\\tequipment\\tand\\tpricing.\\tIn\\taddition,\\tfederal\\tlaw\\trequires\\tinclusion\\tof\\tfuel\\neconomy\\tratings,\\tas\\tdetermined\\tby\\tthe\\tU.S.\\tDepartment\\tof\\tTransportation\\tand\\tthe\\tEnvironmental\\tProtection\\tAgency\\t(the\\t“EPA”),\\tand\\tNew\\tCar\\nAssessment\\tProgram\\tratings\\tas\\tdetermined\\tby\\tNHTSA,\\tif\\tavailable.\\nOur\\tvehicles\\tsold\\toutside\\tof\\tthe\\tU.S.\\tare\\tsubject\\tto\\tsimilar\\tforeign\\tcompliance,\\tsafety,\\tenvironmental\\tand\\tother\\tregulations.\\tMany\\tof\\tthose\\nregulations\\tare\\tdifferent\\tfrom\\tthose\\tapplicable\\tin\\tthe\\tU.S.\\tand\\tmay\\trequire\\tredesign\\tand/or\\tretesting.\\tSome\\tof\\tthose\\tregulations\\timpact\\tor\\tprevent\\tthe\\nrollout\\tof\\tnew\\tvehicle\\tfeatures.\\nSelf-Driving\\tVehicles\\nGenerally,\\tlaws\\tpertaining\\tto\\tself-driving\\tvehicles\\tare\\tevolving\\tglobally,\\tand\\tin\\tsome\\tcases\\tmay\\tcreate\\trestrictions\\ton\\tfeatures\\tor\\tvehicle\\tdesigns\\nthat\\twe\\tdevelop.\\tWhile\\tthere\\tare\\tcurrently\\tno\\tfederal\\tU.S.\\tregulations\\tpertaining\\tspecifically\\tto\\tself-driving\\tvehicles\\tor\\tself-driving\\tequipment,\\tNHTSA\\thas\\npublished\\trecommended\\tguidelines\\ton\\tself-driving\\tvehicles,\\tapart\\tfrom\\tthe\\tFMVSS\\tand\\tmanufacturer\\treporting\\tobligations,\\tand\\tretains\\tthe\\tauthority\\tto\\ninvestigate\\tand/or\\ttake\\taction\\ton\\tthe\\tsafety\\tor\\tcompliance\\tof\\tany\\tvehicle,\\tequipment\\tor\\tfeatures\\toperating\\ton\\tpublic\\troads.\\tCertain\\tU.S.\\tstates\\talso\\thave\\nlegal\\trestrictions\\ton\\tthe\\toperation,\\tregistration\\tor\\tlicensure\\tof\\tself-driving\\tvehicles,\\tand\\tmany\\tother\\tstates\\tare\\tconsidering\\tthem.\\tThis\\tregulatory\\npatchwork\\tincreases\\tthe\\tlegal\\tcomplexity\\twith\\trespect\\tto\\tself-driving\\tvehicles\\tin\\tthe\\tU.S.\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 11,\n        \"lines\": {\n          \"from\": 18,\n          \"to\": 33\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"In\\tmarkets\\tthat\\tfollow\\tthe\\tregulations\\tof\\tthe\\tUnited\\tNations\\tEconomic\\tCommission\\tfor\\tEurope\\t(“ECE\\tmarkets”),\\tsome\\trequirements\\trestrict\\tthe\\ndesign\\tof\\tadvanced\\tdriver-assistance\\tor\\tself-driving\\tfeatures,\\twhich\\tcan\\tcompromise\\tor\\tprevent\\ttheir\\tuse\\tentirely.\\tOther\\tapplicable\\tlaws,\\tboth\\tcurrent\\tand\\nproposed,\\tmay\\thinder\\tthe\\tpath\\tand\\ttimeline\\tto\\tintroducing\\tself-driving\\tvehicles\\tfor\\tsale\\tand\\tuse\\tin\\tthe\\tmarkets\\twhere\\tthey\\tapply.\\nOther\\tkey\\tmarkets,\\tincluding\\tChina,\\tcontinue\\tto\\tconsider\\tself-driving\\tregulation.\\tAny\\timplemented\\tregulations\\tmay\\tdiffer\\tmaterially\\tfrom\\tthe\\tU.S.\\nand\\tECE\\tmarkets,\\twhich\\tmay\\tfurther\\tincrease\\tthe\\tlegal\\tcomplexity\\tof\\tself-driving\\tvehicles\\tand\\tlimit\\tor\\tprevent\\tcertain\\tfeatures.\\n10\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 11,\n        \"lines\": {\n          \"from\": 34,\n          \"to\": 39\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Table\\tof\\tContents\\nAutomobile\\tManufacturer\\tand\\tDealer\\tRegulation\\nIn\\tthe\\tU.S.,\\tstate\\tlaws\\tregulate\\tthe\\tmanufacture,\\tdistribution,\\tsale\\tand\\tservice\\tof\\tautomobiles,\\tand\\tgenerally\\trequire\\tmotor\\tvehicle\\tmanufacturers\\nand\\tdealers\\tto\\tbe\\tlicensed\\tin\\torder\\tto\\tsell\\tvehicles\\tdirectly\\tto\\tresidents.\\tCertain\\tstates\\thave\\tasserted\\tthat\\tthe\\tlaws\\tin\\tsuch\\tstates\\tdo\\tnot\\tpermit\\tautomobile\\nmanufacturers\\tto\\tbe\\tlicensed\\tas\\tdealers\\tor\\tto\\tact\\tin\\tthe\\tcapacity\\tof\\ta\\tdealer,\\tor\\tthat\\tthey\\totherwise\\trestrict\\ta\\tmanufacturer’s\\tability\\tto\\tdeliver\\tor\\tperform\\nwarranty\\trepairs\\ton\\tvehicles.\\tTo\\tsell\\tvehicles\\tto\\tresidents\\tof\\tstates\\twhere\\twe\\tare\\tnot\\tlicensed\\tas\\ta\\tdealer,\\twe\\tgenerally\\tconduct\\tthe\\tsale\\tout\\tof\\tthe\\tstate.\\nIn\\tcertain\\tsuch\\tstates,\\twe\\thave\\topened\\t“galleries”\\tthat\\tserve\\tan\\teducational\\tpurpose\\tand\\twhere\\tsales\\tmay\\tnot\\toccur.\\nSome\\tautomobile\\tdealer\\ttrade\\tassociations\\thave\\tboth\\tchallenged\\tthe\\tlegality\\tof\\tour\\toperations\\tin\\tcourt\\tand\\tused\\tadministrative\\tand\\tlegislative\\nprocesses\\tto\\tattempt\\tto\\tprohibit\\tor\\tlimit\\tour\\tability\\tto\\toperate\\texisting\\tstores\\tor\\texpand\\tto\\tnew\\tlocations.\\tCertain\\tdealer\\tassociations\\thave\\talso\\tactively\\nlobbied\\tstate\\tlicensing\\tagencies\\tand\\tlegislators\\tto\\tinterpret\\texisting\\tlaws\\tor\\tenact\\tnew\\tlaws\\tin\\tways\\tnot\\tfavorable\\tto\\tour\\townership\\tand\\toperation\\tof\\tour\\nown\\tretail\\tand\\tservice\\tlocations.\\tWe\\texpect\\tsuch\\tchallenges\\tto\\tcontinue,\\tand\\twe\\tintend\\tto\\tactively\\tfight\\tany\\tsuch\\tefforts.\\nBattery\\tSafety\\tand\\tTesting\\nOur\\tbattery\\tpacks\\tare\\tsubject\\tto\\tvarious\\tU.S.\\tand\\tinternational\\tregulations\\tthat\\tgovern\\ttransport\\tof\\t“dangerous\\tgoods,”\\tdefined\\tto\\tinclude\\tlithium-\\nion\\tbatteries,\\twhich\\tmay\\tpresent\\ta\\trisk\\tin\\ttransportation.\\tWe\\tconduct\\ttesting\\tto\\tdemonstrate\\tour\\tcompliance\\twith\\tsuch\\tregulations.\\nWe\\tuse\\tlithium-ion\\tcells\\tin\\tour\\thigh\\tvoltage\\tbattery\\tpacks\\tin\\tour\\tvehicles\\tand\\tenergy\\tstorage\\tproducts.\\tThe\\tuse,\\tstorage\\tand\\tdisposal\\tof\\tour\\tbattery\\npacks\\tare\\tregulated\\tunder\\texisting\\tlaws\\tand\\tare\\tthe\\tsubject\\tof\\tongoing\\tregulatory\\tchanges\\tthat\\tmay\\tadd\\tadditional\\trequirements\\tin\\tthe\\tfuture.\\tWe\\thave\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 12,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 16\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"agreements\\twith\\tthird\\tparty\\tbattery\\trecycling\\tcompanies\\tto\\trecycle\\tour\\tbattery\\tpacks,\\tand\\twe\\tare\\talso\\tpiloting\\tour\\town\\trecycling\\ttechnology.\\nSolar\\tEnergy—General\\nWe\\tare\\tsubject\\tto\\tcertain\\tstate\\tand\\tfederal\\tregulations\\tapplicable\\tto\\tsolar\\tand\\tbattery\\tstorage\\tproviders\\tand\\tsellers\\tof\\telectricity.\\tTo\\toperate\\tour\\nsystems,\\twe\\tenter\\tinto\\tstandard\\tinterconnection\\tagreements\\twith\\tapplicable\\tutilities.\\tSales\\tof\\telectricity\\tand\\tnon-sale\\tequipment\\tleases\\tby\\tthird\\tparties,\\nsuch\\tas\\tour\\tleases\\tand\\tPPAs,\\thave\\tfaced\\tregulatory\\tchallenges\\tin\\tsome\\tstates\\tand\\tjurisdictions.\\nSolar\\tEnergy—Net\\tMetering\\nMost\\tstates\\tin\\tthe\\tU.S.\\tmake\\tnet\\tenergy\\tmetering,\\tor\\tnet\\tmetering,\\tavailable\\tto\\tsolar\\tcustomers.\\tNet\\tmetering\\ttypically\\tallows\\tsolar\\tcustomers\\tto\\ninterconnect\\ttheir\\tsolar\\tenergy\\tsystems\\tto\\tthe\\tutility\\tgrid\\tand\\toffset\\ttheir\\tutility\\telectricity\\tpurchases\\tby\\treceiving\\ta\\tbill\\tcredit\\tfor\\texcess\\tenergy\\tgenerated\\nby\\ttheir\\tsolar\\tenergy\\tsystem\\tthat\\tis\\texported\\tto\\tthe\\tgrid.\\tIn\\tcertain\\tjurisdictions,\\tregulators\\tor\\tutilities\\thave\\treduced\\tor\\teliminated\\tthe\\tbenefit\\tavailable\\nunder\\tnet\\tmetering\\tor\\thave\\tproposed\\tto\\tdo\\tso.\\nCompetition\\nAutomotive\\nThe\\tworldwide\\tautomotive\\tmarket\\tis\\thighly\\tcompetitive\\tand\\twe\\texpect\\tit\\twill\\tbecome\\teven\\tmore\\tcompetitive\\tin\\tthe\\tfuture\\tas\\ta\\tsignificant\\tand\\ngrowing\\tnumber\\tof\\testablished\\tand\\tnew\\tautomobile\\tmanufacturers,\\tas\\twell\\tas\\tother\\tcompanies,\\thave\\tentered,\\tor\\tare\\treported\\tto\\thave\\tplans\\tto\\tenter\\tthe\\nelectric\\tvehicle\\tmarket.\\nWe\\tbelieve\\tthat\\tour\\tvehicles\\tcompete\\tin\\tthe\\tmarket\\tbased\\ton\\tboth\\ttheir\\ttraditional\\tsegment\\tclassification\\tas\\twell\\tas\\ttheir\\tpropulsion\\ttechnology.\\tFor\\nexample,\\tCybertruck\\tcompetes\\twith\\tother\\tpickup\\ttrucks,\\tModel\\tS\\tand\\tModel\\tX\\tcompete\\tprimarily\\twith\\tpremium\\tsedans\\tand\\tpremium\\tSUVs\\tand\\tModel\\t3\\nand\\tModel\\tY\\tcompete\\twith\\tsmall\\tto\\tmedium-sized\\tsedans\\tand\\tcompact\\tSUVs,\\twhich\\tare\\textremely\\tcompetitive\\tmarkets.\\tCompeting\\tproducts\\ttypically\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 12,\n        \"lines\": {\n          \"from\": 17,\n          \"to\": 34\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"include\\tinternal\\tcombustion\\tvehicles\\tfrom\\tmore\\testablished\\tautomobile\\tmanufacturers;\\thowever,\\tmany\\testablished\\tand\\tnew\\tautomobile\\tmanufacturers\\nhave\\tentered\\tor\\thave\\tannounced\\tplans\\tto\\tenter\\tthe\\tmarket\\tfor\\telectric\\tand\\tother\\talternative\\tfuel\\tvehicles.\\tOverall,\\twe\\tbelieve\\tthese\\tannouncements\\tand\\nvehicle\\tintroductions,\\tincluding\\tthe\\tintroduction\\tof\\telectric\\tvehicles\\tinto\\trental\\tcar\\tcompany\\tfleets,\\tpromote\\tthe\\tdevelopment\\tof\\tthe\\telectric\\tvehicle\\nmarket\\tby\\thighlighting\\tthe\\tattractiveness\\tof\\telectric\\tvehicles\\trelative\\tto\\tthe\\tinternal\\tcombustion\\tvehicle.\\tMany\\tmajor\\tautomobile\\tmanufacturers\\thave\\nelectric\\tvehicles\\tavailable\\ttoday\\tin\\tmajor\\tmarkets\\tincluding\\tthe\\tU.S.,\\tChina\\tand\\tEurope,\\tand\\tother\\tcurrent\\tand\\tprospective\\tautomobile\\tmanufacturers\\tare\\nalso\\tdeveloping\\telectric\\tvehicles.\\tIn\\taddition,\\tseveral\\tmanufacturers\\toffer\\thybrid\\tvehicles,\\tincluding\\tplug-in\\tversions.\\n11\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 12,\n        \"lines\": {\n          \"from\": 35,\n          \"to\": 41\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Table\\tof\\tContents\\nWe\\tbelieve\\tthat\\tthere\\tis\\talso\\tincreasing\\tcompetition\\tfor\\tour\\tvehicle\\tofferings\\tas\\ta\\tplatform\\tfor\\tdelivering\\tself-driving\\ttechnologies,\\tcharging\\tsolutions\\nand\\tother\\tfeatures\\tand\\tservices,\\tand\\twe\\texpect\\tto\\tcompete\\tin\\tthis\\tdeveloping\\tmarket\\tthrough\\tcontinued\\tprogress\\ton\\tour\\tAutopilot,\\tFSD\\tand\\tneural\\nnetwork\\tcapabilities,\\tSupercharger\\tnetwork\\tand\\tour\\tinfotainment\\tofferings.\\nEnergy\\tGeneration\\tand\\tStorage\\nEnergy\\tStorage\\tSystems\\nThe\\tmarket\\tfor\\tenergy\\tstorage\\tproducts\\tis\\talso\\thighly\\tcompetitive,\\tand\\tboth\\testablished\\tand\\temerging\\tcompanies\\thave\\tintroduced\\tproducts\\tthat\\tare\\nsimilar\\tto\\tour\\tproduct\\tportfolio\\tor\\tthat\\tare\\talternatives\\tto\\tthe\\telements\\tof\\tour\\tsystems.\\tWe\\tcompete\\twith\\tthese\\tcompanies\\tbased\\ton\\tprice,\\tenergy\\tdensity\\nand\\tefficiency.\\tWe\\tbelieve\\tthat\\tthe\\tspecifications\\tand\\tfeatures\\tof\\tour\\tproducts,\\tour\\tstrong\\tbrand\\tand\\tthe\\tmodular,\\tscalable\\tnature\\tof\\tour\\tenergy\\tstorage\\nproducts\\tgive\\tus\\ta\\tcompetitive\\tadvantage\\tin\\tour\\tmarkets.\\nSolar\\tEnergy\\tSystems\\nThe\\tprimary\\tcompetitors\\tto\\tour\\tsolar\\tenergy\\tbusiness\\tare\\tthe\\ttraditional\\tlocal\\tutility\\tcompanies\\tthat\\tsupply\\tenergy\\tto\\tour\\tpotential\\tcustomers.\\tWe\\ncompete\\twith\\tthese\\ttraditional\\tutility\\tcompanies\\tprimarily\\tbased\\ton\\tprice\\tand\\tthe\\tease\\tby\\twhich\\tcustomers\\tcan\\tswitch\\tto\\telectricity\\tgenerated\\tby\\tour\\nsolar\\tenergy\\tsystems.\\tWe\\talso\\tcompete\\twith\\tsolar\\tenergy\\tcompanies\\tthat\\tprovide\\tproducts\\tand\\tservices\\tsimilar\\tto\\tours.\\tMany\\tsolar\\tenergy\\tcompanies\\nonly\\tinstall\\tsolar\\tenergy\\tsystems,\\twhile\\tothers\\tonly\\tprovide\\tfinancing\\tfor\\tthese\\tinstallations.\\tWe\\tbelieve\\twe\\thave\\ta\\tsignificant\\texpansion\\topportunity\\twith\\nour\\tofferings\\tand\\tthat\\tthe\\tregulatory\\tenvironment\\tis\\tincreasingly\\tconducive\\tto\\tthe\\tadoption\\tof\\trenewable\\tenergy\\tsystems.\\nIntellectual\\tProperty\\nWe\\tplace\\ta\\tstrong\\temphasis\\ton\\tour\\tinnovative\\tapproach\\tand\\tproprietary\\tdesigns\\twhich\\tbring\\tintrinsic\\tvalue\\tand\\tuniqueness\\tto\\tour\\tproduct\\tportfolio.\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 13,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 18\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"As\\tpart\\tof\\tour\\tbusiness,\\twe\\tseek\\tto\\tprotect\\tthe\\tunderlying\\tintellectual\\tproperty\\trights\\tof\\tthese\\tinnovations\\tand\\tdesigns\\tsuch\\tas\\twith\\trespect\\tto\\tpatents,\\ntrademarks,\\tcopyrights,\\ttrade\\tsecrets,\\tconfidential\\tinformation\\tand\\tother\\tmeasures,\\tincluding\\tthrough\\temployee\\tand\\tthird-party\\tnondisclosure\\nagreements\\tand\\tother\\tcontractual\\tarrangements.\\tFor\\texample,\\twe\\tplace\\ta\\thigh\\tpriority\\ton\\tobtaining\\tpatents\\tto\\tprovide\\tthe\\tbroadest\\tand\\tstrongest\\npossible\\tprotection\\tto\\tenable\\tour\\tfreedom\\tto\\toperate\\tour\\tinnovations\\tand\\tdesigns\\tacross\\tall\\tof\\tour\\tproducts\\tand\\ttechnologies\\tas\\twell\\tas\\tto\\tprotect\\tand\\ndefend\\tour\\tproduct\\tportfolio.\\tWe\\thave\\talso\\tadopted\\ta\\tpatent\\tpolicy\\tin\\twhich\\twe\\tirrevocably\\tpledged\\tthat\\twe\\twill\\tnot\\tinitiate\\ta\\tlawsuit\\tagainst\\tany\\tparty\\tfor\\ninfringing\\tour\\tpatents\\tthrough\\tactivity\\trelating\\tto\\telectric\\tvehicles\\tor\\trelated\\tequipment\\tfor\\tso\\tlong\\tas\\tsuch\\tparty\\tis\\tacting\\tin\\tgood\\tfaith.\\tWe\\tmade\\tthis\\npledge\\tin\\torder\\tto\\tencourage\\tthe\\tadvancement\\tof\\ta\\tcommon,\\trapidly-evolving\\tplatform\\tfor\\telectric\\tvehicles,\\tthereby\\tbenefiting\\tourselves,\\tother\\ncompanies\\tmaking\\telectric\\tvehicles\\tand\\tthe\\tworld.\\nEnvironmental,\\tSocial\\tand\\tGovernance\\t(ESG)\\tand\\tHuman\\tCapital\\tResources\\nESG\\nThe\\tvery\\tpurpose\\tof\\tTesla's\\texistence\\tis\\tto\\taccelerate\\tthe\\tworld's\\ttransition\\tto\\tsustainable\\tenergy.\\tWe\\tbelieve\\tthe\\tworld\\tcannot\\treduce\\tcarbon\\nemissions\\twithout\\taddressing\\tboth\\tenergy\\tgeneration\\tand\\tconsumption,\\tand\\twe\\tare\\tdesigning\\tand\\tmanufacturing\\ta\\tcomplete\\tenergy\\tand\\ttransportation\\necosystem\\tto\\tachieve\\tthis\\tgoal.\\tAs\\twe\\texpand,\\twe\\tare\\tbuilding\\teach\\tnew\\tfactory\\tto\\tbe\\tmore\\tefficient\\tand\\tsustainably\\tdesigned\\tthan\\tthe\\tprevious\\tone,\\nincluding\\twith\\trespect\\tto\\tper-unit\\twaste\\treduction\\tand\\tresource\\tconsumption,\\tincluding\\twater\\tand\\tenergy\\tusage.\\tWe\\tare\\tfocused\\ton\\tfurther\\tenhancing\\nsustainability\\tof\\toperations\\toutside\\tof\\tour\\tdirect\\tcontrol,\\tincluding\\treducing\\tthe\\tcarbon\\tfootprint\\tof\\tour\\tsupply\\tchain.\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 13,\n        \"lines\": {\n          \"from\": 19,\n          \"to\": 33\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"We\\tare\\tcommitted\\tto\\tsourcing\\tonly\\tresponsibly\\tproduced\\tmaterials,\\tand\\tour\\tsuppliers\\tare\\trequired\\tto\\tprovide\\tevidence\\tof\\tmanagement\\tsystems\\tthat\\nensure\\tsocial,\\tenvironmental\\tand\\tsustainability\\tbest\\tpractices\\tin\\ttheir\\town\\toperations,\\tas\\twell\\tas\\tto\\tdemonstrate\\ta\\tcommitment\\tto\\tresponsible\\tsourcing\\ninto\\ttheir\\tsupply\\tchains.\\tWe\\thave\\ta\\tzero-tolerance\\tpolicy\\twhen\\tit\\tcomes\\tto\\tchild\\tor\\tforced\\tlabor\\tand\\thuman\\ttrafficking\\tby\\tour\\tsuppliers\\tand\\twe\\tlook\\tto\\tthe\\nOrganization\\tfor\\tEconomic\\tCo-operation\\tand\\tDevelopment\\tDue\\tDiligence\\tGuidelines\\tto\\tinform\\tour\\tprocess\\tand\\tuse\\tfeedback\\tfrom\\tour\\tinternal\\tand\\nexternal\\tstakeholders\\tto\\tfind\\tways\\tto\\tcontinually\\timprove.\\tWe\\tare\\talso\\tdriving\\tsafety\\tin\\tour\\town\\tfactories\\tby\\tfocusing\\ton\\tworker\\tengagement.\\tOur\\nincidents\\tper\\tvehicle\\tcontinue\\tto\\tdrop\\teven\\tas\\tour\\tproduction\\tvolumes\\tincrease.\\tWe\\talso\\tstrive\\tto\\tbe\\tan\\temployer\\tof\\tchoice\\tby\\toffering\\tcompelling,\\nimpactful\\tjobs\\twith\\tbest\\tin-industry\\tbenefits.\\n12\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 13,\n        \"lines\": {\n          \"from\": 34,\n          \"to\": 41\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Table\\tof\\tContents\\nWe\\tbelieve\\tthat\\tsound\\tcorporate\\tgovernance\\tis\\tcritical\\tto\\thelping\\tus\\tachieve\\tour\\tgoals,\\tincluding\\twith\\trespect\\tto\\tESG.\\tWe\\tcontinue\\tto\\tevolve\\ta\\ngovernance\\tframework\\tthat\\texercises\\tappropriate\\toversight\\tof\\tresponsibilities\\tat\\tall\\tlevels\\tthroughout\\tthe\\tcompany\\tand\\tmanages\\tits\\taffairs\\tconsistent\\nwith\\thigh\\tprinciples\\tof\\tbusiness\\tethics.\\tOur\\tESG\\tSustainability\\tCouncil\\tis\\tmade\\tup\\tof\\tleaders\\tfrom\\tacross\\tour\\tcompany,\\tand\\tregularly\\tpresents\\tto\\tour\\tBoard\\nof\\tDirectors,\\twhich\\toversees\\tour\\tESG\\timpacts,\\tinitiatives\\tand\\tpriorities.\\nHuman\\tCapital\\tResources\\nA\\tcompetitive\\tedge\\tfor\\tTesla\\tis\\tits\\tability\\tto\\tattract\\tand\\tretain\\thigh\\tquality\\temployees.\\tDuring\\tthe\\tpast\\tyear,\\tTesla\\tmade\\tsubstantial\\tinvestments\\tin\\nits\\tworkforce,\\tfurther\\tstrengthening\\tits\\tstanding\\tas\\tone\\tof\\tthe\\tmost\\tdesirable\\tand\\tinnovative\\tcompanies\\tto\\twork\\tfor.\\tAs\\tof\\tDecember\\t31,\\t2023,\\tour\\nemployee\\theadcount\\tworldwide\\twas\\t140,473.\\nWe\\thave\\tcreated\\tan\\tenvironment\\tthat\\tfosters\\tgrowth\\topportunities,\\tand\\tas\\tof\\tthis\\treport,\\tnearly\\ttwo-thirds\\t(65%)\\tof\\tour\\tmanagers\\twere\\tpromoted\\nfrom\\tan\\tinternal,\\tnon-manager\\tposition,\\tand\\t43%\\tof\\tour\\tmanagement\\temployees\\thave\\tbeen\\twith\\tTesla\\tfor\\tmore\\tthan\\tfive\\tyears.\\tTesla’s\\tgrowth\\tof\\t35%\\nover\\tthe\\tpast\\ttwo\\tyears\\thas\\toffered\\tinternal\\tcareer\\tdevelopment\\tto\\tour\\temployees\\tas\\twell\\tas\\tthe\\tability\\tto\\tmake\\ta\\tmeaningful\\tcontribution\\tto\\ta\\nsustainable\\tfuture.\\nWe\\tare\\table\\tto\\tretain\\tour\\temployees,\\tin\\tpart,\\tnot\\tonly\\tbecause\\temployees\\tcan\\tenjoy\\townership\\tin\\tTesla\\tthrough\\tstock\\t(of\\twhich\\t89%\\thave\\tbeen\\ngiven\\tthe\\topportunity\\tto),\\tbut\\tbecause\\twe\\talso\\tprovide\\tthem\\twith\\texcellent\\thealth\\tbenefits\\tsuch\\tas\\tfree\\tcounseling,\\tpaid\\tparental\\tleave,\\tpaid\\ttime\\toff\\tand\\nzero-premium\\tmedical\\tplan\\toptions\\tthat\\tare\\tmade\\tavailable\\ton\\tthe\\tfirst\\tday\\tof\\temployment.\\nWe\\trecognize\\tthe\\tpositive\\timpact\\tthat\\tleaders\\tcan\\thave\\ton\\ttheir\\tteams\\tand\\toffer\\tfundamental\\tskills\\ttraining\\tand\\tcontinuous\\tdevelopment\\tto\\tall\\nleaders\\tthrough\\tvarious\\tprograms\\tglobally.\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 14,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 18\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"leaders\\tthrough\\tvarious\\tprograms\\tglobally.\\nWe\\tdon’t\\tstop\\tthere.\\tTesla\\thas\\tseveral\\tother\\tprograms\\tstrategically\\tdesigned\\tto\\tincrease\\tpaths\\tfor\\tgreater\\tcareer\\topportunity\\tsuch\\tas:\\n•Technician\\tTrainee\\t(Service)\\t– The\\tTesla\\tTechnician\\tTrainee\\tProgram\\tprovides\\ton-the-job\\tautomotive\\tmaintenance\\ttraining\\tat\\tTesla,\\nresulting\\tin\\tan\\tindustry\\tcertification.\\tTargeted\\tat\\tindividuals\\twith\\tlimited\\texperience,\\twhether\\tin\\tindustry\\tor\\tvocational\\tschools,\\tthe\\tprogram\\nprepares\\ttrainees\\tfor\\temployment\\tas\\ttechnicians.\\tIn\\t2023,\\twe\\thired\\tover\\t1,900\\tTechnician\\tTrainees\\tacross\\tthe\\tU.S.,\\tGermany\\tand\\tChina.\\n•START\\t(Manufacturing\\tand\\tService)\\t–\\tTesla\\tSTART\\tis\\tan\\tintensive\\ttraining\\tprogram\\tthat\\tcomplements\\tthe\\tTechnician\\tTrainee\\tprogram\\tand\\nequips\\tindividuals\\twith\\tthe\\tskills\\tneeded\\tfor\\ta\\tsuccessful\\ttechnician\\trole\\tat\\tTesla.\\tWe\\thave\\tpartnered\\twith\\tcolleges\\tand\\ttechnical\\tacademies\\tto\\nlaunch\\tTesla\\tSTART\\tin\\tthe\\tU.S.,\\tUnited\\tKingdom\\tand\\tGermany.\\tIn\\t2023,\\twe\\thired\\tover\\t350\\ttrainees\\tfor\\tmanufacturing\\tand\\tservice\\troles\\tthrough\\nthis\\tprogram,\\tproviding\\tan\\topportunity\\tto\\ttransition\\tinto\\tfull-time\\temployment.\\n•Internships\\t–\\tAnnually,\\tTesla\\thires\\tover\\t6,000\\tuniversity\\tand\\tcollege\\tstudents\\tfrom\\taround\\tthe\\tworld.\\tWe\\trecruit\\tfrom\\tdiverse\\tstudent\\norganizations\\tand\\tcampuses,\\tseeking\\ttop\\ttalent\\tpassionate\\tabout\\tour\\tmission.\\tOur\\tinterns\\tengage\\tin\\tmeaningful\\twork\\tfrom\\tday\\tone,\\tand\\twe\\noften\\toffer\\tthem\\tfull-time\\tpositions\\tpost-internship.\\n•Military\\tFellowship\\tand\\tTransition\\tPrograms\\t– The\\tMilitary\\tFellowship\\tand\\tTransition\\tPrograms\\tare\\tdesigned\\tto\\toffer\\texiting\\tmilitary\\tservice\\nmembers\\tin\\tthe\\tU.S.\\tand\\tEurope\\twith\\tcareer\\tguidance\\ton\\ttransitioning\\tinto\\tthe\\tcivil\\tworkforce.\\tWe\\tpartner\\twith\\tthe\\tcareer\\ttransition\\tservices\\tof\\nEuropean\\tDefence\\tMinistries\\tacross\\tfive\\tcountries,\\tas\\twell\\tas\\tthe\\tU.S.\\tChamber\\tof\\tCommerce’s\\tHire\\tour\\tHeroes.\\tThese\\tprograms\\taim\\tto\\tconvert\\nhigh-performing\\tindividuals\\tto\\tfull-time\\troles\\tand\\tcreate\\ta\\tveteran\\ttalent\\tpipeline.\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 14,\n        \"lines\": {\n          \"from\": 18,\n          \"to\": 33\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"•Apprenticeships\\t–\\tTesla\\tApprenticeships\\tare\\toffered\\tglobally,\\tproviding\\tacademic\\tand\\ton-the-job\\ttraining\\tto\\tprepare\\tspecialists\\tin\\tskilled\\ntrades.\\tApprentices\\twill\\tcomplete\\tbetween\\tone\\tto\\tfour\\tyears\\tof\\ton-the-job\\ttraining.\\tApprentice\\tprograms\\thave\\tseen\\tskilled\\ttrade\\thires\\tacross\\tthe\\nU.S.,\\tAustralia,\\tHong\\tKong,\\tKorea\\tand\\tGermany.\\n•Manufacturing\\tDevelopment\\tProgram\\t– Tesla's\\tmanufacturing\\tpathway\\tprogram\\tis\\tdesigned\\tto\\tprovide\\tgraduating\\thigh\\tschool\\tseniors\\twith\\nthe\\tfinancial\\tresources,\\tcoursework\\tand\\texperience\\tthey\\tneed\\tto\\tstart\\ta\\tsuccessful\\tmanufacturing\\tcareer\\tat\\tTesla.\\tWe\\thired\\t373\\tgraduates\\nthrough\\tthis\\tprogram\\tin\\t2023,\\tand\\tour\\tgoal\\tin\\t2024\\tis\\tgrow\\tthis\\tprogram\\tto\\tover\\t600\\tstudents\\tannually\\tacross\\tour\\tFremont\\tFactory,\\tGigafactory\\nNevada,\\tGigafactory\\tTexas\\tand\\tGigafactory\\tNew\\tYork.\\n13\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 14,\n        \"lines\": {\n          \"from\": 34,\n          \"to\": 41\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Table\\tof\\tContents\\n•Engineering\\tDevelopment\\tProgram\\t– Launched\\tin\\tJanuary\\t2024,\\tthis\\tprogram\\ttargets\\trecent\\tcollege\\tand\\tuniversity\\tgraduates\\tfor\\tspecialized\\nengineering\\tfields.\\tIn\\tcollaboration\\twith\\tAustin\\tCommunity\\tCollege,\\tthe\\tprogram\\teducates\\tearly-career\\tengineers\\tin\\tcontrols\\tengineering,\\nenhancing\\ttheir\\tknowledge\\tof\\thigh-demand\\ttechnologies\\tfor\\tU.S.\\tmanufacturing.\\nWe\\twill\\tcontinue\\tto\\texpand\\tthe\\topportunities\\tfor\\tour\\temployees\\tto\\tadd\\tskills\\tand\\tdevelop\\tprofessionally\\twith\\ta\\tnew\\tEmployee\\tEducational\\tAssistance\\nProgram\\tlaunching\\tin\\tthe\\tU.S.\\tin\\tthe\\tspring\\tof\\t2024\\tto\\thelp\\temployees\\tpursue\\tselect\\tcertificates\\tor\\tdegrees.\\tWith\\tvirtual,\\tself-paced\\teducation\\toptions\\navailable,\\temployees\\tcan\\tpursue\\ta\\tnew\\tpath\\tor\\texpand\\ttheir\\tknowledge\\twhile\\tcontinuing\\tto\\tgrow\\ttheir\\tcareer.\\nAt\\tTesla,\\tour\\temployees\\tshow\\tup\\tpassionate\\tabout\\tmaking\\ta\\tdifference\\tin\\tthe\\tworld\\tand\\tfor\\teach\\tother.\\tWe\\tremain\\tunwavering\\tin\\tour\\tdemand\\tthat\\nour\\tfactories,\\toffices,\\tstores\\tand\\tservice\\tcenters\\tare\\tplaces\\twhere\\tour\\temployees\\tfeel\\trespected\\tand\\tappreciated.\\tOur\\tpolicies\\tare\\tdesigned\\tto\\tpromote\\nfairness\\tand\\trespect\\tfor\\teveryone.\\tWe\\thire,\\tevaluate\\tand\\tpromote\\temployees\\tbased\\ton\\ttheir\\tskills\\tand\\tperformance.\\tEveryone\\tis\\texpected\\tto\\tbe\\ntrustworthy,\\tdemonstrate\\texcellence\\tin\\ttheir\\tperformance\\tand\\tcollaborate\\twith\\tothers.\\tWith\\tthis\\tin\\tmind,\\twe\\twill\\tnot\\ttolerate\\tcertain\\tbehaviors.\\tThese\\ninclude\\tharassment,\\tretaliation,\\tviolence,\\tintimidation\\tand\\tdiscrimination\\tof\\tany\\tkind\\ton\\tthe\\tbasis\\tof\\trace,\\tcolor,\\treligion,\\tnational\\torigin,\\tgender,\\tsexual\\norientation,\\tgender\\tidentity,\\tgender\\texpression,\\tage,\\tdisability\\tor\\tveteran\\tstatus.\\nAnti-harassment\\ttraining\\tis\\tconducted\\ton\\tday\\tone\\tof\\tnew\\thire\\torientation\\tfor\\tall\\temployees\\tand\\treoccurring\\tfor\\tleaders.\\tIn\\taddition,\\twe\\trun\\tvarious\\nleadership\\tdevelopment\\tprograms\\tthroughout\\tthe\\tyear\\taimed\\tat\\tenhancing\\tleaders’\\tskills,\\tand\\tin\\tparticular,\\thelping\\tthem\\tto\\tunderstand\\thow\\tto\\nappropriately\\trespond\\tto\\tand\\taddress\\temployee\\tconcerns.\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 15,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 16\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Employees\\tare\\tencouraged\\tto\\tspeak\\tup\\tboth\\tin\\tregard\\tto\\tmisconduct\\tand\\tsafety\\tconcerns\\tand\\tcan\\tdo\\tso\\tby\\tcontacting\\tthe\\tintegrity\\tline,\\tsubmitting\\nconcerns\\tthrough\\tour\\tTake\\tCharge\\tprocess,\\tor\\tnotifying\\ttheir\\tHuman\\tResource\\tPartner\\tor\\tany\\tmember\\tof\\tmanagement.\\tConcerns\\tare\\treviewed\\tin\\naccordance\\twith\\testablished\\tprotocols\\tby\\tinvestigators\\twith\\texpertise,\\twho\\talso\\treview\\tfor\\ttrends\\tand\\toutcomes\\tfor\\tremediation\\tand\\tappropriate\\tcontrols.\\nResponding\\tto\\tquestions\\ttimely\\tis\\tkey\\tso\\tHuman\\tResource\\tPartners\\tfor\\teach\\tfunctional\\tarea\\tare\\tvisible\\tthroughout\\tfacilities\\tand\\tare\\tactively\\tinvolved\\tin\\ndriving\\tculture\\tand\\tengagement\\talongside\\tbusiness\\tleaders.\\nAvailable\\tInformation\\nWe\\tfile\\tor\\tfurnish\\tperiodic\\treports\\tand\\tamendments\\tthereto,\\tincluding\\tour\\tAnnual\\tReports\\ton\\tForm\\t10-K,\\tour\\tQuarterly\\tReports\\ton\\tForm\\t10-Q\\tand\\nCurrent\\tReports\\ton\\tForm\\t8-K,\\tproxy\\tstatements\\tand\\tother\\tinformation\\twith\\tthe\\tSEC.\\tIn\\taddition,\\tthe\\tSEC\\tmaintains\\ta\\twebsite\\t(www.sec.gov)\\tthat\\tcontains\\nreports,\\tproxy\\tand\\tinformation\\tstatements,\\tand\\tother\\tinformation\\tregarding\\tissuers\\tthat\\tfile\\telectronically.\\tOur\\twebsite\\tis\\tlocated\\tat\\twww.tesla.com,\\tand\\nour\\treports,\\tamendments\\tthereto,\\tproxy\\tstatements\\tand\\tother\\tinformation\\tare\\talso\\tmade\\tavailable,\\tfree\\tof\\tcharge,\\ton\\tour\\tinvestor\\trelations\\twebsite\\tat\\nir.tesla.com\\tas\\tsoon\\tas\\treasonably\\tpracticable\\tafter\\twe\\telectronically\\tfile\\tor\\tfurnish\\tsuch\\tinformation\\twith\\tthe\\tSEC.\\tThe\\tinformation\\tposted\\ton\\tour\\twebsite\\nis\\tnot\\tincorporated\\tby\\treference\\tinto\\tthis\\tAnnual\\tReport\\ton\\tForm\\t10-K.\\nITEM\\t1A.\\tRISK\\tFACTORS\\nYou\\tshould\\tcarefully\\tconsider\\tthe\\trisks\\tdescribed\\tbelow\\ttogether\\twith\\tthe\\tother\\tinformation\\tset\\tforth\\tin\\tthis\\treport,\\twhich\\tcould\\tmaterially\\taffect\\tour\\nbusiness,\\tfinancial\\tcondition\\tand\\tfuture\\tresults.\\tThe\\trisks\\tdescribed\\tbelow\\tare\\tnot\\tthe\\tonly\\trisks\\tfacing\\tour\\tcompany.\\tRisks\\tand\\tuncertainties\\tnot\\tcurrently\\nknown\\tto\\tus\\tor\\tthat\\twe\\tcurrently\\tdeem\\tto\\tbe\\timmaterial\\talso\\tmay\\tmaterially\\tadversely\\taffect\\tour\\tbusiness,\\tfinancial\\tcondition\\tand\\toperating\\tresults.\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 15,\n        \"lines\": {\n          \"from\": 17,\n          \"to\": 32\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Risks\\tRelated\\tto\\tOur\\tAbility\\tto\\tGrow\\tOur\\tBusiness\\nWe\\tmay\\texperience\\tdelays\\tin\\tlaunching\\tand\\tramping\\tthe\\tproduction\\tof\\tour\\tproducts\\tand\\tfeatures,\\tor\\twe\\tmay\\tbe\\tunable\\tto\\tcontrol\\nour\\tmanufacturing\\tcosts.\\nWe\\thave\\tpreviously\\texperienced\\tand\\tmay\\tin\\tthe\\tfuture\\texperience\\tlaunch\\tand\\tproduction\\tramp\\tdelays\\tfor\\tnew\\tproducts\\tand\\tfeatures.\\tFor\\texample,\\nwe\\tencountered\\tunanticipated\\tsupplier\\tissues\\tthat\\tled\\tto\\tdelays\\tduring\\tthe\\tinitial\\tramp\\tof\\tour\\tfirst\\tModel\\tX\\tand\\texperienced\\tchallenges\\twith\\ta\\tsupplier\\tand\\nwith\\tramping\\tfull\\tautomation\\tfor\\tcertain\\tof\\tour\\tinitial\\tModel\\t3\\tmanufacturing\\tprocesses.\\tIn\\taddition,\\twe\\tmay\\tintroduce\\tin\\tthe\\tfuture\\tnew\\tor\\tunique\\nmanufacturing\\tprocesses\\tand\\tdesign\\tfeatures\\tfor\\tour\\tproducts.\\tAs\\twe\\texpand\\tour\\tvehicle\\tofferings\\tand\\tglobal\\tfootprint,\\tthere\\tis\\tno\\tguarantee\\tthat\\twe\\twill\\nbe\\table\\tto\\tsuccessfully\\tand\\ttimely\\tintroduce\\tand\\tscale\\tsuch\\tprocesses\\tor\\tfeatures.\\n14\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 15,\n        \"lines\": {\n          \"from\": 33,\n          \"to\": 41\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Table\\tof\\tContents\\nIn\\tparticular,\\tour\\tfuture\\tbusiness\\tdepends\\tin\\tlarge\\tpart\\ton\\tincreasing\\tthe\\tproduction\\tof\\tmass-market\\tvehicles.\\tIn\\torder\\tto\\tbe\\tsuccessful,\\twe\\twill\\tneed\\nto\\timplement,\\tmaintain\\tand\\tramp\\tefficient\\tand\\tcost-effective\\tmanufacturing\\tcapabilities,\\tprocesses\\tand\\tsupply\\tchains\\tand\\tachieve\\tthe\\tdesign\\ttolerances,\\nhigh\\tquality\\tand\\toutput\\trates\\twe\\thave\\tplanned\\tat\\tour\\tmanufacturing\\tfacilities\\tin\\tCalifornia,\\tNevada,\\tTexas,\\tChina,\\tGermany\\tand\\tany\\tfuture\\tsites\\tsuch\\tas\\nMexico.\\tWe\\twill\\talso\\tneed\\tto\\thire,\\ttrain\\tand\\tcompensate\\tskilled\\temployees\\tto\\toperate\\tthese\\tfacilities.\\tBottlenecks\\tand\\tother\\tunexpected\\tchallenges\\tsuch\\nas\\tthose\\twe\\texperienced\\tin\\tthe\\tpast\\tmay\\tarise\\tduring\\tour\\tproduction\\tramps,\\tand\\twe\\tmust\\taddress\\tthem\\tpromptly\\twhile\\tcontinuing\\tto\\timprove\\nmanufacturing\\tprocesses\\tand\\treducing\\tcosts.\\tIf\\twe\\tare\\tnot\\tsuccessful\\tin\\tachieving\\tthese\\tgoals,\\twe\\tcould\\tface\\tdelays\\tin\\testablishing\\tand/or\\tsustaining\\tour\\nproduct\\tramps\\tor\\tbe\\tunable\\tto\\tmeet\\tour\\trelated\\tcost\\tand\\tprofitability\\ttargets.\\nWe\\thave\\texperienced,\\tand\\tmay\\talso\\texperience\\tsimilar\\tfuture\\tdelays\\tin\\tlaunching\\tand/or\\tramping\\tproduction\\tof\\tour\\tenergy\\tstorage\\tproducts\\tand\\nSolar\\tRoof;\\tnew\\tproduct\\tversions\\tor\\tvariants;\\tnew\\tvehicles;\\tand\\tfuture\\tfeatures\\tand\\tservices\\tbased\\ton\\tartificial\\tintelligence.\\tLikewise,\\twe\\tmay\\tencounter\\ndelays\\twith\\tthe\\tdesign,\\tconstruction\\tand\\tregulatory\\tor\\tother\\tapprovals\\tnecessary\\tto\\tbuild\\tand\\tbring\\tonline\\tfuture\\tmanufacturing\\tfacilities\\tand\\tproducts.\\nAny\\tdelay\\tor\\tother\\tcomplication\\tin\\tramping\\tthe\\tproduction\\tof\\tour\\tcurrent\\tproducts\\tor\\tthe\\tdevelopment,\\tmanufacture,\\tlaunch\\tand\\tproduction\\tramp\\tof\\nour\\tfuture\\tproducts,\\tfeatures\\tand\\tservices,\\tor\\tin\\tdoing\\tso\\tcost-effectively\\tand\\twith\\thigh\\tquality,\\tmay\\tharm\\tour\\tbrand,\\tbusiness,\\tprospects,\\tfinancial\\ncondition\\tand\\toperating\\tresults.\\nOur\\tsuppliers\\tmay\\tfail\\tto\\tdeliver\\tcomponents\\taccording\\tto\\tschedules,\\tprices,\\tquality\\tand\\tvolumes\\tthat\\tare\\tacceptable\\tto\\tus,\\tor\\twe\\nmay\\tbe\\tunable\\tto\\tmanage\\tthese\\tcomponents\\teffectively.\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 16,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 16\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Our\\tproducts\\tcontain\\tthousands\\tof\\tparts\\tpurchased\\tglobally\\tfrom\\thundreds\\tof\\tsuppliers,\\tincluding\\tsingle-source\\tdirect\\tsuppliers,\\twhich\\texposes\\tus\\tto\\nmultiple\\tpotential\\tsources\\tof\\tcomponent\\tshortages.\\tUnexpected\\tchanges\\tin\\tbusiness\\tconditions,\\tmaterials\\tpricing,\\tincluding\\tinflation\\tof\\traw\\tmaterial\\ncosts,\\tlabor\\tissues,\\twars,\\ttrade\\tpolicies,\\tnatural\\tdisasters,\\thealth\\tepidemics\\tsuch\\tas\\tthe\\tglobal\\tCOVID-19\\tpandemic,\\ttrade\\tand\\tshipping\\tdisruptions,\\tport\\ncongestions,\\tcyberattacks\\tand\\tother\\tfactors\\tbeyond\\tour\\tor\\tour\\tsuppliers’\\tcontrol\\tcould\\talso\\taffect\\tthese\\tsuppliers’\\tability\\tto\\tdeliver\\tcomponents\\tto\\tus\\tor\\tto\\nremain\\tsolvent\\tand\\toperational.\\tFor\\texample,\\ta\\tglobal\\tshortage\\tof\\tsemiconductors\\tbeginning\\tin\\tearly\\t2021\\thas\\tcaused\\tchallenges\\tin\\tthe\\tmanufacturing\\nindustry\\tand\\timpacted\\tour\\tsupply\\tchain\\tand\\tproduction.\\tAdditionally,\\tif\\tour\\tsuppliers\\tdo\\tnot\\taccurately\\tforecast\\tand\\teffectively\\tallocate\\tproduction\\tor\\tif\\nthey\\tare\\tnot\\twilling\\tto\\tallocate\\tsufficient\\tproduction\\tto\\tus,\\tor\\tface\\tother\\tchallenges\\tsuch\\tas\\tinsolvency,\\tit\\tmay\\treduce\\tour\\taccess\\tto\\tcomponents\\tand\\nrequire\\tus\\tto\\tsearch\\tfor\\tnew\\tsuppliers.\\tThe\\tunavailability\\tof\\tany\\tcomponent\\tor\\tsupplier\\tcould\\tresult\\tin\\tproduction\\tdelays,\\tidle\\tmanufacturing\\tfacilities,\\nproduct\\tdesign\\tchanges\\tand\\tloss\\tof\\taccess\\tto\\timportant\\ttechnology\\tand\\ttools\\tfor\\tproducing\\tand\\tsupporting\\tour\\tproducts,\\tas\\twell\\tas\\timpact\\tour\\tcapacity\\nexpansion\\tand\\tour\\tability\\tto\\tfulfill\\tour\\tobligations\\tunder\\tcustomer\\tcontracts.\\tMoreover,\\tsignificant\\tincreases\\tin\\tour\\tproduction\\tor\\tproduct\\tdesign\\tchanges\\nby\\tus\\thave\\trequired\\tand\\tmay\\tin\\tthe\\tfuture\\trequire\\tus\\tto\\tprocure\\tadditional\\tcomponents\\tin\\ta\\tshort\\tamount\\tof\\ttime.\\tWe\\thave\\tfaced\\tin\\tthe\\tpast,\\tand\\tmay\\nface\\tsuppliers\\twho\\tare\\tunwilling\\tor\\tunable\\tto\\tsustainably\\tmeet\\tour\\ttimelines\\tor\\tour\\tcost,\\tquality\\tand\\tvolume\\tneeds,\\twhich\\tmay\\tincrease\\tour\\tcosts\\tor\\nrequire\\tus\\tto\\treplace\\tthem\\twith\\tother\\tsources.\\tFinally,\\tas\\twe\\tconstruct\\tnew\\tmanufacturing\\tfacilities\\tand\\tadd\\tproduction\\tlines\\tto\\texisting\\tfacilities,\\twe\\tmay\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 16,\n        \"lines\": {\n          \"from\": 17,\n          \"to\": 29\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"experience\\tissues\\tin\\tcorrespondingly\\tincreasing\\tthe\\tlevel\\tof\\tlocalized\\tprocurement\\tat\\tthose\\tfacilities.\\tWhile\\twe\\tbelieve\\tthat\\twe\\twill\\tbe\\table\\tto\\tsecure\\nadditional\\tor\\talternate\\tsources\\tor\\tdevelop\\tour\\town\\treplacements\\tfor\\tmost\\tof\\tour\\tcomponents,\\tthere\\tis\\tno\\tassurance\\tthat\\twe\\twill\\tbe\\table\\tto\\tdo\\tso\\tquickly\\nor\\tat\\tall.\\tAdditionally,\\twe\\tmay\\tbe\\tunsuccessful\\tin\\tour\\tcontinuous\\tefforts\\tto\\tnegotiate\\twith\\texisting\\tsuppliers\\tto\\tobtain\\tcost\\treductions\\tand\\tavoid\\nunfavorable\\tchanges\\tto\\tterms,\\tsource\\tless\\texpensive\\tsuppliers\\tfor\\tcertain\\tparts\\tand\\tredesign\\tcertain\\tparts\\tto\\tmake\\tthem\\tless\\texpensive\\tto\\tproduce,\\nespecially\\tin\\tthe\\tcase\\tof\\tincreases\\tin\\tmaterials\\tpricing.\\tAny\\tof\\tthese\\toccurrences\\tmay\\tharm\\tour\\tbusiness,\\tprospects,\\tfinancial\\tcondition\\tand\\toperating\\nresults.\\nAs\\tthe\\tscale\\tof\\tour\\tvehicle\\tproduction\\tincreases,\\twe\\twill\\talso\\tneed\\tto\\taccurately\\tforecast,\\tpurchase,\\twarehouse\\tand\\ttransport\\tcomponents\\tat\\thigh\\nvolumes\\tto\\tour\\tmanufacturing\\tfacilities\\tand\\tservicing\\tlocations\\tinternationally.\\tIf\\twe\\tare\\tunable\\tto\\taccurately\\tmatch\\tthe\\ttiming\\tand\\tquantities\\tof\\ncomponent\\tpurchases\\tto\\tour\\tactual\\tneeds\\tor\\tsuccessfully\\timplement\\tautomation,\\tinventory\\tmanagement\\tand\\tother\\tsystems\\tto\\taccommodate\\tthe\\nincreased\\tcomplexity\\tin\\tour\\tsupply\\tchain\\tand\\tparts\\tmanagement,\\twe\\tmay\\tincur\\tunexpected\\tproduction\\tdisruption,\\tstorage,\\ttransportation\\tand\\twrite-off\\ncosts,\\twhich\\tmay\\tharm\\tour\\tbusiness\\tand\\toperating\\tresults.\\nWe\\tmay\\tbe\\tunable\\tto\\tmeet\\tour\\tprojected\\tconstruction\\ttimelines,\\tcosts\\tand\\tproduction\\tramps\\tat\\tnew\\tfactories,\\tor\\twe\\tmay\\nexperience\\tdifficulties\\tin\\tgenerating\\tand\\tmaintaining\\tdemand\\tfor\\tproducts\\tmanufactured\\tthere.\\nOur\\tability\\tto\\tincrease\\tproduction\\tof\\tour\\tvehicles\\ton\\ta\\tsustained\\tbasis,\\tmake\\tthem\\taffordable\\tglobally\\tby\\taccessing\\tlocal\\tsupply\\tchains\\tand\\nworkforces\\tand\\tstreamline\\tdelivery\\tlogistics\\tis\\tdependent\\ton\\tthe\\tconstruction\\tand\\tramp\\tof\\tour\\tcurrent\\tand\\tfuture\\tfactories.\\tThe\\tconstruction\\tof\\tand\\ncommencement\\tand\\tramp\\tof\\tproduction\\tat\\tthese\\tfactories\\tare\\tsubject\\n15\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 16,\n        \"lines\": {\n          \"from\": 30,\n          \"to\": 46\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Table\\tof\\tContents\\nto\\ta\\tnumber\\tof\\tuncertainties\\tinherent\\tin\\tall\\tnew\\tmanufacturing\\toperations,\\tincluding\\tongoing\\tcompliance\\twith\\tregulatory\\trequirements,\\tprocurement\\tand\\nmaintenance\\tof\\tconstruction,\\tenvironmental\\tand\\toperational\\tlicenses\\tand\\tapprovals\\tfor\\tadditional\\texpansion,\\tsupply\\tchain\\tconstraints,\\thiring,\\ttraining\\tand\\nretention\\tof\\tqualified\\temployees\\tand\\tthe\\tpace\\tof\\tbringing\\tproduction\\tequipment\\tand\\tprocesses\\tonline\\twith\\tthe\\tcapability\\tto\\tmanufacture\\thigh-quality\\nunits\\tat\\tscale.\\tMoreover,\\twe\\twill\\thave\\tto\\testablish\\tand\\tramp\\tproduction\\tof\\tour\\tproprietary\\tbattery\\tcells\\tand\\tpacks\\tat\\tour\\tnew\\tfactories,\\tand\\twe\\tadditionally\\nintend\\tto\\tincorporate\\tsequential\\tdesign\\tand\\tmanufacturing\\tchanges\\tinto\\tvehicles\\tmanufactured\\tat\\teach\\tnew\\tfactory.\\tIf\\twe\\texperience\\tany\\tissues\\tor\\tdelays\\nin\\tmeeting\\tour\\tprojected\\ttimelines,\\tcosts,\\tcapital\\tefficiency\\tand\\tproduction\\tcapacity\\tfor\\tour\\tnew\\tfactories,\\texpanding\\tand\\tmanaging\\tteams\\tto\\timplement\\niterative\\tdesign\\tand\\tproduction\\tchanges\\tthere,\\tmaintaining\\tand\\tcomplying\\twith\\tthe\\tterms\\tof\\tany\\tdebt\\tfinancing\\tthat\\twe\\tobtain\\tto\\tfund\\tthem\\tor\\tgenerating\\nand\\tmaintaining\\tdemand\\tfor\\tthe\\tvehicles\\twe\\tmanufacture\\tthere,\\tour\\tbusiness,\\tprospects,\\toperating\\tresults\\tand\\tfinancial\\tcondition\\tmay\\tbe\\tharmed.\\nWe\\tmay\\tbe\\tunable\\tto\\tgrow\\tour\\tglobal\\tproduct\\tsales,\\tdelivery\\tand\\tinstallation\\tcapabilities\\tand\\tour\\tservicing\\tand\\tvehicle\\tcharging\\nnetworks,\\tor\\twe\\tmay\\tbe\\tunable\\tto\\taccurately\\tproject\\tand\\teffectively\\tmanage\\tour\\tgrowth.\\nOur\\tsuccess\\twill\\tdepend\\ton\\tour\\tability\\tto\\tcontinue\\tto\\texpand\\tour\\tsales\\tcapabilities.\\tWe\\tare\\ttargeting\\ta\\tglobal\\tmass\\tdemographic\\twith\\ta\\tbroad\\trange\\nof\\tpotential\\tcustomers,\\tin\\twhich\\twe\\thave\\trelatively\\tlimited\\texperience\\tprojecting\\tdemand\\tand\\tpricing\\tour\\tproducts.\\tWe\\tcurrently\\tproduce\\tnumerous\\ninternational\\tvariants\\tat\\ta\\tlimited\\tnumber\\tof\\tfactories,\\tand\\tif\\tour\\tspecific\\tdemand\\texpectations\\tfor\\tthese\\tvariants\\tprove\\tinaccurate,\\twe\\tmay\\tnot\\tbe\\table\\tto\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 17,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 14\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"timely\\tgenerate\\tdeliveries\\tmatched\\tto\\tthe\\tvehicles\\tthat\\twe\\tproduce\\tin\\tthe\\tsame\\ttimeframe\\tor\\tthat\\tare\\tcommensurate\\twith\\tthe\\tsize\\tof\\tour\\toperations\\tin\\ta\\ngiven\\tregion.\\tLikewise,\\tas\\twe\\tdevelop\\tand\\tgrow\\tour\\tenergy\\tproducts\\tand\\tservices\\tworldwide,\\tour\\tsuccess\\twill\\tdepend\\ton\\tour\\tability\\tto\\tcorrectly\\tforecast\\ndemand\\tin\\tvarious\\tmarkets.\\nBecause\\twe\\tdo\\tnot\\thave\\tindependent\\tdealer\\tnetworks,\\twe\\tare\\tresponsible\\tfor\\tdelivering\\tall\\tof\\tour\\tvehicles\\tto\\tour\\tcustomers.\\tAs\\tour\\tproduction\\nvolumes\\tcontinue\\tto\\tgrow,\\twe\\thave\\tfaced\\tin\\tthe\\tpast,\\tand\\tmay\\tface\\tchallenges\\twith\\tdeliveries\\tat\\tincreasing\\tvolumes,\\tparticularly\\tin\\tinternational\\tmarkets\\nrequiring\\tsignificant\\ttransit\\ttimes.\\tWe\\thave\\talso\\tdeployed\\ta\\tnumber\\tof\\tdelivery\\tmodels,\\tsuch\\tas\\tdeliveries\\tto\\tcustomers’\\thomes\\tand\\tworkplaces\\tand\\ntouchless\\tdeliveries,\\tbut\\tthere\\tis\\tno\\tguarantee\\tthat\\tsuch\\tmodels\\twill\\tbe\\tscalable\\tor\\tbe\\taccepted\\tglobally.\\tLikewise,\\tas\\twe\\tramp\\tour\\tenergy\\tproducts,\\twe\\nare\\tworking\\tto\\tsubstantially\\tincrease\\tour\\tproduction\\tand\\tinstallation\\tcapabilities.\\tIf\\twe\\texperience\\tproduction\\tdelays\\tor\\tinaccurately\\tforecast\\tdemand,\\tour\\nbusiness,\\tfinancial\\tcondition\\tand\\toperating\\tresults\\tmay\\tbe\\tharmed.\\nMoreover,\\tbecause\\tof\\tour\\tunique\\texpertise\\twith\\tour\\tvehicles,\\twe\\trecommend\\tthat\\tour\\tvehicles\\tbe\\tserviced\\tby\\tus\\tor\\tby\\tcertain\\tauthorized\\nprofessionals.\\tIf\\twe\\texperience\\tdelays\\tin\\tadding\\tservicing\\tcapacity\\tor\\tservicing\\tour\\tvehicles\\tefficiently,\\tor\\texperience\\tunforeseen\\tissues\\twith\\tthe\\treliability\\nof\\tour\\tvehicles,\\tparticularly\\thigher-volume\\tadditions\\tto\\tour\\tfleet\\tsuch\\tas\\tModel\\t3\\tand\\tModel\\tY,\\tit\\tcould\\toverburden\\tour\\tservicing\\tcapabilities\\tand\\tparts\\ninventory.\\tSimilarly,\\tthe\\tincreasing\\tnumber\\tof\\tTesla\\tvehicles\\talso\\trequires\\tus\\tto\\tcontinue\\tto\\trapidly\\tincrease\\tthe\\tnumber\\tof\\tour\\tSupercharger\\tstations\\tand\\nconnectors\\tthroughout\\tthe\\tworld.\\nThere\\tis\\tno\\tassurance\\tthat\\twe\\twill\\tbe\\table\\tto\\tramp\\tour\\tbusiness\\tto\\tmeet\\tour\\tsales,\\tdelivery,\\tinstallation,\\tservicing\\tand\\tvehicle\\tcharging\\ttargets\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 17,\n        \"lines\": {\n          \"from\": 15,\n          \"to\": 29\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"globally,\\tthat\\tour\\tprojections\\ton\\twhich\\tsuch\\ttargets\\tare\\tbased\\twill\\tprove\\taccurate\\tor\\tthat\\tthe\\tpace\\tof\\tgrowth\\tor\\tcoverage\\tof\\tour\\tcustomer\\tinfrastructure\\nnetwork\\twill\\tmeet\\tcustomer\\texpectations.\\tThese\\tplans\\trequire\\tsignificant\\tcash\\tinvestments\\tand\\tmanagement\\tresources\\tand\\tthere\\tis\\tno\\tguarantee\\tthat\\nthey\\twill\\tgenerate\\tadditional\\tsales\\tor\\tinstallations\\tof\\tour\\tproducts,\\tor\\tthat\\twe\\twill\\tbe\\table\\tto\\tavoid\\tcost\\toverruns\\tor\\tbe\\table\\tto\\thire\\tadditional\\tpersonnel\\tto\\nsupport\\tthem.\\tAs\\twe\\texpand,\\twe\\twill\\talso\\tneed\\tto\\tensure\\tour\\tcompliance\\twith\\tregulatory\\trequirements\\tin\\tvarious\\tjurisdictions\\tapplicable\\tto\\tthe\\tsale,\\ninstallation\\tand\\tservicing\\tof\\tour\\tproducts,\\tthe\\tsale\\tor\\tdispatch\\tof\\telectricity\\trelated\\tto\\tour\\tenergy\\tproducts\\tand\\tthe\\toperation\\tof\\tSuperchargers.\\tIf\\twe\\tfail\\tto\\nmanage\\tour\\tgrowth\\teffectively,\\tit\\tmay\\tharm\\tour\\tbrand,\\tbusiness,\\tprospects,\\tfinancial\\tcondition\\tand\\toperating\\tresults.\\nWe\\twill\\tneed\\tto\\tmaintain\\tand\\tsignificantly\\tgrow\\tour\\taccess\\tto\\tbattery\\tcells,\\tincluding\\tthrough\\tthe\\tdevelopment\\tand\\tmanufacture\\tof\\nour\\town\\tcells,\\tand\\tcontrol\\tour\\trelated\\tcosts.\\nWe\\tare\\tdependent\\ton\\tthe\\tcontinued\\tsupply\\tof\\tlithium-ion\\tbattery\\tcells\\tfor\\tour\\tvehicles\\tand\\tenergy\\tstorage\\tproducts,\\tand\\twe\\twill\\trequire\\tsubstantially\\nmore\\tcells\\tto\\tgrow\\tour\\tbusiness\\taccording\\tto\\tour\\tplans.\\tCurrently,\\twe\\trely\\ton\\tsuppliers\\tsuch\\tas\\tPanasonic\\tand\\tContemporary\\tAmperex\\tTechnology\\tCo.\\nLimited\\t(CATL)\\tfor\\tthese\\tcells.\\tWe\\thave\\tto\\tdate\\tfully\\tqualified\\tonly\\ta\\tvery\\tlimited\\tnumber\\tof\\tsuch\\tsuppliers\\tand\\thave\\tlimited\\tflexibility\\tin\\tchanging\\nsuppliers.\\tAny\\tdisruption\\tin\\tthe\\tsupply\\tof\\tbattery\\tcells\\tfrom\\tour\\tsuppliers\\tcould\\tlimit\\tproduction\\tof\\tour\\tvehicles\\tand\\tenergy\\tstorage\\tproducts.\\tIn\\tthe\\tlong\\nterm,\\twe\\tintend\\tto\\tsupplement\\tcells\\tfrom\\tour\\tsuppliers\\twith\\tcells\\tmanufactured\\tby\\tus,\\twhich\\twe\\tbelieve\\twill\\tbe\\tmore\\tefficient,\\tmanufacturable\\tat\\tgreater\\nvolumes\\tand\\tmore\\tcost-effective\\tthan\\tcurrently\\tavailable\\tcells.\\tHowever,\\tour\\tefforts\\tto\\tdevelop\\tand\\tmanufacture\\tsuch\\tbattery\\tcells\\thave\\trequired,\\tand\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 17,\n        \"lines\": {\n          \"from\": 30,\n          \"to\": 43\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"may\\tcontinue\\tto\\trequire,\\tsignificant\\tinvestments,\\tand\\tthere\\tcan\\tbe\\tno\\tassurance\\tthat\\twe\\twill\\tbe\\table\\tto\\tachieve\\tthese\\ttargets\\tin\\tthe\\ttimeframes\\tthat\\twe\\nhave\\tplanned\\tor\\tat\\tall.\\tIf\\twe\\tare\\n16\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 17,\n        \"lines\": {\n          \"from\": 44,\n          \"to\": 46\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Table\\tof\\tContents\\nunable\\tto\\tdo\\tso,\\twe\\tmay\\thave\\tto\\tcurtail\\tour\\tplanned\\tvehicle\\tand\\tenergy\\tstorage\\tproduct\\tproduction\\tor\\tprocure\\tadditional\\tcells\\tfrom\\tsuppliers\\tat\\npotentially\\tgreater\\tcosts,\\teither\\tof\\twhich\\tmay\\tharm\\tour\\tbusiness\\tand\\toperating\\tresults.\\nIn\\taddition,\\tthe\\tcost\\tand\\tmass\\tproduction\\tof\\tbattery\\tcells,\\twhether\\tmanufactured\\tby\\tour\\tsuppliers\\tor\\tby\\tus,\\tdepends\\tin\\tpart\\tupon\\tthe\\tprices\\tand\\navailability\\tof\\traw\\tmaterials\\tsuch\\tas\\tlithium,\\tnickel,\\tcobalt\\tand/or\\tother\\tmetals.\\tThe\\tprices\\tfor\\tthese\\tmaterials\\tfluctuate\\tand\\ttheir\\tavailable\\tsupply\\tmay\\tbe\\nunstable,\\tdepending\\ton\\tmarket\\tconditions\\tand\\tglobal\\tdemand\\tfor\\tthese\\tmaterials.\\tFor\\texample,\\tas\\ta\\tresult\\tof\\tincreased\\tglobal\\tproduction\\tof\\telectric\\nvehicles\\tand\\tenergy\\tstorage\\tproducts,\\tsuppliers\\tof\\tthese\\traw\\tmaterials\\tmay\\tbe\\tunable\\tto\\tmeet\\tour\\tvolume\\tneeds.\\tAdditionally,\\tour\\tsuppliers\\tmay\\tnot\\tbe\\nwilling\\tor\\table\\tto\\treliably\\tmeet\\tour\\ttimelines\\tor\\tour\\tcost\\tand\\tquality\\tneeds,\\twhich\\tmay\\trequire\\tus\\tto\\treplace\\tthem\\twith\\tother\\tsources.\\tAny\\treduced\\navailability\\tof\\tthese\\tmaterials\\tmay\\timpact\\tour\\taccess\\tto\\tcells\\tand\\tour\\tgrowth,\\tand\\tany\\tincreases\\tin\\ttheir\\tprices\\tmay\\treduce\\tour\\tprofitability\\tif\\twe\\tcannot\\nrecoup\\tsuch\\tcosts\\tthrough\\tincreased\\tprices.\\tMoreover,\\tour\\tinability\\tto\\tmeet\\tdemand\\tand\\tany\\tproduct\\tprice\\tincreases\\tmay\\tharm\\tour\\tbrand,\\tgrowth,\\nprospects\\tand\\toperating\\tresults.\\nOur\\tfuture\\tgrowth\\tand\\tsuccess\\tare\\tdependent\\tupon\\tconsumers’\\tdemand\\tfor\\telectric\\tvehicles\\tand\\tspecifically\\tour\\tvehicles\\tin\\tan\\nautomotive\\tindustry\\tthat\\tis\\tgenerally\\tcompetitive,\\tcyclical\\tand\\tvolatile.\\nThough\\twe\\tcontinue\\tto\\tsee\\tincreased\\tinterest\\tand\\tadoption\\tof\\telectric\\tvehicles,\\tif\\tthe\\tmarket\\tfor\\telectric\\tvehicles\\tin\\tgeneral\\tand\\tTesla\\tvehicles\\tin\\nparticular\\tdoes\\tnot\\tdevelop\\tas\\twe\\texpect,\\tdevelops\\tmore\\tslowly\\tthan\\twe\\texpect,\\tor\\tif\\tdemand\\tfor\\tour\\tvehicles\\tdecreases\\tin\\tour\\tmarkets\\tor\\tour\\tvehicles\\ncompete\\twith\\teach\\tother,\\tour\\tbusiness,\\tprospects,\\tfinancial\\tcondition\\tand\\toperating\\tresults\\tmay\\tbe\\tharmed.\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 18,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 16\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"In\\taddition,\\telectric\\tvehicles\\tstill\\tconstitute\\ta\\tsmall\\tpercentage\\tof\\toverall\\tvehicle\\tsales.\\tAs\\ta\\tresult,\\tthe\\tmarket\\tfor\\tour\\tvehicles\\tcould\\tbe\\tnegatively\\naffected\\tby\\tnumerous\\tfactors,\\tsuch\\tas:\\n•perceptions\\tabout\\telectric\\tvehicle\\tfeatures,\\tquality,\\tsafety,\\tperformance\\tand\\tcost;\\n•perceptions\\tabout\\tthe\\tlimited\\trange\\tover\\twhich\\telectric\\tvehicles\\tmay\\tbe\\tdriven\\ton\\ta\\tsingle\\tbattery\\tcharge,\\tand\\taccess\\tto\\tcharging\\tfacilities;\\n•competition,\\tincluding\\tfrom\\tother\\ttypes\\tof\\talternative\\tfuel\\tvehicles,\\tplug-in\\thybrid\\telectric\\tvehicles\\tand\\thigh\\tfuel-economy\\tinternal\\tcombustion\\nengine\\tvehicles;\\n•volatility\\tin\\tthe\\tcost\\tof\\toil,\\tgasoline\\tand\\tenergy;\\n•government\\tregulations\\tand\\teconomic\\tincentives\\tand\\tconditions;\\tand\\n•concerns\\tabout\\tour\\tfuture\\tviability.\\nThe\\ttarget\\tdemographics\\tfor\\tour\\tvehicles\\tare\\thighly\\tcompetitive.\\tSales\\tof\\tvehicles\\tin\\tthe\\tautomotive\\tindustry\\ttend\\tto\\tbe\\tcyclical\\tin\\tmany\\tmarkets,\\nwhich\\tmay\\texpose\\tus\\tto\\tfurther\\tvolatility.\\tWe\\talso\\tcannot\\tpredict\\tthe\\tduration\\tor\\tdirection\\tof\\tcurrent\\tglobal\\ttrends\\tor\\ttheir\\tsustained\\timpact\\ton\\tconsumer\\ndemand.\\tUltimately,\\twe\\tcontinue\\tto\\tmonitor\\tmacroeconomic\\tconditions\\tto\\tremain\\tflexible\\tand\\tto\\toptimize\\tand\\tevolve\\tour\\tbusiness\\tas\\tappropriate,\\tand\\nattempt\\tto\\taccurately\\tproject\\tdemand\\tand\\tinfrastructure\\trequirements\\tglobally\\tand\\tdeploy\\tour\\tproduction,\\tworkforce\\tand\\tother\\tresources\\taccordingly.\\nRising\\tinterest\\trates\\tmay\\tlead\\tto\\tconsumers\\tto\\tincreasingly\\tpull\\tback\\tspending,\\tincluding\\ton\\tour\\tproducts,\\twhich\\tmay\\tharm\\tour\\tdemand,\\tbusiness\\tand\\noperating\\tresults.\\tIf\\twe\\texperience\\tunfavorable\\tglobal\\tmarket\\tconditions,\\tor\\tif\\twe\\tcannot\\tor\\tdo\\tnot\\tmaintain\\toperations\\tat\\ta\\tscope\\tthat\\tis\\tcommensurate\\nwith\\tsuch\\tconditions\\tor\\tare\\tlater\\trequired\\tto\\tor\\tchoose\\tto\\tsuspend\\tsuch\\toperations\\tagain,\\tour\\tbusiness,\\tprospects,\\tfinancial\\tcondition\\tand\\toperating\\tresults\\nmay\\tbe\\tharmed.\\nWe\\tface\\tstrong\\tcompetition\\tfor\\tour\\tproducts\\tand\\tservices\\tfrom\\ta\\tgrowing\\tlist\\tof\\testablished\\tand\\tnew\\tcompetitors.\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 18,\n        \"lines\": {\n          \"from\": 17,\n          \"to\": 34\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"The\\tworldwide\\tautomotive\\tmarket\\tis\\thighly\\tcompetitive\\ttoday\\tand\\twe\\texpect\\tit\\twill\\tbecome\\teven\\tmore\\tso\\tin\\tthe\\tfuture.\\tA\\tsignificant\\tand\\tgrowing\\nnumber\\tof\\testablished\\tand\\tnew\\tautomobile\\tmanufacturers,\\tas\\twell\\tas\\tother\\tcompanies,\\thave\\tentered,\\tor\\tare\\treported\\tto\\thave\\tplans\\tto\\tenter,\\tthe\\tmarket\\nfor\\telectric\\tand\\tother\\talternative\\tfuel\\tvehicles,\\tincluding\\thybrid,\\tplug-in\\thybrid\\tand\\tfully\\telectric\\tvehicles,\\tas\\twell\\tas\\tthe\\tmarket\\tfor\\tself-driving\\ttechnology\\nand\\tother\\tvehicle\\tapplications\\tand\\tsoftware\\tplatforms.\\tIn\\tsome\\tcases,\\tour\\tcompetitors\\toffer\\tor\\twill\\toffer\\telectric\\tvehicles\\tin\\timportant\\tmarkets\\tsuch\\tas\\nChina\\tand\\tEurope,\\tand/or\\thave\\tannounced\\tan\\tintention\\tto\\tproduce\\telectric\\tvehicles\\texclusively\\tat\\tsome\\tpoint\\tin\\tthe\\tfuture.\\tIn\\taddition,\\tcertain\\ngovernment\\tand\\teconomic\\tincentives\\twhich\\tprovide\\tbenefits\\tto\\tmanufacturers\\twho\\tassemble\\tdomestically\\tor\\thave\\tlocal\\tsuppliers,\\tmay\\tprovide\\ta\\tgreater\\nbenefit\\tto\\tour\\tcompetitors,\\twhich\\tcould\\tnegatively\\timpact\\tour\\tprofitability.\\tMany\\tof\\tour\\tcompetitors\\thave\\tsignificantly\\tmore\\tor\\tbetter-established\\nresources\\tthan\\twe\\tdo\\tto\\tdevote\\tto\\tthe\\tdesign,\\tdevelopment,\\tmanufacturing,\\tdistribution,\\tpromotion,\\tsale\\tand\\tsupport\\tof\\ttheir\\tproducts.\\tIncreased\\ncompetition\\tcould\\tresult\\tin\\tour\\tlower\\tvehicle\\tunit\\tsales,\\tprice\\treductions,\\trevenue\\tshortfalls,\\tloss\\tof\\tcustomers\\tand\\tloss\\tof\\tmarket\\tshare,\\twhich\\tmay\\tharm\\nour\\tbusiness,\\tfinancial\\tcondition\\tand\\toperating\\tresults.\\n17\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 18,\n        \"lines\": {\n          \"from\": 35,\n          \"to\": 45\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Table\\tof\\tContents\\nWe\\talso\\tface\\tcompetition\\tin\\tour\\tenergy\\tgeneration\\tand\\tstorage\\tbusiness\\tfrom\\tother\\tmanufacturers,\\tdevelopers,\\tinstallers\\tand\\tservice\\tproviders\\tof\\ncompeting\\tenergy\\ttechnologies,\\tas\\twell\\tas\\tfrom\\tlarge\\tutilities.\\tDecreases\\tin\\tthe\\tretail\\tor\\twholesale\\tprices\\tof\\telectricity\\tfrom\\tutilities\\tor\\tother\\trenewable\\nenergy\\tsources\\tcould\\tmake\\tour\\tproducts\\tless\\tattractive\\tto\\tcustomers\\tand\\tlead\\tto\\tan\\tincreased\\trate\\tof\\tcustomer\\tdefaults.\\nRisks\\tRelated\\tto\\tOur\\tOperations\\nWe\\tmay\\texperience\\tissues\\twith\\tlithium-ion\\tcells\\tor\\tother\\tcomponents\\tmanufactured\\tat\\tour\\tGigafactories,\\twhich\\tmay\\tharm\\tthe\\nproduction\\tand\\tprofitability\\tof\\tour\\tvehicle\\tand\\tenergy\\tstorage\\tproducts.\\nOur\\tplan\\tto\\tgrow\\tthe\\tvolume\\tand\\tprofitability\\tof\\tour\\tvehicles\\tand\\tenergy\\tstorage\\tproducts\\tdepends\\ton\\tsignificant\\tlithium-ion\\tbattery\\tcell\\tproduction,\\nincluding\\tby\\tour\\tpartner\\tPanasonic\\tat\\tGigafactory\\tNevada.\\tWe\\talso\\tproduce\\tseveral\\tvehicle\\tcomponents\\tat\\tour\\tGigafactories,\\tsuch\\tas\\tbattery\\tmodules\\tand\\npacks\\tand\\tdrive\\tunits,\\tand\\tmanufacture\\tenergy\\tstorage\\tproducts.\\tIf\\twe\\tare\\tunable\\tto\\tor\\totherwise\\tdo\\tnot\\tmaintain\\tand\\tgrow\\tour\\trespective\\toperations,\\tor\\nif\\twe\\tare\\tunable\\tto\\tdo\\tso\\tcost-effectively\\tor\\thire\\tand\\tretain\\thighly-skilled\\tpersonnel\\tthere,\\tour\\tability\\tto\\tmanufacture\\tour\\tproducts\\tprofitably\\twould\\tbe\\nlimited,\\twhich\\tmay\\tharm\\tour\\tbusiness\\tand\\toperating\\tresults.\\nFinally,\\tthe\\thigh\\tvolumes\\tof\\tlithium-ion\\tcells\\tand\\tbattery\\tmodules\\tand\\tpacks\\tmanufactured\\tby\\tus\\tand\\tby\\tour\\tsuppliers\\tare\\tstored\\tand\\trecycled\\tat\\tour\\nvarious\\tfacilities.\\tAny\\tmishandling\\tof\\tthese\\tproducts\\tmay\\tcause\\tdisruption\\tto\\tthe\\toperation\\tof\\tsuch\\tfacilities.\\tWhile\\twe\\thave\\timplemented\\tsafety\\nprocedures\\trelated\\tto\\tthe\\thandling\\tof\\tthe\\tcells,\\tthere\\tcan\\tbe\\tno\\tassurance\\tthat\\ta\\tsafety\\tissue\\tor\\tfire\\trelated\\tto\\tthe\\tcells\\twould\\tnot\\tdisrupt\\tour\\toperations.\\nAny\\tsuch\\tdisruptions\\tor\\tissues\\tmay\\tharm\\tour\\tbrand\\tand\\tbusiness.\\nWe\\tface\\trisks\\tassociated\\twith\\tmaintaining\\tand\\texpanding\\tour\\tinternational\\toperations,\\tincluding\\tunfavorable\\tand\\tuncertain\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 19,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 17\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"regulatory,\\tpolitical,\\teconomic,\\ttax\\tand\\tlabor\\tconditions.\\nWe\\tare\\tsubject\\tto\\tlegal\\tand\\tregulatory\\trequirements,\\tpolitical\\tuncertainty\\tand\\tsocial,\\tenvironmental\\tand\\teconomic\\tconditions\\tin\\tnumerous\\njurisdictions,\\tincluding\\tmarkets\\tin\\twhich\\twe\\tgenerate\\tsignificant\\tsales,\\tover\\twhich\\twe\\thave\\tlittle\\tcontrol\\tand\\twhich\\tare\\tinherently\\tunpredictable.\\tOur\\noperations\\tin\\tsuch\\tjurisdictions,\\tparticularly\\tas\\ta\\tcompany\\tbased\\tin\\tthe\\tU.S.,\\tcreate\\trisks\\trelating\\tto\\tconforming\\tour\\tproducts\\tto\\tregulatory\\tand\\tsafety\\nrequirements\\tand\\tcharging\\tand\\tother\\telectric\\tinfrastructures;\\torganizing\\tlocal\\toperating\\tentities;\\testablishing,\\tstaffing\\tand\\tmanaging\\tforeign\\tbusiness\\nlocations;\\tattracting\\tlocal\\tcustomers;\\tnavigating\\tforeign\\tgovernment\\ttaxes,\\tregulations\\tand\\tpermit\\trequirements;\\tenforceability\\tof\\tour\\tcontractual\\trights;\\ntrade\\trestrictions,\\tcustoms\\tregulations,\\ttariffs\\tand\\tprice\\tor\\texchange\\tcontrols;\\tand\\tpreferences\\tin\\tforeign\\tnations\\tfor\\tdomestically\\tmanufactured\\tproducts.\\nFor\\texample,\\twe\\tmonitor\\ttax\\tlegislation\\tchanges\\ton\\ta\\tglobal\\tbasis,\\tincluding\\tchanges\\tarising\\tas\\ta\\tresult\\tof\\tthe\\tOrganization\\tfor\\tEconomic\\tCooperation\\tand\\nDevelopment’s\\tmulti-jurisdictional\\tplan\\tof\\taction\\tto\\taddress\\tbase\\terosion\\tand\\tprofit\\tshifting.\\tSuch\\tconditions\\tmay\\tincrease\\tour\\tcosts,\\timpact\\tour\\tability\\tto\\nsell\\tour\\tproducts\\tand\\trequire\\tsignificant\\tmanagement\\tattention,\\tand\\tmay\\tharm\\tour\\tbusiness\\tif\\twe\\tare\\tunable\\tto\\tmanage\\tthem\\teffectively.\\nOur\\tbusiness\\tmay\\tsuffer\\tif\\tour\\tproducts\\tor\\tfeatures\\tcontain\\tdefects,\\tfail\\tto\\tperform\\tas\\texpected\\tor\\ttake\\tlonger\\tthan\\texpected\\tto\\nbecome\\tfully\\tfunctional.\\nIf\\tour\\tproducts\\tcontain\\tdesign\\tor\\tmanufacturing\\tdefects,\\twhether\\trelating\\tto\\tour\\tsoftware\\tor\\thardware,\\tthat\\tcause\\tthem\\tnot\\tto\\tperform\\tas\\tdesigned\\nor\\tintended\\tor\\tthat\\trequire\\trepair,\\tor\\tcertain\\tfeatures\\tof\\tour\\tvehicles\\tsuch\\tas\\tnew\\tAutopilot\\tor\\tFSD\\tCapability\\tfeatures\\ttake\\tlonger\\tthan\\texpected\\tto\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 19,\n        \"lines\": {\n          \"from\": 18,\n          \"to\": 31\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"become\\tenabled,\\tare\\tlegally\\trestricted\\tor\\tbecome\\tsubject\\tto\\tonerous\\tregulation,\\tour\\tability\\tto\\tdevelop,\\tmarket\\tand\\tsell\\tour\\tproducts\\tand\\tservices\\tmay\\tbe\\nharmed,\\tand\\twe\\tmay\\texperience\\tdelivery\\tdelays,\\tproduct\\trecalls,\\tallegations\\tof\\tproduct\\tliability,\\tbreach\\tof\\twarranty\\tand\\trelated\\tconsumer\\tprotection\\nclaims\\tand\\tsignificant\\twarranty\\tand\\tother\\texpenses.\\tWhile\\twe\\tare\\tcontinuously\\tworking\\tto\\tdevelop\\tand\\timprove\\tour\\tproducts’\\tcapability\\tand\\tperformance,\\nthere\\tis\\tno\\tguarantee\\tthat\\tany\\tincremental\\tchanges\\tin\\tthe\\tspecific\\tsoftware\\tor\\tequipment\\twe\\tdeploy\\tin\\tour\\tvehicles\\tover\\ttime\\twill\\tnot\\tresult\\tin\\tinitial\\nfunctional\\tdisparities\\tfrom\\tprior\\titerations\\tor\\twill\\tperform\\tas\\tforecast\\tin\\tthe\\ttimeframe\\twe\\tanticipate,\\tor\\tat\\tall.\\tAlthough\\twe\\tattempt\\tto\\tremedy\\tany\\tissues\\nwe\\tobserve\\tin\\tour\\tproducts\\tas\\teffectively\\tand\\trapidly\\tas\\tpossible,\\tsuch\\tefforts\\tmay\\tnot\\tbe\\ttimely,\\tmay\\thamper\\tproduction\\tor\\tmay\\tnot\\tcompletely\\tsatisfy\\nour\\tcustomers.\\tWe\\thave\\tperformed,\\tand\\tcontinue\\tto\\tperform,\\textensive\\tinternal\\ttesting\\ton\\tour\\tproducts\\tand\\tfeatures,\\tthough,\\tlike\\tthe\\trest\\tof\\tthe\\tindustry,\\nwe\\tcurrently\\thave\\ta\\tlimited\\tframe\\tof\\treference\\tby\\twhich\\tto\\tevaluate\\tcertain\\taspects\\tof\\ttheir\\tlong-term\\tquality,\\treliability,\\tdurability\\tand\\tperformance\\ncharacteristics,\\tincluding\\texposure\\tto\\tor\\tconsequence\\tof\\texternal\\tattacks.\\tWhile\\twe\\tattempt\\tto\\tidentify\\tand\\taddress\\tor\\tremedy\\tdefects\\twe\\tidentify\\tpre-\\nproduction\\tand\\tsale,\\tthere\\tmay\\tbe\\tlatent\\tdefects\\tthat\\twe\\tmay\\tbe\\tunable\\tto\\tdetect\\tor\\tcontrol\\tfor\\tin\\tour\\tproducts,\\tand\\tthereby\\taddress,\\tprior\\tto\\ttheir\\tsale\\tto\\nor\\tinstallation\\tfor\\tcustomers.\\n18\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 19,\n        \"lines\": {\n          \"from\": 32,\n          \"to\": 43\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Table\\tof\\tContents\\nWe\\tmay\\tbe\\trequired\\tto\\tdefend\\tor\\tinsure\\tagainst\\tproduct\\tliability\\tclaims.\\nThe\\tautomobile\\tindustry\\tgenerally\\texperiences\\tsignificant\\tproduct\\tliability\\tclaims,\\tand\\tas\\tsuch\\twe\\tface\\tthe\\trisk\\tof\\tsuch\\tclaims\\tin\\tthe\\tevent\\tour\\nvehicles\\tdo\\tnot\\tperform\\tor\\tare\\tclaimed\\tto\\tnot\\thave\\tperformed\\tas\\texpected.\\tAs\\tis\\ttrue\\tfor\\tother\\tautomakers,\\tour\\tvehicles\\thave\\tbeen\\tinvolved\\tand\\twe\\nexpect\\tin\\tthe\\tfuture\\twill\\tbe\\tinvolved\\tin\\taccidents\\tresulting\\tin\\tdeath\\tor\\tpersonal\\tinjury,\\tand\\tsuch\\taccidents\\twhere\\tAutopilot,\\tEnhanced\\tAutopilot\\tor\\tFSD\\nCapability\\tfeatures\\tare\\tengaged\\tare\\tthe\\tsubject\\tof\\tsignificant\\tpublic\\tattention,\\tespecially\\tin\\tlight\\tof\\tNHTSA’s\\tStanding\\tGeneral\\tOrder\\trequiring\\treports\\nregarding\\tcrashes\\tinvolving\\tvehicles\\twith\\tadvanced\\tdriver\\tassistance\\tsystems.\\tWe\\thave\\texperienced,\\tand\\twe\\texpect\\tto\\tcontinue\\tto\\tface,\\tclaims\\tand\\nregulatory\\tscrutiny\\tarising\\tfrom\\tor\\trelated\\tto\\tmisuse\\tor\\tclaimed\\tfailures\\tor\\talleged\\tmisrepresentations\\tof\\tsuch\\tnew\\ttechnologies\\tthat\\twe\\tare\\tpioneering.\\tIn\\naddition,\\tthe\\tbattery\\tpacks\\tthat\\twe\\tproduce\\tmake\\tuse\\tof\\tlithium-ion\\tcells.\\tOn\\trare\\toccasions,\\tlithium-ion\\tcells\\tcan\\trapidly\\trelease\\tthe\\tenergy\\tthey\\tcontain\\nby\\tventing\\tsmoke\\tand\\tflames\\tin\\ta\\tmanner\\tthat\\tcan\\tignite\\tnearby\\tmaterials\\tas\\twell\\tas\\tother\\tlithium-ion\\tcells.\\tWhile\\twe\\thave\\tdesigned\\tour\\tbattery\\tpacks\\tto\\npassively\\tcontain\\tany\\tsingle\\tcell’s\\trelease\\tof\\tenergy\\twithout\\tspreading\\tto\\tneighboring\\tcells,\\tthere\\tcan\\tbe\\tno\\tassurance\\tthat\\ta\\tfield\\tor\\ttesting\\tfailure\\tof\\tour\\nvehicles\\tor\\tother\\tbattery\\tpacks\\tthat\\twe\\tproduce\\twill\\tnot\\toccur,\\tin\\tparticular\\tdue\\tto\\ta\\thigh-speed\\tcrash.\\tLikewise,\\tas\\tour\\tsolar\\tenergy\\tsystems\\tand\\tenergy\\nstorage\\tproducts\\tgenerate\\tand\\tstore\\telectricity,\\tthey\\thave\\tthe\\tpotential\\tto\\tfail\\tor\\tcause\\tinjury\\tto\\tpeople\\tor\\tproperty.\\tAny\\tproduct\\tliability\\tclaim\\tmay\\nsubject\\tus\\tto\\tlawsuits\\tand\\tsubstantial\\tmonetary\\tdamages,\\tproduct\\trecalls\\tor\\tredesign\\tefforts,\\tand\\teven\\ta\\tmeritless\\tclaim\\tmay\\trequire\\tus\\tto\\tdefend\\tit,\\tall\\tof\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 20,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 14\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"which\\tmay\\tgenerate\\tnegative\\tpublicity\\tand\\tbe\\texpensive\\tand\\ttime-consuming.\\tIn\\tmost\\tjurisdictions,\\twe\\tgenerally\\tself-insure\\tagainst\\tthe\\trisk\\tof\\tproduct\\nliability\\tclaims\\tfor\\tvehicle\\texposure,\\tmeaning\\tthat\\tany\\tproduct\\tliability\\tclaims\\twill\\tlikely\\thave\\tto\\tbe\\tpaid\\tfrom\\tcompany\\tfunds\\tand\\tnot\\tby\\tinsurance.\\nWe\\twill\\tneed\\tto\\tmaintain\\tpublic\\tcredibility\\tand\\tconfidence\\tin\\tour\\tlong-term\\tbusiness\\tprospects\\tin\\torder\\tto\\tsucceed.\\nIn\\torder\\tto\\tmaintain\\tand\\tgrow\\tour\\tbusiness,\\twe\\tmust\\tmaintain\\tcredibility\\tand\\tconfidence\\tamong\\tcustomers,\\tsuppliers,\\tanalysts,\\tinvestors,\\tratings\\nagencies\\tand\\tother\\tparties\\tin\\tour\\tlong-term\\tfinancial\\tviability\\tand\\tbusiness\\tprospects.\\tMaintaining\\tsuch\\tconfidence\\tmay\\tbe\\tchallenging\\tdue\\tto\\tour\\tlimited\\noperating\\thistory\\trelative\\tto\\testablished\\tcompetitors;\\tcustomer\\tunfamiliarity\\twith\\tour\\tproducts;\\tany\\tdelays\\twe\\tmay\\texperience\\tin\\tscaling\\tmanufacturing,\\ndelivery\\tand\\tservice\\toperations\\tto\\tmeet\\tdemand;\\tcompetition\\tand\\tuncertainty\\tregarding\\tthe\\tfuture\\tof\\telectric\\tvehicles\\tor\\tour\\tother\\tproducts\\tand\\tservices;\\nour\\tquarterly\\tproduction\\tand\\tsales\\tperformance\\tcompared\\twith\\tmarket\\texpectations;\\tand\\tother\\tfactors\\tincluding\\tthose\\tover\\twhich\\twe\\thave\\tno\\tcontrol.\\tIn\\nparticular,\\tTesla’s\\tproducts,\\tbusiness,\\tresults\\tof\\toperations,\\tand\\tstatements\\tand\\tactions\\tof\\tTesla\\tand\\tits\\tmanagement\\tare\\tsubject\\tto\\tsignificant\\tamounts\\tof\\ncommentary\\tby\\ta\\trange\\tof\\tthird\\tparties.\\tSuch\\tattention\\tcan\\tinclude\\tcriticism,\\twhich\\tmay\\tbe\\texaggerated\\tor\\tunfounded,\\tsuch\\tas\\tspeculation\\tregarding\\tthe\\nsufficiency\\tor\\tstability\\tof\\tour\\tmanagement\\tteam.\\tAny\\tsuch\\tnegative\\tperceptions,\\twhether\\tcaused\\tby\\tus\\tor\\tnot,\\tmay\\tharm\\tour\\tbusiness\\tand\\tmake\\tit\\tmore\\ndifficult\\tto\\traise\\tadditional\\tfunds\\tif\\tneeded.\\nWe\\tmay\\tbe\\tunable\\tto\\teffectively\\tgrow,\\tor\\tmanage\\tthe\\tcompliance,\\tresidual\\tvalue,\\tfinancing\\tand\\tcredit\\trisks\\trelated\\tto,\\tour\\tvarious\\nfinancing\\tprograms.\\nWe\\toffer\\tfinancing\\tarrangements\\tfor\\tour\\tvehicles\\tin\\tNorth\\tAmerica,\\tEurope\\tand\\tAsia\\tprimarily\\tourselves\\tand\\tthrough\\tvarious\\tfinancial\\tinstitutions.\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 20,\n        \"lines\": {\n          \"from\": 15,\n          \"to\": 29\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"We\\talso\\tcurrently\\toffer\\tvehicle\\tfinancing\\tarrangements\\tdirectly\\tthrough\\tour\\tlocal\\tsubsidiaries\\tin\\tcertain\\tmarkets.\\tDepending\\ton\\tthe\\tcountry,\\tsuch\\narrangements\\tare\\tavailable\\tfor\\tspecified\\tmodels\\tand\\tmay\\tinclude\\toperating\\tleases\\tdirectly\\twith\\tus\\tunder\\twhich\\twe\\ttypically\\treceive\\tonly\\ta\\tvery\\tsmall\\nportion\\tof\\tthe\\ttotal\\tvehicle\\tpurchase\\tprice\\tat\\tthe\\ttime\\tof\\tlease,\\tfollowed\\tby\\ta\\tstream\\tof\\tpayments\\tover\\tthe\\tterm\\tof\\tthe\\tlease.\\tWe\\thave\\talso\\toffered\\tvarious\\narrangements\\tfor\\tcustomers\\tof\\tour\\tsolar\\tenergy\\tsystems\\twhereby\\tthey\\tpay\\tus\\ta\\tfixed\\tpayment\\tto\\tlease\\tor\\tfinance\\tthe\\tpurchase\\tof\\tsuch\\tsystems\\tor\\npurchase\\telectricity\\tgenerated\\tby\\tthem.\\tIf\\twe\\tdo\\tnot\\tsuccessfully\\tmonitor\\tand\\tcomply\\twith\\tapplicable\\tnational,\\tstate\\tand/or\\tlocal\\tfinancial\\tregulations\\tand\\nconsumer\\tprotection\\tlaws\\tgoverning\\tthese\\ttransactions,\\twe\\tmay\\tbecome\\tsubject\\tto\\tenforcement\\tactions\\tor\\tpenalties.\\nThe\\tprofitability\\tof\\tany\\tdirectly-leased\\tvehicles\\treturned\\tto\\tus\\tat\\tthe\\tend\\tof\\ttheir\\tleases\\tdepends\\ton\\tour\\tability\\tto\\taccurately\\tproject\\tour\\tvehicles’\\nresidual\\tvalues\\tat\\tthe\\toutset\\tof\\tthe\\tleases,\\tand\\tsuch\\tvalues\\tmay\\tfluctuate\\tprior\\tto\\tthe\\tend\\tof\\ttheir\\tterms\\tdepending\\ton\\tvarious\\tfactors\\tsuch\\tas\\tsupply\\tand\\ndemand\\tof\\tour\\tused\\tvehicles,\\teconomic\\tcycles\\tand\\tthe\\tpricing\\tof\\tnew\\tvehicles.\\tWe\\thave\\tmade\\tin\\tthe\\tpast\\tand\\tmay\\tmake\\tin\\tthe\\tfuture\\tcertain\\tadjustments\\nto\\tour\\tprices\\tfrom\\ttime\\tto\\ttime\\tin\\tthe\\tordinary\\tcourse\\tof\\tbusiness,\\twhich\\tmay\\timpact\\tthe\\tresidual\\tvalues\\tof\\tour\\tvehicles\\tand\\treduce\\tthe\\tprofitability\\tof\\tour\\nvehicle\\tleasing\\tprogram.\\tThe\\tfunding\\tand\\tgrowth\\tof\\tthis\\tprogram\\talso\\trely\\ton\\tour\\tability\\tto\\tsecure\\tadequate\\tfinancing\\tand/or\\tbusiness\\tpartners.\\tIf\\twe\\tare\\nunable\\tto\\tadequately\\tfund\\tour\\tleasing\\tprogram\\tthrough\\tinternal\\tfunds,\\tpartners\\tor\\tother\\tfinancing\\tsources,\\tand\\tcompelling\\talternative\\tfinancing\\tprograms\\nare\\tnot\\tavailable\\tfor\\tour\\tcustomers\\twho\\tmay\\texpect\\tor\\tneed\\tsuch\\toptions,\\twe\\tmay\\tbe\\tunable\\tto\\tgrow\\tour\\tvehicle\\tdeliveries.\\tFurthermore,\\tif\\tour\\tvehicle\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 20,\n        \"lines\": {\n          \"from\": 30,\n          \"to\": 42\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"leasing\\tbusiness\\tgrows\\tsubstantially,\\tour\\tbusiness\\tmay\\tsuffer\\tif\\twe\\tcannot\\teffectively\\tmanage\\tthe\\tresulting\\tgreater\\tlevels\\tof\\tresidual\\trisk.\\n19\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 20,\n        \"lines\": {\n          \"from\": 43,\n          \"to\": 44\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Table\\tof\\tContents\\nSimilarly,\\twe\\thave\\tprovided\\tresale\\tvalue\\tguarantees\\tto\\tvehicle\\tcustomers\\tand\\tpartners\\tfor\\tcertain\\tfinancing\\tprograms,\\tunder\\twhich\\tsuch\\ncounterparties\\tmay\\tsell\\ttheir\\tvehicles\\tback\\tto\\tus\\tat\\tcertain\\tpoints\\tin\\ttime\\tat\\tpre-determined\\tamounts.\\tHowever,\\tactual\\tresale\\tvalues\\tare\\tsubject\\tto\\nfluctuations\\tover\\tthe\\tterm\\tof\\tthe\\tfinancing\\tarrangements,\\tsuch\\tas\\tfrom\\tthe\\tvehicle\\tpricing\\tchanges\\tdiscussed\\tabove.\\tIf\\tthe\\tactual\\tresale\\tvalues\\tof\\tany\\nvehicles\\tresold\\tor\\treturned\\tto\\tus\\tpursuant\\tto\\tthese\\tprograms\\tare\\tmaterially\\tlower\\tthan\\tthe\\tpre-determined\\tamounts\\twe\\thave\\toffered,\\tour\\tfinancial\\ncondition\\tand\\toperating\\tresults\\tmay\\tbe\\tharmed.\\nFinally,\\tour\\tvehicle\\tand\\tsolar\\tenergy\\tsystem\\tfinancing\\tprograms\\tand\\tour\\tenergy\\tstorage\\tsales\\tprograms\\talso\\texpose\\tus\\tto\\tcustomer\\tcredit\\trisk.\\tIn\\nthe\\tevent\\tof\\ta\\twidespread\\teconomic\\tdownturn\\tor\\tother\\tcatastrophic\\tevent,\\tour\\tcustomers\\tmay\\tbe\\tunable\\tor\\tunwilling\\tto\\tsatisfy\\ttheir\\tpayment\\tobligations\\nto\\tus\\ton\\ta\\ttimely\\tbasis\\tor\\tat\\tall.\\tIf\\ta\\tsignificant\\tnumber\\tof\\tour\\tcustomers\\tdefault,\\twe\\tmay\\tincur\\tsubstantial\\tcredit\\tlosses\\tand/or\\timpairment\\tcharges\\twith\\nrespect\\tto\\tthe\\tunderlying\\tassets.\\nWe\\tmust\\tmanage\\tongoing\\tobligations\\tunder\\tour\\tagreement\\twith\\tthe\\tResearch\\tFoundation\\tfor\\tthe\\tState\\tUniversity\\tof\\tNew\\tYork\\nrelating\\tto\\tour\\tGigafactory\\tNew\\tYork.\\nWe\\tare\\tparty\\tto\\tan\\toperating\\tlease\\tand\\ta\\tresearch\\tand\\tdevelopment\\tagreement\\tthrough\\tthe\\tState\\tUniversity\\tof\\tNew\\tYork\\t(the\\t“SUNY\\tFoundation”).\\nThese\\tagreements\\tprovide\\tfor\\tthe\\tconstruction\\tand\\tuse\\tof\\tour\\tGigafactory\\tNew\\tYork,\\twhich\\twe\\thave\\tprimarily\\tused\\tfor\\tthe\\tdevelopment\\tand\\tproduction\\tof\\nour\\tSolar\\tRoof\\tand\\tother\\tsolar\\tproducts\\tand\\tcomponents,\\tenergy\\tstorage\\tcomponents\\tand\\tSupercharger\\tcomponents,\\tand\\tfor\\tother\\tlessor-approved\\nfunctions.\\tUnder\\tthis\\tagreement,\\twe\\tare\\tobligated\\tto,\\tamong\\tother\\tthings,\\tmeet\\temployment\\ttargets\\tas\\twell\\tas\\tspecified\\tminimum\\tnumbers\\tof\\tpersonnel\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 21,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 16\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"in\\tthe\\tState\\tof\\tNew\\tYork\\tand\\tin\\tBuffalo,\\tNew\\tYork\\tand\\tspend\\tor\\tincur\\t$5.00\\tbillion\\tin\\tcombined\\tcapital,\\toperational\\texpenses,\\tcosts\\tof\\tgoods\\tsold\\tand\\nother\\tcosts\\tin\\tthe\\tState\\tof\\tNew\\tYork\\tduring\\ta\\tperiod\\tthat\\twas\\tinitially\\t10\\tyears\\tbeginning\\tApril\\t30,\\t2018.\\tAs\\tof\\tDecember\\t31,\\t2023,\\twe\\tare\\tcurrently\\tin\\nexcess\\tof\\tsuch\\ttargets\\trelating\\tto\\tinvestments\\tand\\tpersonnel\\tin\\tthe\\tState\\tof\\tNew\\tYork\\tand\\tBuffalo.\\tWhile\\twe\\texpect\\tto\\thave\\tand\\tgrow\\tsignificant\\noperations\\tat\\tGigafactory\\tNew\\tYork\\tand\\tthe\\tsurrounding\\tBuffalo\\tarea,\\tany\\tfailure\\tby\\tus\\tin\\tany\\tyear\\tover\\tthe\\tcourse\\tof\\tthe\\tterm\\tof\\tthe\\tagreement\\tto\\tmeet\\nall\\tapplicable\\tfuture\\tobligations\\tmay\\tresult\\tin\\tour\\tobligation\\tto\\tpay\\ta\\t“program\\tpayment”\\tof\\t$41\\tmillion\\tto\\tthe\\tSUNY\\tFoundation\\tfor\\tsuch\\tyear,\\tthe\\ntermination\\tof\\tour\\tlease\\tat\\tGigafactory\\tNew\\tYork\\twhich\\tmay\\trequire\\tus\\tto\\tpay\\tadditional\\tpenalties,\\tand/or\\tthe\\tneed\\tto\\tadjust\\tcertain\\tof\\tour\\toperations.\\nAny\\tof\\tthe\\tforegoing\\tevents\\tmay\\tharm\\tour\\tbusiness,\\tfinancial\\tcondition\\tand\\toperating\\tresults.\\nIf\\twe\\tare\\tunable\\tto\\tattract,\\thire\\tand\\tretain\\tkey\\temployees\\tand\\tqualified\\tpersonnel,\\tour\\tability\\tto\\tcompete\\tmay\\tbe\\tharmed.\\nThe\\tloss\\tof\\tthe\\tservices\\tof\\tany\\tof\\tour\\tkey\\temployees\\tor\\tany\\tsignificant\\tportion\\tof\\tour\\tworkforce\\tcould\\tdisrupt\\tour\\toperations\\tor\\tdelay\\tthe\\ndevelopment,\\tintroduction\\tand\\tramp\\tof\\tour\\tproducts\\tand\\tservices.\\tIn\\tparticular,\\twe\\tare\\thighly\\tdependent\\ton\\tthe\\tservices\\tof\\tElon\\tMusk,\\tTechnoking\\tof\\nTesla\\tand\\tour\\tChief\\tExecutive\\tOfficer.\\tNone\\tof\\tour\\tkey\\temployees\\tis\\tbound\\tby\\tan\\temployment\\tagreement\\tfor\\tany\\tspecific\\tterm\\tand\\twe\\tmay\\tnot\\tbe\\table\\tto\\nsuccessfully\\tattract\\tand\\tretain\\tsenior\\tleadership\\tnecessary\\tto\\tgrow\\tour\\tbusiness.\\tOur\\tfuture\\tsuccess\\talso\\tdepends\\tupon\\tour\\tability\\tto\\tattract,\\thire\\tand\\nretain\\ta\\tlarge\\tnumber\\tof\\tengineering,\\tmanufacturing,\\tmarketing,\\tsales\\tand\\tdelivery,\\tservice,\\tinstallation,\\ttechnology\\tand\\tsupport\\tpersonnel,\\tespecially\\tto\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 21,\n        \"lines\": {\n          \"from\": 17,\n          \"to\": 29\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"support\\tour\\tplanned\\thigh-volume\\tproduct\\tsales,\\tmarket\\tand\\tgeographical\\texpansion\\tand\\ttechnological\\tinnovations.\\tIf\\twe\\tare\\tnot\\tsuccessful\\tin\\tmanaging\\nthese\\trisks,\\tour\\tbusiness,\\tfinancial\\tcondition\\tand\\toperating\\tresults\\tmay\\tbe\\tharmed.\\nEmployees\\tmay\\tleave\\tTesla\\tor\\tchoose\\tother\\temployers\\tover\\tTesla\\tdue\\tto\\tvarious\\tfactors,\\tsuch\\tas\\ta\\tvery\\tcompetitive\\tlabor\\tmarket\\tfor\\ttalented\\nindividuals\\twith\\tautomotive\\tor\\ttechnology\\texperience,\\tor\\tany\\tnegative\\tpublicity\\trelated\\tto\\tus.\\tIn\\tregions\\twhere\\twe\\thave\\tor\\twill\\thave\\toperations,\\nparticularly\\tsignificant\\tengineering\\tand\\tmanufacturing\\tcenters,\\tthere\\tis\\tstrong\\tcompetition\\tfor\\tindividuals\\twith\\tskillsets\\tneeded\\tfor\\tour\\tbusiness,\\tincluding\\nspecialized\\tknowledge\\tof\\telectric\\tvehicles,\\tengineering\\tand\\telectrical\\tand\\tbuilding\\tconstruction\\texpertise.\\tWe\\talso\\tcompete\\twith\\tboth\\tmature\\tand\\nprosperous\\tcompanies\\tthat\\thave\\tfar\\tgreater\\tfinancial\\tresources\\tthan\\twe\\tdo\\tand\\tstart-ups\\tand\\temerging\\tcompanies\\tthat\\tpromise\\tshort-term\\tgrowth\\nopportunities.\\nFinally,\\tour\\tcompensation\\tphilosophy\\tfor\\tall\\tof\\tour\\tpersonnel\\treflects\\tour\\tstartup\\torigins,\\twith\\tan\\temphasis\\ton\\tequity-based\\tawards\\tand\\tbenefits\\tin\\norder\\tto\\tclosely\\talign\\ttheir\\tincentives\\twith\\tthe\\tlong-term\\tinterests\\tof\\tour\\tstockholders.\\tWe\\tperiodically\\tseek\\tand\\tobtain\\tapproval\\tfrom\\tour\\tstockholders\\tfor\\nfuture\\tincreases\\tto\\tthe\\tnumber\\tof\\tawards\\tavailable\\tunder\\tour\\tequity\\tincentive\\tand\\temployee\\tstock\\tpurchase\\tplans.\\tIf\\twe\\tare\\tunable\\tto\\tobtain\\tthe\\trequisite\\nstockholder\\tapprovals\\tfor\\tsuch\\tfuture\\tincreases,\\twe\\tmay\\thave\\tto\\texpend\\tadditional\\tcash\\tto\\tcompensate\\tour\\temployees\\tand\\tour\\tability\\tto\\tretain\\tand\\thire\\nqualified\\tpersonnel\\tmay\\tbe\\tharmed.\\n20\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 21,\n        \"lines\": {\n          \"from\": 30,\n          \"to\": 43\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Table\\tof\\tContents\\nWe\\tare\\thighly\\tdependent\\ton\\tthe\\tservices\\tof\\tElon\\tMusk,\\tTechnoking\\tof\\tTesla\\tand\\tour\\tChief\\tExecutive\\tOfficer.\\nWe\\tare\\thighly\\tdependent\\ton\\tthe\\tservices\\tof\\tElon\\tMusk,\\tTechnoking\\tof\\tTesla\\tand\\tour\\tChief\\tExecutive\\tOfficer.\\tAlthough\\tMr.\\tMusk\\tspends\\tsignificant\\ntime\\twith\\tTesla\\tand\\tis\\thighly\\tactive\\tin\\tour\\tmanagement,\\the\\tdoes\\tnot\\tdevote\\this\\tfull\\ttime\\tand\\tattention\\tto\\tTesla.\\tMr.\\tMusk\\talso\\tcurrently\\tserves\\tas\\tChief\\nExecutive\\tOfficer\\tand\\tChief\\tTechnical\\tOfficer\\tof\\tSpace\\tExploration\\tTechnologies\\tCorp.,\\ta\\tdeveloper\\tand\\tmanufacturer\\tof\\tspace\\tlaunch\\tvehicles,\\tChairman\\nand\\tChief\\tTechnical\\tOfficer\\tof\\tX\\tCorp.,\\ta\\tsocial\\tmedia\\tcompany,\\tand\\tis\\tinvolved\\tin\\tother\\temerging\\ttechnology\\tventures.\\nOur\\tinformation\\ttechnology\\tsystems\\tor\\tdata,\\tor\\tthose\\tof\\tour\\tservice\\tproviders\\tor\\tcustomers\\tor\\tusers\\tcould\\tbe\\tsubject\\tto\\tcyber-\\nattacks\\tor\\tother\\tsecurity\\tincidents,\\twhich\\tcould\\tresult\\tin\\tdata\\tbreaches,\\tintellectual\\tproperty\\ttheft,\\tclaims,\\tlitigation,\\tregulatory\\ninvestigations,\\tsignificant\\tliability,\\treputational\\tdamage\\tand\\tother\\tadverse\\tconsequences.\\nWe\\tcontinue\\tto\\texpand\\tour\\tinformation\\ttechnology\\tsystems\\tas\\tour\\toperations\\tgrow,\\tsuch\\tas\\tproduct\\tdata\\tmanagement,\\tprocurement,\\tinventory\\nmanagement,\\tproduction\\tplanning\\tand\\texecution,\\tsales,\\tservice\\tand\\tlogistics,\\tdealer\\tmanagement,\\tfinancial,\\ttax\\tand\\tregulatory\\tcompliance\\tsystems.\\tThis\\nincludes\\tthe\\timplementation\\tof\\tnew\\tinternally\\tdeveloped\\tsystems\\tand\\tthe\\tdeployment\\tof\\tsuch\\tsystems\\tin\\tthe\\tU.S.\\tand\\tabroad.\\tWhile,\\twe\\tmaintain\\ninformation\\ttechnology\\tmeasures\\tdesigned\\tto\\tprotect\\tus\\tagainst\\tintellectual\\tproperty\\ttheft,\\tdata\\tbreaches,\\tsabotage\\tand\\tother\\texternal\\tor\\tinternal\\tcyber-\\nattacks\\tor\\tmisappropriation,\\tour\\tsystems\\tand\\tthose\\tof\\tour\\tservice\\tproviders\\tare\\tpotentially\\tvulnerable\\tto\\tmalware,\\transomware,\\tviruses,\\tdenial-of-service\\nattacks,\\tphishing\\tattacks,\\tsocial\\tengineering,\\tcomputer\\thacking,\\tunauthorized\\taccess,\\texploitation\\tof\\tbugs,\\tdefects\\tand\\tvulnerabilities,\\tbreakdowns,\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 22,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 15\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"damage,\\tinterruptions,\\tsystem\\tmalfunctions,\\tpower\\toutages,\\tterrorism,\\tacts\\tof\\tvandalism,\\tsecurity\\tbreaches,\\tsecurity\\tincidents,\\tinadvertent\\tor\\tintentional\\nactions\\tby\\temployees\\tor\\tother\\tthird\\tparties,\\tand\\tother\\tcyber-attacks.\\nTo\\tthe\\textent\\tany\\tsecurity\\tincident\\tresults\\tin\\tunauthorized\\taccess\\tor\\tdamage\\tto\\tor\\tacquisition,\\tuse,\\tcorruption,\\tloss,\\tdestruction,\\talteration\\tor\\ndissemination\\tof\\tour\\tdata,\\tincluding\\tintellectual\\tproperty\\tand\\tpersonal\\tinformation,\\tor\\tour\\tproducts\\tor\\tvehicles,\\tor\\tfor\\tit\\tto\\tbe\\tbelieved\\tor\\treported\\tthat\\tany\\nof\\tthese\\toccurred,\\tit\\tcould\\tdisrupt\\tour\\tbusiness,\\tharm\\tour\\treputation,\\tcompel\\tus\\tto\\tcomply\\twith\\tapplicable\\tdata\\tbreach\\tnotification\\tlaws,\\tsubject\\tus\\tto\\ttime\\nconsuming,\\tdistracting\\tand\\texpensive\\tlitigation,\\tregulatory\\tinvestigation\\tand\\toversight,\\tmandatory\\tcorrective\\taction,\\trequire\\tus\\tto\\tverify\\tthe\\tcorrectness\\nof\\tdatabase\\tcontents,\\tor\\totherwise\\tsubject\\tus\\tto\\tliability\\tunder\\tlaws,\\tregulations\\tand\\tcontractual\\tobligations,\\tincluding\\tthose\\tthat\\tprotect\\tthe\\tprivacy\\tand\\nsecurity\\tof\\tpersonal\\tinformation.\\tThis\\tcould\\tresult\\tin\\tincreased\\tcosts\\tto\\tus\\tand\\tresult\\tin\\tsignificant\\tlegal\\tand\\tfinancial\\texposure\\tand/or\\treputational\\tharm.\\nWe\\talso\\trely\\ton\\tservice\\tproviders,\\tand\\tsimilar\\tincidents\\trelating\\tto\\ttheir\\tinformation\\ttechnology\\tsystems\\tcould\\talso\\thave\\ta\\tmaterial\\tadverse\\teffect\\ton\\nour\\tbusiness.\\tThere\\thave\\tbeen\\tand\\tmay\\tcontinue\\tto\\tbe\\tsignificant\\tsupply\\tchain\\tattacks.\\tOur\\tservice\\tproviders,\\tincluding\\tour\\tworkforce\\tmanagement\\nsoftware\\tprovider,\\thave\\tbeen\\tsubject\\tto\\transomware\\tand\\tother\\tsecurity\\tincidents,\\tand\\twe\\tcannot\\tguarantee\\tthat\\tour\\tor\\tour\\tservice\\tproviders’\\tsystems\\nhave\\tnot\\tbeen\\tbreached\\tor\\tthat\\tthey\\tdo\\tnot\\tcontain\\texploitable\\tdefects,\\tbugs,\\tor\\tvulnerabilities\\tthat\\tcould\\tresult\\tin\\ta\\tsecurity\\tincident,\\tor\\tother\\tdisruption\\nto,\\tour\\tor\\tour\\tservice\\tproviders’\\tsystems.\\tOur\\tability\\tto\\tmonitor\\tour\\tservice\\tproviders’\\tsecurity\\tmeasures\\tis\\tlimited,\\tand,\\tin\\tany\\tevent,\\tmalicious\\tthird\\nparties\\tmay\\tbe\\table\\tto\\tcircumvent\\tthose\\tsecurity\\tmeasures.\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 22,\n        \"lines\": {\n          \"from\": 16,\n          \"to\": 29\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Further,\\tthe\\timplementation,\\tmaintenance,\\tsegregation\\tand\\timprovement\\tof\\tthese\\tsystems\\trequire\\tsignificant\\tmanagement\\ttime,\\tsupport\\tand\\tcost,\\nand\\tthere\\tare\\tinherent\\trisks\\tassociated\\twith\\tdeveloping,\\timproving\\tand\\texpanding\\tour\\tcore\\tsystems\\tas\\twell\\tas\\timplementing\\tnew\\tsystems\\tand\\tupdating\\ncurrent\\tsystems,\\tincluding\\tdisruptions\\tto\\tthe\\trelated\\tareas\\tof\\tbusiness\\toperation.\\tThese\\trisks\\tmay\\taffect\\tour\\tability\\tto\\tmanage\\tour\\tdata\\tand\\tinventory,\\nprocure\\tparts\\tor\\tsupplies\\tor\\tmanufacture,\\tsell,\\tdeliver\\tand\\tservice\\tproducts,\\tadequately\\tprotect\\tour\\tintellectual\\tproperty\\tor\\tachieve\\tand\\tmaintain\\ncompliance\\twith,\\tor\\trealize\\tavailable\\tbenefits\\tunder,\\ttax\\tlaws\\tand\\tother\\tapplicable\\tregulations.\\nMoreover,\\tif\\twe\\tdo\\tnot\\tsuccessfully\\timplement,\\tmaintain\\tor\\texpand\\tthese\\tsystems\\tas\\tplanned,\\tour\\toperations\\tmay\\tbe\\tdisrupted,\\tour\\tability\\tto\\naccurately\\tand/or\\ttimely\\treport\\tour\\tfinancial\\tresults\\tcould\\tbe\\timpaired\\tand\\tdeficiencies\\tmay\\tarise\\tin\\tour\\tinternal\\tcontrol\\tover\\tfinancial\\treporting,\\twhich\\nmay\\timpact\\tour\\tability\\tto\\tcertify\\tour\\tfinancial\\tresults.\\tMoreover,\\tour\\tproprietary\\tinformation,\\tincluding\\tintellectual\\tproperty\\tand\\tpersonal\\tinformation,\\ncould\\tbe\\tcompromised\\tor\\tmisappropriated\\tand\\tour\\treputation\\tmay\\tbe\\tadversely\\taffected.\\tIf\\tthese\\tsystems\\tor\\ttheir\\tfunctionality\\tdo\\tnot\\toperate\\tas\\twe\\nexpect\\tthem\\tto,\\twe\\tmay\\tbe\\trequired\\tto\\texpend\\tsignificant\\tresources\\tto\\tmake\\tcorrections\\tor\\tfind\\talternative\\tsources\\tfor\\tperforming\\tthese\\tfunctions.\\n21\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 22,\n        \"lines\": {\n          \"from\": 30,\n          \"to\": 40\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Table\\tof\\tContents\\nAny\\tunauthorized\\tcontrol\\tor\\tmanipulation\\tof\\tour\\tproducts’\\tsystems\\tcould\\tresult\\tin\\tloss\\tof\\tconfidence\\tin\\tus\\tand\\tour\\tproducts.\\nOur\\tproducts\\tcontain\\tcomplex\\tinformation\\ttechnology\\tsystems.\\tFor\\texample,\\tour\\tvehicles\\tand\\tenergy\\tstorage\\tproducts\\tare\\tdesigned\\twith\\tbuilt-in\\ndata\\tconnectivity\\tto\\taccept\\tand\\tinstall\\tperiodic\\tremote\\tupdates\\tfrom\\tus\\tto\\timprove\\tor\\tupdate\\ttheir\\tfunctionality.\\tWhile\\twe\\thave\\timplemented\\tsecurity\\nmeasures\\tintended\\tto\\tprevent\\tunauthorized\\taccess\\tto\\tour\\tinformation\\ttechnology\\tnetworks,\\tour\\tproducts\\tand\\ttheir\\tsystems,\\tmalicious\\tentities\\thave\\nreportedly\\tattempted,\\tand\\tmay\\tattempt\\tin\\tthe\\tfuture,\\tto\\tgain\\tunauthorized\\taccess\\tto\\tmodify,\\talter\\tand\\tuse\\tsuch\\tnetworks,\\tproducts\\tand\\tsystems\\tto\\tgain\\ncontrol\\tof,\\tor\\tto\\tchange,\\tour\\tproducts’\\tfunctionality,\\tuser\\tinterface\\tand\\tperformance\\tcharacteristics\\tor\\tto\\tgain\\taccess\\tto\\tdata\\tstored\\tin\\tor\\tgenerated\\tby\\tour\\nproducts.\\tWe\\tencourage\\treporting\\tof\\tpotential\\tvulnerabilities\\tin\\tthe\\tsecurity\\tof\\tour\\tproducts\\tthrough\\tour\\tsecurity\\tvulnerability\\treporting\\tpolicy,\\tand\\twe\\naim\\tto\\tremedy\\tany\\treported\\tand\\tverified\\tvulnerability.\\tHowever,\\tthere\\tcan\\tbe\\tno\\tassurance\\tthat\\tany\\tvulnerabilities\\twill\\tnot\\tbe\\texploited\\tbefore\\tthey\\tcan\\nbe\\tidentified,\\tor\\tthat\\tour\\tremediation\\tefforts\\tare\\tor\\twill\\tbe\\tsuccessful.\\nAny\\tunauthorized\\taccess\\tto\\tor\\tcontrol\\tof\\tour\\tproducts\\tor\\ttheir\\tsystems\\tor\\tany\\tloss\\tof\\tdata\\tcould\\tresult\\tin\\tlegal\\tclaims\\tor\\tgovernment\\tinvestigations.\\nIn\\taddition,\\tregardless\\tof\\ttheir\\tveracity,\\treports\\tof\\tunauthorized\\taccess\\tto\\tour\\tproducts,\\ttheir\\tsystems\\tor\\tdata,\\tas\\twell\\tas\\tother\\tfactors\\tthat\\tmay\\tresult\\tin\\nthe\\tperception\\tthat\\tour\\tproducts,\\ttheir\\tsystems\\tor\\tdata\\tare\\tcapable\\tof\\tbeing\\thacked,\\tmay\\tharm\\tour\\tbrand,\\tprospects\\tand\\toperating\\tresults.\\tWe\\thave\\tbeen\\nthe\\tsubject\\tof\\tsuch\\treports\\tin\\tthe\\tpast.\\nOur\\tbusiness\\tmay\\tbe\\tadversely\\taffected\\tby\\tany\\tdisruptions\\tcaused\\tby\\tunion\\tactivities.\\nIt\\tis\\tnot\\tuncommon\\tfor\\temployees\\tof\\tcertain\\ttrades\\tat\\tcompanies\\tsuch\\tas\\tours\\tto\\tbelong\\tto\\ta\\tunion,\\twhich\\tcan\\tresult\\tin\\thigher\\temployee\\tcosts\\tand\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 23,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 16\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"increased\\trisk\\tof\\twork\\tstoppages.\\tMoreover,\\tregulations\\tin\\tsome\\tjurisdictions\\toutside\\tof\\tthe\\tU.S.\\tmandate\\temployee\\tparticipation\\tin\\tindustrial\\tcollective\\nbargaining\\tagreements\\tand\\twork\\tcouncils\\twith\\tcertain\\tconsultation\\trights\\twith\\trespect\\tto\\tthe\\trelevant\\tcompanies’\\toperations.\\tAlthough\\twe\\twork\\tdiligently\\nto\\tprovide\\tthe\\tbest\\tpossible\\twork\\tenvironment\\tfor\\tour\\temployees,\\tthey\\tmay\\tstill\\tdecide\\tto\\tjoin\\tor\\tseek\\trecognition\\tto\\tform\\ta\\tlabor\\tunion,\\tor\\twe\\tmay\\tbe\\nrequired\\tto\\tbecome\\ta\\tunion\\tsignatory.\\tFrom\\ttime\\tto\\ttime,\\tlabor\\tunions\\thave\\tengaged\\tin\\tcampaigns\\tto\\torganize\\tcertain\\tof\\tour\\toperations,\\tas\\tpart\\tof\\twhich\\nsuch\\tunions\\thave\\tfiled\\tunfair\\tlabor\\tpractice\\tcharges\\tagainst\\tus\\twith\\tthe\\tNational\\tLabor\\tRelations\\tBoard\\t(the\\t“NLRB”),\\tand\\tthey\\tmay\\tdo\\tso\\tin\\tthe\\tfuture.\\nAny\\tunfavorable\\tultimate\\toutcome\\tfor\\tTesla\\tmay\\thave\\ta\\tnegative\\timpact\\ton\\tthe\\tperception\\tof\\tTesla’s\\ttreatment\\tof\\tour\\temployees.\\tFurthermore,\\twe\\tare\\ndirectly\\tor\\tindirectly\\tdependent\\tupon\\tcompanies\\twith\\tunionized\\twork\\tforces,\\tsuch\\tas\\tsuppliers\\tand\\ttrucking\\tand\\tfreight\\tcompanies.\\tAny\\twork\\tstoppages\\tor\\nstrikes\\torganized\\tby\\tsuch\\tunions\\tcould\\tdelay\\tthe\\tmanufacture\\tand\\tsale\\tof\\tour\\tproducts\\tand\\tmay\\tharm\\tour\\tbusiness\\tand\\toperating\\tresults.\\nWe\\tmay\\tchoose\\tto\\tor\\tbe\\tcompelled\\tto\\tundertake\\tproduct\\trecalls\\tor\\ttake\\tother\\tsimilar\\tactions.\\nAs\\ta\\tmanufacturing\\tcompany,\\twe\\tmust\\tmanage\\tthe\\trisk\\tof\\tproduct\\trecalls\\twith\\trespect\\tto\\tour\\tproducts.\\tRecalls\\tfor\\tour\\tvehicles\\thave\\tresulted\\tfrom\\nvarious\\thardware\\tand\\tsoftware-related\\tsafety\\tconcerns\\tor\\tnon-compliance\\tdeterminations.\\tIn\\taddition\\tto\\trecalls\\tinitiated\\tby\\tus\\tfor\\tvarious\\tcauses,\\ttesting\\nof\\tor\\tinvestigations\\tinto\\tour\\tproducts\\tby\\tgovernment\\tregulators\\tor\\tindustry\\tgroups\\tmay\\tcompel\\tus\\tto\\tinitiate\\tproduct\\trecalls\\tor\\tmay\\tresult\\tin\\tnegative\\npublic\\tperceptions\\tabout\\tthe\\tsafety\\tof\\tour\\tproducts,\\teven\\tif\\twe\\tdisagree\\twith\\tthe\\tdefect\\tdetermination\\tor\\thave\\tdata\\tthat\\tcontradicts\\tit.\\tIn\\tthe\\tfuture,\\twe\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 23,\n        \"lines\": {\n          \"from\": 17,\n          \"to\": 29\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"may\\tvoluntarily\\tor\\tinvoluntarily\\tinitiate\\trecalls\\tif\\tany\\tof\\tour\\tproducts\\tare\\tdetermined\\tby\\tus\\tor\\ta\\tregulator\\tto\\tcontain\\ta\\tsafety\\tdefect\\tor\\tbe\\tnoncompliant\\nwith\\tapplicable\\tlaws\\tand\\tregulations,\\tsuch\\tas\\tU.S.\\tFederal\\tMotor\\tVehicle\\tSafety\\tStandards.\\tSuch\\trecalls,\\twhether\\tvoluntary\\tor\\tinvoluntary\\tor\\tcaused\\tby\\nsystems\\tor\\tcomponents\\tengineered\\tor\\tmanufactured\\tby\\tus\\tor\\tour\\tsuppliers,\\tcould\\tresult\\tin\\tsignificant\\texpense,\\tsupply\\tchain\\tcomplications\\tand\\tservice\\nburdens,\\tand\\tmay\\tharm\\tour\\tbrand,\\tbusiness,\\tprospects,\\tfinancial\\tcondition\\tand\\toperating\\tresults.\\nOur\\tcurrent\\tand\\tfuture\\twarranty\\treserves\\tmay\\tbe\\tinsufficient\\tto\\tcover\\tfuture\\twarranty\\tclaims.\\nWe\\tprovide\\ta\\tmanufacturer’s\\twarranty\\ton\\tall\\tnew\\tand\\tused\\tTesla\\tvehicles\\twe\\tsell\\tdirectly\\tto\\tcustomers.\\tWe\\talso\\tprovide\\tcertain\\twarranties\\twith\\nrespect\\tto\\tthe\\tenergy\\tgeneration\\tand\\tstorage\\tsystems\\twe\\tsell,\\tincluding\\ton\\ttheir\\tinstallation\\tand\\tmaintenance.\\tFor\\tcomponents\\tnot\\tmanufactured\\tby\\tus,\\nwe\\tgenerally\\tpass\\tthrough\\tto\\tour\\tcustomers\\tthe\\tapplicable\\tmanufacturers’\\twarranties,\\tbut\\tmay\\tretain\\tsome\\twarranty\\tresponsibilities\\tfor\\tsome\\tor\\tall\\tof\\tthe\\nlife\\tof\\tsuch\\tcomponents.\\tAs\\tpart\\tof\\tour\\tenergy\\tgeneration\\tand\\tstorage\\tsystem\\tcontracts,\\twe\\tmay\\tprovide\\tthe\\tcustomer\\twith\\tperformance\\tguarantees\\tthat\\nguarantee\\tthat\\tthe\\tunderlying\\tsystem\\twill\\tmeet\\tor\\texceed\\tthe\\tminimum\\tenergy\\tgeneration\\tor\\tother\\tenergy\\tperformance\\trequirements\\tspecified\\tin\\tthe\\ncontract.\\tUnder\\tthese\\tperformance\\tguarantees,\\twe\\tgenerally\\tbear\\tthe\\trisk\\tof\\telectricity\\tproduction\\tor\\tother\\tperformance\\tshortfalls,\\tincluding\\tin\\tsome\\ncases\\tshortfalls\\tcaused\\tby\\tfailures\\tin\\tcomponents\\tfrom\\tthird\\tparty\\tmanufacturers.\\tThese\\trisks\\tare\\texacerbated\\tin\\tthe\\tevent\\tsuch\\tmanufacturers\\tcease\\noperations\\tor\\tfail\\tto\\thonor\\ttheir\\twarranties.\\n22\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 23,\n        \"lines\": {\n          \"from\": 30,\n          \"to\": 43\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Table\\tof\\tContents\\nIf\\tour\\twarranty\\treserves\\tare\\tinadequate\\tto\\tcover\\tfuture\\twarranty\\tclaims\\ton\\tour\\tproducts,\\tour\\tfinancial\\tcondition\\tand\\toperating\\tresults\\tmay\\tbe\\nharmed.\\tWarranty\\treserves\\tinclude\\tour\\tmanagement’s\\tbest\\testimates\\tof\\tthe\\tprojected\\tcosts\\tto\\trepair\\tor\\tto\\treplace\\titems\\tunder\\twarranty,\\twhich\\tare\\tbased\\non\\tactual\\tclaims\\tincurred\\tto\\tdate\\tand\\tan\\testimate\\tof\\tthe\\tnature,\\tfrequency\\tand\\tcosts\\tof\\tfuture\\tclaims.\\tSuch\\testimates\\tare\\tinherently\\tuncertain\\tand\\nchanges\\tto\\tour\\thistorical\\tor\\tprojected\\texperience,\\tespecially\\twith\\trespect\\tto\\tproducts\\tthat\\twe\\thave\\tintroduced\\trelatively\\trecently\\tand/or\\tthat\\twe\\texpect\\tto\\nproduce\\tat\\tsignificantly\\tgreater\\tvolumes\\tthan\\tour\\tpast\\tproducts,\\tmay\\tcause\\tmaterial\\tchanges\\tto\\tour\\twarranty\\treserves\\tin\\tthe\\tfuture.\\nOur\\tinsurance\\tcoverage\\tstrategy\\tmay\\tnot\\tbe\\tadequate\\tto\\tprotect\\tus\\tfrom\\tall\\tbusiness\\trisks.\\nWe\\tmay\\tbe\\tsubject,\\tin\\tthe\\tordinary\\tcourse\\tof\\tbusiness,\\tto\\tlosses\\tresulting\\tfrom\\tproducts\\tliability,\\taccidents,\\tacts\\tof\\tGod\\tand\\tother\\tclaims\\tagainst\\tus,\\nfor\\twhich\\twe\\tmay\\thave\\tno\\tinsurance\\tcoverage.\\tAs\\ta\\tgeneral\\tmatter,\\twe\\tdo\\tnot\\tmaintain\\tas\\tmuch\\tinsurance\\tcoverage\\tas\\tmany\\tother\\tcompanies\\tdo,\\tand\\tin\\nsome\\tcases,\\twe\\tdo\\tnot\\tmaintain\\tany\\tat\\tall.\\tAdditionally,\\tthe\\tpolicies\\tthat\\twe\\tdo\\thave\\tmay\\tinclude\\tsignificant\\tdeductibles\\tor\\tself-insured\\tretentions,\\tpolicy\\nlimitations\\tand\\texclusions,\\tand\\twe\\tcannot\\tbe\\tcertain\\tthat\\tour\\tinsurance\\tcoverage\\twill\\tbe\\tsufficient\\tto\\tcover\\tall\\tfuture\\tlosses\\tor\\tclaims\\tagainst\\tus.\\tA\\tloss\\nthat\\tis\\tuninsured\\tor\\twhich\\texceeds\\tpolicy\\tlimits\\tmay\\trequire\\tus\\tto\\tpay\\tsubstantial\\tamounts,\\twhich\\tmay\\tharm\\tour\\tfinancial\\tcondition\\tand\\toperating\\tresults.\\nOur\\tdebt\\tagreements\\tcontain\\tcovenant\\trestrictions\\tthat\\tmay\\tlimit\\tour\\tability\\tto\\toperate\\tour\\tbusiness.\\nThe\\tterms\\tof\\tcertain\\tof\\tour\\tdebt\\tfacilities\\tcontain,\\tand\\tany\\tof\\tour\\tother\\tfuture\\tdebt\\tagreements\\tmay\\tcontain,\\tcovenant\\trestrictions\\tthat\\tmay\\tlimit\\tour\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 24,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 14\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"ability\\tto\\toperate\\tour\\tbusiness,\\tincluding\\trestrictions\\ton\\tour\\tand/or\\tour\\tsubsidiaries’\\tability\\tto,\\tamong\\tother\\tthings,\\tincur\\tadditional\\tdebt\\tor\\tcreate\\tliens.\\tIn\\naddition,\\tunder\\tcertain\\tcircumstances\\twe\\tare\\trequired\\tto\\tmaintain\\ta\\tcertain\\tamount\\tof\\tliquidity.\\tAs\\ta\\tresult\\tof\\tthese\\tcovenants,\\tour\\tability\\tto\\trespond\\tto\\nchanges\\tin\\tbusiness\\tand\\teconomic\\tconditions\\tand\\tengage\\tin\\tbeneficial\\ttransactions,\\tincluding\\tto\\tobtain\\tadditional\\tfinancing\\tas\\tneeded,\\tmay\\tbe\\trestricted.\\nFurthermore,\\tour\\tfailure\\tto\\tcomply\\twith\\tour\\tdebt\\tcovenants\\tcould\\tresult\\tin\\ta\\tdefault\\tunder\\tour\\tdebt\\tagreements,\\twhich\\tcould\\tpermit\\tthe\\tholders\\tto\\naccelerate\\tour\\tobligation\\tto\\trepay\\tthe\\tdebt.\\tIf\\tany\\tof\\tour\\tdebt\\tis\\taccelerated,\\twe\\tmay\\tnot\\thave\\tsufficient\\tfunds\\tavailable\\tto\\trepay\\tit.\\nAdditional\\tfunds\\tmay\\tnot\\tbe\\tavailable\\tto\\tus\\twhen\\twe\\tneed\\tor\\twant\\tthem.\\nOur\\tbusiness\\tand\\tour\\tfuture\\tplans\\tfor\\texpansion\\tare\\tcapital-intensive,\\tand\\tthe\\tspecific\\ttiming\\tof\\tcash\\tinflows\\tand\\toutflows\\tmay\\tfluctuate\\nsubstantially\\tfrom\\tperiod\\tto\\tperiod.\\tWe\\tmay\\tneed\\tor\\twant\\tto\\traise\\tadditional\\tfunds\\tthrough\\tthe\\tissuance\\tof\\tequity,\\tequity-related\\tor\\tdebt\\tsecurities\\tor\\nthrough\\tobtaining\\tcredit\\tfrom\\tfinancial\\tinstitutions\\tto\\tfund,\\ttogether\\twith\\tour\\tprincipal\\tsources\\tof\\tliquidity,\\tthe\\tcosts\\tof\\tdeveloping\\tand\\tmanufacturing\\tour\\ncurrent\\tor\\tfuture\\tproducts,\\tto\\tpay\\tany\\tsignificant\\tunplanned\\tor\\taccelerated\\texpenses\\tor\\tfor\\tnew\\tsignificant\\tstrategic\\tinvestments,\\tor\\tto\\trefinance\\tour\\nsignificant\\tconsolidated\\tindebtedness,\\teven\\tif\\tnot\\trequired\\tto\\tdo\\tso\\tby\\tthe\\tterms\\tof\\tsuch\\tindebtedness.\\tWe\\tcannot\\tbe\\tcertain\\tthat\\tadditional\\tfunds\\twill\\tbe\\navailable\\tto\\tus\\ton\\tfavorable\\tterms\\twhen\\trequired,\\tor\\tat\\tall.\\tIf\\twe\\tcannot\\traise\\tadditional\\tfunds\\twhen\\twe\\tneed\\tthem,\\tour\\tfinancial\\tcondition,\\tresults\\tof\\noperations,\\tbusiness\\tand\\tprospects\\tcould\\tbe\\tmaterially\\tand\\tadversely\\taffected.\\nWe\\tmay\\tbe\\tnegatively\\timpacted\\tby\\tany\\tearly\\tobsolescence\\tof\\tour\\tmanufacturing\\tequipment.\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 24,\n        \"lines\": {\n          \"from\": 15,\n          \"to\": 28\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"We\\tdepreciate\\tthe\\tcost\\tof\\tour\\tmanufacturing\\tequipment\\tover\\ttheir\\texpected\\tuseful\\tlives.\\tHowever,\\tproduct\\tcycles\\tor\\tmanufacturing\\ttechnology\\tmay\\nchange\\tperiodically,\\tand\\twe\\tmay\\tdecide\\tto\\tupdate\\tour\\tproducts\\tor\\tmanufacturing\\tprocesses\\tmore\\tquickly\\tthan\\texpected.\\tMoreover,\\timprovements\\tin\\nengineering\\tand\\tmanufacturing\\texpertise\\tand\\tefficiency\\tmay\\tresult\\tin\\tour\\tability\\tto\\tmanufacture\\tour\\tproducts\\tusing\\tless\\tof\\tour\\tcurrently\\tinstalled\\nequipment.\\tAlternatively,\\tas\\twe\\tramp\\tand\\tmature\\tthe\\tproduction\\tof\\tour\\tproducts\\tto\\thigher\\tlevels,\\twe\\tmay\\tdiscontinue\\tthe\\tuse\\tof\\talready\\tinstalled\\nequipment\\tin\\tfavor\\tof\\tdifferent\\tor\\tadditional\\tequipment.\\tThe\\tuseful\\tlife\\tof\\tany\\tequipment\\tthat\\twould\\tbe\\tretired\\tearly\\tas\\ta\\tresult\\twould\\tbe\\tshortened,\\ncausing\\tthe\\tdepreciation\\ton\\tsuch\\tequipment\\tto\\tbe\\taccelerated,\\tand\\tour\\tresults\\tof\\toperations\\tmay\\tbe\\tharmed.\\nThere\\tis\\tno\\tguarantee\\tthat\\twe\\twill\\thave\\tsufficient\\tcash\\tflow\\tfrom\\tour\\tbusiness\\tto\\tpay\\tour\\tindebtedness\\tor\\tthat\\twe\\twill\\tnot\\tincur\\nadditional\\tindebtedness.\\nAs\\tof\\tDecember\\t31,\\t2023,\\twe\\tand\\tour\\tsubsidiaries\\thad\\toutstanding\\t$4.68\\tbillion\\tin\\taggregate\\tprincipal\\tamount\\tof\\tindebtedness\\t(see\\tNote\\t11,\\tDebt,\\nto\\tthe\\tconsolidated\\tfinancial\\tstatements\\tincluded\\telsewhere\\tin\\tthis\\tAnnual\\tReport\\ton\\tForm\\t10-K).\\tOur\\tconsolidated\\tindebtedness\\tmay\\tincrease\\tour\\nvulnerability\\tto\\tany\\tgenerally\\tadverse\\teconomic\\tand\\tindustry\\tconditions.\\tWe\\tand\\tour\\tsubsidiaries\\tmay,\\tsubject\\tto\\tthe\\tlimitations\\tin\\tthe\\tterms\\tof\\tour\\nexisting\\tand\\tfuture\\tindebtedness,\\tincur\\tadditional\\tdebt,\\tsecure\\texisting\\tor\\tfuture\\tdebt\\tor\\trecapitalize\\tour\\tdebt.\\n23\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 24,\n        \"lines\": {\n          \"from\": 29,\n          \"to\": 41\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Table\\tof\\tContents\\nOur\\tability\\tto\\tmake\\tscheduled\\tpayments\\tof\\tthe\\tprincipal\\tand\\tinterest\\ton\\tour\\tindebtedness\\twhen\\tdue,\\tto\\tmake\\tpayments\\tupon\\tconversion\\tor\\nrepurchase\\tdemands\\twith\\trespect\\tto\\tour\\tconvertible\\tsenior\\tnotes\\tor\\tto\\trefinance\\tour\\tindebtedness\\tas\\twe\\tmay\\tneed\\tor\\tdesire,\\tdepends\\ton\\tour\\tfuture\\nperformance,\\twhich\\tis\\tsubject\\tto\\teconomic,\\tfinancial,\\tcompetitive\\tand\\tother\\tfactors\\tbeyond\\tour\\tcontrol.\\tOur\\tbusiness\\tmay\\tnot\\tcontinue\\tto\\tgenerate\\tcash\\nflow\\tfrom\\toperations\\tin\\tthe\\tfuture\\tsufficient\\tto\\tsatisfy\\tour\\tobligations\\tunder\\tour\\texisting\\tindebtedness\\tand\\tany\\tfuture\\tindebtedness\\twe\\tmay\\tincur,\\tand\\tto\\nmake\\tnecessary\\tcapital\\texpenditures.\\tIf\\twe\\tare\\tunable\\tto\\tgenerate\\tsuch\\tcash\\tflow,\\twe\\tmay\\tbe\\trequired\\tto\\tadopt\\tone\\tor\\tmore\\talternatives,\\tsuch\\tas\\nreducing\\tor\\tdelaying\\tinvestments\\tor\\tcapital\\texpenditures,\\tselling\\tassets,\\trefinancing\\tor\\tobtaining\\tadditional\\tequity\\tcapital\\ton\\tterms\\tthat\\tmay\\tbe\\tonerous\\nor\\thighly\\tdilutive.\\tOur\\tability\\tto\\trefinance\\texisting\\tor\\tfuture\\tindebtedness\\twill\\tdepend\\ton\\tthe\\tcapital\\tmarkets\\tand\\tour\\tfinancial\\tcondition\\tat\\tsuch\\ttime.\\tIn\\naddition,\\tour\\tability\\tto\\tmake\\tpayments\\tmay\\tbe\\tlimited\\tby\\tlaw,\\tby\\tregulatory\\tauthority\\tor\\tby\\tagreements\\tgoverning\\tour\\tfuture\\tindebtedness.\\tWe\\tmay\\tnot\\nbe\\table\\tto\\tengage\\tin\\tthese\\tactivities\\ton\\tdesirable\\tterms\\tor\\tat\\tall,\\twhich\\tmay\\tresult\\tin\\ta\\tdefault\\ton\\tour\\texisting\\tor\\tfuture\\tindebtedness\\tand\\tharm\\tour\\nfinancial\\tcondition\\tand\\toperating\\tresults.\\nWe\\tare\\texposed\\tto\\tfluctuations\\tin\\tcurrency\\texchange\\trates.\\nWe\\ttransact\\tbusiness\\tglobally\\tin\\tmultiple\\tcurrencies\\tand\\thave\\tforeign\\tcurrency\\trisks\\trelated\\tto\\tour\\trevenue,\\tcosts\\tof\\trevenue,\\toperating\\texpenses\\nand\\tlocalized\\tsubsidiary\\tdebt\\tdenominated\\tin\\tcurrencies\\tother\\tthan\\tthe\\tU.S.\\tdollar.\\tTo\\tthe\\textent\\twe\\thave\\tsignificant\\trevenues\\tdenominated\\tin\\tsuch\\nforeign\\tcurrencies,\\tany\\tstrengthening\\tof\\tthe\\tU.S.\\tdollar\\twould\\ttend\\tto\\treduce\\tour\\trevenues\\tas\\tmeasured\\tin\\tU.S.\\tdollars,\\tas\\twe\\thave\\thistorically\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 25,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 15\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"experienced,\\tand\\tare\\tcurrently\\texperiencing.\\tIn\\taddition,\\ta\\tportion\\tof\\tour\\tcosts\\tand\\texpenses\\thave\\tbeen,\\tand\\twe\\tanticipate\\twill\\tcontinue\\tto\\tbe,\\ndenominated\\tin\\tforeign\\tcurrencies.\\tIf\\twe\\tdo\\tnot\\thave\\tfully\\toffsetting\\trevenues\\tin\\tthese\\tcurrencies\\tand\\tif\\tthe\\tvalue\\tof\\tthe\\tU.S.\\tdollar\\tdepreciates\\nsignificantly\\tagainst\\tthese\\tcurrencies,\\tour\\tcosts\\tas\\tmeasured\\tin\\tU.S.\\tdollars\\tas\\ta\\tpercent\\tof\\tour\\trevenues\\twill\\tcorrespondingly\\tincrease\\tand\\tour\\tmargins\\nwill\\tsuffer.\\tAs\\ta\\tresult,\\tour\\toperating\\tresults\\tmay\\tbe\\tharmed.\\nWe\\tmay\\tnot\\tbe\\table\\tto\\tadequately\\tprotect\\tor\\tdefend\\tourselves\\tagainst\\tintellectual\\tproperty\\tinfringement\\tclaims,\\twhich\\tmay\\tbe\\ntime-consuming\\tand\\texpensive,\\tor\\taffect\\tthe\\tfreedom\\tto\\toperate\\tour\\tbusiness.\\nOur\\tcompetitors\\tor\\tother\\tthird\\tparties\\tmay\\thold\\tor\\tobtain\\tpatents,\\tcopyrights,\\ttrademarks\\tor\\tother\\tproprietary\\trights\\tthat\\tcould\\tprevent,\\tlimit\\tor\\ninterfere\\twith\\tour\\tability\\tto\\tmake,\\tuse,\\tdevelop,\\tsell\\tor\\tmarket\\tour\\tproducts\\tand\\tservices,\\twhich\\tcould\\tmake\\tit\\tmore\\tdifficult\\tfor\\tus\\tto\\toperate\\tour\\tbusiness.\\nFrom\\ttime\\tto\\ttime,\\tthe\\tholders\\tof\\tsuch\\tintellectual\\tproperty\\trights\\tmay\\tassert\\ttheir\\trights\\tand\\turge\\tus\\tto\\ttake\\tlicenses\\tand/or\\tmay\\tbring\\tsuits\\talleging\\ninfringement\\tor\\tmisappropriation\\tof\\tsuch\\trights,\\twhich\\tcould\\tresult\\tin\\tsubstantial\\tcosts,\\tnegative\\tpublicity\\tand\\tmanagement\\tattention,\\tregardless\\tof\\tmerit.\\nIn\\taddition,\\tthe\\teffective\\tprotection\\tfor\\tour\\tbrands,\\ttechnologies,\\tand\\tproprietary\\tinformation\\tmay\\tbe\\tlimited\\tor\\tunavailable\\tin\\tcertain\\tcountries,\\nmaking\\tit\\tdifficult\\tto\\tprotect\\tour\\tintellectual\\tproperty\\tfrom\\tmisappropriation\\tor\\tinfringement.\\tAlthough\\twe\\tmake\\treasonable\\tefforts\\tto\\tmaintain\\tthe\\nconfidentiality\\tof\\tour\\tproprietary\\tinformation,\\twe\\tcannot\\tguarantee\\tthat\\tthese\\tactions\\twill\\tdeter\\tor\\tprevent\\tmisappropriation\\tof\\tour\\tintellectual\\tproperty.\\nThe\\ttheft\\tor\\tunauthorized\\tuse\\tor\\tpublication\\tof\\tour\\ttrade\\tsecrets\\tand\\tconfidential\\tinformation\\tcould\\taffect\\tour\\tcompetitive\\tposition.\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 25,\n        \"lines\": {\n          \"from\": 16,\n          \"to\": 29\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"While\\twe\\tendeavor\\tto\\tobtain\\tand\\tprotect\\tthe\\tintellectual\\tproperty\\trights\\tthat\\twe\\texpect\\twill\\tallow\\tus\\tto\\tretain\\tor\\tadvance\\tour\\tstrategic\\tinitiatives\\tin\\nthese\\tcircumstances,\\tthere\\tcan\\tbe\\tno\\tassurance\\tthat\\twe\\twill\\tbe\\table\\tto\\tadequately\\tidentify\\tand\\tprotect\\tthe\\tportions\\tof\\tintellectual\\tproperty\\tthat\\tare\\nstrategic\\tto\\tour\\tbusiness,\\tor\\tmitigate\\tthe\\trisk\\tof\\tpotential\\tsuits\\tor\\tother\\tlegal\\tdemands\\tby\\tthird\\tparties.\\tAccordingly,\\twe\\tmay\\tconsider\\tthe\\tentering\\tinto\\nlicensing\\tagreements\\twith\\trespect\\tto\\tsuch\\trights,\\talthough\\tno\\tassurance\\tcan\\tbe\\tgiven\\tthat\\tsuch\\tlicenses\\tcan\\tbe\\tobtained\\ton\\tacceptable\\tterms\\tor\\tthat\\nlitigation\\twill\\tnot\\toccur,\\tand\\tsuch\\tlicenses\\tand\\tassociated\\tlitigation\\tcould\\tsignificantly\\tincrease\\tour\\toperating\\texpenses.\\tFurther,\\tif\\twe\\tare\\tdetermined\\tto\\nhave\\tor\\tbelieve\\tthere\\tis\\ta\\thigh\\tlikelihood\\tthat\\twe\\thave\\tinfringed\\tupon\\ta\\tthird\\tparty’s\\tintellectual\\tproperty\\trights,\\twe\\tmay\\tbe\\trequired\\tto\\tcease\\tmaking,\\nselling\\tor\\tincorporating\\tcertain\\tcomponents\\tor\\tintellectual\\tproperty\\tinto\\tthe\\tgoods\\tand\\tservices\\twe\\toffer,\\tto\\tpay\\tsubstantial\\tdamages\\tand/or\\tlicense\\nroyalties,\\tto\\tredesign\\tour\\tproducts\\tand\\tservices\\tand/or\\tto\\testablish\\tand\\tmaintain\\talternative\\tbranding\\tfor\\tour\\tproducts\\tand\\tservices.\\tIn\\tthe\\tevent\\tthat\\twe\\nare\\trequired\\tto\\ttake\\tone\\tor\\tmore\\tsuch\\tactions,\\tour\\tbrand,\\tbusiness,\\tfinancial\\tcondition\\tand\\toperating\\tresults\\tmay\\tbe\\tharmed.\\nIncreased\\tscrutiny\\tand\\tchanging\\texpectations\\tfrom\\tstakeholders\\twith\\trespect\\tto\\tthe\\tCompany’s\\tESG\\tpractices\\tmay\\tresult\\tin\\nadditional\\tcosts\\tor\\trisks.\\nCompanies\\tacross\\tmany\\tindustries\\tare\\tfacing\\tincreasing\\tscrutiny\\trelated\\tto\\ttheir\\tenvironmental,\\tsocial\\tand\\tgovernance\\t(ESG)\\tpractices.\\tInvestor\\nadvocacy\\tgroups,\\tcertain\\tinstitutional\\tinvestors,\\tinvestment\\tfunds\\tand\\tother\\tinfluential\\tinvestors\\tare\\talso\\tincreasingly\\tfocused\\ton\\tESG\\tpractices\\tand\\tin\\nrecent\\tyears\\thave\\tplaced\\tincreasing\\timportance\\ton\\tthe\\tnon-financial\\timpacts\\tof\\ttheir\\tinvestments.\\tWhile\\tour\\tmission\\tis\\tto\\taccelerate\\tthe\\tworld’s\\ttransition\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 25,\n        \"lines\": {\n          \"from\": 30,\n          \"to\": 43\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"to\\tsustainable\\tenergy,\\tif\\tour\\tESG\\tpractices\\tdo\\tnot\\tmeet\\tinvestor\\tor\\tother\\tindustry\\tstakeholder\\texpectations,\\twhich\\tcontinue\\tto\\tevolve,\\twe\\tmay\\tincur\\nadditional\\tcosts\\tand\\tour\\tbrand,\\tability\\tto\\tattract\\tand\\tretain\\tqualified\\temployees\\tand\\tbusiness\\tmay\\tbe\\tharmed.\\n24\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 25,\n        \"lines\": {\n          \"from\": 44,\n          \"to\": 46\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Table\\tof\\tContents\\nOur\\toperations\\tcould\\tbe\\tadversely\\taffected\\tby\\tevents\\toutside\\tof\\tour\\tcontrol,\\tsuch\\tas\\tnatural\\tdisasters,\\twars\\tor\\thealth\\tepidemics.\\nWe\\tmay\\tbe\\timpacted\\tby\\tnatural\\tdisasters,\\twars,\\thealth\\tepidemics,\\tweather\\tconditions,\\tthe\\tlong-term\\teffects\\tof\\tclimate\\tchange,\\tpower\\toutages\\tor\\nother\\tevents\\toutside\\tof\\tour\\tcontrol.\\tFor\\texample,\\tour\\tFremont\\tFactory\\tand\\tGigafactory\\tNevada\\tare\\tlocated\\tin\\tseismically\\tactive\\tregions\\tin\\tNorthern\\nCalifornia\\tand\\tNevada,\\tand\\tour\\tGigafactory\\tShanghai\\tis\\tlocated\\tin\\ta\\tflood-prone\\tarea.\\tMoreover,\\tthe\\tarea\\tin\\twhich\\tour\\tGigafactory\\tTexas\\tis\\tlocated\\nexperienced\\tsevere\\twinter\\tstorms\\tin\\tthe\\tfirst\\tquarter\\tof\\t2021\\tthat\\thad\\ta\\twidespread\\timpact\\ton\\tutilities\\tand\\ttransportation.\\tIf\\tmajor\\tdisasters\\tsuch\\tas\\nearthquakes,\\tfloods\\tor\\tother\\tclimate-related\\tevents\\toccur,\\tor\\tour\\tinformation\\tsystem\\tor\\tcommunication\\tbreaks\\tdown\\tor\\toperates\\timproperly,\\tour\\nheadquarters\\tand\\tproduction\\tfacilities\\tmay\\tbe\\tseriously\\tdamaged,\\tor\\twe\\tmay\\thave\\tto\\tstop\\tor\\tdelay\\tproduction\\tand\\tshipment\\tof\\tour\\tproducts.\\tIn\\taddition,\\nthe\\tglobal\\tCOVID-19\\tpandemic\\thas\\timpacted\\teconomic\\tmarkets,\\tmanufacturing\\toperations,\\tsupply\\tchains,\\temployment\\tand\\tconsumer\\tbehavior\\tin\\tnearly\\nevery\\tgeographic\\tregion\\tand\\tindustry\\tacross\\tthe\\tworld,\\tand\\twe\\thave\\tbeen,\\tand\\tmay\\tin\\tthe\\tfuture\\tbe,\\tadversely\\taffected\\tas\\ta\\tresult.\\tAlso,\\tthe\\tbroader\\nconsequences\\tin\\tthe\\tcurrent\\tconflict\\tbetween\\tRussia\\tand\\tUkraine,\\twhich\\tmay\\tinclude\\tfurther\\tembargoes,\\tregional\\tinstability\\tand\\tgeopolitical\\tshifts;\\nairspace\\tbans\\trelating\\tto\\tcertain\\troutes,\\tor\\tstrategic\\tdecisions\\tto\\talter\\tcertain\\troutes;\\tand\\tpotential\\tretaliatory\\taction\\tby\\tthe\\tRussian\\tgovernment\\tagainst\\ncompanies,\\tand\\tthe\\textent\\tof\\tthe\\tconflict\\ton\\tour\\tbusiness\\tand\\toperating\\tresults\\tcannot\\tbe\\tpredicted.\\tWe\\tmay\\tincur\\texpenses\\tor\\tdelays\\trelating\\tto\\tsuch\\nevents\\toutside\\tof\\tour\\tcontrol,\\twhich\\tcould\\thave\\ta\\tmaterial\\tadverse\\timpact\\ton\\tour\\tbusiness,\\toperating\\tresults\\tand\\tfinancial\\tcondition.\\nRisks\\tRelated\\tto\\tGovernment\\tLaws\\tand\\tRegulations\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 26,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 15\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Risks\\tRelated\\tto\\tGovernment\\tLaws\\tand\\tRegulations\\nDemand\\tfor\\tour\\tproducts\\tand\\tservices\\tmay\\tbe\\timpacted\\tby\\tthe\\tstatus\\tof\\tgovernment\\tand\\teconomic\\tincentives\\tsupporting\\tthe\\ndevelopment\\tand\\tadoption\\tof\\tsuch\\tproducts.\\nGovernment\\tand\\teconomic\\tincentives\\tthat\\tsupport\\tthe\\tdevelopment\\tand\\tadoption\\tof\\telectric\\tvehicles\\tin\\tthe\\tU.S.\\tand\\tabroad,\\tincluding\\tcertain\\ttax\\nexemptions,\\ttax\\tcredits\\tand\\trebates,\\tmay\\tbe\\treduced,\\teliminated,\\tamended\\tor\\texhausted\\tfrom\\ttime\\tto\\ttime.\\tFor\\texample,\\tpreviously\\tavailable\\tincentives\\nfavoring\\telectric\\tvehicles\\tin\\tcertain\\tareas\\thave\\texpired\\tor\\twere\\tcancelled\\tor\\ttemporarily\\tunavailable,\\tand\\tin\\tsome\\tcases\\twere\\tnot\\teventually\\treplaced\\tor\\nreinstituted,\\twhich\\tmay\\thave\\tnegatively\\timpacted\\tsales.\\tIn\\taddition,\\tcertain\\tgovernment\\tand\\teconomic\\tincentives\\tmay\\talso\\tbe\\timplemented\\tor\\tamended\\nto\\tprovide\\tbenefits\\tto\\tmanufacturers\\twho\\tassemble\\tdomestically,\\thave\\tlocal\\tsuppliers\\tor\\thave\\tother\\tcharacteristics\\tthat\\tmay\\tnot\\tapply\\tto\\tTesla.\\tSuch\\ndevelopments\\tcould\\tnegatively\\timpact\\tdemand\\tfor\\tour\\tvehicles,\\tand\\twe\\tand\\tour\\tcustomers\\tmay\\thave\\tto\\tadjust\\tto\\tthem,\\tincluding\\tthrough\\tpricing\\nmodifications.\\nIn\\taddition,\\tcertain\\tgovernmental\\trebates,\\ttax\\tcredits\\tand\\tother\\tfinancial\\tincentives\\tthat\\tare\\tcurrently\\tavailable\\twith\\trespect\\tto\\tour\\tsolar\\tand\\tenergy\\nstorage\\tproduct\\tbusinesses\\tallow\\tus\\tto\\tlower\\tour\\tcosts\\tand\\tencourage\\tcustomers\\tto\\tbuy\\tour\\tproducts\\tand\\tinvestors\\tto\\tinvest\\tin\\tour\\tsolar\\tfinancing\\tfunds.\\nHowever,\\tthese\\tincentives\\tmay\\texpire\\twhen\\tthe\\tallocated\\tfunding\\tis\\texhausted,\\treduced\\tor\\tterminated\\tas\\trenewable\\tenergy\\tadoption\\trates\\tincrease,\\nsometimes\\twithout\\twarning.\\tLikewise,\\tin\\tjurisdictions\\twhere\\tnet\\tmetering\\tis\\tcurrently\\tavailable,\\tour\\tcustomers\\treceive\\tbill\\tcredits\\tfrom\\tutilities\\tfor\\tenergy\\nthat\\ttheir\\tsolar\\tenergy\\tsystems\\tgenerate\\tand\\texport\\tto\\tthe\\tgrid\\tin\\texcess\\tof\\tthe\\telectric\\tload\\tthey\\tuse.\\tThe\\tbenefit\\tavailable\\tunder\\tnet\\tmetering\\thas\\tbeen\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 26,\n        \"lines\": {\n          \"from\": 15,\n          \"to\": 29\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"or\\thas\\tbeen\\tproposed\\tto\\tbe\\treduced,\\taltered\\tor\\teliminated\\tin\\tseveral\\tjurisdictions,\\tand\\thas\\talso\\tbeen\\tcontested\\tand\\tmay\\tcontinue\\tto\\tbe\\tcontested\\tbefore\\nthe\\tFederal\\tEnergy\\tRegulatory\\tCommission.\\tAny\\treductions\\tor\\tterminations\\tof\\tsuch\\tincentives\\tmay\\tharm\\tour\\tbusiness,\\tprospects,\\tfinancial\\tcondition\\tand\\noperating\\tresults\\tby\\tmaking\\tour\\tproducts\\tless\\tcompetitive\\tfor\\tcustomers,\\tincreasing\\tour\\tcost\\tof\\tcapital\\tand\\tadversely\\timpacting\\tour\\tability\\tto\\tattract\\ninvestment\\tpartners\\tand\\tto\\tform\\tnew\\tfinancing\\tfunds\\tfor\\tour\\tsolar\\tand\\tenergy\\tstorage\\tassets.\\nFinally,\\twe\\tand\\tour\\tfund\\tinvestors\\tclaim\\tthese\\tU.S.\\tfederal\\ttax\\tcredits\\tand\\tcertain\\tstate\\tincentives\\tin\\tamounts\\tbased\\ton\\tindependently\\tappraised\\tfair\\nmarket\\tvalues\\tof\\tour\\tsolar\\tand\\tenergy\\tstorage\\tsystems.\\tSome\\tgovernmental\\tauthorities\\thave\\taudited\\tsuch\\tvalues\\tand\\tin\\tcertain\\tcases\\thave\\tdetermined\\nthat\\tthese\\tvalues\\tshould\\tbe\\tlower,\\tand\\tthey\\tmay\\tdo\\tso\\tagain\\tin\\tthe\\tfuture.\\tSuch\\tdeterminations\\tmay\\tresult\\tin\\tadverse\\ttax\\tconsequences\\tand/or\\tour\\nobligation\\tto\\tmake\\tindemnification\\tor\\tother\\tpayments\\tto\\tour\\tfunds\\tor\\tfund\\tinvestors.\\nWe\\tare\\tsubject\\tto\\tevolving\\tlaws\\tand\\tregulations\\tthat\\tcould\\timpose\\tsubstantial\\tcosts,\\tlegal\\tprohibitions\\tor\\tunfavorable\\tchanges\\nupon\\tour\\toperations\\tor\\tproducts.\\nAs\\twe\\tgrow\\tour\\tmanufacturing\\toperations\\tin\\tadditional\\tregions,\\twe\\tare\\tor\\twill\\tbe\\tsubject\\tto\\tcomplex\\tenvironmental,\\tmanufacturing,\\thealth\\tand\\nsafety\\tlaws\\tand\\tregulations\\tat\\tnumerous\\tjurisdictional\\tlevels\\tin\\tthe\\tU.S.,\\tChina,\\tGermany\\tand\\tother\\tlocations\\tabroad,\\tincluding\\tlaws\\trelating\\tto\\tthe\\tuse,\\nhandling,\\tstorage,\\trecycling,\\tdisposal\\tand/or\\thuman\\texposure\\tto\\thazardous\\tmaterials,\\tproduct\\tmaterial\\tinputs\\tand\\tpost-consumer\\tproducts\\tand\\twith\\nrespect\\tto\\tconstructing,\\texpanding\\tand\\tmaintaining\\tour\\tfacilities.\\tNew,\\tor\\tchanges\\tin,\\tenvironmental\\tand\\tclimate\\tchange\\tlaws,\\tregulations\\tor\\trules\\tcould\\nalso\\tlead\\tto\\tincreased\\tcosts\\tof\\tcompliance,\\tincluding\\tremediations\\tof\\tany\\tdiscovered\\tissues,\\tand\\tchanges\\tto\\tour\\toperations,\\twhich\\tmay\\tbe\\tsignificant,\\tand\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 26,\n        \"lines\": {\n          \"from\": 30,\n          \"to\": 44\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"any\\tfailures\\tto\\tcomply\\tcould\\tresult\\tin\\tsignificant\\texpenses,\\tdelays\\tor\\tfines.\\tIn\\taddition,\\tas\\twe\\thave\\n25\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 26,\n        \"lines\": {\n          \"from\": 45,\n          \"to\": 46\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Table\\tof\\tContents\\nincreased\\tour\\temployee\\theadcount\\tand\\toperations,\\twe\\tare\\tand\\tmay\\tcontinue\\tto\\tbe\\tsubject\\tto\\tincreased\\tscrutiny,\\tincluding\\tlitigation\\tand\\tgovernment\\ninvestigations,\\tthat\\twe\\twill\\tneed\\tto\\tdefend\\tagainst.\\tIf\\twe\\tare\\tunable\\tto\\tsuccessfully\\tdefend\\tourselves\\tin\\tsuch\\tlitigation\\tor\\tgovernment\\tinvestigations,\\tit\\nmay\\tharm\\tour\\tbrand,\\tability\\tto\\tattract\\tand\\tretain\\tqualified\\temployees,\\tbusiness\\tand\\tfinancial\\tcondition.\\tWe\\tare\\talso\\tsubject\\tto\\tlaws\\tand\\tregulations\\napplicable\\tto\\tthe\\tsupply,\\tmanufacture,\\timport,\\tsale,\\tservice\\tand\\tperformance\\tof\\tour\\tproducts\\tboth\\tdomestically\\tand\\tabroad.\\tFor\\texample,\\tin\\tcountries\\noutside\\tof\\tthe\\tU.S.,\\twe\\tare\\trequired\\tto\\tmeet\\tstandards\\trelating\\tto\\tvehicle\\tsafety,\\tfuel\\teconomy\\tand\\temissions\\tthat\\tare\\toften\\tmaterially\\tdifferent\\tfrom\\nequivalent\\trequirements\\tin\\tthe\\tU.S.,\\tthus\\tresulting\\tin\\tadditional\\tinvestment\\tinto\\tthe\\tvehicles\\tand\\tsystems\\tto\\tensure\\tregulatory\\tcompliance\\tin\\tall\\tcountries.\\nThis\\tprocess\\tmay\\tinclude\\tofficial\\treview\\tand\\tcertification\\tof\\tour\\tvehicles\\tby\\tforeign\\tregulatory\\tagencies\\tprior\\tto\\tmarket\\tentry,\\tas\\twell\\tas\\tcompliance\\twith\\nforeign\\treporting\\tand\\trecall\\tmanagement\\tsystems\\trequirements.\\nIn\\tparticular,\\twe\\toffer\\tin\\tour\\tvehicles\\tin\\tcertain\\tmarkets\\tAutopilot\\tand\\tFSD\\tCapability\\tfeatures\\tthat\\ttoday\\tassist\\tdrivers\\twith\\tcertain\\ttedious\\tand\\npotentially\\tdangerous\\taspects\\tof\\troad\\ttravel,\\tbut\\twhich\\tcurrently\\trequire\\tdrivers\\tto\\tremain\\tfully\\tengaged\\tin\\tthe\\tdriving\\toperation.\\tWe\\tare\\tcontinuing\\tto\\ndevelop\\tour\\tAutopilot\\tand\\tFSD\\tCapability\\ttechnology.\\tThere\\tare\\ta\\tvariety\\tof\\tinternational,\\tfederal\\tand\\tstate\\tregulations\\tthat\\tmay\\tapply\\tto,\\tand\\tmay\\nadversely\\taffect,\\tthe\\tdesign\\tand\\tperformance,\\tsale,\\tmarketing,\\tregistration\\tand\\toperation\\tof\\tAutopilot\\tand\\tFSD\\tCapability,\\tand\\tfuture\\tcapability,\\tincluding\\nfull\\tself-driving\\tvehicles\\tthat\\tmay\\tnot\\tbe\\toperated\\tby\\ta\\thuman\\tdriver.\\tThis\\tincludes\\tmany\\texisting\\tvehicle\\tstandards\\tthat\\twere\\tnot\\toriginally\\tintended\\tto\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 27,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 14\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"apply\\tto\\tvehicles\\tthat\\tmay\\tnot\\tbe\\toperated\\tby\\ta\\thuman\\tdriver.\\tSuch\\tregulations\\tcontinue\\tto\\trapidly\\tchange,\\twhich\\tincreases\\tthe\\tlikelihood\\tof\\ta\\tpatchwork\\nof\\tcomplex\\tor\\tconflicting\\tregulations,\\tor\\tmay\\tdelay,\\trestrict\\tor\\tprohibit\\tthe\\tavailability\\tof\\tcertain\\tfunctionalities\\tand\\tvehicle\\tdesigns,\\twhich\\tcould\\tadversely\\naffect\\tour\\tbusiness.\\nFinally,\\tas\\ta\\tmanufacturer,\\tinstaller\\tand\\tservice\\tprovider\\twith\\trespect\\tto\\tsolar\\tgeneration\\tand\\tenergy\\tstorage\\tsystems,\\ta\\tsupplier\\tof\\telectricity\\ngenerated\\tand\\tstored\\tby\\tcertain\\tof\\tthe\\tsolar\\tenergy\\tand\\tenergy\\tstorage\\tsystems\\twe\\tinstall\\tfor\\tcustomers,\\tand\\ta\\tprovider\\tof\\tgrid\\tservices\\tthrough\\tvirtual\\npower\\tplant\\tmodels,\\twe\\tare\\timpacted\\tby\\tfederal,\\tstate\\tand\\tlocal\\tregulations\\tand\\tpolicies\\tconcerning\\tthe\\timport\\tor\\texport\\tof\\tcomponents,\\telectricity\\npricing,\\tthe\\tinterconnection\\tof\\telectricity\\tgeneration\\tand\\tstorage\\tequipment\\twith\\tthe\\telectrical\\tgrid\\tand\\tthe\\tsale\\tof\\telectricity\\tgenerated\\tby\\tthird\\tparty-\\nowned\\tsystems.\\tIf\\tregulations\\tand\\tpolicies\\tare\\tintroduced\\tthat\\tadversely\\timpact\\tthe\\timport\\tor\\texport\\tof\\tcomponents,\\tor\\tthe\\tinterconnection,\\tmaintenance\\nor\\tuse\\tof\\tour\\tsolar\\tand\\tenergy\\tstorage\\tsystems,\\tthey\\tcould\\tdeter\\tpotential\\tcustomers\\tfrom\\tpurchasing\\tour\\tsolar\\tand\\tenergy\\tstorage\\tproducts\\tand\\nservices,\\tthreaten\\tthe\\teconomics\\tof\\tour\\texisting\\tcontracts\\tand\\tcause\\tus\\tto\\tcease\\tsolar\\tand\\tenergy\\tstorage\\tsystem\\tsales\\tand\\tservices\\tin\\tthe\\trelevant\\njurisdictions,\\twhich\\tmay\\tharm\\tour\\tbusiness,\\tfinancial\\tcondition\\tand\\toperating\\tresults.\\nAny\\tfailure\\tby\\tus\\tto\\tcomply\\twith\\ta\\tvariety\\tof\\tU.S.\\tand\\tinternational\\tprivacy\\tand\\tconsumer\\tprotection\\tlaws\\tmay\\tharm\\tus.\\nAny\\tfailure\\tby\\tus\\tor\\tour\\tvendors\\tor\\tother\\tbusiness\\tpartners\\tto\\tcomply\\twith\\tour\\tpublic\\tprivacy\\tnotice\\tor\\twith\\tfederal,\\tstate\\tor\\tinternational\\tprivacy,\\ndata\\tprotection\\tor\\tsecurity\\tlaws\\tor\\tregulations\\trelating\\tto\\tthe\\tprocessing,\\tcollection,\\tuse,\\tretention,\\tsecurity\\tand\\ttransfer\\tof\\tpersonally\\tidentifiable\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 27,\n        \"lines\": {\n          \"from\": 15,\n          \"to\": 28\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"information\\tcould\\tresult\\tin\\tregulatory\\tor\\tlitigation-related\\tactions\\tagainst\\tus,\\tlegal\\tliability,\\tfines,\\tdamages,\\tongoing\\taudit\\trequirements\\tand\\tother\\nsignificant\\tcosts.\\tSubstantial\\texpenses\\tand\\toperational\\tchanges\\tmay\\tbe\\trequired\\tin\\tconnection\\twith\\tmaintaining\\tcompliance\\twith\\tsuch\\tlaws,\\tand\\teven\\tan\\nunsuccessful\\tchallenge\\tby\\tcustomers\\tor\\tregulatory\\tauthorities\\tof\\tour\\tactivities\\tcould\\tresult\\tin\\tadverse\\tpublicity\\tand\\tcould\\trequire\\ta\\tcostly\\tresponse\\tfrom\\nand\\tdefense\\tby\\tus.\\tIn\\taddition,\\tcertain\\tprivacy\\tlaws\\tare\\tstill\\tsubject\\tto\\ta\\thigh\\tdegree\\tof\\tuncertainty\\tas\\tto\\ttheir\\tinterpretation,\\tapplication\\tand\\timpact,\\tand\\nmay\\trequire\\textensive\\tsystem\\tand\\toperational\\tchanges,\\tbe\\tdifficult\\tto\\timplement,\\tincrease\\tour\\toperating\\tcosts,\\tadversely\\timpact\\tthe\\tcost\\tor\\nattractiveness\\tof\\tthe\\tproducts\\tor\\tservices\\twe\\toffer,\\tor\\tresult\\tin\\tadverse\\tpublicity\\tand\\tharm\\tour\\treputation.\\tFor\\texample,\\tthe\\tGeneral\\tData\\tProtection\\nRegulation\\tapplies\\tto\\tthe\\tprocessing\\tof\\tpersonal\\tinformation\\tcollected\\tfrom\\tindividuals\\tlocated\\tin\\tthe\\tEuropean\\tUnion\\trequiring\\tcertain\\tdata\\tprotection\\nmeasures\\twhen\\thandling,\\twith\\ta\\tsignificant\\trisk\\tof\\tfines\\tfor\\tnoncompliance.\\tSimilarly,\\tour\\tNorth\\tAmerican\\toperations\\tare\\tsubject\\tto\\tcomplex\\tand\\tchanging\\nfederal\\tand\\tUS\\tstate-specific\\tdata\\tprivacy\\tlaws\\tand\\tregulations,\\tsuch\\tas\\tthe\\tCalifornia\\tConsumer\\tPrivacy\\tAct\\twhich\\timposes\\tcertain\\tlegal\\tobligations\\ton\\nour\\tuse\\tand\\tprocessing\\tof\\tpersonal\\tinformation\\trelated\\tto\\tCalifornia\\tresidents.\\tFinally,\\tadditional\\tprivacy\\tand\\tcybersecurity\\tlaws\\thave\\tcome\\tinto\\teffect\\tin\\nChina.\\nThese\\tlaws\\tcontinue\\tto\\tdevelop\\tand\\tmay\\tbe\\tinconsistent\\tfrom\\tjurisdiction\\tto\\tjurisdiction.\\tComplying\\twith\\temerging\\tand\\tchanging\\trequirements\\tmay\\ncause\\tus\\tto\\tincur\\tsubstantial\\tcosts\\tand\\tmake\\tenhancements\\tto\\trelevant\\tdata\\tpractices.\\tNoncompliance\\tcould\\tresult\\tin\\tsignificant\\tpenalties\\tor\\tlegal\\nliability.\\nIn\\taddition\\tto\\tthe\\trisks\\trelated\\tto\\tgeneral\\tprivacy\\tregulation,\\twe\\tmay\\talso\\tbe\\tsubject\\tto\\tspecific\\tvehicle\\tmanufacturer\\tobligations\\trelating\\tto\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 27,\n        \"lines\": {\n          \"from\": 29,\n          \"to\": 43\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"cybersecurity,\\tdata\\tprivacy\\tand\\tdata\\tlocalization\\trequirements\\twhich\\tplace\\tadditional\\trisks\\tto\\tour\\tinternational\\toperations.\\tRisks\\tand\\tpenalties\\tcould\\ninclude\\tongoing\\taudit\\trequirements,\\tdata\\tprotection\\n26\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 27,\n        \"lines\": {\n          \"from\": 44,\n          \"to\": 46\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Table\\tof\\tContents\\nauthority\\tinvestigations,\\tlegal\\tproceedings\\tby\\tinternational\\tgovernmental\\tentities\\tor\\tothers\\tresulting\\tin\\tmandated\\tdisclosure\\tof\\tsensitive\\tdata\\tor\\tother\\ncommercially\\tunfavorable\\tterms.\\tNotwithstanding\\tour\\tefforts\\tto\\tprotect\\tthe\\tsecurity\\tand\\tintegrity\\tof\\tour\\tcustomers’\\tpersonal\\tinformation,\\twe\\tmay\\tbe\\nrequired\\tto\\texpend\\tsignificant\\tresources\\tto\\tcomply\\twith\\tdata\\tbreach\\trequirements\\tif,\\tfor\\texample,\\tthird\\tparties\\timproperly\\tobtain\\tand\\tuse\\tthe\\tpersonal\\ninformation\\tof\\tour\\tcustomers\\tor\\twe\\totherwise\\texperience\\ta\\tdata\\tloss\\twith\\trespect\\tto\\tthe\\tpersonal\\tinformation\\twe\\tprocess\\tand\\thandle.\\tA\\tmajor\\tbreach\\tof\\nour\\tnetwork\\tsecurity\\tand\\tsystems\\tmay\\toccur\\tdespite\\tdefensive\\tmeasures,\\tand\\tmay\\tresult\\tin\\tfines,\\tpenalties\\tand\\tdamages\\tand\\tharm\\tour\\tbrand,\\tprospects\\nand\\toperating\\tresults.\\nWe\\tcould\\tbe\\tsubject\\tto\\tliability,\\tpenalties\\tand\\tother\\trestrictive\\tsanctions\\tand\\tadverse\\tconsequences\\tarising\\tout\\tof\\tcertain\\ngovernmental\\tinvestigations\\tand\\tproceedings.\\nWe\\tare\\tcooperating\\twith\\tcertain\\tgovernment\\tinvestigations\\tas\\tdiscussed\\tin\\tNote\\t15,\\tCommitments\\tand\\tContingencies,\\tto\\tthe\\tconsolidated\\tfinancial\\nstatements\\tincluded\\telsewhere\\tin\\tthis\\tAnnual\\tReport\\ton\\tForm\\t10-K.\\tTo\\tour\\tknowledge,\\tno\\tgovernment\\tagency\\tin\\tany\\tsuch\\tongoing\\tinvestigation\\thas\\nconcluded\\tthat\\tany\\twrongdoing\\toccurred.\\tHowever,\\twe\\tcannot\\tpredict\\tthe\\toutcome\\tor\\timpact\\tof\\tany\\tsuch\\tongoing\\tmatters,\\tand\\tthere\\texists\\tthe\\tpossibility\\nthat\\twe\\tcould\\tbe\\tsubject\\tto\\tliability,\\tpenalties\\tand\\tother\\trestrictive\\tsanctions\\tand\\tadverse\\tconsequences\\tif\\tthe\\tSEC,\\tthe\\tU.S.\\tDepartment\\tof\\tJustice\\tor\\tany\\nother\\tgovernment\\tagency\\twere\\tto\\tpursue\\tlegal\\taction\\tin\\tthe\\tfuture.\\tMoreover,\\twe\\texpect\\tto\\tincur\\tcosts\\tin\\tresponding\\tto\\trelated\\trequests\\tfor\\tinformation\\nand\\tsubpoenas,\\tand\\tif\\tinstituted,\\tin\\tdefending\\tagainst\\tany\\tgovernmental\\tproceedings.\\nWe\\tmay\\tface\\tregulatory\\tchallenges\\tto\\tor\\tlimitations\\ton\\tour\\tability\\tto\\tsell\\tvehicles\\tdirectly.\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 28,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 16\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"While\\twe\\tintend\\tto\\tcontinue\\tto\\tleverage\\tour\\tmost\\teffective\\tsales\\tstrategies,\\tincluding\\tsales\\tthrough\\tour\\twebsite,\\twe\\tmay\\tnot\\tbe\\table\\tto\\tsell\\tour\\nvehicles\\tthrough\\tour\\town\\tstores\\tin\\tcertain\\tstates\\tin\\tthe\\tU.S.\\twith\\tlaws\\tthat\\tmay\\tbe\\tinterpreted\\tto\\timpose\\tlimitations\\ton\\tthis\\tdirect-to-consumer\\tsales\\nmodel.\\tIt\\thas\\talso\\tbeen\\tasserted\\tthat\\tthe\\tlaws\\tin\\tsome\\tstates\\tlimit\\tour\\tability\\tto\\tobtain\\tdealer\\tlicenses\\tfrom\\tstate\\tmotor\\tvehicle\\tregulators,\\tand\\tsuch\\nassertions\\tpersist.\\tIn\\tcertain\\tlocations,\\tdecisions\\tby\\tregulators\\tpermitting\\tus\\tto\\tsell\\tvehicles\\thave\\tbeen,\\tand\\tmay\\tbe,\\tchallenged\\tby\\tdealer\\tassociations\\nand\\tothers\\tas\\tto\\twhether\\tsuch\\tdecisions\\tcomply\\twith\\tapplicable\\tstate\\tmotor\\tvehicle\\tindustry\\tlaws.\\tWe\\thave\\tprevailed\\tin\\tmany\\tof\\tthese\\tlawsuits\\tand\\tsuch\\nresults\\thave\\treinforced\\tour\\tcontinuing\\tbelief\\tthat\\tstate\\tfranchise\\tlaws\\twere\\tnot\\tintended\\tto\\tapply\\tto\\ta\\tmanufacturer\\tthat\\tdoes\\tnot\\thave\\tfranchise\\tdealers\\nanywhere\\tin\\tthe\\tworld.\\tIn\\tsome\\tstates,\\tthere\\thave\\talso\\tbeen\\tregulatory\\tand\\tlegislative\\tefforts\\tby\\tdealer\\tassociations\\tto\\tpropose\\tlaws\\tthat,\\tif\\tenacted,\\nwould\\tprevent\\tus\\tfrom\\tobtaining\\tdealer\\tlicenses\\tin\\ttheir\\tstates\\tgiven\\tour\\tcurrent\\tsales\\tmodel.\\tA\\tfew\\tstates\\thave\\tpassed\\tlegislation\\tthat\\tclarifies\\tour\\tability\\nto\\toperate,\\tbut\\tat\\tthe\\tsame\\ttime\\tlimits\\tthe\\tnumber\\tof\\tdealer\\tlicenses\\twe\\tcan\\tobtain\\tor\\tstores\\tthat\\twe\\tcan\\toperate.\\tThe\\tapplication\\tof\\tstate\\tlaws\\tapplicable\\nto\\tour\\toperations\\tcontinues\\tto\\tbe\\tdifficult\\tto\\tpredict.\\nInternationally,\\tthere\\tmay\\tbe\\tlaws\\tin\\tjurisdictions\\twe\\thave\\tnot\\tyet\\tentered\\tor\\tlaws\\twe\\tare\\tunaware\\tof\\tin\\tjurisdictions\\twe\\thave\\tentered\\tthat\\tmay\\nrestrict\\tour\\tsales\\tor\\tother\\tbusiness\\tpractices.\\tEven\\tfor\\tthose\\tjurisdictions\\twe\\thave\\tanalyzed,\\tthe\\tlaws\\tin\\tthis\\tarea\\tcan\\tbe\\tcomplex,\\tdifficult\\tto\\tinterpret\\tand\\nmay\\tchange\\tover\\ttime.\\tContinued\\tregulatory\\tlimitations\\tand\\tother\\tobstacles\\tinterfering\\twith\\tour\\tability\\tto\\tsell\\tvehicles\\tdirectly\\tto\\tconsumers\\tmay\\tharm\\nour\\tfinancial\\tcondition\\tand\\toperating\\tresults.\\nRisks\\tRelated\\tto\\tthe\\tOwnership\\tof\\tOur\\tCommon\\tStock\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 28,\n        \"lines\": {\n          \"from\": 17,\n          \"to\": 31\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"The\\ttrading\\tprice\\tof\\tour\\tcommon\\tstock\\tis\\tlikely\\tto\\tcontinue\\tto\\tbe\\tvolatile.\\nThe\\ttrading\\tprice\\tof\\tour\\tcommon\\tstock\\thas\\tbeen\\thighly\\tvolatile\\tand\\tcould\\tcontinue\\tto\\tbe\\tsubject\\tto\\twide\\tfluctuations\\tin\\tresponse\\tto\\tvarious\\tfactors,\\nsome\\tof\\twhich\\tare\\tbeyond\\tour\\tcontrol.\\tOur\\tcommon\\tstock\\thas\\texperienced\\tover\\tthe\\tlast\\t52\\tweeks\\tan\\tintra-day\\ttrading\\thigh\\tof\\t$299.29\\tper\\tshare\\tand\\ta\\nlow\\tof\\t$152.37\\tper\\tshare.\\tThe\\tstock\\tmarket\\tin\\tgeneral,\\tand\\tthe\\tmarket\\tfor\\ttechnology\\tcompanies\\tin\\tparticular,\\thas\\texperienced\\textreme\\tprice\\tand\\tvolume\\nfluctuations\\tthat\\thave\\toften\\tbeen\\tunrelated\\tor\\tdisproportionate\\tto\\tthe\\toperating\\tperformance\\tof\\tthose\\tcompanies.\\tIn\\tparticular,\\ta\\tlarge\\tproportion\\tof\\tour\\ncommon\\tstock\\thas\\tbeen\\thistorically\\tand\\tmay\\tin\\tthe\\tfuture\\tbe\\ttraded\\tby\\tshort\\tsellers\\twhich\\tmay\\tput\\tpressure\\ton\\tthe\\tsupply\\tand\\tdemand\\tfor\\tour\\tcommon\\nstock,\\tfurther\\tinfluencing\\tvolatility\\tin\\tits\\tmarket\\tprice.\\tPublic\\tperception\\tof\\tour\\tcompany\\tor\\tmanagement\\tand\\tother\\tfactors\\toutside\\tof\\tour\\tcontrol\\tmay\\nadditionally\\timpact\\tthe\\tstock\\tprice\\tof\\tcompanies\\tlike\\tus\\tthat\\tgarner\\ta\\tdisproportionate\\tdegree\\tof\\tpublic\\tattention,\\tregardless\\tof\\tactual\\toperating\\nperformance.\\tIn\\taddition,\\tin\\tthe\\tpast,\\tfollowing\\tperiods\\tof\\tvolatility\\tin\\tthe\\toverall\\tmarket\\tor\\tthe\\tmarket\\tprice\\tof\\tour\\tshares,\\tsecurities\\tclass\\taction\\tlitigation\\nhas\\tbeen\\tfiled\\tagainst\\tus.\\tWhile\\twe\\tdefend\\tsuch\\tactions\\tvigorously,\\tany\\tjudgment\\tagainst\\tus\\tor\\tany\\tfuture\\tstockholder\\tlitigation\\tcould\\tresult\\tin\\tsubstantial\\ncosts\\tand\\ta\\tdiversion\\tof\\tour\\tmanagement’s\\tattention\\tand\\tresources.\\n27\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 28,\n        \"lines\": {\n          \"from\": 32,\n          \"to\": 43\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Table\\tof\\tContents\\nOur\\tfinancial\\tresults\\tmay\\tvary\\tsignificantly\\tfrom\\tperiod\\tto\\tperiod\\tdue\\tto\\tfluctuations\\tin\\tour\\toperating\\tcosts\\tand\\tother\\tfactors.\\nWe\\texpect\\tour\\tperiod-to-period\\tfinancial\\tresults\\tto\\tvary\\tbased\\ton\\tour\\toperating\\tcosts,\\twhich\\twe\\tanticipate\\twill\\tfluctuate\\tas\\tthe\\tpace\\tat\\twhich\\twe\\ncontinue\\tto\\tdesign,\\tdevelop\\tand\\tmanufacture\\tnew\\tproducts\\tand\\tincrease\\tproduction\\tcapacity\\tby\\texpanding\\tour\\tcurrent\\tmanufacturing\\tfacilities\\tand\\nadding\\tfuture\\tfacilities,\\tmay\\tnot\\tbe\\tconsistent\\tor\\tlinear\\tbetween\\tperiods.\\tAdditionally,\\tour\\trevenues\\tfrom\\tperiod\\tto\\tperiod\\tmay\\tfluctuate\\tas\\twe\\tintroduce\\nexisting\\tproducts\\tto\\tnew\\tmarkets\\tfor\\tthe\\tfirst\\ttime\\tand\\tas\\twe\\tdevelop\\tand\\tintroduce\\tnew\\tproducts.\\tAs\\ta\\tresult\\tof\\tthese\\tfactors,\\twe\\tbelieve\\tthat\\tquarter-to-\\nquarter\\tcomparisons\\tof\\tour\\tfinancial\\tresults,\\tespecially\\tin\\tthe\\tshort\\tterm,\\tare\\tnot\\tnecessarily\\tmeaningful\\tand\\tthat\\tthese\\tcomparisons\\tcannot\\tbe\\trelied\\nupon\\tas\\tindicators\\tof\\tfuture\\tperformance.\\tMoreover,\\tour\\tfinancial\\tresults\\tmay\\tnot\\tmeet\\texpectations\\tof\\tequity\\tresearch\\tanalysts,\\tratings\\tagencies\\tor\\ninvestors,\\twho\\tmay\\tbe\\tfocused\\tonly\\ton\\tshort-term\\tquarterly\\tfinancial\\tresults.\\tIf\\tany\\tof\\tthis\\toccurs,\\tthe\\ttrading\\tprice\\tof\\tour\\tstock\\tcould\\tfall\\tsubstantially,\\neither\\tsuddenly\\tor\\tover\\ttime.\\nWe\\tmay\\tfail\\tto\\tmeet\\tour\\tpublicly\\tannounced\\tguidance\\tor\\tother\\texpectations\\tabout\\tour\\tbusiness,\\twhich\\tcould\\tcause\\tour\\tstock\\tprice\\nto\\tdecline.\\nWe\\tprovide\\tfrom\\ttime\\tto\\ttime\\tguidance\\tregarding\\tour\\texpected\\tfinancial\\tand\\tbusiness\\tperformance.\\tCorrectly\\tidentifying\\tkey\\tfactors\\taffecting\\nbusiness\\tconditions\\tand\\tpredicting\\tfuture\\tevents\\tis\\tinherently\\tan\\tuncertain\\tprocess,\\tand\\tour\\tguidance\\tmay\\tnot\\tultimately\\tbe\\taccurate\\tand\\thas\\tin\\tthe\\tpast\\nbeen\\tinaccurate\\tin\\tcertain\\trespects,\\tsuch\\tas\\tthe\\ttiming\\tof\\tnew\\tproduct\\tmanufacturing\\tramps.\\tOur\\tguidance\\tis\\tbased\\ton\\tcertain\\tassumptions\\tsuch\\tas\\tthose\\nrelating\\tto\\tanticipated\\tproduction\\tand\\tsales\\tvolumes\\t(which\\tgenerally\\tare\\tnot\\tlinear\\tthroughout\\ta\\tgiven\\tperiod),\\taverage\\tsales\\tprices,\\tsupplier\\tand\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 29,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 16\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"commodity\\tcosts\\tand\\tplanned\\tcost\\treductions.\\tIf\\tour\\tguidance\\tvaries\\tfrom\\tactual\\tresults,\\tsuch\\tas\\tdue\\tto\\tour\\tassumptions\\tnot\\tbeing\\tmet\\tor\\tthe\\timpact\\ton\\nour\\tfinancial\\tperformance\\tthat\\tcould\\toccur\\tas\\ta\\tresult\\tof\\tvarious\\trisks\\tand\\tuncertainties,\\tthe\\tmarket\\tvalue\\tof\\tour\\tcommon\\tstock\\tcould\\tdecline\\tsignificantly.\\nIf\\tElon\\tMusk\\twere\\tforced\\tto\\tsell\\tshares\\tof\\tour\\tcommon\\tstock,\\teither\\tthat\\the\\thas\\tpledged\\tto\\tsecure\\tcertain\\tpersonal\\tloan\\tobligations,\\nor\\tin\\tsatisfaction\\tof\\tother\\tobligations,\\tsuch\\tsales\\tcould\\tcause\\tour\\tstock\\tprice\\tto\\tdecline.\\nCertain\\tbanking\\tinstitutions\\thave\\tmade\\textensions\\tof\\tcredit\\tto\\tElon\\tMusk,\\tour\\tChief\\tExecutive\\tOfficer,\\ta\\tportion\\tof\\twhich\\twas\\tused\\tto\\tpurchase\\nshares\\tof\\tcommon\\tstock\\tin\\tcertain\\tof\\tour\\tpublic\\tofferings\\tand\\tprivate\\tplacements\\tat\\tthe\\tsame\\tprices\\toffered\\tto\\tthird-party\\tparticipants\\tin\\tsuch\\tofferings\\nand\\tplacements.\\tWe\\tare\\tnot\\ta\\tparty\\tto\\tthese\\tloans,\\twhich\\tare\\tpartially\\tsecured\\tby\\tpledges\\tof\\ta\\tportion\\tof\\tthe\\tTesla\\tcommon\\tstock\\tcurrently\\towned\\tby\\tMr.\\nMusk.\\tIf\\tthe\\tprice\\tof\\tour\\tcommon\\tstock\\twere\\tto\\tdecline\\tsubstantially,\\tMr.\\tMusk\\tmay\\tbe\\tforced\\tby\\tone\\tor\\tmore\\tof\\tthe\\tbanking\\tinstitutions\\tto\\tsell\\tshares\\tof\\nTesla\\tcommon\\tstock\\tto\\tsatisfy\\this\\tloan\\tobligations\\tif\\the\\tcould\\tnot\\tdo\\tso\\tthrough\\tother\\tmeans.\\tAny\\tsuch\\tsales\\tcould\\tcause\\tthe\\tprice\\tof\\tour\\tcommon\\tstock\\nto\\tdecline\\tfurther.\\tFurther,\\tMr.\\tMusk\\tfrom\\ttime\\tto\\ttime\\tmay\\tcommit\\tto\\tinvesting\\tin\\tsignificant\\tbusiness\\tor\\tother\\tventures,\\tand\\tas\\ta\\tresult,\\tbe\\trequired\\tto\\nsell\\tshares\\tof\\tour\\tcommon\\tstock\\tin\\tsatisfaction\\tof\\tsuch\\tcommitments.\\nAnti-takeover\\tprovisions\\tcontained\\tin\\tour\\tgoverning\\tdocuments,\\tapplicable\\tlaws\\tand\\tour\\tconvertible\\tsenior\\tnotes\\tcould\\timpair\\ta\\ntakeover\\tattempt.\\nOur\\tcertificate\\tof\\tincorporation\\tand\\tbylaws\\tafford\\tcertain\\trights\\tand\\tpowers\\tto\\tour\\tboard\\tof\\tdirectors\\tthat\\tmay\\tfacilitate\\tthe\\tdelay\\tor\\tprevention\\tof\\tan\\nacquisition\\tthat\\tit\\tdeems\\tundesirable.\\tWe\\tare\\talso\\tsubject\\tto\\tSection\\t203\\tof\\tthe\\tDelaware\\tGeneral\\tCorporation\\tLaw\\tand\\tother\\tprovisions\\tof\\tDelaware\\tlaw\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 29,\n        \"lines\": {\n          \"from\": 17,\n          \"to\": 31\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"that\\tlimit\\tthe\\tability\\tof\\tstockholders\\tin\\tcertain\\tsituations\\tto\\teffect\\tcertain\\tbusiness\\tcombinations.\\tIn\\taddition,\\tthe\\tterms\\tof\\tour\\tconvertible\\tsenior\\tnotes\\tmay\\nrequire\\tus\\tto\\trepurchase\\tsuch\\tnotes\\tin\\tthe\\tevent\\tof\\ta\\tfundamental\\tchange,\\tincluding\\ta\\ttakeover\\tof\\tour\\tcompany.\\tAny\\tof\\tthe\\tforegoing\\tprovisions\\tand\\nterms\\tthat\\thas\\tthe\\teffect\\tof\\tdelaying\\tor\\tdeterring\\ta\\tchange\\tin\\tcontrol\\tcould\\tlimit\\tthe\\topportunity\\tfor\\tour\\tstockholders\\tto\\treceive\\ta\\tpremium\\tfor\\ttheir\\tshares\\nof\\tour\\tcommon\\tstock,\\tand\\tcould\\talso\\taffect\\tthe\\tprice\\tthat\\tsome\\tinvestors\\tare\\twilling\\tto\\tpay\\tfor\\tour\\tcommon\\tstock.\\nITEM\\t1B.\\tUNRESOLVED\\tSTAFF\\tCOMMENTS\\nNone.\\n28\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 29,\n        \"lines\": {\n          \"from\": 32,\n          \"to\": 38\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"ITEM\\t1C.\\tCYBERSECURITY\\nCybersecurity\\tRisk\\tManagement\\tand\\tStrategy\\nWe\\trecognize\\tthe\\timportance\\tof\\tassessing,\\tidentifying,\\tand\\tmanaging\\tmaterial\\trisks\\tassociated\\twith\\tcybersecurity\\tthreats,\\tas\\tsuch\\tterm\\tis\\tdefined\\tin\\nItem\\t106(a)\\tof\\tRegulation\\tS-K.\\tThese\\trisks\\tinclude,\\tamong\\tother\\tthings:\\toperational\\trisks,\\tintellectual\\tproperty\\ttheft,\\tfraud,\\textortion,\\tharm\\tto\\temployees\\nor\\tcustomers\\tand\\tviolation\\tof\\tdata\\tprivacy\\tor\\tsecurity\\tlaws.\\nIdentifying\\tand\\tassessing\\tcybersecurity\\trisk\\tis\\tintegrated\\tinto\\tour\\toverall\\trisk\\tmanagement\\tsystems\\tand\\tprocesses.\\tCybersecurity\\trisks\\trelated\\tto\\tour\\nbusiness,\\ttechnical\\toperations,\\tprivacy\\tand\\tcompliance\\tissues\\tare\\tidentified\\tand\\taddressed\\tthrough\\ta\\tmulti-faceted\\tapproach\\tincluding\\tthird\\tparty\\nassessments,\\tinternal\\tIT\\tAudit,\\tIT\\tsecurity,\\tgovernance,\\trisk\\tand\\tcompliance\\treviews.\\tTo\\tdefend,\\tdetect\\tand\\trespond\\tto\\tcybersecurity\\tincidents,\\twe,\\namong\\tother\\tthings:\\tconduct\\tproactive\\tprivacy\\tand\\tcybersecurity\\treviews\\tof\\tsystems\\tand\\tapplications,\\taudit\\tapplicable\\tdata\\tpolicies,\\tperform\\tpenetration\\ntesting\\tusing\\texternal\\tthird-party\\ttools\\tand\\ttechniques\\tto\\ttest\\tsecurity\\tcontrols,\\toperate\\ta\\tbug\\tbounty\\tprogram\\tto\\tencourage\\tproactive\\tvulnerability\\nreporting,\\tconduct\\temployee\\ttraining,\\tmonitor\\temerging\\tlaws\\tand\\tregulations\\trelated\\tto\\tdata\\tprotection\\tand\\tinformation\\tsecurity\\t(including\\tour\\tconsumer\\nproducts)\\tand\\timplement\\tappropriate\\tchanges.\\nWe\\thave\\timplemented\\tincident\\tresponse\\tand\\tbreach\\tmanagement\\tprocesses\\twhich\\thave\\tfour\\toverarching\\tand\\tinterconnected\\tstages:\\t1)\\npreparation\\tfor\\ta\\tcybersecurity\\tincident,\\t2)\\tdetection\\tand\\tanalysis\\tof\\ta\\tsecurity\\tincident,\\t3)\\tcontainment,\\teradication\\tand\\trecovery,\\tand\\t4)\\tpost-incident\\nanalysis.\\tSuch\\tincident\\tresponses\\tare\\toverseen\\tby\\tleaders\\tfrom\\tour\\tInformation\\tSecurity,\\tProduct\\tSecurity,\\tCompliance\\tand\\tLegal\\tteams\\tregarding\\nmatters\\tof\\tcybersecurity.\\nSecurity\\tevents\\tand\\tdata\\tincidents\\tare\\tevaluated,\\tranked\\tby\\tseverity\\tand\\tprioritized\\tfor\\tresponse\\tand\\tremediation.\\tIncidents\\tare\\tevaluated\\tto\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 30,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 17\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"determine\\tmateriality\\tas\\twell\\tas\\toperational\\tand\\tbusiness\\timpact,\\tand\\treviewed\\tfor\\tprivacy\\timpact.\\nWe\\talso\\tconduct\\ttabletop\\texercises\\tto\\tsimulate\\tresponses\\tto\\tcybersecurity\\tincidents.\\tOur\\tteam\\tof\\tcybersecurity\\tprofessionals\\tthen\\tcollaborate\\twith\\ntechnical\\tand\\tbusiness\\tstakeholders\\tacross\\tour\\tbusiness\\tunits\\tto\\tfurther\\tanalyze\\tthe\\trisk\\tto\\tthe\\tcompany,\\tand\\tform\\tdetection,\\tmitigation\\tand\\tremediation\\nstrategies.\\nAs\\tpart\\tof\\tthe\\tabove\\tprocesses,\\twe\\tregularly\\tengage\\texternal\\tauditors\\tand\\tconsultants\\tto\\tassess\\tour\\tinternal\\tcybersecurity\\tprograms\\tand\\ncompliance\\twith\\tapplicable\\tpractices\\tand\\tstandards.\\tAs\\tof\\t2023,\\tour\\tInformation\\tSecurity\\tManagement\\tSystem\\thas\\tbeen\\tcertified\\tto\\tconform\\tto\\tthe\\nrequirements\\tof\\tISO/IEC\\t27001:2013.\\nOur\\trisk\\tmanagement\\tprogram\\talso\\tassesses\\tthird\\tparty\\trisks,\\tand\\twe\\tperform\\tthird-party\\trisk\\tmanagement\\tto\\tidentify\\tand\\tmitigate\\trisks\\tfrom\\tthird\\nparties\\tsuch\\tas\\tvendors,\\tsuppliers,\\tand\\tother\\tbusiness\\tpartners\\tassociated\\twith\\tour\\tuse\\tof\\tthird-party\\tservice\\tproviders.\\tCybersecurity\\trisks\\tare\\tevaluated\\nwhen\\tdetermining\\tthe\\tselection\\tand\\toversight\\tof\\tapplicable\\tthird-party\\tservice\\tproviders\\tand\\tpotential\\tfourth-party\\trisks\\twhen\\thandling\\tand/or\\tprocessing\\nour\\temployee,\\tbusiness\\tor\\tcustomer\\tdata.\\tIn\\taddition\\tto\\tnew\\tvendor\\tonboarding,\\twe\\tperform\\trisk\\tmanagement\\tduring\\tthird-party\\tcybersecurity\\ncompromise\\tincidents\\tto\\tidentify\\tand\\tmitigate\\trisks\\tto\\tus\\tfrom\\tthird-party\\tincidents.\\nWe\\tdescribe\\twhether\\tand\\thow\\trisks\\tfrom\\tidentified\\tcybersecurity\\tthreats,\\tincluding\\tas\\ta\\tresult\\tof\\tany\\tprevious\\tcybersecurity\\tincidents,\\thave\\nmaterially\\taffected\\tor\\tare\\treasonably\\tlikely\\tto\\tmaterially\\taffect\\tus,\\tincluding\\tour\\tbusiness\\tstrategy,\\tresults\\tof\\toperations,\\tor\\tfinancial\\tcondition,\\tunder\\tthe\\nheading\\t“Our\\tinformation\\ttechnology\\tsystems\\tor\\tdata,\\tor\\tthose\\tof\\tour\\tservice\\tproviders\\tor\\tcustomers\\tor\\tusers\\tcould\\tbe\\tsubject\\tto\\tcyber-attacks\\tor\\tother\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 30,\n        \"lines\": {\n          \"from\": 18,\n          \"to\": 32\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"security\\tincidents,\\twhich\\tcould\\tresult\\tin\\tdata\\tbreaches,\\tintellectual\\tproperty\\ttheft,\\tclaims,\\tlitigation,\\tregulatory\\tinvestigations,\\tsignificant\\tliability,\\nreputational\\tdamage\\tand\\tother\\tadverse\\tconsequences”\\tincluded\\tas\\tpart\\tof\\tour\\trisk\\tfactor\\tdisclosures\\tat\\tItem\\t1A\\tof\\tthis\\tAnnual\\tReport\\ton\\tForm\\t10-K.\\nCybersecurity\\tGovernance\\nCybersecurity\\tis\\tan\\timportant\\tpart\\tof\\tour\\trisk\\tmanagement\\tprocesses\\tand\\tan\\tarea\\tof\\tfocus\\tfor\\tour\\tBoard\\tand\\tmanagement.\\tOur\\tAudit\\tCommittee\\tis\\nresponsible\\tfor\\tthe\\toversight\\tof\\trisks\\tfrom\\tcybersecurity\\tthreats.\\tMembers\\tof\\tthe\\tAudit\\tCommittee\\treceive\\tupdates\\ton\\ta\\tquarterly\\tbasis\\tfrom\\tsenior\\nmanagement,\\tincluding\\tleaders\\tfrom\\tour\\tInformation\\tSecurity,\\tProduct\\tSecurity,\\tCompliance\\tand\\tLegal\\tteams\\tregarding\\tmatters\\tof\\tcybersecurity.\\tThis\\nincludes\\texisting\\tand\\tnew\\tcybersecurity\\trisks,\\tstatus\\ton\\thow\\tmanagement\\tis\\taddressing\\tand/or\\tmitigating\\tthose\\trisks,\\tcybersecurity\\tand\\tdata\\tprivacy\\nincidents\\t(if\\tany)\\tand\\tstatus\\ton\\tkey\\tinformation\\tsecurity\\tinitiatives.\\tOur\\tBoard\\tmembers\\talso\\tengage\\tin\\tad\\thoc\\tconversations\\twith\\tmanagement\\ton\\ncybersecurity-related\\tnews\\tevents\\tand\\tdiscuss\\tany\\tupdates\\tto\\tour\\tcybersecurity\\trisk\\tmanagement\\tand\\tstrategy\\tprograms.\\n29\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 30,\n        \"lines\": {\n          \"from\": 33,\n          \"to\": 42\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Our\\tcybersecurity\\trisk\\tmanagement\\tand\\tstrategy\\tprocesses\\tare\\toverseen\\tby\\tleaders\\tfrom\\tour\\tInformation\\tSecurity,\\tProduct\\tSecurity,\\tCompliance\\nand\\tLegal\\tteams.\\tSuch\\tindividuals\\thave\\tan\\taverage\\tof\\tover\\t15\\tyears\\tof\\tprior\\twork\\texperience\\tin\\tvarious\\troles\\tinvolving\\tinformation\\ttechnology,\\tincluding\\nsecurity,\\tauditing,\\tcompliance,\\tsystems\\tand\\tprogramming.\\tThese\\tindividuals\\tare\\tinformed\\tabout,\\tand\\tmonitor\\tthe\\tprevention,\\tmitigation,\\tdetection\\tand\\nremediation\\tof\\tcybersecurity\\tincidents\\tthrough\\ttheir\\tmanagement\\tof,\\tand\\tparticipation\\tin,\\tthe\\tcybersecurity\\trisk\\tmanagement\\tand\\tstrategy\\tprocesses\\ndescribed\\tabove,\\tincluding\\tthe\\toperation\\tof\\tour\\tincident\\tresponse\\tplan,\\tand\\treport\\tto\\tthe\\tAudit\\tCommittee\\ton\\tany\\tappropriate\\titems.\\nITEM\\t2.\\tPROPERTIES\\nWe\\tare\\theadquartered\\tin\\tAustin,\\tTexas.\\tOur\\tprincipal\\tfacilities\\tinclude\\ta\\tlarge\\tnumber\\tof\\tproperties\\tin\\tNorth\\tAmerica,\\tEurope\\tand\\tAsia\\tutilized\\tfor\\nmanufacturing\\tand\\tassembly,\\twarehousing,\\tengineering,\\tretail\\tand\\tservice\\tlocations,\\tSupercharger\\tsites\\tand\\tadministrative\\tand\\tsales\\toffices.\\tOur\\tfacilities\\nare\\tused\\tto\\tsupport\\tboth\\tof\\tour\\treporting\\tsegments,\\tand\\tare\\tsuitable\\tand\\tadequate\\tfor\\tthe\\tconduct\\tof\\tour\\tbusiness.\\tWe\\tgenerally\\tlease\\tsuch\\tfacilities\\twith\\nthe\\tprimary\\texception\\tof\\tsome\\tmanufacturing\\tfacilities.\\tThe\\tfollowing\\ttable\\tsets\\tforth\\tthe\\tlocation\\tof\\tour\\tprimary\\towned\\tand\\tleased\\tmanufacturing\\nfacilities.\\nPrimary\\tManufacturing\\tFacilitiesLocationOwned\\tor\\tLeased\\nGigafactory\\tTexasAustin,\\tTexasOwned\\nFremont\\tFactoryFremont,\\tCaliforniaOwned\\nGigafactory\\tNevadaSparks,\\tNevadaOwned\\nGigafactory\\tBerlin-BrandenburgGrunheide,\\tGermanyOwned\\nGigafactory\\tShanghaiShanghai,\\tChina*\\nGigafactory\\tNew\\tYorkBuffalo,\\tNew\\tYorkLeased\\nMegafactoryLathrop,\\tCaliforniaLeased\\n*We\\town\\tthe\\tbuilding\\tand\\tthe\\tland\\tuse\\trights\\twith\\tan\\tinitial\\tterm\\tof\\t50\\tyears.\\tThe\\tland\\tuse\\trights\\tare\\ttreated\\tas\\toperating\\tlease\\tright-of-use\\tassets.\\nITEM\\t3.\\tLEGAL\\tPROCEEDINGS\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 31,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 21\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"ITEM\\t3.\\tLEGAL\\tPROCEEDINGS\\nFor\\ta\\tdescription\\tof\\tour\\tmaterial\\tpending\\tlegal\\tproceedings,\\tplease\\tsee\\tNote\\t15,\\tCommitments\\tand\\tContingencies,\\tto\\tthe\\tconsolidated\\tfinancial\\nstatements\\tincluded\\telsewhere\\tin\\tthis\\tAnnual\\tReport\\ton\\tForm\\t10-K.\\nIn\\taddition,\\teach\\tof\\tthe\\tmatters\\tbelow\\tis\\tbeing\\tdisclosed\\tpursuant\\tto\\tItem\\t103\\tof\\tRegulation\\tS-K\\tbecause\\tit\\trelates\\tto\\tenvironmental\\tregulations\\tand\\naggregate\\tcivil\\tpenalties\\tthat\\twe\\tcurrently\\tbelieve\\tcould\\tpotentially\\texceed\\t$1\\tmillion.\\tWe\\tbelieve\\tthat\\tany\\tproceeding\\tthat\\tis\\tmaterial\\tto\\tour\\tbusiness\\tor\\nfinancial\\tcondition\\tis\\tlikely\\tto\\thave\\tpotential\\tpenalties\\tfar\\tin\\texcess\\tof\\tsuch\\tamount.\\nDistrict\\tattorneys\\tin\\tcertain\\tCalifornia\\tcounties\\tconducted\\tan\\tinvestigation\\tinto\\tTesla’s\\twaste\\tsegregation\\tpractices\\tpursuant\\tto\\tCal.\\tHealth\\t&\\tSaf.\\nCode\\t§\\t25100\\tet\\tseq.\\tand\\tCal.\\tCivil\\tCode\\t§\\t1798.80.\\tTesla\\thas\\timplemented\\tvarious\\tremedial\\tmeasures,\\tincluding\\tconducting\\ttraining\\tand\\taudits,\\tand\\nenhancements\\tto\\tits\\tsite\\twaste\\tmanagement\\tprograms,\\tand\\tsettlement\\tdiscussions\\tare\\tongoing.\\tWhile\\tthe\\toutcome\\tof\\tthis\\tmatter\\tcannot\\tbe\\tdetermined\\nat\\tthis\\ttime,\\tit\\tis\\tnot\\tcurrently\\texpected\\tto\\thave\\ta\\tmaterial\\tadverse\\timpact\\ton\\tour\\tbusiness.\\nITEM\\t4.\\tMINE\\tSAFETY\\tDISCLOSURES\\nNot\\tapplicable.\\n30\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 31,\n        \"lines\": {\n          \"from\": 21,\n          \"to\": 33\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"PART\\tII\\nITEM\\t5.\\tMARKET\\tFOR\\tREGISTRANT’S\\tCOMMON\\tEQUITY,\\tRELATED\\tSTOCKHOLDER\\tMATTERS\\tAND\\tISSUER\\tPURCHASES\\tOF\\tEQUITY\\nSECURITIES\\nMarket\\tInformation\\nOur\\tcommon\\tstock\\thas\\ttraded\\ton\\tThe\\tNASDAQ\\tGlobal\\tSelect\\tMarket\\tunder\\tthe\\tsymbol\\t“TSLA”\\tsince\\tit\\tbegan\\ttrading\\ton\\tJune\\t29,\\t2010.\\tOur\\tinitial\\npublic\\toffering\\twas\\tpriced\\tat\\tapproximately\\t$1.13\\tper\\tshare\\ton\\tJune\\t28,\\t2010\\tas\\tadjusted\\tto\\tgive\\teffect\\tto\\tthe\\tthree-for-one\\tstock\\tsplit\\teffected\\tin\\tthe\\nform\\tof\\ta\\tstock\\tdividend\\tin\\tAugust\\t2022\\t(the\\t“2022\\tStock\\tSplit”)\\tand\\tthe\\tfive-for-one\\tstock\\tsplit\\teffected\\tin\\tthe\\tform\\tof\\ta\\tstock\\tdividend\\tin\\tAugust\\t2020\\n(the\\t“2020\\tStock\\tSplit”).\\nHolders\\nAs\\tof\\tJanuary\\t22,\\t2024,\\tthere\\twere\\t9,300\\tholders\\tof\\trecord\\tof\\tour\\tcommon\\tstock.\\tA\\tsubstantially\\tgreater\\tnumber\\tof\\tholders\\tof\\tour\\tcommon\\tstock\\tare\\n“street\\tname”\\tor\\tbeneficial\\tholders,\\twhose\\tshares\\tare\\theld\\tby\\tbanks,\\tbrokers\\tand\\tother\\tfinancial\\tinstitutions.\\nDividend\\tPolicy\\nWe\\thave\\tnever\\tdeclared\\tor\\tpaid\\tcash\\tdividends\\ton\\tour\\tcommon\\tstock.\\tWe\\tcurrently\\tdo\\tnot\\tanticipate\\tpaying\\tany\\tcash\\tdividends\\tin\\tthe\\tforeseeable\\nfuture.\\tAny\\tfuture\\tdetermination\\tto\\tdeclare\\tcash\\tdividends\\twill\\tbe\\tmade\\tat\\tthe\\tdiscretion\\tof\\tour\\tboard\\tof\\tdirectors,\\tsubject\\tto\\tapplicable\\tlaws,\\tand\\twill\\ndepend\\ton\\tour\\tfinancial\\tcondition,\\tresults\\tof\\toperations,\\tcapital\\trequirements,\\tgeneral\\tbusiness\\tconditions\\tand\\tother\\tfactors\\tthat\\tour\\tboard\\tof\\tdirectors\\nmay\\tdeem\\trelevant.\\nStock\\tPerformance\\tGraph\\nThis\\tperformance\\tgraph\\tshall\\tnot\\tbe\\tdeemed\\t“filed”\\tfor\\tpurposes\\tof\\tSection\\t18\\tof\\tthe\\tSecurities\\tExchange\\tAct\\tof\\t1934,\\tas\\tamended\\t(the\\t“Exchange\\nAct”),\\tor\\tincorporated\\tby\\treference\\tinto\\tany\\tfiling\\tof\\tTesla,\\tInc.\\tunder\\tthe\\tSecurities\\tAct\\tof\\t1933,\\tas\\tamended\\t(the\\t“Securities\\tAct”),\\tor\\tthe\\tExchange\\tAct,\\nexcept\\tas\\tshall\\tbe\\texpressly\\tset\\tforth\\tby\\tspecific\\treference\\tin\\tsuch\\tfiling.\\nThe\\tfollowing\\tgraph\\tshows\\ta\\tcomparison,\\tfrom\\tJanuary\\t1,\\t2019\\tthrough\\tDecember\\t31,\\t2023,\\tof\\tthe\\tcumulative\\ttotal\\treturn\\ton\\tour\\tcommon\\tstock,\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 32,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 21\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"The\\tNASDAQ\\tComposite\\tIndex\\tand\\ta\\tgroup\\tof\\tall\\tpublic\\tcompanies\\tsharing\\tthe\\tsame\\tSIC\\tcode\\tas\\tus,\\twhich\\tis\\tSIC\\tcode\\t3711,\\t“Motor\\tVehicles\\tand\\nPassenger\\tCar\\tBodies”\\t(Motor\\tVehicles\\tand\\tPassenger\\tCar\\tBodies\\tPublic\\tCompany\\tGroup).\\tSuch\\treturns\\tare\\tbased\\ton\\thistorical\\tresults\\tand\\tare\\tnot\\nintended\\tto\\tsuggest\\tfuture\\tperformance.\\tData\\tfor\\tThe\\tNASDAQ\\tComposite\\tIndex\\tand\\tthe\\tMotor\\tVehicles\\tand\\tPassenger\\tCar\\tBodies\\tPublic\\tCompany\\tGroup\\nassumes\\tan\\tinvestment\\tof\\t$100\\ton\\tJanuary\\t1,\\t2019\\tand\\treinvestment\\tof\\tdividends.\\tWe\\thave\\tnever\\tdeclared\\tor\\tpaid\\tcash\\tdividends\\ton\\tour\\tcommon\\tstock\\nnor\\tdo\\twe\\tanticipate\\tpaying\\tany\\tsuch\\tcash\\tdividends\\tin\\tthe\\tforeseeable\\tfuture.\\n31\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 32,\n        \"lines\": {\n          \"from\": 22,\n          \"to\": 27\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Unregistered\\tSales\\tof\\tEquity\\tSecurities\\tand\\tUse\\tof\\tProceeds\\nNone.\\nPurchases\\tof\\tEquity\\tSecurities\\tby\\tthe\\tIssuer\\tand\\tAffiliated\\tPurchasers\\nNone.\\nITEM\\t6.\\t[RESERVED]\\n32\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 33,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 6\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"ITEM\\t7.\\tMANAGEMENT’S\\tDISCUSSION\\tAND\\tANALYSIS\\tOF\\tFINANCIAL\\tCONDITION\\tAND\\tRESULTS\\tOF\\tOPERATIONS\\nThe\\tfollowing\\tdiscussion\\tand\\tanalysis\\tshould\\tbe\\tread\\tin\\tconjunction\\twith\\tthe\\tconsolidated\\tfinancial\\tstatements\\tand\\tthe\\trelated\\tnotes\\tincluded\\nelsewhere\\tin\\tthis\\tAnnual\\tReport\\ton\\tForm\\t10-K.\\tFor\\tfurther\\tdiscussion\\tof\\tour\\tproducts\\tand\\tservices,\\ttechnology\\tand\\tcompetitive\\tstrengths,\\trefer\\tto\\tItem\\t1-\\nBusiness.\\tFor\\tdiscussion\\trelated\\tto\\tchanges\\tin\\tfinancial\\tcondition\\tand\\tthe\\tresults\\tof\\toperations\\tfor\\tfiscal\\tyear\\t2022-related\\titems,\\trefer\\tto\\tPart\\tII,\\tItem\\t7.\\nManagement’s\\tDiscussion\\tand\\tAnalysis\\tof\\tFinancial\\tCondition\\tand\\tResults\\tof\\tOperations\\tin\\tour\\tAnnual\\tReport\\ton\\tForm\\t10-K\\tfor\\tfiscal\\tyear\\t2022,\\twhich\\twas\\nfiled\\twith\\tthe\\tSecurities\\tand\\tExchange\\tCommission\\ton\\tJanuary\\t31,\\t2023.\\nOverview\\tand\\t2023\\tHighlights\\nOur\\tmission\\tis\\tto\\taccelerate\\tthe\\tworld’s\\ttransition\\tto\\tsustainable\\tenergy.\\tWe\\tdesign,\\tdevelop,\\tmanufacture,\\tlease\\tand\\tsell\\thigh-performance\\tfully\\nelectric\\tvehicles,\\tsolar\\tenergy\\tgeneration\\tsystems\\tand\\tenergy\\tstorage\\tproducts.\\tWe\\talso\\toffer\\tmaintenance,\\tinstallation,\\toperation,\\tcharging,\\tinsurance,\\nfinancial\\tand\\tother\\tservices\\trelated\\tto\\tour\\tproducts.\\tAdditionally,\\twe\\tare\\tincreasingly\\tfocused\\ton\\tproducts\\tand\\tservices\\tbased\\ton\\tartificial\\tintelligence,\\nrobotics\\tand\\tautomation.\\nIn\\t2023,\\twe\\tproduced\\t1,845,985\\tconsumer\\tvehicles\\tand\\tdelivered\\t1,808,581\\tconsumer\\tvehicles.\\tWe\\tare\\tcurrently\\tfocused\\ton\\tincreasing\\tvehicle\\nproduction,\\tcapacity\\tand\\tdelivery\\tcapabilities,\\treducing\\tcosts,\\timproving\\tand\\tdeveloping\\tour\\tvehicles\\tand\\tbattery\\ttechnologies,\\tvertically\\tintegrating\\tand\\nlocalizing\\tour\\tsupply\\tchain,\\timproving\\tand\\tfurther\\tdeploying\\tour\\tFSD\\tcapabilities,\\tincreasing\\tthe\\taffordability\\tand\\tefficiency\\tof\\tour\\tvehicles,\\tbringing\\tnew\\nproducts\\tto\\tmarket\\tand\\texpanding\\tour\\tglobal\\tinfrastructure,\\tincluding\\tour\\tservice\\tand\\tcharging\\tinfrastructure.\\nIn\\t2023,\\twe\\tdeployed\\t14.72\\tGWh\\tof\\tenergy\\tstorage\\tproducts\\tand\\t223\\tmegawatts\\tof\\tsolar\\tenergy\\tsystems.\\tWe\\tare\\tcurrently\\tfocused\\ton\\tramping\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 34,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 16\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"production\\tof\\tenergy\\tstorage\\tproducts,\\timproving\\tour\\tSolar\\tRoof\\tinstallation\\tcapability\\tand\\tefficiency,\\tand\\tincreasing\\tmarket\\tshare\\tof\\tretrofit\\tsolar\\tenergy\\nsystems.\\nIn\\t2023,\\twe\\trecognized\\ttotal\\trevenues\\tof\\t$96.77\\tbillion,\\trepresenting\\tan\\tincrease\\tof\\t$15.31\\tbillion,\\tcompared\\tto\\tthe\\tprior\\tyear.\\tWe\\tcontinue\\tto\\tramp\\nproduction,\\tbuild\\tnew\\tmanufacturing\\tcapacity\\tand\\texpand\\tour\\toperations\\tto\\tenable\\tincreased\\tdeliveries\\tand\\tdeployments\\tof\\tour\\tproducts,\\tand\\tinvest\\tin\\nresearch\\tand\\tdevelopment\\tto\\taccelerate\\tour\\tAI,\\tsoftware\\tand\\tfleet-based\\tprofits\\tfor\\tfurther\\trevenue\\tgrowth.\\nIn\\t2023,\\tour\\tnet\\tincome\\tattributable\\tto\\tcommon\\tstockholders\\twas\\t$15.00\\tbillion,\\trepresenting\\ta\\tfavorable\\tchange\\tof\\t$2.44\\tbillion,\\tcompared\\tto\\tthe\\nprior\\tyear.\\tThis\\tincluded\\ta\\tone-time\\tnon-cash\\ttax\\tbenefit\\tof\\t$5.93\\tbillion\\tfor\\tthe\\trelease\\tof\\tvaluation\\tallowance\\ton\\tcertain\\tdeferred\\ttax\\tassets.\\tWe\\tcontinue\\nto\\tfocus\\ton\\tfurther\\tcost\\treductions\\tand\\toperational\\tefficiencies\\twhile\\tmaximizing\\tdelivery\\tvolumes.\\nWe\\tended\\t2023\\twith\\t$29.09\\tbillion\\tin\\tcash\\tand\\tcash\\tequivalents\\tand\\tinvestments,\\trepresenting\\tan\\tincrease\\tof\\t$6.91\\tbillion\\tfrom\\tthe\\tend\\tof\\t2022.\\nOur\\tcash\\tflows\\tprovided\\tby\\toperating\\tactivities\\tin\\t2023\\tand\\t2022\\twere\\t$13.26\\tbillion\\tand\\t$14.72\\tbillion,\\trespectively,\\trepresenting\\ta\\tdecrease\\tof\\t$1.47\\nbillion.\\tCapital\\texpenditures\\tamounted\\tto\\t$8.90\\tbillion\\tin\\t2023,\\tcompared\\tto\\t$7.16\\tbillion\\tin\\t2022,\\trepresenting\\tan\\tincrease\\tof\\t$1.74\\tbillion.\\tSustained\\ngrowth\\thas\\tallowed\\tour\\tbusiness\\tto\\tgenerally\\tfund\\titself,\\tand\\twe\\twill\\tcontinue\\tinvesting\\tin\\ta\\tnumber\\tof\\tcapital-intensive\\tprojects\\tand\\tresearch\\tand\\ndevelopment\\tin\\tupcoming\\tperiods.\\n33\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 34,\n        \"lines\": {\n          \"from\": 17,\n          \"to\": 30\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Management\\tOpportunities,\\tChallenges\\tand\\tUncertainties\\tand\\t2024\\tOutlook\\nAutomotive—Production\\nThe\\tfollowing\\tis\\ta\\tsummary\\tof\\tthe\\tstatus\\tof\\tproduction\\tof\\teach\\tof\\tour\\tannounced\\tvehicle\\tmodels\\tin\\tproduction\\tand\\tunder\\tdevelopment,\\tas\\tof\\tthe\\ndate\\tof\\tthis\\tAnnual\\tReport\\ton\\tForm\\t10-K:\\nProduction\\tLocationVehicle\\tModel(s)Production\\tStatus\\nFremont\\tFactoryModel\\tS\\t/\\tModel\\tXActive\\n\\tModel\\t3\\t/\\tModel\\tYActive\\nGigafactory\\tShanghaiModel\\t3\\t/\\tModel\\tYActive\\nGigafactory\\tBerlin-BrandenburgModel\\tYActive\\nGigafactory\\tTexasModel\\tYActive\\n\\tCybertruckActive\\nGigafactory\\tNevadaTesla\\tSemiPilot\\tproduction\\nVariousNext\\tGeneration\\tPlatformIn\\tdevelopment\\nTBDTesla\\tRoadsterIn\\tdevelopment\\nWe\\tare\\tfocused\\ton\\tgrowing\\tour\\tmanufacturing\\tcapacity,\\twhich\\tincludes\\tcapacity\\tfor\\tmanufacturing\\tnew\\tvehicle\\tmodels\\tsuch\\tas\\tour\\tCybertruck\\tand\\nnext\\tgeneration\\tplatform,\\tand\\tramping\\tall\\tof\\tour\\tproduction\\tvehicles\\tto\\ttheir\\tinstalled\\tproduction\\tcapacities\\tas\\twell\\tas\\tincreasing\\tproduction\\trate\\tand\\nefficiency\\tat\\tour\\tcurrent\\tfactories.\\tThe\\tnext\\tphase\\tof\\tproduction\\tgrowth\\twill\\tdepend\\ton\\tthe\\tcontinued\\tramp\\tat\\tour\\tfactories\\tand\\tthe\\tintroduction\\tof\\tour\\nnext\\tgeneration\\tplatform,\\tas\\twell\\tas\\tour\\tability\\tto\\tadd\\tto\\tour\\tavailable\\tsources\\tof\\tbattery\\tcell\\tsupply\\tby\\tmanufacturing\\tour\\town\\tcells\\tthat\\twe\\tare\\ndeveloping\\tto\\thave\\thigh-volume\\toutput,\\tlower\\tcapital\\tand\\tproduction\\tcosts\\tand\\tlonger\\trange.\\tOur\\tgoals\\tare\\tto\\timprove\\tvehicle\\tperformance,\\tdecrease\\nproduction\\tcosts\\tand\\tincrease\\taffordability\\tand\\tcustomer\\tawareness.\\nThese\\tplans\\tare\\tsubject\\tto\\tuncertainties\\tinherent\\tin\\testablishing\\tand\\tramping\\tmanufacturing\\toperations,\\twhich\\tmay\\tbe\\texacerbated\\tby\\tnew\\tproduct\\nand\\tmanufacturing\\ttechnologies\\twe\\tintroduce,\\tthe\\tnumber\\tof\\tconcurrent\\tinternational\\tprojects,\\tany\\tindustry-wide\\tcomponent\\tconstraints,\\tlabor\\tshortages\\nand\\tany\\tfuture\\timpact\\tfrom\\tevents\\toutside\\tof\\tour\\tcontrol.\\tFor\\texample,\\tduring\\tthe\\tthird\\tquarter\\tof\\t2023,\\twe\\texperienced\\ta\\tsequential\\tdecline\\tin\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 35,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 23\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"production\\tvolumes\\tdue\\tto\\tpre-planned\\tshutdowns\\tfor\\tupgrades\\tat\\tvarious\\tfactories.\\tMoreover,\\twe\\thave\\tset\\tambitious\\ttechnological\\ttargets\\twith\\tour\\nplans\\tfor\\tbattery\\tcells\\tas\\twell\\tas\\tfor\\titerative\\tmanufacturing\\tand\\tdesign\\timprovements\\tfor\\tour\\tvehicles\\twith\\teach\\tnew\\tfactory.\\nAutomotive—Demand,\\tSales,\\tDeliveries\\tand\\tInfrastructure\\nOur\\tcost\\treduction\\tefforts,\\tcost\\tinnovation\\tstrategies,\\tand\\tadditional\\tlocalized\\tprocurement\\tand\\tmanufacturing\\tare\\tkey\\tto\\tour\\tvehicles’\\taffordability\\nand\\thave\\tallowed\\tus\\tto\\tcompetitively\\tprice\\tour\\tvehicles.\\tWe\\twill\\talso\\tcontinue\\tto\\tgenerate\\tdemand\\tand\\tbrand\\tawareness\\tby\\timproving\\tour\\tvehicles’\\nperformance\\tand\\tfunctionality,\\tincluding\\tthrough\\tproducts\\tbased\\ton\\tartificial\\tintelligence\\tsuch\\tas\\tAutopilot,\\tFSD\\tCapability,\\tand\\tother\\tsoftware\\tfeatures\\nand\\tdelivering\\tnew\\tvehicles,\\tsuch\\tas\\tour\\tCybertruck.\\tMoreover,\\twe\\texpect\\tto\\tcontinue\\tto\\tbenefit\\tfrom\\tongoing\\telectrification\\tof\\tthe\\tautomotive\\tsector\\tand\\nincreasing\\tenvironmental\\tregulations\\tand\\tinitiatives.\\nHowever,\\twe\\toperate\\tin\\ta\\tcyclical\\tindustry\\tthat\\tis\\tsensitive\\tto\\tpolitical\\tand\\tregulatory\\tuncertainty,\\tincluding\\twith\\trespect\\tto\\ttrade\\tand\\tthe\\nenvironment,\\tall\\tof\\twhich\\tcan\\tbe\\tcompounded\\tby\\tinflationary\\tpressures,\\trising\\tenergy\\tprices,\\tinterest\\trate\\tfluctuations\\tand\\tthe\\tliquidity\\tof\\tenterprise\\ncustomers.\\tFor\\texample,\\tinflationary\\tpressures\\thave\\tincreased\\tacross\\tthe\\tmarkets\\tin\\twhich\\twe\\toperate.\\tIn\\tan\\teffort\\tto\\tcurb\\tthis\\ttrend,\\tcentral\\tbanks\\tin\\ndeveloped\\tcountries\\traised\\tinterest\\trates\\trapidly\\tand\\tsubstantially,\\timpacting\\tthe\\taffordability\\tof\\tvehicle\\tlease\\tand\\tfinance\\tarrangements.\\tFurther,\\tsales\\tof\\nvehicles\\tin\\tthe\\tautomotive\\tindustry\\talso\\ttend\\tto\\tbe\\tcyclical\\tin\\tmany\\tmarkets,\\twhich\\tmay\\texpose\\tus\\tto\\tincreased\\tvolatility\\tas\\twe\\texpand\\tand\\tadjust\\tour\\noperations.\\tMoreover,\\tas\\tadditional\\tcompetitors\\tenter\\tthe\\tmarketplace\\tand\\thelp\\tbring\\tthe\\tworld\\tcloser\\tto\\tsustainable\\ttransportation,\\twe\\twill\\thave\\tto\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 35,\n        \"lines\": {\n          \"from\": 24,\n          \"to\": 37\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"adjust\\tand\\tcontinue\\tto\\texecute\\twell\\tto\\tmaintain\\tour\\tmomentum.\\tAdditionally,\\tour\\tsuppliers’\\tliquidity\\tand\\tallocation\\tplans\\tmay\\tbe\\taffected\\tby\\tcurrent\\nchallenges\\tin\\tthe\\tNorth\\tAmerican\\tautomotive\\tindustry,\\twhich\\tcould\\treduce\\tour\\taccess\\tto\\tcomponents\\tor\\tresult\\tin\\tunfavorable\\tchanges\\tto\\tcost.\\tThese\\nmacroeconomic\\tand\\tindustry\\ttrends\\thave\\thad,\\tand\\twill\\tlikely\\tcontinue\\tto\\thave,\\tan\\timpact\\ton\\tthe\\tpricing\\tof,\\tand\\torder\\trate\\tfor\\tour\\tvehicles,\\tand\\tin\\tturn\\tour\\noperating\\tmargin.\\tChanges\\tin\\tgovernment\\tand\\teconomic\\tincentives\\tin\\trelation\\tto\\telectric\\tvehicles\\tmay\\talso\\timpact\\tour\\tsales.\\tWe\\twill\\tcontinue\\tto\\tadjust\\naccordingly\\tto\\tsuch\\tdevelopments,\\tand\\twe\\tbelieve\\tour\\tongoing\\tcost\\treduction,\\tincluding\\timproved\\tproduction\\tinnovation\\tand\\tefficiency\\tat\\tour\\tnewest\\nfactories\\tand\\tlower\\tlogistics\\tcosts,\\tand\\tfocus\\ton\\toperating\\tleverage\\twill\\tcontinue\\tto\\tbenefit\\tus\\tin\\trelation\\tto\\tour\\tcompetitors,\\twhile\\tour\\tnew\\tproducts\\twill\\nhelp\\tenable\\tfuture\\tgrowth.\\n34\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 35,\n        \"lines\": {\n          \"from\": 38,\n          \"to\": 45\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"As\\tour\\tproduction\\tincreases,\\twe\\tmust\\twork\\tconstantly\\tto\\tsimilarly\\tincrease\\tvehicle\\tdelivery\\tcapability\\tso\\tthat\\tit\\tdoes\\tnot\\tbecome\\ta\\tbottleneck\\ton\\tour\\ntotal\\tdeliveries.\\tWe\\tare\\talso\\tcommitted\\tto\\treducing\\tthe\\tpercentage\\tof\\tvehicles\\tdelivered\\tin\\tthe\\tthird\\tmonth\\tof\\teach\\tquarter,\\twhich\\twill\\thelp\\tto\\treduce\\tthe\\ncost\\tper\\tvehicle.\\tAs\\twe\\texpand\\tour\\tmanufacturing\\toperations\\tglobally,\\twe\\twill\\talso\\thave\\tto\\tcontinue\\tto\\tincrease\\tand\\tstaff\\tour\\tdelivery,\\tservicing\\tand\\ncharging\\tinfrastructure\\taccordingly,\\tmaintain\\tour\\tvehicle\\treliability\\tand\\toptimize\\tour\\tSupercharger\\tlocations\\tto\\tensure\\tcost\\teffectiveness\\tand\\tcustomer\\nsatisfaction.\\tIn\\tparticular,\\tas\\tother\\tautomotive\\tmanufacturers\\thave\\tannounced\\ttheir\\tadoption\\tof\\tthe\\tNorth\\tAmerican\\tCharging\\tStandard\\t(“NACS”)\\tand\\nagreements\\twith\\tus\\tto\\tutilize\\tour\\tSuperchargers,\\twe\\tmust\\tcorrespondingly\\texpand\\tour\\tnetwork\\tin\\torder\\tto\\tensure\\tadequate\\tavailability\\tto\\tmeet\\tcustomer\\ndemands.\\tWe\\talso\\tremain\\tfocused\\ton\\tcontinued\\tenhancements\\tof\\tthe\\tcapability\\tand\\tefficiency\\tof\\tour\\tservicing\\toperations.\\nEnergy\\tGeneration\\tand\\tStorage\\tDemand,\\tProduction\\tand\\tDeployment\\nThe\\tlong-term\\tsuccess\\tof\\tthis\\tbusiness\\tis\\tdependent\\tupon\\tincreasing\\tmargins\\tthrough\\tgreater\\tvolumes.\\tWe\\tcontinue\\tto\\tincrease\\tthe\\tproduction\\tof\\nour\\tenergy\\tstorage\\tproducts\\tto\\tmeet\\thigh\\tlevels\\tof\\tdemand,\\tincluding\\tthe\\tconstruction\\tof\\ta\\tnew\\tMegafactory\\tin\\tShanghai\\tand\\tthe\\tongoing\\tramp\\tat\\tour\\nMegafactory\\tin\\tLathrop,\\tCalifornia.\\tFor\\tMegapack,\\tenergy\\tstorage\\tdeployments\\tcan\\tvary\\tmeaningfully\\tquarter\\tto\\tquarter\\tdepending\\ton\\tthe\\ttiming\\tof\\nspecific\\tproject\\tmilestones.\\tWe\\tremain\\tcommitted\\tto\\tgrowing\\tour\\tretrofit\\tsolar\\tenergy\\tbusiness\\tby\\toffering\\ta\\tlow-cost\\tand\\tsimplified\\tonline\\tordering\\nexperience.\\tIn\\taddition,\\twe\\tcontinue\\tto\\tseek\\tto\\timprove\\tour\\tinstallation\\tcapabilities\\tand\\tprice\\tefficiencies\\tfor\\tSolar\\tRoof.\\tAs\\tthese\\tproduct\\tlines\\tgrow,\\twe\\nwill\\thave\\tto\\tmaintain\\tadequate\\tbattery\\tcell\\tsupply\\tfor\\tour\\tenergy\\tstorage\\tproducts\\tand\\tensure\\tthe\\tavailability\\tof\\tqualified\\tpersonnel,\\tparticularly\\tskilled\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 36,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 14\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"electricians,\\tto\\tsupport\\tthe\\tramp\\tof\\tSolar\\tRoof.\\nCash\\tFlow\\tand\\tCapital\\tExpenditure\\tTrends\\nOur\\tcapital\\texpenditures\\tare\\ttypically\\tdifficult\\tto\\tproject\\tbeyond\\tthe\\tshort-term\\tgiven\\tthe\\tnumber\\tand\\tbreadth\\tof\\tour\\tcore\\tprojects\\tat\\tany\\tgiven\\ttime,\\nand\\tmay\\tfurther\\tbe\\timpacted\\tby\\tuncertainties\\tin\\tfuture\\tglobal\\tmarket\\tconditions.\\tWe\\tare\\tsimultaneously\\tramping\\tnew\\tproducts,\\tbuilding\\tor\\tramping\\nmanufacturing\\tfacilities\\ton\\tthree\\tcontinents,\\tpiloting\\tthe\\tdevelopment\\tand\\tmanufacture\\tof\\tnew\\tbattery\\tcell\\ttechnologies,\\texpanding\\tour\\tSupercharger\\nnetwork\\tand\\tinvesting\\tin\\tautonomy\\tand\\tother\\tartificial\\tintelligence\\tenabled\\ttraining\\tand\\tproducts,\\tand\\tthe\\tpace\\tof\\tour\\tcapital\\tspend\\tmay\\tvary\\tdepending\\non\\toverall\\tpriority\\tamong\\tprojects,\\tthe\\tpace\\tat\\twhich\\twe\\tmeet\\tmilestones,\\tproduction\\tadjustments\\tto\\tand\\tamong\\tour\\tvarious\\tproducts,\\tincreased\\tcapital\\nefficiencies\\tand\\tthe\\taddition\\tof\\tnew\\tprojects.\\tOwing\\tand\\tsubject\\tto\\tthe\\tforegoing\\tas\\twell\\tas\\tthe\\tpipeline\\tof\\tannounced\\tprojects\\tunder\\tdevelopment,\\tall\\nother\\tcontinuing\\tinfrastructure\\tgrowth\\tand\\tvarying\\tlevels\\tof\\tinflation,\\twe\\tcurrently\\texpect\\tour\\tcapital\\texpenditures\\tto\\texceed\\t$10.00\\tbillion\\tin\\t2024\\tand\\tbe\\nbetween\\t$8.00\\tto\\t$10.00\\tbillion\\tin\\teach\\tof\\tthe\\tfollowing\\ttwo\\tfiscal\\tyears.\\nOur\\tbusiness\\thas\\tbeen\\tconsistently\\tgenerating\\tcash\\tflow\\tfrom\\toperations\\tin\\texcess\\tof\\tour\\tlevel\\tof\\tcapital\\tspend,\\tand\\twith\\tbetter\\tworking\\tcapital\\nmanagement\\tresulting\\tin\\tshorter\\tdays\\tsales\\toutstanding\\tthan\\tdays\\tpayable\\toutstanding,\\tour\\tsales\\tgrowth\\tis\\talso\\tgenerally\\tfacilitating\\tpositive\\tcash\\ngeneration.\\tWe\\thave\\tand\\twill\\tcontinue\\tto\\tutilize\\tsuch\\tcash\\tflows,\\tamong\\tother\\tthings,\\tto\\tdo\\tmore\\tvertical\\tintegration,\\texpand\\tour\\tproduct\\troadmap\\tand\\nprovide\\tfinancing\\toptions\\tto\\tour\\tcustomers.\\tAt\\tthe\\tsame\\ttime,\\twe\\tare\\tlikely\\tto\\tsee\\theightened\\tlevels\\tof\\tcapital\\texpenditures\\tduring\\tcertain\\tperiods\\ndepending\\ton\\tthe\\tspecific\\tpace\\tof\\tour\\tcapital-intensive\\tprojects\\tand\\tother\\tpotential\\tvariables\\tsuch\\tas\\trising\\tmaterial\\tprices\\tand\\tincreases\\tin\\tsupply\\tchain\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 36,\n        \"lines\": {\n          \"from\": 15,\n          \"to\": 29\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"and\\tlabor\\texpenses\\tresulting\\tfrom\\tchanges\\tin\\tglobal\\ttrade\\tconditions\\tand\\tlabor\\tavailability.\\tOverall,\\twe\\texpect\\tour\\tability\\tto\\tbe\\tself-funding\\tto\\tcontinue\\tas\\nlong\\tas\\tmacroeconomic\\tfactors\\tsupport\\tcurrent\\ttrends\\tin\\tour\\tsales.\\nCritical\\tAccounting\\tPolicies\\tand\\tEstimates\\nThe\\tconsolidated\\tfinancial\\tstatements\\tare\\tprepared\\tin\\taccordance\\twith\\taccounting\\tprinciples\\tgenerally\\taccepted\\tin\\tthe\\tU.S.\\t(“GAAP”).\\tThe\\npreparation\\tof\\tthe\\tconsolidated\\tfinancial\\tstatements\\trequires\\tus\\tto\\tmake\\testimates\\tand\\tassumptions\\tthat\\taffect\\tthe\\treported\\tamounts\\tof\\tassets,\\tliabilities,\\nrevenues,\\tcosts\\tand\\texpenses\\tand\\trelated\\tdisclosures.\\tWe\\tbase\\tour\\testimates\\ton\\thistorical\\texperience,\\tas\\tappropriate,\\tand\\ton\\tvarious\\tother\\tassumptions\\nthat\\twe\\tbelieve\\tto\\tbe\\treasonable\\tunder\\tthe\\tcircumstances.\\tChanges\\tin\\tthe\\taccounting\\testimates\\tare\\treasonably\\tlikely\\tto\\toccur\\tfrom\\tperiod\\tto\\tperiod.\\nAccordingly,\\tactual\\tresults\\tcould\\tdiffer\\tsignificantly\\tfrom\\tthe\\testimates\\tmade\\tby\\tour\\tmanagement.\\tWe\\tevaluate\\tour\\testimates\\tand\\tassumptions\\ton\\tan\\nongoing\\tbasis.\\tTo\\tthe\\textent\\tthat\\tthere\\tare\\tmaterial\\tdifferences\\tbetween\\tthese\\testimates\\tand\\tactual\\tresults,\\tour\\tfuture\\tfinancial\\tstatement\\tpresentation,\\nfinancial\\tcondition,\\tresults\\tof\\toperations\\tand\\tcash\\tflows\\tmay\\tbe\\taffected.\\n35\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 36,\n        \"lines\": {\n          \"from\": 30,\n          \"to\": 40\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"The\\testimates\\tused\\tfor,\\tbut\\tnot\\tlimited\\tto,\\tdetermining\\tsignificant\\teconomic\\tincentive\\tfor\\tresale\\tvalue\\tguarantee\\tarrangements,\\tsales\\treturn\\nreserves,\\tthe\\tcollectability\\tof\\taccounts\\tand\\tfinancing\\treceivables,\\tinventory\\tvaluation,\\twarranties,\\tfair\\tvalue\\tof\\tlong-lived\\tassets,\\tgoodwill,\\tfair\\tvalue\\tof\\nfinancial\\tinstruments,\\tfair\\tvalue\\tand\\tresidual\\tvalue\\tof\\toperating\\tlease\\tvehicles\\tand\\tsolar\\tenergy\\tsystems\\tsubject\\tto\\tleases\\tcould\\tbe\\timpacted.\\tWe\\thave\\nassessed\\tthe\\timpact\\tand\\tare\\tnot\\taware\\tof\\tany\\tspecific\\tevents\\tor\\tcircumstances\\tthat\\trequired\\tan\\tupdate\\tto\\tour\\testimates\\tand\\tassumptions\\tor\\tmaterially\\naffected\\tthe\\tcarrying\\tvalue\\tof\\tour\\tassets\\tor\\tliabilities\\tas\\tof\\tthe\\tdate\\tof\\tissuance\\tof\\tthis\\tAnnual\\tReport\\ton\\tForm\\t10-K.\\tThese\\testimates\\tmay\\tchange\\tas\\tnew\\nevents\\toccur\\tand\\tadditional\\tinformation\\tis\\tobtained.\\tActual\\tresults\\tcould\\tdiffer\\tmaterially\\tfrom\\tthese\\testimates\\tunder\\tdifferent\\tassumptions\\tor\\tconditions.\\nRevenue\\tRecognition\\nAutomotive\\tSales\\nAutomotive\\tsales\\trevenue\\tincludes\\trevenues\\trelated\\tto\\tcash\\tand\\tfinancing\\tdeliveries\\tof\\tnew\\tvehicles,\\tand\\tspecific\\tother\\tfeatures\\tand\\tservices\\tthat\\nmeet\\tthe\\tdefinition\\tof\\ta\\tperformance\\tobligation\\tunder\\tAccounting\\tStandards\\tCodification\\t(“ASC”)\\t606,\\tRevenue\\tfrom\\tContracts\\twith\\tCustomers\\t(“ASC\\n606”),\\tincluding\\taccess\\tto\\tour\\tFSD\\tCapability\\tfeatures\\tand\\ttheir\\tongoing\\tmaintenance,\\tinternet\\tconnectivity,\\tfree\\tSupercharging\\tprograms\\tand\\tover-the-\\nair\\tsoftware\\tupdates.\\tWe\\trecognize\\trevenue\\ton\\tautomotive\\tsales\\tupon\\tdelivery\\tto\\tthe\\tcustomer,\\twhich\\tis\\twhen\\tthe\\tcontrol\\tof\\ta\\tvehicle\\ttransfers.\\nPayments\\tare\\ttypically\\treceived\\tat\\tthe\\tpoint\\tcontrol\\ttransfers\\tor\\tin\\taccordance\\twith\\tpayment\\tterms\\tcustomary\\tto\\tthe\\tbusiness,\\texcept\\tsales\\twe\\tfinance\\tfor\\nwhich\\tpayments\\tare\\tcollected\\tover\\tthe\\tcontractual\\tloan\\tterm.\\tWe\\talso\\trecognize\\ta\\tsales\\treturn\\treserve\\tbased\\ton\\thistorical\\texperience\\tplus\\tconsideration\\nfor\\texpected\\tfuture\\tmarket\\tvalues,\\twhen\\twe\\toffer\\tresale\\tvalue\\tguarantees\\tor\\tsimilar\\tbuyback\\tterms.\\tOther\\tfeatures\\tand\\tservices\\tsuch\\tas\\taccess\\tto\\tour\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 37,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 15\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"internet\\tconnectivity,\\tunlimited\\tfree\\tSupercharging\\tand\\tover-the-air\\tsoftware\\tupdates\\tare\\tprovisioned\\tupon\\tcontrol\\ttransfer\\tof\\ta\\tvehicle\\tand\\trecognized\\nover\\ttime\\ton\\ta\\tstraight-line\\tbasis\\tas\\twe\\thave\\ta\\tstand-ready\\tobligation\\tto\\tdeliver\\tsuch\\tservices\\tto\\tthe\\tcustomer.\\tOther\\tlimited\\tfree\\tSupercharging\\nincentives\\tare\\trecognized\\tbased\\ton\\tactual\\tusage\\tor\\texpiration,\\twhichever\\tis\\tearlier.\\tWe\\trecognize\\trevenue\\trelated\\tto\\tthese\\tother\\tfeatures\\tand\\tservices\\nover\\tthe\\tperformance\\tperiod,\\twhich\\tis\\tgenerally\\tthe\\texpected\\townership\\tlife\\tof\\tthe\\tvehicle.\\tRevenue\\trelated\\tto\\tFSD\\tCapability\\tfeatures\\tis\\trecognized\\twhen\\nfunctionality\\tis\\tdelivered\\tto\\tthe\\tcustomer\\tand\\ttheir\\tongoing\\tmaintenance\\tis\\trecognized\\tover\\ttime.\\tFor\\tour\\tobligations\\trelated\\tto\\tautomotive\\tsales,\\twe\\nestimate\\tstandalone\\tselling\\tprice\\tby\\tconsidering\\tcosts\\tused\\tto\\tdevelop\\tand\\tdeliver\\tthe\\tservice,\\tthird-party\\tpricing\\tof\\tsimilar\\toptions\\tand\\tother\\tinformation\\nthat\\tmay\\tbe\\tavailable.\\nInventory\\tValuation\\nInventories\\tare\\tstated\\tat\\tthe\\tlower\\tof\\tcost\\tor\\tnet\\trealizable\\tvalue.\\tCost\\tis\\tcomputed\\tusing\\tstandard\\tcost\\tfor\\tvehicles\\tand\\tenergy\\tproducts,\\twhich\\napproximates\\tactual\\tcost\\ton\\ta\\tfirst-in,\\tfirst-out\\tbasis.\\tWe\\trecord\\tinventory\\twrite-downs\\tfor\\texcess\\tor\\tobsolete\\tinventories\\tbased\\tupon\\tassumptions\\tabout\\ncurrent\\tand\\tfuture\\tdemand\\tforecasts.\\tIf\\tour\\tinventory\\ton-hand\\tis\\tin\\texcess\\tof\\tour\\tfuture\\tdemand\\tforecast,\\tthe\\texcess\\tamounts\\tare\\twritten-off.\\nWe\\talso\\treview\\tour\\tinventory\\tto\\tdetermine\\twhether\\tits\\tcarrying\\tvalue\\texceeds\\tthe\\tnet\\tamount\\trealizable\\tupon\\tthe\\tultimate\\tsale\\tof\\tthe\\tinventory.\\nThis\\trequires\\tus\\tto\\tdetermine\\tthe\\testimated\\tselling\\tprice\\tof\\tour\\tvehicles\\tless\\tthe\\testimated\\tcost\\tto\\tconvert\\tthe\\tinventory\\ton-hand\\tinto\\ta\\tfinished\\tproduct.\\nOnce\\tinventory\\tis\\twritten-down,\\ta\\tnew,\\tlower\\tcost\\tbasis\\tfor\\tthat\\tinventory\\tis\\testablished\\tand\\tsubsequent\\tchanges\\tin\\tfacts\\tand\\tcircumstances\\tdo\\tnot\\tresult\\nin\\tthe\\trestoration\\tor\\tincrease\\tin\\tthat\\tnewly\\testablished\\tcost\\tbasis.\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 37,\n        \"lines\": {\n          \"from\": 16,\n          \"to\": 30\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Should\\tour\\testimates\\tof\\tfuture\\tselling\\tprices\\tor\\tproduction\\tcosts\\tchange,\\tadditional\\tand\\tpotentially\\tmaterial\\twrite-downs\\tmay\\tbe\\trequired.\\tA\\tsmall\\nchange\\tin\\tour\\testimates\\tmay\\tresult\\tin\\ta\\tmaterial\\tcharge\\tto\\tour\\treported\\tfinancial\\tresults.\\n36\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 37,\n        \"lines\": {\n          \"from\": 31,\n          \"to\": 33\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Warranties\\nWe\\tprovide\\ta\\tmanufacturer’s\\twarranty\\ton\\tall\\tnew\\tand\\tused\\tvehicles\\tand\\ta\\twarranty\\ton\\tthe\\tinstallation\\tand\\tcomponents\\tof\\tthe\\tenergy\\tgeneration\\nand\\tstorage\\tsystems\\twe\\tsell\\tfor\\tperiods\\ttypically\\tbetween\\t10\\tto\\t25\\tyears.\\tWe\\taccrue\\ta\\twarranty\\treserve\\tfor\\tthe\\tproducts\\tsold\\tby\\tus,\\twhich\\tincludes\\tour\\nbest\\testimate\\tof\\tthe\\tprojected\\tcosts\\tto\\trepair\\tor\\treplace\\titems\\tunder\\twarranties\\tand\\trecalls\\tif\\tidentified.\\tThese\\testimates\\tare\\tbased\\ton\\tactual\\tclaims\\nincurred\\tto\\tdate\\tand\\tan\\testimate\\tof\\tthe\\tnature,\\tfrequency\\tand\\tcosts\\tof\\tfuture\\tclaims.\\tThese\\testimates\\tare\\tinherently\\tuncertain\\tand\\tchanges\\tto\\tour\\nhistorical\\tor\\tprojected\\twarranty\\texperience\\tmay\\tcause\\tmaterial\\tchanges\\tto\\tthe\\twarranty\\treserve\\tin\\tthe\\tfuture.\\tThe\\twarranty\\treserve\\tdoes\\tnot\\tinclude\\nprojected\\twarranty\\tcosts\\tassociated\\twith\\tour\\tvehicles\\tsubject\\tto\\toperating\\tlease\\taccounting\\tand\\tour\\tsolar\\tenergy\\tsystems\\tunder\\tlease\\tcontracts\\tor\\tPPAs,\\nas\\tthe\\tcosts\\tto\\trepair\\tthese\\twarranty\\tclaims\\tare\\texpensed\\tas\\tincurred.\\tThe\\tportion\\tof\\tthe\\twarranty\\treserve\\texpected\\tto\\tbe\\tincurred\\twithin\\tthe\\tnext\\t12\\nmonths\\tis\\tincluded\\twithin\\tAccrued\\tliabilities\\tand\\tother,\\twhile\\tthe\\tremaining\\tbalance\\tis\\tincluded\\twithin\\tOther\\tlong-term\\tliabilities\\ton\\tthe\\tconsolidated\\nbalance\\tsheets.\\tFor\\tliabilities\\tthat\\twe\\tare\\tentitled\\tto\\treceive\\tindemnification\\tfrom\\tour\\tsuppliers,\\twe\\trecord\\treceivables\\tfor\\tthe\\tcontractually\\tobligated\\namounts\\ton\\tthe\\tconsolidated\\tbalance\\tsheets\\tas\\ta\\tcomponent\\tof\\tPrepaid\\texpenses\\tand\\tother\\tcurrent\\tassets\\tfor\\tthe\\tcurrent\\tportion\\tand\\tas\\tOther\\tnon-\\ncurrent\\tassets\\tfor\\tthe\\tlong-term\\tportion.\\tWarranty\\texpense\\tis\\trecorded\\tas\\ta\\tcomponent\\tof\\tCost\\tof\\trevenues\\tin\\tthe\\tconsolidated\\tstatements\\tof\\toperations.\\nDue\\tto\\tthe\\tmagnitude\\tof\\tour\\tautomotive\\tbusiness,\\tour\\taccrued\\twarranty\\tbalance\\tis\\tprimarily\\trelated\\tto\\tour\\tautomotive\\tsegment.\\nStock-Based\\tCompensation\\nWe\\tuse\\tthe\\tfair\\tvalue\\tmethod\\tof\\taccounting\\tfor\\tour\\tstock\\toptions\\tand\\trestricted\\tstock\\tunits\\t(“RSUs”)\\tgranted\\tto\\temployees\\tand\\tfor\\tour\\temployee\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 38,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 15\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"stock\\tpurchase\\tplan\\t(the\\t“ESPP”)\\tto\\tmeasure\\tthe\\tcost\\tof\\temployee\\tservices\\treceived\\tin\\texchange\\tfor\\tthe\\tstock-based\\tawards.\\tThe\\tfair\\tvalue\\tof\\tstock\\noption\\tawards\\twith\\tonly\\tservice\\tand/or\\tperformance\\tconditions\\tis\\testimated\\ton\\tthe\\tgrant\\tor\\toffering\\tdate\\tusing\\tthe\\tBlack-Scholes\\toption-pricing\\tmodel.\\nThe\\tBlack-Scholes\\toption-pricing\\tmodel\\trequires\\tinputs\\tsuch\\tas\\tthe\\trisk-free\\tinterest\\trate,\\texpected\\tterm\\tand\\texpected\\tvolatility.\\tThese\\tinputs\\tare\\nsubjective\\tand\\tgenerally\\trequire\\tsignificant\\tjudgment.\\tThe\\tfair\\tvalue\\tof\\tRSUs\\tis\\tmeasured\\ton\\tthe\\tgrant\\tdate\\tbased\\ton\\tthe\\tclosing\\tfair\\tmarket\\tvalue\\tof\\tour\\ncommon\\tstock.\\tThe\\tresulting\\tcost\\tis\\trecognized\\tover\\tthe\\tperiod\\tduring\\twhich\\tan\\temployee\\tis\\trequired\\tto\\tprovide\\tservice\\tin\\texchange\\tfor\\tthe\\tawards,\\nusually\\tthe\\tvesting\\tperiod,\\twhich\\tis\\tgenerally\\tfour\\tyears\\tfor\\tstock\\toptions\\tand\\tRSUs\\tand\\tsix\\tmonths\\tfor\\tthe\\tESPP.\\tStock-based\\tcompensation\\texpense\\tis\\nrecognized\\ton\\ta\\tstraight-line\\tbasis,\\tnet\\tof\\tactual\\tforfeitures\\tin\\tthe\\tperiod.\\nFor\\tperformance-based\\tawards,\\tstock-based\\tcompensation\\texpense\\tis\\trecognized\\tover\\tthe\\texpected\\tperformance\\tachievement\\tperiod\\tof\\tindividual\\nperformance\\tmilestones\\twhen\\tthe\\tachievement\\tof\\teach\\tindividual\\tperformance\\tmilestone\\tbecomes\\tprobable.\\nAs\\twe\\taccumulate\\tadditional\\temployee\\tstock-based\\tawards\\tdata\\tover\\ttime\\tand\\tas\\twe\\tincorporate\\tmarket\\tdata\\trelated\\tto\\tour\\tcommon\\tstock,\\twe\\tmay\\ncalculate\\tsignificantly\\tdifferent\\tvolatilities\\tand\\texpected\\tlives,\\twhich\\tcould\\tmaterially\\timpact\\tthe\\tvaluation\\tof\\tour\\tstock-based\\tawards\\tand\\tthe\\tstock-based\\ncompensation\\texpense\\tthat\\twe\\twill\\trecognize\\tin\\tfuture\\tperiods.\\tStock-based\\tcompensation\\texpense\\tis\\trecorded\\tin\\tCost\\tof\\trevenues,\\tResearch\\tand\\ndevelopment\\texpense\\tand\\tSelling,\\tgeneral\\tand\\tadministrative\\texpense\\tin\\tthe\\tconsolidated\\tstatements\\tof\\toperations.\\nIncome\\tTaxes\\nWe\\tare\\tsubject\\tto\\tincome\\ttaxes\\tin\\tthe\\tU.S.\\tand\\tin\\tmany\\tforeign\\tjurisdictions.\\tSignificant\\tjudgment\\tis\\trequired\\tin\\tdetermining\\tour\\tprovision\\tfor\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 38,\n        \"lines\": {\n          \"from\": 16,\n          \"to\": 30\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"income\\ttaxes,\\tour\\tdeferred\\ttax\\tassets\\tand\\tliabilities\\tand\\tany\\tvaluation\\tallowance\\trecorded\\tagainst\\tour\\tnet\\tdeferred\\ttax\\tassets\\tthat\\tare\\tnot\\tmore\\tlikely\\nthan\\tnot\\tto\\tbe\\trealized.\\tWe\\tmonitor\\tthe\\trealizability\\tof\\tour\\tdeferred\\ttax\\tassets\\ttaking\\tinto\\taccount\\tall\\trelevant\\tfactors\\tat\\teach\\treporting\\tperiod.\\tIn\\ncompleting\\tour\\tassessment\\tof\\trealizability\\tof\\tour\\tdeferred\\ttax\\tassets,\\twe\\tconsider\\tour\\thistory\\tof\\tincome\\t(loss)\\tmeasured\\tat\\tpre-tax\\tincome\\t(loss)\\tadjusted\\nfor\\tpermanent\\tbook-tax\\tdifferences\\ton\\ta\\tjurisdictional\\tbasis,\\tvolatility\\tin\\tactual\\tearnings,\\texcess\\ttax\\tbenefits\\trelated\\tto\\tstock-based\\tcompensation\\tin\\nrecent\\tprior\\tyears,\\tand\\timpacts\\tof\\tthe\\ttiming\\tof\\treversal\\tof\\texisting\\ttemporary\\tdifferences.\\tWe\\talso\\trely\\ton\\tour\\tassessment\\tof\\tthe\\tCompany’s\\tprojected\\nfuture\\tresults\\tof\\tbusiness\\toperations,\\tincluding\\tuncertainty\\tin\\tfuture\\toperating\\tresults\\trelative\\tto\\thistorical\\tresults,\\tvolatility\\tin\\tthe\\tmarket\\tprice\\tof\\tour\\ncommon\\tstock\\tand\\tits\\tperformance\\tover\\ttime,\\tvariable\\tmacroeconomic\\tconditions\\timpacting\\tour\\tability\\tto\\tforecast\\tfuture\\ttaxable\\tincome,\\tand\\tchanges\\tin\\nbusiness\\tthat\\tmay\\taffect\\tthe\\texistence\\tand\\tmagnitude\\tof\\tfuture\\ttaxable\\tincome.\\tOur\\tvaluation\\tallowance\\tassessment\\tis\\tbased\\ton\\tour\\tbest\\testimate\\tof\\nfuture\\tresults\\tconsidering\\tall\\tavailable\\tinformation.\\n37\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 38,\n        \"lines\": {\n          \"from\": 31,\n          \"to\": 40\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Furthermore,\\tsignificant\\tjudgment\\tis\\trequired\\tin\\tevaluating\\tour\\ttax\\tpositions.\\tIn\\tthe\\tordinary\\tcourse\\tof\\tbusiness,\\tthere\\tare\\tmany\\ttransactions\\tand\\ncalculations\\tfor\\twhich\\tthe\\tultimate\\ttax\\tsettlement\\tis\\tuncertain.\\tAs\\ta\\tresult,\\twe\\trecognize\\tthe\\teffect\\tof\\tthis\\tuncertainty\\ton\\tour\\ttax\\tattributes\\tor\\ttaxes\\npayable\\tbased\\ton\\tour\\testimates\\tof\\tthe\\teventual\\toutcome.\\tThese\\teffects\\tare\\trecognized\\twhen,\\tdespite\\tour\\tbelief\\tthat\\tour\\ttax\\treturn\\tpositions\\tare\\nsupportable,\\twe\\tbelieve\\tthat\\tit\\tis\\tmore\\tlikely\\tthan\\tnot\\tthat\\tsome\\tof\\tthose\\tpositions\\tmay\\tnot\\tbe\\tfully\\tsustained\\tupon\\treview\\tby\\ttax\\tauthorities.\\tWe\\tare\\nrequired\\tto\\tfile\\tincome\\ttax\\treturns\\tin\\tthe\\tU.S.\\tand\\tvarious\\tforeign\\tjurisdictions,\\twhich\\trequires\\tus\\tto\\tinterpret\\tthe\\tapplicable\\ttax\\tlaws\\tand\\tregulations\\tin\\neffect\\tin\\tsuch\\tjurisdictions.\\tSuch\\treturns\\tare\\tsubject\\tto\\taudit\\tby\\tthe\\tvarious\\tfederal,\\tstate\\tand\\tforeign\\ttaxing\\tauthorities,\\twho\\tmay\\tdisagree\\twith\\trespect\\tto\\nour\\ttax\\tpositions.\\tWe\\tbelieve\\tthat\\tour\\tconsideration\\tis\\tadequate\\tfor\\tall\\topen\\taudit\\tyears\\tbased\\ton\\tour\\tassessment\\tof\\tmany\\tfactors,\\tincluding\\tpast\\nexperience\\tand\\tinterpretations\\tof\\ttax\\tlaw.\\tWe\\treview\\tand\\tupdate\\tour\\testimates\\tin\\tlight\\tof\\tchanging\\tfacts\\tand\\tcircumstances,\\tsuch\\tas\\tthe\\tclosing\\tof\\ta\\ttax\\naudit,\\tthe\\tlapse\\tof\\ta\\tstatute\\tof\\tlimitations\\tor\\ta\\tchange\\tin\\testimate.\\tTo\\tthe\\textent\\tthat\\tthe\\tfinal\\ttax\\toutcome\\tof\\tthese\\tmatters\\tdiffers\\tfrom\\tour\\texpectations,\\nsuch\\tdifferences\\tmay\\timpact\\tincome\\ttax\\texpense\\tin\\tthe\\tperiod\\tin\\twhich\\tsuch\\tdetermination\\tis\\tmade.\\nResults\\tof\\tOperations\\nRevenues\\n\\tYear\\tEnded\\tDecember\\t31,2023\\tvs.\\t2022\\tChange2022\\tvs.\\t2021\\tChange\\n(Dollars\\tin\\tmillions)202320222021$%$%\\nAutomotive\\tsales$78,509\\t$67,210\\t$44,125\\t$11,299\\t17\\t%$23,085\\t52\\t%\\nAutomotive\\tregulatory\\tcredits1,790\\t1,776\\t1,465\\t14\\t1\\t%311\\t21\\t%\\nAutomotive\\tleasing2,120\\t2,476\\t1,642\\t(356)(14)%834\\t51\\t%\\nTotal\\tautomotive\\trevenues82,419\\t71,462\\t47,232\\t10,957\\t15\\t%24,230\\t51\\t%\\nServices\\tand\\tother8,319\\t6,091\\t3,802\\t2,228\\t37\\t%2,289\\t60\\t%\\nTotal\\tautomotive\\t&\\tservices\\tand\\tother\\tsegment\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 39,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 20\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Total\\tautomotive\\t&\\tservices\\tand\\tother\\tsegment\\nrevenue90,738\\t77,553\\t51,034\\t13,185\\t17\\t%26,519\\t52\\t%\\nEnergy\\tgeneration\\tand\\tstorage\\tsegment\\trevenue6,035\\t3,909\\t2,789\\t2,126\\t54\\t%1,120\\t40\\t%\\nTotal\\trevenues\\n$96,773\\t$81,462\\t$53,823\\t$15,311\\t\\n19\\t%\\n$27,639\\t\\n51\\t%\\nAutomotive\\t&\\tServices\\tand\\tOther\\tSegment\\nAutomotive\\tsales\\trevenue\\tincludes\\trevenues\\trelated\\tto\\tcash\\tand\\tfinancing\\tdeliveries\\tof\\tnew\\tModel\\tS,\\tModel\\tX,\\tSemi,\\tModel\\t3,\\tModel\\tY,\\tand\\nCybertruck\\tvehicles,\\tincluding\\taccess\\tto\\tour\\tFSD\\tCapability\\tfeatures\\tand\\ttheir\\tongoing\\tmaintenance,\\tinternet\\tconnectivity,\\tfree\\tSupercharging\\tprograms\\nand\\tover-the-air\\tsoftware\\tupdates.\\tThese\\tdeliveries\\tare\\tvehicles\\tthat\\tare\\tnot\\tsubject\\tto\\tlease\\taccounting.\\nAutomotive\\tregulatory\\tcredits\\tincludes\\tsales\\tof\\tregulatory\\tcredits\\tto\\tother\\tautomotive\\tmanufacturers.\\tOur\\trevenue\\tfrom\\tautomotive\\tregulatory\\ncredits\\tis\\tdirectly\\trelated\\tto\\tour\\tnew\\tvehicle\\tproduction,\\tsales\\tand\\tpricing\\tnegotiated\\twith\\tour\\tcustomers.\\tWe\\tmonetize\\tthem\\tproactively\\tas\\tnew\\tvehicles\\nare\\tsold\\tbased\\ton\\tstanding\\tarrangements\\twith\\tbuyers\\tof\\tsuch\\tcredits,\\ttypically\\tas\\tclose\\tas\\tpossible\\tto\\tthe\\tproduction\\tand\\tdelivery\\tof\\tthe\\tvehicle\\tor\\nchanges\\tin\\tregulation\\timpacting\\tthe\\tcredits.\\nAutomotive\\tleasing\\trevenue\\tincludes\\tthe\\tamortization\\tof\\trevenue\\tfor\\tvehicles\\tunder\\tdirect\\toperating\\tlease\\tagreements.\\tAdditionally,\\tautomotive\\nleasing\\trevenue\\tincludes\\tdirect\\tsales-type\\tleasing\\tprograms\\twhere\\twe\\trecognize\\tall\\trevenue\\tassociated\\twith\\tthe\\tsales-type\\tlease\\tupon\\tdelivery\\tto\\tthe\\ncustomer.\\nServices\\tand\\tother\\trevenue\\tconsists\\tof\\tsales\\tof\\tused\\tvehicles,\\tnon-warranty\\tafter-sales\\tvehicle\\tservices,\\tbody\\tshop\\tand\\tparts,\\tpaid\\tSupercharging,\\nvehicle\\tinsurance\\trevenue\\tand\\tretail\\tmerchandise.\\n2023\\tcompared\\tto\\t2022\\nAutomotive\\tsales\\trevenue\\tincreased\\t$11.30\\tbillion,\\tor\\t17%,\\tin\\tthe\\tyear\\tended\\tDecember\\t31,\\t2023\\tas\\tcompared\\tto\\tthe\\tyear\\tended\\tDecember\\t31,\\n2022,\\tprimarily\\tdue\\tto\\tan\\tincrease\\tof\\t473,382\\tcombined\\tModel\\t3\\tand\\tModel\\tY\\tcash\\tdeliveries\\tfrom\\tproduction\\tramping\\tof\\tModel\\tY\\tglobally.\\tThe\\tincrease\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 39,\n        \"lines\": {\n          \"from\": 20,\n          \"to\": 43\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"was\\tpartially\\toffset\\tby\\ta\\tlower\\taverage\\tselling\\tprice\\ton\\tour\\tvehicles\\tdriven\\tby\\toverall\\tprice\\treductions\\tyear\\tover\\tyear,\\tsales\\tmix,\\tand\\ta\\tnegative\\timpact\\nfrom\\tthe\\tUnited\\tStates\\tdollar\\tstrengthening\\tagainst\\tother\\tforeign\\tcurrencies\\tin\\tthe\\tyear\\tended\\tDecember\\t31,\\t2023\\tcompared\\tto\\tthe\\tprior\\tyear.\\nAutomotive\\tregulatory\\tcredits\\trevenue\\tincreased\\t$14\\tmillion,\\tor\\t1%,\\tin\\tthe\\tyear\\tended\\tDecember\\t31,\\t2023\\tas\\tcompared\\tto\\tthe\\tyear\\tended\\nDecember\\t31,\\t2022.\\n38\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 39,\n        \"lines\": {\n          \"from\": 44,\n          \"to\": 48\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Automotive\\tleasing\\trevenue\\tdecreased\\t$356\\tmillion,\\tor\\t14%,\\tin\\tthe\\tyear\\tended\\tDecember\\t31,\\t2023\\tas\\tcompared\\tto\\tthe\\tyear\\tended\\tDecember\\t31,\\n2022.\\tThe\\tdecrease\\twas\\tprimarily\\tdue\\tto\\ta\\tdecrease\\tin\\tdirect\\tsales-type\\tleasing\\trevenue\\tdriven\\tby\\tlower\\tdeliveries\\tyear\\tover\\tyear,\\tpartially\\toffset\\tby\\tan\\nincrease\\tfrom\\tour\\tgrowing\\tdirect\\toperating\\tlease\\tportfolio.\\nServices\\tand\\tother\\trevenue\\tincreased\\t$2.23\\tbillion,\\tor\\t37%,\\tin\\tthe\\tyear\\tended\\tDecember\\t31,\\t2023\\tas\\tcompared\\tto\\tthe\\tyear\\tended\\tDecember\\t31,\\n2022.\\tThe\\tincrease\\twas\\tprimarily\\tdue\\tto\\thigher\\tused\\tvehicle\\trevenue\\tdriven\\tby\\tincreases\\tin\\tvolume,\\tbody\\tshop\\tand\\tpart\\tsales\\trevenue,\\tnon-warranty\\nmaintenance\\tservices\\trevenue,\\tpaid\\tSupercharging\\trevenue\\tand\\tinsurance\\tservices\\trevenue,\\tall\\tof\\twhich\\tare\\tprimarily\\tattributable\\tto\\tour\\tgrowing\\tfleet.\\nThe\\tincreases\\twere\\tpartially\\toffset\\tby\\ta\\tdecrease\\tin\\tthe\\taverage\\tselling\\tprice\\tof\\tused\\tvehicles.\\nEnergy\\tGeneration\\tand\\tStorage\\tSegment\\nEnergy\\tgeneration\\tand\\tstorage\\trevenue\\tincludes\\tsales\\tand\\tleasing\\tof\\tsolar\\tenergy\\tgeneration\\tand\\tenergy\\tstorage\\tproducts,\\tfinancing\\tof\\tsolar\\tenergy\\ngeneration\\tproducts,\\tservices\\trelated\\tto\\tsuch\\tproducts\\tand\\tsales\\tof\\tsolar\\tenergy\\tsystems\\tincentives.\\n2023\\tcompared\\tto\\t2022\\nEnergy\\tgeneration\\tand\\tstorage\\trevenue\\tincreased\\t$2.13\\tbillion,\\tor\\t54%,\\tin\\tthe\\tyear\\tended\\tDecember\\t31,\\t2023\\tas\\tcompared\\tto\\tthe\\tyear\\tended\\nDecember\\t31,\\t2022.\\tThe\\tincrease\\twas\\tprimarily\\tdue\\tto\\tan\\tincrease\\tin\\tdeployments\\tof\\tMegapack.\\nCost\\tof\\tRevenues\\tand\\tGross\\tMargin\\nYear\\tEnded\\tDecember\\t31,2023\\tvs.\\t2022\\tChange2022\\tvs.\\t2021\\tChange\\n(Dollars\\tin\\tmillions)202320222021$%$%\\nCost\\tof\\trevenues\\nAutomotive\\tsales$65,121\\t$49,599\\t$32,415\\t$15,522\\t31\\t%$17,184\\t53\\t%\\nAutomotive\\tleasing1,268\\t1,509\\t978\\t(241)(16)%531\\t54\\t%\\nTotal\\tautomotive\\tcost\\tof\\trevenues66,389\\t51,108\\t33,393\\t15,281\\t30\\t%17,715\\t53\\t%\\nServices\\tand\\tother7,830\\t5,880\\t3,906\\t1,950\\t33\\t%1,974\\t51\\t%\\nTotal\\tautomotive\\t&\\tservices\\tand\\tother\\tsegment\\ncost\\tof\\trevenues74,219\\t56,988\\t37,299\\t17,231\\t30\\t%19,689\\t53\\t%\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 40,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 23\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Energy\\tgeneration\\tand\\tstorage\\tsegment4,894\\t3,621\\t2,918\\t1,273\\t35\\t%703\\t24\\t%\\nTotal\\tcost\\tof\\trevenues\\n$79,113\\t$60,609\\t$40,217\\t$18,504\\t\\n31\\t%\\n$20,392\\t\\n51\\t%\\nGross\\tprofit\\ttotal\\tautomotive$16,030\\t$20,354\\t$13,839\\t\\nGross\\tmargin\\ttotal\\tautomotive19.4\\t%28.5\\t%29.3\\t%\\nGross\\tprofit\\ttotal\\tautomotive\\t&\\tservices\\tand\\tother\\nsegment$16,519\\t$20,565\\t$13,735\\t\\nGross\\tmargin\\ttotal\\tautomotive\\t&\\tservices\\tand\\tother\\nsegment18.2\\t%26.5\\t%26.9\\t%\\nGross\\tprofit\\tenergy\\tgeneration\\tand\\tstorage\\tsegment$1,141\\t$288\\t$(129)\\nGross\\tmargin\\tenergy\\tgeneration\\tand\\tstorage\\tsegment18.9\\t%7.4\\t%(4.6)%\\nTotal\\tgross\\tprofit$17,660\\t$20,853\\t$13,606\\t\\nTotal\\tgross\\tmargin18.2\\t%25.6\\t%25.3\\t%\\n39\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 40,\n        \"lines\": {\n          \"from\": 24,\n          \"to\": 40\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Automotive\\t&\\tServices\\tand\\tOther\\tSegment\\nCost\\tof\\tautomotive\\tsales\\trevenue\\tincludes\\tdirect\\tand\\tindirect\\tmaterials,\\tlabor\\tcosts,\\tmanufacturing\\toverhead,\\tincluding\\tdepreciation\\tcosts\\tof\\ttooling\\nand\\tmachinery,\\tshipping\\tand\\tlogistic\\tcosts,\\tvehicle\\tconnectivity\\tcosts,\\tFSD\\tongoing\\tmaintenance\\tcosts,\\tallocations\\tof\\telectricity\\tand\\tinfrastructure\\tcosts\\nrelated\\tto\\tour\\tSupercharger\\tnetwork\\tand\\treserves\\tfor\\testimated\\twarranty\\texpenses.\\tCost\\tof\\tautomotive\\tsales\\trevenues\\talso\\tincludes\\tadjustments\\tto\\nwarranty\\texpense\\tand\\tcharges\\tto\\twrite\\tdown\\tthe\\tcarrying\\tvalue\\tof\\tour\\tinventory\\twhen\\tit\\texceeds\\tits\\testimated\\tnet\\trealizable\\tvalue\\tand\\tto\\tprovide\\tfor\\nobsolete\\tand\\ton-hand\\tinventory\\tin\\texcess\\tof\\tforecasted\\tdemand.\\tAdditionally,\\tcost\\tof\\tautomotive\\tsales\\trevenue\\tbenefits\\tfrom\\tmanufacturing\\tcredits\\nearned.\\nCost\\tof\\tautomotive\\tleasing\\trevenue\\tincludes\\tthe\\tdepreciation\\tof\\toperating\\tlease\\tvehicles,\\tcost\\tof\\tgoods\\tsold\\tassociated\\twith\\tdirect\\tsales-type\\tleases\\nand\\twarranty\\texpense\\trelated\\tto\\tleased\\tvehicles.\\nCosts\\tof\\tservices\\tand\\tother\\trevenue\\tincludes\\tcost\\tof\\tused\\tvehicles\\tincluding\\trefurbishment\\tcosts,\\tcosts\\tassociated\\twith\\tproviding\\tnon-warranty\\nafter-sales\\tservices,\\tcosts\\tassociated\\twith\\tour\\tbody\\tshops\\tand\\tpart\\tsales,\\tcosts\\tof\\tpaid\\tSupercharging,\\tcosts\\tto\\tprovide\\tvehicle\\tinsurance\\tand\\tcosts\\tfor\\nretail\\tmerchandise.\\n2023\\tcompared\\tto\\t2022\\nCost\\tof\\tautomotive\\tsales\\trevenue\\tincreased\\t$15.52\\tbillion,\\tor\\t31%,\\tin\\tthe\\tyear\\tended\\tDecember\\t31,\\t2023\\tas\\tcompared\\tto\\tthe\\tyear\\tended\\nDecember\\t31,\\t2022.\\tCost\\tof\\tautomotive\\tsales\\trevenue\\tincreased\\tin\\tline\\twith\\tthe\\tchange\\tin\\tdeliveries\\tyear\\tover\\tyear,\\tas\\tdiscussed\\tabove.\\tThe\\tincrease\\nwas\\tpartially\\toffset\\tby\\ta\\tdecrease\\tin\\tthe\\taverage\\tcombined\\tcost\\tper\\tunit\\tof\\tour\\tvehicles\\tprimarily\\tdue\\tto\\tsales\\tmix,\\tlower\\tinbound\\tfreight,\\ta\\tdecrease\\tin\\nmaterial\\tcosts\\tand\\tlower\\tmanufacturing\\tcosts\\tfrom\\tbetter\\tfixed\\tcost\\tabsorption.\\tOur\\tcosts\\tof\\trevenue\\twere\\talso\\tpositively\\timpacted\\tby\\tthe\\tUnited\\tStates\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 41,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 17\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"dollar\\tstrengthening\\tagainst\\tour\\tforeign\\tcurrencies\\tas\\tcompared\\tto\\tthe\\tprior\\tperiods\\tand\\tby\\tthe\\tIRA\\tmanufacturing\\tcredits\\tearned\\tduring\\tthe\\tcurrent\\tyear.\\nCost\\tof\\tautomotive\\tleasing\\trevenue\\tdecreased\\t$241\\tmillion,\\tor\\t16%,\\tin\\tthe\\tyear\\tended\\tDecember\\t31,\\t2023\\tas\\tcompared\\tto\\tthe\\tyear\\tended\\nDecember\\t31,\\t2022.\\tThe\\tdecrease\\twas\\tprimarily\\tdue\\tto\\ta\\tdecrease\\tin\\tdirect\\tsales-type\\tleasing\\tcost\\tof\\trevenue\\tdriven\\tby\\tlower\\tdeliveries\\tyear\\tover\\tyear.\\nCost\\tof\\tservices\\tand\\tother\\trevenue\\tincreased\\t$1.95\\tbillion,\\tor\\t33%,\\tin\\tthe\\tyear\\tended\\tDecember\\t31,\\t2023\\tas\\tcompared\\tto\\tthe\\tyear\\tended\\nDecember\\t31,\\t2022.\\tThe\\tincrease\\twas\\tgenerally\\tin\\tline\\twith\\tthe\\tchanges\\tin\\tservices\\tand\\tother\\trevenue\\tas\\tdiscussed\\tabove.\\nGross\\tmargin\\tfor\\ttotal\\tautomotive\\tdecreased\\tfrom\\t28.5%\\tto\\t19.4%\\tin\\tthe\\tyear\\tended\\tDecember\\t31,\\t2023\\tas\\tcompared\\tto\\tthe\\tyear\\tended\\nDecember\\t31,\\t2022.\\tThe\\tdecrease\\twas\\tprimarily\\tdue\\tto\\ta\\tlower\\taverage\\tselling\\tprice\\ton\\tour\\tvehicles\\tpartially\\toffset\\tby\\tthe\\tfavorable\\tchange\\tin\\tour\\naverage\\tcombined\\tcost\\tper\\tunit\\tof\\tour\\tvehicles\\tand\\tIRA\\tmanufacturing\\tcredits\\tearned\\tas\\tdiscussed\\tabove.\\nGross\\tmargin\\tfor\\ttotal\\tautomotive\\t&\\tservices\\tand\\tother\\tsegment\\tdecreased\\tfrom\\t26.5%\\tto\\t18.2%\\tin\\tthe\\tyear\\tended\\tDecember\\t31,\\t2023\\tas\\ncompared\\tto\\tthe\\tyear\\tended\\tDecember\\t31,\\t2022,\\tprimarily\\tdue\\tto\\tthe\\tautomotive\\tgross\\tmargin\\tdecrease\\tdiscussed\\tabove.\\nEnergy\\tGeneration\\tand\\tStorage\\tSegment\\nCost\\tof\\tenergy\\tgeneration\\tand\\tstorage\\trevenue\\tincludes\\tdirect\\tand\\tindirect\\tmaterial\\tand\\tlabor\\tcosts,\\twarehouse\\trent,\\tfreight,\\twarranty\\texpense,\\nother\\toverhead\\tcosts\\tand\\tamortization\\tof\\tcertain\\tacquired\\tintangible\\tassets.\\tCost\\tof\\tenergy\\tgeneration\\tand\\tstorage\\trevenue\\talso\\tincludes\\tcharges\\tto\\twrite\\ndown\\tthe\\tcarrying\\tvalue\\tof\\tour\\tinventory\\twhen\\tit\\texceeds\\tits\\testimated\\tnet\\trealizable\\tvalue\\tand\\tto\\tprovide\\tfor\\tobsolete\\tand\\ton-hand\\tinventory\\tin\\texcess\\nof\\tforecasted\\tdemand.\\tAdditionally,\\tcost\\tof\\tenergy\\tgeneration\\tand\\tstorage\\trevenue\\tbenefits\\tfrom\\tmanufacturing\\tcredits\\tearned.\\tIn\\tagreements\\tfor\\tsolar\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 41,\n        \"lines\": {\n          \"from\": 18,\n          \"to\": 32\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"energy\\tsystems\\tand\\tPPAs\\twhere\\twe\\tare\\tthe\\tlessor,\\tthe\\tcost\\tof\\trevenue\\tis\\tprimarily\\tcomprised\\tof\\tdepreciation\\tof\\tthe\\tcost\\tof\\tleased\\tsolar\\tenergy\\tsystems,\\nmaintenance\\tcosts\\tassociated\\twith\\tthose\\tsystems\\tand\\tamortization\\tof\\tany\\tinitial\\tdirect\\tcosts.\\n2023\\tcompared\\tto\\t2022\\nCost\\tof\\tenergy\\tgeneration\\tand\\tstorage\\trevenue\\tincreased\\t$1.27\\tbillion,\\tor\\t35%,\\tin\\tthe\\tyear\\tended\\tDecember\\t31,\\t2023\\tas\\tcompared\\tto\\tthe\\tyear\\nended\\tDecember\\t31,\\t2022,\\tin\\tline\\twith\\tthe\\tincrease\\tin\\tMegapack\\tdeployments\\tyear\\tover\\tyear,\\tas\\tdiscussed\\tabove.\\tThis\\tincrease\\twas\\tpartially\\toffset\\tby\\tan\\nimprovement\\tin\\tproduction\\tramping\\tthat\\tdrove\\tdown\\tthe\\taverage\\tcost\\tper\\tMWh\\tof\\tMegapack\\tas\\twell\\tas\\tIRA\\tmanufacturing\\tcredits\\tearned\\tduring\\tthe\\ncurrent\\tyear.\\n40\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 41,\n        \"lines\": {\n          \"from\": 33,\n          \"to\": 40\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Gross\\tmargin\\tfor\\tenergy\\tgeneration\\tand\\tstorage\\tincreased\\tfrom\\t7.4%\\tto\\t18.9%\\tin\\tthe\\tyear\\tended\\tDecember\\t31,\\t2023\\tas\\tcompared\\tto\\tthe\\tyear\\nended\\tDecember\\t31,\\t2022.\\tThe\\tincrease\\twas\\tdriven\\tby\\tan\\timprovement\\tin\\tour\\tMegapack\\tgross\\tmargin\\tfrom\\tlower\\taverage\\tcost\\tper\\tMWh\\tand\\ta\\thigher\\nproportion\\tof\\tMegapack,\\twhich\\toperated\\tat\\ta\\thigher\\tgross\\tmargin,\\twithin\\tthe\\tsegment\\tas\\tcompared\\tto\\tthe\\tprior\\tyear\\tperiods.\\tAdditionally,\\tthere\\twas\\ta\\nmargin\\tbenefit\\tfrom\\tIRA\\tmanufacturing\\tcredits\\tearned.\\nResearch\\tand\\tDevelopment\\tExpense\\nYear\\tEnded\\tDecember\\t31,2023\\tvs.\\t2022\\tChange2022\\tvs.\\t2021\\tChange\\n(Dollars\\tin\\tmillions)202320222021$%$%\\nResearch\\tand\\tdevelopment\\n$3,969\\t$3,075\\t$2,593\\t$894\\t29\\t%$482\\t19\\t%\\nAs\\ta\\tpercentage\\tof\\trevenues4\\t%4\\t%5\\t%\\nResearch\\tand\\tdevelopment\\t(“R&D”)\\texpenses\\tconsist\\tprimarily\\tof\\tpersonnel\\tcosts\\tfor\\tour\\tteams\\tin\\tengineering\\tand\\tresearch,\\tmanufacturing\\nengineering\\tand\\tmanufacturing\\ttest\\torganizations,\\tprototyping\\texpense,\\tcontract\\tand\\tprofessional\\tservices\\tand\\tamortized\\tequipment\\texpense.\\nR&D\\texpenses\\tincreased\\t$894\\tmillion,\\tor\\t29%,\\tin\\tthe\\tyear\\tended\\tDecember\\t31,\\t2023\\tas\\tcompared\\tto\\tthe\\tyear\\tended\\tDecember\\t31,\\t2022.\\tThe\\noverall\\tincrease\\twas\\tprimarily\\tdriven\\tby\\tadditional\\tcosts\\tin\\tthe\\tcurrent\\tyear\\trelated\\tto\\tthe\\tpre-production\\tphase\\tfor\\tCybertruck,\\tAI\\tand\\tother\\tprograms.\\nR&D\\texpenses\\tas\\ta\\tpercentage\\tof\\trevenue\\tstayed\\tconsistent\\tat\\t4%\\tin\\tthe\\tyear\\tended\\tDecember\\t31,\\t2023\\tas\\tcompared\\tto\\tthe\\tyear\\tended\\nDecember\\t31,\\t2022.\\tOur\\tR&D\\texpenses\\thave\\tincreased\\tproportionately\\twith\\ttotal\\trevenues\\tas\\twe\\tcontinue\\tto\\texpand\\tour\\tproduct\\troadmap\\tand\\ntechnologies.\\nSelling,\\tGeneral\\tand\\tAdministrative\\tExpense\\nYear\\tEnded\\tDecember\\t31,2023\\tvs.\\t2022\\tChange2022\\tvs.\\t2021\\tChange\\n(Dollars\\tin\\tmillions)202320222021$%$%\\nSelling,\\tgeneral\\tand\\tadministrative\\n$4,800\\t$3,946\\t$4,517\\t$854\\t22\\t%$(571)(13)%\\nAs\\ta\\tpercentage\\tof\\trevenues5\\t%5\\t%8\\t%\\nSelling,\\tgeneral\\tand\\tadministrative\\t(“SG&A”)\\texpenses\\tgenerally\\tconsist\\tof\\tpersonnel\\tand\\tfacilities\\tcosts\\trelated\\tto\\tour\\tstores,\\tmarketing,\\tsales,\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 42,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 24\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"executive,\\tfinance,\\thuman\\tresources,\\tinformation\\ttechnology\\tand\\tlegal\\torganizations,\\tas\\twell\\tas\\tfees\\tfor\\tprofessional\\tand\\tcontract\\tservices\\tand\\tlitigation\\nsettlements.\\nSG&A\\texpenses\\tincreased\\t$854\\tmillion,\\tor\\t22%,\\tin\\tthe\\tyear\\tended\\tDecember\\t31,\\t2023\\tas\\tcompared\\tto\\tthe\\tyear\\tended\\tDecember\\t31,\\t2022.\\tThis\\twas\\ndriven\\tby\\ta\\t$447\\tmillion\\tincrease\\tin\\temployee\\tand\\tlabor\\tcosts\\tprimarily\\tfrom\\tincreased\\theadcount,\\tincluding\\tprofessional\\tservices\\tand\\ta\\t$363\\tmillion\\nincrease\\tin\\tfacilities\\trelated\\texpenses.\\nRestructuring\\tand\\tOther\\nYear\\tEnded\\tDecember\\t31,2023\\tvs.\\t2022\\tChange2022\\tvs.\\t2021\\tChange\\n(Dollars\\tin\\tmillions)202320222021$%$%\\nRestructuring\\tand\\tother\\n$—\\t$176\\t$(27)$(176)(100)%$203\\tNot\\tmeaningful\\nDuring\\tthe\\tyear\\tended\\tDecember\\t31,\\t2022,\\twe\\trecorded\\tan\\timpairment\\tloss\\tof\\t$204\\tmillion\\tas\\twell\\tas\\trealized\\tgains\\tof\\t$64\\tmillion\\tin\\tconnection\\nwith\\tconverting\\tour\\tholdings\\tof\\tdigital\\tassets\\tinto\\tfiat\\tcurrency.\\tWe\\talso\\trecorded\\tother\\texpenses\\tof\\t$36\\tmillion\\tduring\\tthe\\tsecond\\tquarter\\tof\\tthe\\tyear\\nended\\tDecember\\t31,\\t2022,\\trelated\\tto\\temployee\\tterminations.\\nInterest\\tIncome\\nYear\\tEnded\\tDecember\\t31,2023\\tvs.\\t2022\\tChange2022\\tvs.\\t2021\\tChange\\n(Dollars\\tin\\tmillions)202320222021$%$%\\nInterest\\tincome\\n$1,066\\t$297\\t$56\\t$769\\t259\\t%$241\\t430\\t%\\n41\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 42,\n        \"lines\": {\n          \"from\": 25,\n          \"to\": 43\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Interest\\tincome\\tincreased\\t$769\\tmillion,\\tor\\t259%,\\tin\\tthe\\tyear\\tended\\tDecember\\t31,\\t2023\\tas\\tcompared\\tto\\tthe\\tyear\\tended\\tDecember\\t31,\\t2022.\\tThis\\nincrease\\twas\\tprimarily\\tdue\\tto\\thigher\\tinterest\\tearned\\ton\\tour\\tcash\\tand\\tcash\\tequivalents\\tand\\tshort-term\\tinvestments\\tin\\tthe\\tyear\\tended\\tDecember\\t31,\\t2023\\nas\\tcompared\\tto\\tthe\\tprior\\tyear\\tdue\\tto\\trising\\tinterest\\trates\\tand\\tour\\tincreasing\\tportfolio\\tbalance.\\nOther\\tIncome\\t(Expense),\\tNet\\nYear\\tEnded\\tDecember\\t31,2023\\tvs.\\t2022\\tChange2022\\tvs.\\t2021\\tChange\\n(Dollars\\tin\\tmillions)202320222021$%$%\\nOther\\tincome\\t(expense),\\tnet$172\\t$(43)$135\\t$215\\tNot\\tmeaningful$(178)Not\\tmeaningful\\nOther\\tincome\\t(expense),\\tnet,\\tconsists\\tprimarily\\tof\\tforeign\\texchange\\tgains\\tand\\tlosses\\trelated\\tto\\tour\\tforeign\\tcurrency-denominated\\tmonetary\\tassets\\nand\\tliabilities.\\tWe\\texpect\\tour\\tforeign\\texchange\\tgains\\tand\\tlosses\\twill\\tvary\\tdepending\\tupon\\tmovements\\tin\\tthe\\tunderlying\\texchange\\trates.\\nOther\\tincome,\\tnet,\\tchanged\\tfavorably\\tby\\t$215\\tmillion\\tin\\tthe\\tyear\\tended\\tDecember\\t31,\\t2023\\tas\\tcompared\\tto\\tthe\\tyear\\tended\\tDecember\\t31,\\t2022.\\nThe\\tfavorable\\tchange\\twas\\tprimarily\\tdue\\tto\\tfluctuations\\tin\\tforeign\\tcurrency\\texchange\\trates\\ton\\tour\\tintercompany\\tbalances.\\n(Benefit\\tfrom)\\tProvision\\tfor\\tIncome\\tTaxes\\nYear\\tEnded\\tDecember\\t31,2023\\tvs.\\t2022\\tChange2022\\tvs.\\t2021\\tChange\\n(Dollars\\tin\\tmillions)202320222021$%$%\\n(Benefit\\tfrom)\\tprovision\\tfor\\tincome\\ttaxes\\n$(5,001)$1,132\\t$699\\t$(6,133)Not\\tmeaningful$433\\t62\\t%\\nEffective\\ttax\\trate(50)%8\\t%11\\t%\\nWe\\tmonitor\\tthe\\trealizability\\tof\\tour\\tdeferred\\ttax\\tassets\\ttaking\\tinto\\taccount\\tall\\trelevant\\tfactors\\tat\\teach\\treporting\\tperiod.\\tAs\\tof\\tDecember\\t31,\\t2023,\\nbased\\ton\\tthe\\trelevant\\tweight\\tof\\tpositive\\tand\\tnegative\\tevidence,\\tincluding\\tthe\\tamount\\tof\\tour\\ttaxable\\tincome\\tin\\trecent\\tyears\\twhich\\tis\\tobjective\\tand\\nverifiable,\\tand\\tconsideration\\tof\\tour\\texpected\\tfuture\\ttaxable\\tearnings,\\twe\\tconcluded\\tthat\\tit\\tis\\tmore\\tlikely\\tthan\\tnot\\tthat\\tour\\tU.S.\\tfederal\\tand\\tcertain\\tstate\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 43,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 20\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"deferred\\ttax\\tassets\\tare\\trealizable.\\tAs\\tsuch,\\twe\\treleased\\t$6.54\\tbillion\\tof\\tour\\tvaluation\\tallowance\\tassociated\\twith\\tthe\\tU.S.\\tfederal\\tand\\tstate\\tdeferred\\ttax\\nassets,\\twith\\tthe\\texception\\tof\\tour\\tCalifornia\\tdeferred\\ttax\\tassets.\\tApproximately\\t$5.93\\tbillion\\tof\\tthe\\ttotal\\tvaluation\\tallowance\\trelease\\twas\\trelated\\tto\\ndeferred\\ttax\\tassets\\tto\\tbe\\trealized\\tin\\tthe\\tfuture\\tyears\\tand\\tthe\\tremainder\\tbenefited\\tus\\tduring\\tthe\\tyear\\tended\\tDecember\\t31,\\t2023.\\tWe\\tcontinue\\tto\\tmaintain\\na\\tfull\\tvaluation\\tallowance\\tagainst\\tour\\tCalifornia\\tdeferred\\ttax\\tassets\\tas\\tof\\tDecember\\t31,\\t2023,\\tbecause\\twe\\tconcluded\\tthey\\tare\\tnot\\tmore\\tlikely\\tthan\\tnot\\tto\\nbe\\trealized\\tas\\twe\\texpect\\tour\\tCalifornia\\tdeferred\\ttax\\tassets\\tgeneration\\tin\\tfuture\\tyears\\tto\\texceed\\tour\\tability\\tto\\tuse\\tthese\\tdeferred\\ttax\\tassets.\\nOur\\t(benefit\\tfrom)\\tprovision\\tfor\\tincome\\ttaxes\\tchanged\\tby\\t$6.13\\tbillion\\tin\\tthe\\tyear\\tended\\tDecember\\t31,\\t2023\\tas\\tcompared\\tto\\tthe\\tyear\\tended\\nDecember\\t31,\\t2022,\\tprimarily\\tdue\\tto\\tthe\\trelease\\tof\\t$6.54\\tbillion\\tof\\tour\\tvaluation\\tallowance\\tassociated\\twith\\tthe\\tU.S.\\tfederal\\tand\\tcertain\\tstate\\tdeferred\\ttax\\nassets.\\nOur\\teffective\\ttax\\trate\\tchanged\\tfrom\\tan\\texpense\\tof\\t8%\\tto\\ta\\tbenefit\\tof\\t50%\\tin\\tthe\\tyear\\tended\\tDecember\\t31,\\t2023\\tas\\tcompared\\tto\\tthe\\tyear\\tended\\nDecember\\t31,\\t2022,\\tprimarily\\tdue\\tto\\tthe\\trelease\\tof\\tthe\\tvaluation\\tallowance\\tregarding\\tour\\tU.S.\\tfederal\\tand\\tcertain\\tstate\\tdeferred\\ttax\\tassets.\\nSee\\tNote\\t14,\\tIncome\\tTaxes,\\tto\\tthe\\tconsolidated\\tfinancial\\tstatements\\tincluded\\telsewhere\\tin\\tthis\\tAnnual\\tReport\\ton\\tForm\\t10-K\\tfor\\tfurther\\tdetails.\\nLiquidity\\tand\\tCapital\\tResources\\nWe\\texpect\\tto\\tcontinue\\tto\\tgenerate\\tnet\\tpositive\\toperating\\tcash\\tflow\\tas\\twe\\thave\\tdone\\tin\\tthe\\tlast\\tfive\\tfiscal\\tyears.\\tThe\\tcash\\twe\\tgenerate\\tfrom\\tour\\tcore\\noperations\\tenables\\tus\\tto\\tfund\\tongoing\\toperations\\tand\\tproduction,\\tour\\tresearch\\tand\\tdevelopment\\tprojects\\tfor\\tnew\\tproducts\\tand\\ttechnologies\\tincluding\\tour\\nproprietary\\tbattery\\tcells,\\tadditional\\tmanufacturing\\tramps\\tat\\texisting\\tmanufacturing\\tfacilities,\\tthe\\tconstruction\\tof\\tfuture\\tfactories,\\tand\\tthe\\tcontinued\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 43,\n        \"lines\": {\n          \"from\": 21,\n          \"to\": 35\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"expansion\\tof\\tour\\tretail\\tand\\tservice\\tlocations,\\tbody\\tshops,\\tMobile\\tService\\tfleet,\\tSupercharger,\\tincluding\\tto\\tsupport\\tNACS,\\tenergy\\tproduct\\tinstallation\\ncapabilities\\tand\\tautonomy\\tand\\tother\\tartificial\\tintelligence\\tenabled\\tproducts.\\n42\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 43,\n        \"lines\": {\n          \"from\": 36,\n          \"to\": 38\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"In\\taddition,\\tbecause\\ta\\tlarge\\tportion\\tof\\tour\\tfuture\\texpenditures\\twill\\tbe\\tto\\tfund\\tour\\tgrowth,\\twe\\texpect\\tthat\\tif\\tneeded\\twe\\twill\\tbe\\table\\tto\\tadjust\\tour\\ncapital\\tand\\toperating\\texpenditures\\tby\\toperating\\tsegment.\\tFor\\texample,\\tif\\tour\\tnear-term\\tmanufacturing\\toperations\\tdecrease\\tin\\tscale\\tor\\tramp\\tmore\\tslowly\\nthan\\texpected,\\tincluding\\tdue\\tto\\tglobal\\teconomic\\tor\\tbusiness\\tconditions,\\twe\\tmay\\tchoose\\tto\\tcorrespondingly\\tslow\\tthe\\tpace\\tof\\tour\\tcapital\\texpenditures.\\nFinally,\\twe\\tcontinually\\tevaluate\\tour\\tcash\\tneeds\\tand\\tmay\\tdecide\\tit\\tis\\tbest\\tto\\traise\\tadditional\\tcapital\\tor\\tseek\\talternative\\tfinancing\\tsources\\tto\\tfund\\tthe\\trapid\\ngrowth\\tof\\tour\\tbusiness,\\tincluding\\tthrough\\tdrawdowns\\ton\\texisting\\tor\\tnew\\tdebt\\tfacilities\\tor\\tfinancing\\tfunds.\\tConversely,\\twe\\tmay\\talso\\tfrom\\ttime\\tto\\ttime\\ndetermine\\tthat\\tit\\tis\\tin\\tour\\tbest\\tinterests\\tto\\tvoluntarily\\trepay\\tcertain\\tindebtedness\\tearly.\\nAccordingly,\\twe\\tbelieve\\tthat\\tour\\tcurrent\\tsources\\tof\\tfunds\\twill\\tprovide\\tus\\twith\\tadequate\\tliquidity\\tduring\\tthe\\t12-month\\tperiod\\tfollowing\\tDecember\\t31,\\n2023,\\tas\\twell\\tas\\tin\\tthe\\tlong-term.\\nSee\\tthe\\tsections\\tbelow\\tfor\\tmore\\tdetails\\tregarding\\tthe\\tmaterial\\trequirements\\tfor\\tcash\\tin\\tour\\tbusiness\\tand\\tour\\tsources\\tof\\tliquidity\\tto\\tmeet\\tsuch\\nneeds.\\nMaterial\\tCash\\tRequirements\\nFrom\\ttime\\tto\\ttime\\tin\\tthe\\tordinary\\tcourse\\tof\\tbusiness,\\twe\\tenter\\tinto\\tagreements\\twith\\tvendors\\tfor\\tthe\\tpurchase\\tof\\tcomponents\\tand\\traw\\tmaterials\\tto\\nbe\\tused\\tin\\tthe\\tmanufacture\\tof\\tour\\tproducts.\\tHowever,\\tdue\\tto\\tcontractual\\tterms,\\tvariability\\tin\\tthe\\tprecise\\tgrowth\\tcurves\\tof\\tour\\tdevelopment\\tand\\nproduction\\tramps,\\tand\\topportunities\\tto\\trenegotiate\\tpricing,\\twe\\tgenerally\\tdo\\tnot\\thave\\tbinding\\tand\\tenforceable\\tpurchase\\torders\\tunder\\tsuch\\tcontracts\\nbeyond\\tthe\\tshort-term,\\tand\\tthe\\ttiming\\tand\\tmagnitude\\tof\\tpurchase\\torders\\tbeyond\\tsuch\\tperiod\\tis\\tdifficult\\tto\\taccurately\\tproject.\\nAs\\tdiscussed\\tin\\tand\\tsubject\\tto\\tthe\\tconsiderations\\treferenced\\tin\\tPart\\tII,\\tItem\\t7,\\tManagement's\\tDiscussion\\tand\\tAnalysis\\tof\\tFinancial\\tCondition\\tand\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 44,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 16\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Results\\tof\\tOperations—Management\\tOpportunities,\\tChallenges\\tand\\tUncertainties\\tand\\t2023\\tOutlook—Cash\\tFlow\\tand\\tCapital\\tExpenditure\\tTrends\\tin\\tthis\\nAnnual\\tReport\\ton\\tForm\\t10-K,\\twe\\tcurrently\\texpect\\tour\\tcapital\\texpenditures\\tto\\tsupport\\tour\\tprojects\\tglobally\\tto\\texceed\\t$10.00\\tbillion\\tin\\t2024\\tand\\tbe\\nbetween\\t$8.00\\tto\\t$10.00\\tbillion\\tin\\teach\\tof\\tthe\\tfollowing\\ttwo\\tfiscal\\tyears.\\tIn\\tconnection\\twith\\tour\\toperations\\tat\\tGigafactory\\tNew\\tYork,\\twe\\thave\\tan\\nagreement\\tto\\tspend\\tor\\tincur\\t$5.00\\tbillion\\tin\\tcombined\\tcapital,\\toperational\\texpenses,\\tcosts\\tof\\tgoods\\tsold\\tand\\tother\\tcosts\\tin\\tthe\\tState\\tof\\tNew\\tYork\\tthrough\\nDecember\\t31,\\t2029\\t(pursuant\\tto\\ta\\tdeferral\\tof\\tour\\trequired\\ttimelines\\tto\\tmeet\\tsuch\\tobligations\\tthat\\twas\\tgranted\\tin\\tApril\\t2021,\\tand\\twhich\\twas\\tmemorialized\\nin\\tan\\tamendment\\tto\\tour\\tagreement\\twith\\tthe\\tSUNY\\tFoundation\\tin\\tAugust\\t2021).\\tFor\\tdetails\\tregarding\\tthese\\tobligations,\\trefer\\tto\\tNote\\t15,\\tCommitments\\nand\\tContingencies,\\tto\\tthe\\tconsolidated\\tfinancial\\tstatements\\tincluded\\telsewhere\\tin\\tthis\\tAnnual\\tReport\\ton\\tForm\\t10-K.\\nAs\\tof\\tDecember\\t31,\\t2023,\\twe\\tand\\tour\\tsubsidiaries\\thad\\toutstanding\\t$4.68\\tbillion\\tin\\taggregate\\tprincipal\\tamount\\tof\\tindebtedness,\\tof\\twhich\\t$1.98\\nbillion\\tis\\tscheduled\\tto\\tbecome\\tdue\\tin\\tthe\\tsucceeding\\t12\\tmonths.\\tAs\\tof\\tDecember\\t31,\\t2023,\\tour\\ttotal\\tminimum\\tlease\\tpayments\\twas\\t$5.96\\tbillion,\\tof\\twhich\\n$1.31\\tbillion\\tis\\tdue\\tin\\tthe\\tsucceeding\\t12\\tmonths.\\tFor\\tdetails\\tregarding\\tour\\tindebtedness\\tand\\tlease\\tobligations,\\trefer\\tto\\tNote\\t11,\\tDebt,\\tand\\tNote\\t12,\\nLeases,\\tto\\tthe\\tconsolidated\\tfinancial\\tstatements\\tincluded\\telsewhere\\tin\\tthis\\tAnnual\\tReport\\ton\\tForm\\t10-K.\\nSources\\tand\\tConditions\\tof\\tLiquidity\\nOur\\tsources\\tto\\tfund\\tour\\tmaterial\\tcash\\trequirements\\tare\\tpredominantly\\tfrom\\tour\\tdeliveries\\tand\\tservicing\\tof\\tnew\\tand\\tused\\tvehicles,\\tsales\\tand\\ninstallations\\tof\\tour\\tenergy\\tstorage\\tproducts\\tand\\tsolar\\tenergy\\tsystems,\\tproceeds\\tfrom\\tdebt\\tfacilities\\tand\\tproceeds\\tfrom\\tequity\\tofferings,\\twhen\\tapplicable.\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 44,\n        \"lines\": {\n          \"from\": 17,\n          \"to\": 30\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"As\\tof\\tDecember\\t31,\\t2023,\\twe\\thad\\t$16.40\\tbillion\\tand\\t$12.70\\tbillion\\tof\\tcash\\tand\\tcash\\tequivalents\\tand\\tshort-term\\tinvestments,\\trespectively.\\tBalances\\nheld\\tin\\tforeign\\tcurrencies\\thad\\ta\\tU.S.\\tdollar\\tequivalent\\tof\\t$4.43\\tbillion\\tand\\tconsisted\\tprimarily\\tof\\tChinese\\tyuan\\tand\\teuros.\\tWe\\thad\\t$5.03\\tbillion\\tof\\tunused\\ncommitted\\tcredit\\tamounts\\tas\\tof\\tDecember\\t31,\\t2023.\\tFor\\tdetails\\tregarding\\tour\\tindebtedness,\\trefer\\tto\\tNote\\t11,\\tDebt,\\tto\\tthe\\tconsolidated\\tfinancial\\nstatements\\tincluded\\telsewhere\\tin\\tthis\\tAnnual\\tReport\\ton\\tForm\\t10-K.\\nWe\\tcontinue\\tadapting\\tour\\tstrategy\\tto\\tmeet\\tour\\tliquidity\\tand\\trisk\\tobjectives,\\tsuch\\tas\\tinvesting\\tin\\tU.S.\\tgovernment\\tsecurities\\tand\\tother\\tinvestments,\\nto\\tdo\\tmore\\tvertical\\tintegration,\\texpand\\tour\\tproduct\\troadmap\\tand\\tprovide\\tfinancing\\toptions\\tto\\tour\\tcustomers.\\n43\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 44,\n        \"lines\": {\n          \"from\": 31,\n          \"to\": 37\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Summary\\tof\\tCash\\tFlows\\n\\tYear\\tEnded\\tDecember\\t31,\\n(Dollars\\tin\\tmillions)202320222021\\nNet\\tcash\\tprovided\\tby\\toperating\\tactivities$13,256\\t$14,724\\t$11,497\\t\\nNet\\tcash\\tused\\tin\\tinvesting\\tactivities$(15,584)$(11,973)$(7,868)\\nNet\\tcash\\tprovided\\tby\\t(used\\tin)\\tfinancing\\tactivities$2,589\\t$(3,527)$(5,203)\\nCash\\tFlows\\tfrom\\tOperating\\tActivities\\nOur\\tcash\\tflows\\tfrom\\toperating\\tactivities\\tare\\tsignificantly\\taffected\\tby\\tour\\tcash\\tinvestments\\tto\\tsupport\\tthe\\tgrowth\\tof\\tour\\tbusiness\\tin\\tareas\\tsuch\\tas\\nresearch\\tand\\tdevelopment\\tand\\tselling,\\tgeneral\\tand\\tadministrative\\tand\\tworking\\tcapital.\\tOur\\toperating\\tcash\\tinflows\\tinclude\\tcash\\tfrom\\tvehicle\\tsales\\tand\\nrelated\\tservicing,\\tcustomer\\tlease\\tand\\tfinancing\\tpayments,\\tcustomer\\tdeposits,\\tcash\\tfrom\\tsales\\tof\\tregulatory\\tcredits\\tand\\tenergy\\tgeneration\\tand\\tstorage\\nproducts,\\tand\\tinterest\\tincome\\ton\\tour\\tcash\\tand\\tinvestments\\tportfolio.\\tThese\\tcash\\tinflows\\tare\\toffset\\tby\\tour\\tpayments\\tto\\tsuppliers\\tfor\\tproduction\\tmaterials\\nand\\tparts\\tused\\tin\\tour\\tmanufacturing\\tprocess,\\toperating\\texpenses,\\toperating\\tlease\\tpayments\\tand\\tinterest\\tpayments\\ton\\tour\\tfinancings.\\nNet\\tcash\\tprovided\\tby\\toperating\\tactivities\\tdecreased\\tby\\t$1.47\\tbillion\\tto\\t$13.26\\tbillion\\tduring\\tthe\\tyear\\tended\\tDecember\\t31,\\t2023\\tfrom\\t$14.72\\tbillion\\nduring\\tthe\\tyear\\tended\\tDecember\\t31,\\t2022.\\tThis\\tdecrease\\twas\\tprimarily\\tdue\\tto\\tthe\\tdecrease\\tin\\tnet\\tincome\\texcluding\\tnon-cash\\texpenses,\\tgains\\tand\\tlosses\\nof\\t$2.93\\tbillion,\\tpartially\\toffset\\tby\\tfavorable\\tchanges\\tin\\tnet\\toperating\\tassets\\tand\\tliabilities\\tof\\t$1.46\\tbillion.\\nCash\\tFlows\\tfrom\\tInvesting\\tActivities\\nCash\\tflows\\tfrom\\tinvesting\\tactivities\\tand\\ttheir\\tvariability\\tacross\\teach\\tperiod\\trelated\\tprimarily\\tto\\tcapital\\texpenditures,\\twhich\\twere\\t$8.90\\tbillion\\tfor\\tthe\\nyear\\tended\\tDecember\\t31,\\t2023\\tand\\t$7.16\\tbillion\\tfor\\tthe\\tyear\\tended\\tDecember\\t31,\\t2022,\\tmainly\\tfor\\tglobal\\tfactory\\texpansion\\tand\\tmachinery\\tand\\nequipment\\tas\\twe\\texpand\\tour\\tproduct\\troadmap.\\tWe\\talso\\tpurchased\\t$6.62\\tbillion\\tand\\t$5.81\\tbillion\\tof\\tinvestments,\\tnet\\tof\\tproceeds\\tfrom\\tmaturities\\tand\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 45,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 19\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"sales,\\tfor\\tthe\\tyear\\tended\\tDecember\\t31,\\t2023\\tand\\t2022,\\trespectively.\\tAdditionally,\\tproceeds\\tfrom\\tsales\\tof\\tdigital\\tassets\\twas\\t$936\\tmillion\\tin\\tthe\\tyear\\nended\\tDecember\\t31,\\t2022.\\nCash\\tFlows\\tfrom\\tFinancing\\tActivities\\nNet\\tcash\\tfrom\\tfinancing\\tactivities\\tchanged\\tby\\t$6.12\\tbillion\\tto\\t$2.59\\tbillion\\tnet\\tcash\\tprovided\\tby\\tfinancing\\tactivities\\tduring\\tthe\\tyear\\tended\\nDecember\\t31,\\t2023\\tfrom\\t$3.53\\tbillion\\tnet\\tcash\\tused\\tin\\tfinancing\\tactivities\\tduring\\tthe\\tyear\\tended\\tDecember\\t31,\\t2022.\\tThe\\tchange\\twas\\tprimarily\\tdue\\tto\\ta\\n$3.93\\tbillion\\tincrease\\tin\\tproceeds\\tfrom\\tissuances\\tof\\tdebt\\tand\\ta\\t$2.01\\tbillion\\tdecrease\\tin\\trepayments\\tof\\tdebt.\\tSee\\tNote\\t11,\\tDebt,\\tto\\tthe\\tconsolidated\\nfinancial\\tstatements\\tincluded\\telsewhere\\tin\\tthis\\tAnnual\\tReport\\ton\\tForm\\t10-K\\tfor\\tfurther\\tdetails\\tregarding\\tour\\tdebt\\tobligations.\\nRecent\\tAccounting\\tPronouncements\\nSee\\tNote\\t2,\\tSummary\\tof\\tSignificant\\tAccounting\\tPolicies,\\tto\\tthe\\tconsolidated\\tfinancial\\tstatements\\tincluded\\telsewhere\\tin\\tthis\\tAnnual\\tReport\\ton\\tForm\\n10-K.\\n44\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 45,\n        \"lines\": {\n          \"from\": 20,\n          \"to\": 30\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"ITEM\\t7A.\\tQUANTITATIVE\\tAND\\tQUALITATIVE\\tDISCLOSURES\\tABOUT\\tMARKET\\tRISK\\nForeign\\tCurrency\\tRisk\\nWe\\ttransact\\tbusiness\\tglobally\\tin\\tmultiple\\tcurrencies\\tand\\thence\\thave\\tforeign\\tcurrency\\trisks\\trelated\\tto\\tour\\trevenue,\\tcosts\\tof\\trevenue\\tand\\toperating\\nexpenses\\tdenominated\\tin\\tcurrencies\\tother\\tthan\\tthe\\tU.S.\\tdollar\\t(primarily\\tthe\\tChinese\\tyuan\\tand\\teuro\\tin\\trelation\\tto\\tour\\tcurrent\\tyear\\toperations).\\tIn\\tgeneral,\\nwe\\tare\\ta\\tnet\\treceiver\\tof\\tcurrencies\\tother\\tthan\\tthe\\tU.S.\\tdollar\\tfor\\tour\\tforeign\\tsubsidiaries.\\tAccordingly,\\tchanges\\tin\\texchange\\trates\\taffect\\tour\\toperating\\nresults\\tas\\texpressed\\tin\\tU.S.\\tdollars\\tas\\twe\\tdo\\tnot\\ttypically\\thedge\\tforeign\\tcurrency\\trisk.\\nWe\\thave\\talso\\texperienced,\\tand\\twill\\tcontinue\\tto\\texperience,\\tfluctuations\\tin\\tour\\tnet\\tincome\\tas\\ta\\tresult\\tof\\tgains\\t(losses)\\ton\\tthe\\tsettlement\\tand\\tthe\\tre-\\nmeasurement\\tof\\tmonetary\\tassets\\tand\\tliabilities\\tdenominated\\tin\\tcurrencies\\tthat\\tare\\tnot\\tthe\\tlocal\\tcurrency\\t(primarily\\tconsisting\\tof\\tour\\tintercompany\\tand\\ncash\\tand\\tcash\\tequivalents\\tbalances).\\nWe\\tconsidered\\tthe\\thistorical\\ttrends\\tin\\tforeign\\tcurrency\\texchange\\trates\\tand\\tdetermined\\tthat\\tit\\tis\\treasonably\\tpossible\\tthat\\tadverse\\tchanges\\tin\\tforeign\\ncurrency\\texchange\\trates\\tof\\t10%\\tfor\\tall\\tcurrencies\\tcould\\tbe\\texperienced\\tin\\tthe\\tnear-term.\\tThese\\tchanges\\twere\\tapplied\\tto\\tour\\ttotal\\tmonetary\\tassets\\tand\\nliabilities\\tdenominated\\tin\\tcurrencies\\tother\\tthan\\tour\\tlocal\\tcurrencies\\tat\\tthe\\tbalance\\tsheet\\tdate\\tto\\tcompute\\tthe\\timpact\\tthese\\tchanges\\twould\\thave\\thad\\ton\\nour\\tnet\\tincome\\tbefore\\tincome\\ttaxes.\\tThese\\tchanges\\twould\\thave\\tresulted\\tin\\ta\\tgain\\tor\\tloss\\tof\\t$1.01\\tbillion\\tat\\tDecember\\t31,\\t2023\\tand\\t$473\\tmillion\\tat\\nDecember\\t31,\\t2022,\\tassuming\\tno\\tforeign\\tcurrency\\thedging.\\n45\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 46,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 15\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"ITEM\\t8.\\tFINANCIAL\\tSTATEMENTS\\tAND\\tSUPPLEMENTARY\\tDATA\\nIndex\\tto\\tConsolidated\\tFinancial\\tStatements\\nPage\\nReport\\tof\\tIndependent\\tRegistered\\tPublic\\tAccounting\\tFirm\\t(PCAOB\\tID:\\t238)47\\nConsolidated\\tBalance\\tSheets49\\nConsolidated\\tStatements\\tof\\tOperations50\\nConsolidated\\tStatements\\tof\\tComprehensive\\tIncome51\\nConsolidated\\tStatements\\tof\\tRedeemable\\tNoncontrolling\\tInterests\\tand\\tEquity52\\nConsolidated\\tStatements\\tof\\tCash\\tFlows53\\nNotes\\tto\\tConsolidated\\tFinancial\\tStatements54\\n46\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 47,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 11\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Report\\tof\\tIndependent\\tRegistered\\tPublic\\tAccounting\\tFirm\\nTo\\tthe\\tBoard\\tof\\tDirectors\\tand\\tStockholders\\tof\\tTesla,\\tInc.\\nOpinions\\ton\\tthe\\tFinancial\\tStatements\\tand\\tInternal\\tControl\\tover\\tFinancial\\tReporting\\nWe\\thave\\taudited\\tthe\\taccompanying\\tconsolidated\\tbalance\\tsheets\\tof\\tTesla,\\tInc.\\tand\\tits\\tsubsidiaries\\t(the\\t“Company”)\\tas\\tof\\tDecember\\t31,\\t2023\\tand\\t2022,\\nand\\tthe\\trelated\\tconsolidated\\tstatements\\tof\\toperations,\\tof\\tcomprehensive\\tincome,\\tof\\tredeemable\\tnoncontrolling\\tinterests\\tand\\tequity\\tand\\tof\\tcash\\tflows\\tfor\\neach\\tof\\tthe\\tthree\\tyears\\tin\\tthe\\tperiod\\tended\\tDecember\\t31,\\t2023,\\tincluding\\tthe\\trelated\\tnotes\\t(collectively\\treferred\\tto\\tas\\tthe\\t“consolidated\\tfinancial\\nstatements”).\\tWe\\talso\\thave\\taudited\\tthe\\tCompany's\\tinternal\\tcontrol\\tover\\tfinancial\\treporting\\tas\\tof\\tDecember\\t31,\\t2023,\\tbased\\ton\\tcriteria\\testablished\\tin\\nInternal\\tControl\\t-\\tIntegrated\\tFramework\\t(2013)\\tissued\\tby\\tthe\\tCommittee\\tof\\tSponsoring\\tOrganizations\\tof\\tthe\\tTreadway\\tCommission\\t(COSO).\\nIn\\tour\\topinion,\\tthe\\tconsolidated\\tfinancial\\tstatements\\treferred\\tto\\tabove\\tpresent\\tfairly,\\tin\\tall\\tmaterial\\trespects,\\tthe\\tfinancial\\tposition\\tof\\tthe\\tCompany\\tas\\tof\\nDecember\\t31,\\t2023\\tand\\t2022,\\tand\\tthe\\tresults\\tof\\tits\\toperations\\tand\\tits\\tcash\\tflows\\tfor\\teach\\tof\\tthe\\tthree\\tyears\\tin\\tthe\\tperiod\\tended\\tDecember\\t31,\\t2023\\tin\\nconformity\\twith\\taccounting\\tprinciples\\tgenerally\\taccepted\\tin\\tthe\\tUnited\\tStates\\tof\\tAmerica.\\tAlso\\tin\\tour\\topinion,\\tthe\\tCompany\\tmaintained,\\tin\\tall\\tmaterial\\nrespects,\\teffective\\tinternal\\tcontrol\\tover\\tfinancial\\treporting\\tas\\tof\\tDecember\\t31,\\t2023,\\tbased\\ton\\tcriteria\\testablished\\tin\\tInternal\\tControl\\t-\\tIntegrated\\nFramework\\t(2013)\\tissued\\tby\\tthe\\tCOSO.\\nChanges\\tin\\tAccounting\\tPrinciples\\nAs\\tdiscussed\\tin\\tNote\\t2\\tto\\tthe\\tconsolidated\\tfinancial\\tstatements,\\tthe\\tCompany\\tchanged\\tthe\\tmanner\\tin\\twhich\\tit\\taccounts\\tfor\\tconvertible\\tdebt\\tin\\t2021.\\nBasis\\tfor\\tOpinions\\nThe\\tCompany's\\tmanagement\\tis\\tresponsible\\tfor\\tthese\\tconsolidated\\tfinancial\\tstatements,\\tfor\\tmaintaining\\teffective\\tinternal\\tcontrol\\tover\\tfinancial\\treporting,\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 48,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 17\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"and\\tfor\\tits\\tassessment\\tof\\tthe\\teffectiveness\\tof\\tinternal\\tcontrol\\tover\\tfinancial\\treporting,\\tincluded\\tin\\tManagement’s\\tReport\\ton\\tInternal\\tControl\\tover\\tFinancial\\nReporting\\tappearing\\tunder\\tItem\\t9A.\\tOur\\tresponsibility\\tis\\tto\\texpress\\topinions\\ton\\tthe\\tCompany’s\\tconsolidated\\tfinancial\\tstatements\\tand\\ton\\tthe\\tCompany's\\ninternal\\tcontrol\\tover\\tfinancial\\treporting\\tbased\\ton\\tour\\taudits.\\tWe\\tare\\ta\\tpublic\\taccounting\\tfirm\\tregistered\\twith\\tthe\\tPublic\\tCompany\\tAccounting\\tOversight\\nBoard\\t(United\\tStates)\\t(PCAOB)\\tand\\tare\\trequired\\tto\\tbe\\tindependent\\twith\\trespect\\tto\\tthe\\tCompany\\tin\\taccordance\\twith\\tthe\\tU.S.\\tfederal\\tsecurities\\tlaws\\tand\\nthe\\tapplicable\\trules\\tand\\tregulations\\tof\\tthe\\tSecurities\\tand\\tExchange\\tCommission\\tand\\tthe\\tPCAOB.\\nWe\\tconducted\\tour\\taudits\\tin\\taccordance\\twith\\tthe\\tstandards\\tof\\tthe\\tPCAOB.\\tThose\\tstandards\\trequire\\tthat\\twe\\tplan\\tand\\tperform\\tthe\\taudits\\tto\\tobtain\\nreasonable\\tassurance\\tabout\\twhether\\tthe\\tconsolidated\\tfinancial\\tstatements\\tare\\tfree\\tof\\tmaterial\\tmisstatement,\\twhether\\tdue\\tto\\terror\\tor\\tfraud,\\tand\\twhether\\neffective\\tinternal\\tcontrol\\tover\\tfinancial\\treporting\\twas\\tmaintained\\tin\\tall\\tmaterial\\trespects.\\nOur\\taudits\\tof\\tthe\\tconsolidated\\tfinancial\\tstatements\\tincluded\\tperforming\\tprocedures\\tto\\tassess\\tthe\\trisks\\tof\\tmaterial\\tmisstatement\\tof\\tthe\\tconsolidated\\nfinancial\\tstatements,\\twhether\\tdue\\tto\\terror\\tor\\tfraud,\\tand\\tperforming\\tprocedures\\tthat\\trespond\\tto\\tthose\\trisks.\\tSuch\\tprocedures\\tincluded\\texamining,\\ton\\ta\\ntest\\tbasis,\\tevidence\\tregarding\\tthe\\tamounts\\tand\\tdisclosures\\tin\\tthe\\tconsolidated\\tfinancial\\tstatements.\\tOur\\taudits\\talso\\tincluded\\tevaluating\\tthe\\taccounting\\nprinciples\\tused\\tand\\tsignificant\\testimates\\tmade\\tby\\tmanagement,\\tas\\twell\\tas\\tevaluating\\tthe\\toverall\\tpresentation\\tof\\tthe\\tconsolidated\\tfinancial\\tstatements.\\nOur\\taudit\\tof\\tinternal\\tcontrol\\tover\\tfinancial\\treporting\\tincluded\\tobtaining\\tan\\tunderstanding\\tof\\tinternal\\tcontrol\\tover\\tfinancial\\treporting,\\tassessing\\tthe\\trisk\\nthat\\ta\\tmaterial\\tweakness\\texists,\\tand\\ttesting\\tand\\tevaluating\\tthe\\tdesign\\tand\\toperating\\teffectiveness\\tof\\tinternal\\tcontrol\\tbased\\ton\\tthe\\tassessed\\trisk.\\tOur\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 48,\n        \"lines\": {\n          \"from\": 18,\n          \"to\": 31\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"audits\\talso\\tincluded\\tperforming\\tsuch\\tother\\tprocedures\\tas\\twe\\tconsidered\\tnecessary\\tin\\tthe\\tcircumstances.\\tWe\\tbelieve\\tthat\\tour\\taudits\\tprovide\\ta\\treasonable\\nbasis\\tfor\\tour\\topinions.\\n47\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 48,\n        \"lines\": {\n          \"from\": 32,\n          \"to\": 34\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Definition\\tand\\tLimitations\\tof\\tInternal\\tControl\\tover\\tFinancial\\tReporting\\nA\\tcompany’s\\tinternal\\tcontrol\\tover\\tfinancial\\treporting\\tis\\ta\\tprocess\\tdesigned\\tto\\tprovide\\treasonable\\tassurance\\tregarding\\tthe\\treliability\\tof\\tfinancial\\treporting\\nand\\tthe\\tpreparation\\tof\\tfinancial\\tstatements\\tfor\\texternal\\tpurposes\\tin\\taccordance\\twith\\tgenerally\\taccepted\\taccounting\\tprinciples.\\tA\\tcompany’s\\tinternal\\ncontrol\\tover\\tfinancial\\treporting\\tincludes\\tthose\\tpolicies\\tand\\tprocedures\\tthat\\t(i)\\tpertain\\tto\\tthe\\tmaintenance\\tof\\trecords\\tthat,\\tin\\treasonable\\tdetail,\\taccurately\\nand\\tfairly\\treflect\\tthe\\ttransactions\\tand\\tdispositions\\tof\\tthe\\tassets\\tof\\tthe\\tcompany;\\t(ii)\\tprovide\\treasonable\\tassurance\\tthat\\ttransactions\\tare\\trecorded\\tas\\nnecessary\\tto\\tpermit\\tpreparation\\tof\\tfinancial\\tstatements\\tin\\taccordance\\twith\\tgenerally\\taccepted\\taccounting\\tprinciples,\\tand\\tthat\\treceipts\\tand\\texpenditures\\nof\\tthe\\tcompany\\tare\\tbeing\\tmade\\tonly\\tin\\taccordance\\twith\\tauthorizations\\tof\\tmanagement\\tand\\tdirectors\\tof\\tthe\\tcompany;\\tand\\t(iii)\\tprovide\\treasonable\\nassurance\\tregarding\\tprevention\\tor\\ttimely\\tdetection\\tof\\tunauthorized\\tacquisition,\\tuse,\\tor\\tdisposition\\tof\\tthe\\tcompany’s\\tassets\\tthat\\tcould\\thave\\ta\\tmaterial\\neffect\\ton\\tthe\\tfinancial\\tstatements.\\nBecause\\tof\\tits\\tinherent\\tlimitations,\\tinternal\\tcontrol\\tover\\tfinancial\\treporting\\tmay\\tnot\\tprevent\\tor\\tdetect\\tmisstatements.\\tAlso,\\tprojections\\tof\\tany\\tevaluation\\nof\\teffectiveness\\tto\\tfuture\\tperiods\\tare\\tsubject\\tto\\tthe\\trisk\\tthat\\tcontrols\\tmay\\tbecome\\tinadequate\\tbecause\\tof\\tchanges\\tin\\tconditions,\\tor\\tthat\\tthe\\tdegree\\tof\\ncompliance\\twith\\tthe\\tpolicies\\tor\\tprocedures\\tmay\\tdeteriorate.\\nCritical\\tAudit\\tMatters\\nThe\\tcritical\\taudit\\tmatter\\tcommunicated\\tbelow\\tis\\ta\\tmatter\\tarising\\tfrom\\tthe\\tcurrent\\tperiod\\taudit\\tof\\tthe\\tconsolidated\\tfinancial\\tstatements\\tthat\\twas\\ncommunicated\\tor\\trequired\\tto\\tbe\\tcommunicated\\tto\\tthe\\taudit\\tcommittee\\tand\\tthat\\t(i)\\trelates\\tto\\taccounts\\tor\\tdisclosures\\tthat\\tare\\tmaterial\\tto\\tthe\\tconsolidated\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 49,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 15\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"financial\\tstatements\\tand\\t(ii)\\tinvolved\\tour\\tespecially\\tchallenging,\\tsubjective,\\tor\\tcomplex\\tjudgments.\\tThe\\tcommunication\\tof\\tcritical\\taudit\\tmatters\\tdoes\\tnot\\nalter\\tin\\tany\\tway\\tour\\topinion\\ton\\tthe\\tconsolidated\\tfinancial\\tstatements,\\ttaken\\tas\\ta\\twhole,\\tand\\twe\\tare\\tnot,\\tby\\tcommunicating\\tthe\\tcritical\\taudit\\tmatter\\tbelow,\\nproviding\\ta\\tseparate\\topinion\\ton\\tthe\\tcritical\\taudit\\tmatter\\tor\\ton\\tthe\\taccounts\\tor\\tdisclosures\\tto\\twhich\\tit\\trelates.\\nAutomotive\\tWarranty\\tReserve\\nAs\\tdescribed\\tin\\tNote\\t2\\tto\\tthe\\tconsolidated\\tfinancial\\tstatements,\\ttotal\\taccrued\\twarranty,\\twhich\\tprimarily\\trelates\\tto\\tthe\\tautomotive\\tsegment,\\twas\\t$5,152\\nmillion\\tas\\tof\\tDecember\\t31,\\t2023.\\tThe\\tCompany\\tprovides\\ta\\tmanufacturer’s\\twarranty\\ton\\tall\\tnew\\tand\\tused\\tTesla\\tvehicles.\\tA\\twarranty\\treserve\\tis\\taccrued\\tfor\\nthese\\tproducts\\tsold,\\twhich\\tincludes\\tmanagement’s\\tbest\\testimate\\tof\\tthe\\tprojected\\tcosts\\tto\\trepair\\tor\\treplace\\titems\\tunder\\twarranty\\tand\\trecalls\\tif\\tidentified.\\nThese\\testimates\\tare\\tbased\\ton\\tactual\\tclaims\\tincurred\\tto\\tdate\\tand\\tan\\testimate\\tof\\tthe\\tnature,\\tfrequency\\tand\\tcosts\\tof\\tfuture\\tclaims.\\nThe\\tprincipal\\tconsiderations\\tfor\\tour\\tdetermination\\tthat\\tperforming\\tprocedures\\trelating\\tto\\tthe\\tautomotive\\twarranty\\treserve\\tis\\ta\\tcritical\\taudit\\tmatter\\tare\\nthe\\tsignificant\\tjudgment\\tby\\tmanagement\\tin\\tdetermining\\tthe\\tautomotive\\twarranty\\treserve\\tfor\\tcertain\\tTesla\\tvehicle\\tmodels;\\tthis\\tin\\tturn\\tled\\tto\\tsignificant\\nauditor\\tjudgment,\\tsubjectivity,\\tand\\teffort\\tin\\tperforming\\tprocedures\\tto\\tevaluate\\tmanagement’s\\tsignificant\\tassumptions\\trelated\\tto\\tthe\\tnature,\\tfrequency\\nand\\tcosts\\tof\\tfuture\\tclaims\\tfor\\tcertain\\tTesla\\tvehicle\\tmodels,\\tand\\tthe\\taudit\\teffort\\tinvolved\\tthe\\tuse\\tof\\tprofessionals\\twith\\tspecialized\\tskill\\tand\\tknowledge.\\nAddressing\\tthe\\tmatter\\tinvolved\\tperforming\\tprocedures\\tand\\tevaluating\\taudit\\tevidence\\tin\\tconnection\\twith\\tforming\\tour\\toverall\\topinion\\ton\\tthe\\tconsolidated\\nfinancial\\tstatements.\\tThese\\tprocedures\\tincluded\\ttesting\\tthe\\teffectiveness\\tof\\tcontrols\\trelating\\tto\\tmanagement’s\\testimate\\tof\\tthe\\tautomotive\\twarranty\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 49,\n        \"lines\": {\n          \"from\": 16,\n          \"to\": 29\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"reserve\\tfor\\tcertain\\tTesla\\tvehicle\\tmodels,\\tincluding\\tcontrols\\tover\\tmanagement’s\\tsignificant\\tassumptions\\trelated\\tto\\tthe\\tnature,\\tfrequency\\tand\\tcosts\\tof\\nfuture\\tclaims\\tas\\twell\\tas\\tthe\\tcompleteness\\tand\\taccuracy\\tof\\tactual\\tclaims\\tincurred\\tto\\tdate.\\tThese\\tprocedures\\talso\\tincluded,\\tamong\\tothers,\\tperforming\\tone\\nof\\tthe\\tfollowing:\\t(i)\\ttesting\\tmanagement’s\\tprocess\\tfor\\tdetermining\\tthe\\tautomotive\\twarranty\\treserve\\tfor\\tcertain\\tTesla\\tvehicle\\tmodels\\tor\\t(ii)\\tdeveloping\\tan\\nindependent\\testimate\\tof\\tthe\\tautomotive\\twarranty\\treserve\\tfor\\tcertain\\tTesla\\tvehicle\\tmodels\\tand\\tcomparing\\tthe\\tindependent\\testimate\\tto\\tmanagement’s\\nestimate\\tto\\tevaluate\\tthe\\treasonableness\\tof\\tthe\\testimate.\\tTesting\\tmanagement’s\\tprocess\\tinvolved\\tevaluating\\tthe\\treasonableness\\tof\\tsignificant\\nassumptions\\trelated\\tto\\tthe\\tnature\\tand\\tfrequency\\tof\\tfuture\\tclaims\\tand\\tthe\\trelated\\tcosts\\tto\\trepair\\tor\\treplace\\titems\\tunder\\twarranty.\\tEvaluating\\tthe\\nassumptions\\trelated\\tto\\tthe\\tnature\\tand\\tfrequency\\tof\\tfuture\\tclaims\\tand\\tthe\\trelated\\tcosts\\tto\\trepair\\tor\\treplace\\titems\\tunder\\twarranty\\tinvolved\\tevaluating\\nwhether\\tthe\\tassumptions\\tused\\twere\\treasonable\\tby\\tperforming\\ta\\tlookback\\tanalysis\\tcomparing\\tprior\\tperiod\\tforecasted\\tclaims\\tto\\tactual\\tclaims\\tincurred.\\nDeveloping\\tthe\\tindependent\\testimate\\tinvolved\\ttesting\\tthe\\tcompleteness\\tand\\taccuracy\\tof\\thistorical\\tvehicle\\tclaims\\tprocessed\\tand\\ttesting\\tthat\\tsuch\\tclaims\\nwere\\tappropriately\\tused\\tby\\tmanagement\\tin\\tthe\\testimation\\tof\\tfuture\\tclaims.\\tProfessionals\\twith\\tspecialized\\tskill\\tand\\tknowledge\\twere\\tused\\tto\\tassist\\tin\\ndeveloping\\tan\\tindependent\\testimate\\tof\\tthe\\tautomotive\\twarranty\\treserve\\tfor\\tcertain\\tTesla\\tvehicle\\tmodels\\tand\\tin\\tevaluating\\tthe\\tappropriateness\\tof\\tcertain\\naspects\\tof\\tmanagement’s\\tsignificant\\tassumptions\\trelated\\tto\\tthe\\tnature\\tand\\tfrequency\\tof\\tfuture\\tclaims.\\n/s/\\tPricewaterhouseCoopers\\tLLP\\nSan\\tJose,\\tCalifornia\\nJanuary\\t26,\\t2024\\nWe\\thave\\tserved\\tas\\tthe\\tCompany’s\\tauditor\\tsince\\t2005.\\n48\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 49,\n        \"lines\": {\n          \"from\": 30,\n          \"to\": 46\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Tesla,\\tInc.\\nConsolidated\\tBalance\\tSheets\\n(in\\tmillions,\\texcept\\tper\\tshare\\tdata)\\nDecember\\t31,\\n2023\\nDecember\\t31,\\n2022\\nAssets\\nCurrent\\tassets\\nCash\\tand\\tcash\\tequivalents$16,398\\t$16,253\\t\\nShort-term\\tinvestments12,696\\t5,932\\t\\nAccounts\\treceivable,\\tnet3,508\\t2,952\\t\\nInventory13,626\\t12,839\\t\\nPrepaid\\texpenses\\tand\\tother\\tcurrent\\tassets3,388\\t2,941\\t\\nTotal\\tcurrent\\tassets49,616\\t40,917\\t\\nOperating\\tlease\\tvehicles,\\tnet5,989\\t5,035\\t\\nSolar\\tenergy\\tsystems,\\tnet5,229\\t5,489\\t\\nProperty,\\tplant\\tand\\tequipment,\\tnet29,725\\t23,548\\t\\nOperating\\tlease\\tright-of-use\\tassets4,180\\t2,563\\t\\nDigital\\tassets,\\tnet184\\t184\\t\\nIntangible\\tassets,\\tnet178\\t215\\t\\nGoodwill253\\t194\\t\\nDeferred\\ttax\\tassets6,733\\t328\\t\\nOther\\tnon-current\\tassets4,531\\t3,865\\t\\nTotal\\tassets\\n$106,618\\t$82,338\\t\\nLiabilities\\nCurrent\\tliabilities\\nAccounts\\tpayable$14,431\\t$15,255\\t\\nAccrued\\tliabilities\\tand\\tother9,080\\t8,205\\t\\nDeferred\\trevenue2,864\\t1,747\\t\\nCurrent\\tportion\\tof\\tdebt\\tand\\tfinance\\tleases2,373\\t1,502\\t\\nTotal\\tcurrent\\tliabilities28,748\\t26,709\\t\\nDebt\\tand\\tfinance\\tleases,\\tnet\\tof\\tcurrent\\tportion2,857\\t1,597\\t\\nDeferred\\trevenue,\\tnet\\tof\\tcurrent\\tportion3,251\\t2,804\\t\\nOther\\tlong-term\\tliabilities8,153\\t5,330\\t\\nTotal\\tliabilities43,009\\t36,440\\t\\nCommitments\\tand\\tcontingencies\\t(Note\\t15)\\nRedeemable\\tnoncontrolling\\tinterests\\tin\\tsubsidiaries242\\t409\\t\\nEquity\\nStockholders’\\tequity\\nPreferred\\tstock;\\t$0.001\\tpar\\tvalue;\\t100\\tshares\\tauthorized;\\tno\\tshares\\tissued\\tand\\toutstanding—\\t—\\t\\nCommon\\tstock;\\t$0.001\\tpar\\tvalue;\\t6,000\\tshares\\tauthorized;\\t3,185\\tand\\t3,164\\tshares\\tissued\\tand\\toutstanding\\tas\\tof\\nDecember\\t31,\\t2023\\tand\\t2022,\\trespectively3\\t3\\t\\nAdditional\\tpaid-in\\tcapital34,892\\t32,177\\t\\nAccumulated\\tother\\tcomprehensive\\tloss(143)(361)\\nRetained\\tearnings27,882\\t12,885\\t\\nTotal\\tstockholders’\\tequity62,634\\t44,704\\t\\nNoncontrolling\\tinterests\\tin\\tsubsidiaries733\\t785\\t\\nTotal\\tliabilities\\tand\\tequity\\n$106,618\\t$82,338\\t\\nThe\\taccompanying\\tnotes\\tare\\tan\\tintegral\\tpart\\tof\\tthese\\tconsolidated\\tfinancial\\tstatements.\\n49\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 50,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 53\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Tesla,\\tInc.\\nConsolidated\\tStatements\\tof\\tOperations\\n(in\\tmillions,\\texcept\\tper\\tshare\\tdata)\\nYear\\tEnded\\tDecember\\t31,\\n202320222021\\nRevenues\\nAutomotive\\tsales$78,509\\t$67,210\\t$44,125\\t\\nAutomotive\\tregulatory\\tcredits1,790\\t1,776\\t1,465\\t\\nAutomotive\\tleasing2,120\\t2,476\\t1,642\\t\\nTotal\\tautomotive\\trevenues\\n82,419\\t71,462\\t47,232\\t\\nEnergy\\tgeneration\\tand\\tstorage6,035\\t3,909\\t2,789\\t\\nServices\\tand\\tother8,319\\t6,091\\t3,802\\t\\nTotal\\trevenues\\n96,773\\t81,462\\t53,823\\t\\nCost\\tof\\trevenues\\nAutomotive\\tsales65,121\\t49,599\\t32,415\\t\\nAutomotive\\tleasing1,268\\t1,509\\t978\\t\\nTotal\\tautomotive\\tcost\\tof\\trevenues\\n66,389\\t51,108\\t33,393\\t\\nEnergy\\tgeneration\\tand\\tstorage4,894\\t3,621\\t2,918\\t\\nServices\\tand\\tother7,830\\t5,880\\t3,906\\t\\nTotal\\tcost\\tof\\trevenues\\n79,113\\t60,609\\t40,217\\t\\nGross\\tprofit\\n17,660\\t20,853\\t13,606\\t\\nOperating\\texpenses\\nResearch\\tand\\tdevelopment3,969\\t3,075\\t2,593\\t\\nSelling,\\tgeneral\\tand\\tadministrative4,800\\t3,946\\t4,517\\t\\nRestructuring\\tand\\tother—\\t176\\t(27)\\nTotal\\toperating\\texpenses\\n8,769\\t7,197\\t7,083\\t\\nIncome\\tfrom\\toperations8,891\\t13,656\\t6,523\\t\\nInterest\\tincome1,066\\t297\\t56\\t\\nInterest\\texpense(156)(191)(371)\\nOther\\tincome\\t(expense),\\tnet172\\t(43)135\\t\\nIncome\\tbefore\\tincome\\ttaxes9,973\\t13,719\\t6,343\\t\\n(Benefit\\tfrom)\\tprovision\\tfor\\tincome\\ttaxes(5,001)1,132\\t699\\t\\nNet\\tincome14,974\\t12,587\\t5,644\\t\\nNet\\t(loss)\\tincome\\tattributable\\tto\\tnoncontrolling\\tinterests\\tand\\tredeemable\\tnoncontrolling\\tinterests\\nin\\tsubsidiaries(23)31\\t125\\t\\nNet\\tincome\\tattributable\\tto\\tcommon\\tstockholders\\n$14,997\\t$12,556\\t$5,519\\t\\n\\t\\nNet\\tincome\\tper\\tshare\\tof\\tcommon\\tstock\\tattributable\\tto\\tcommon\\tstockholders\\nBasic$4.73\\t$4.02\\t$1.87\\t\\nDiluted\\n$4.30\\t$3.62\\t$1.63\\t\\nWeighted\\taverage\\tshares\\tused\\tin\\tcomputing\\tnet\\tincome\\tper\\tshare\\tof\\tcommon\\tstock\\nBasic3,1743,1302,959\\nDiluted\\n3,4853,4753,386\\nThe\\taccompanying\\tnotes\\tare\\tan\\tintegral\\tpart\\tof\\tthese\\tconsolidated\\tfinancial\\tstatements.\\n50\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 51,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 54\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Tesla,\\tInc.\\nConsolidated\\tStatements\\tof\\tComprehensive\\tIncome\\n(in\\tmillions)\\nYear\\tEnded\\tDecember\\t31,\\n202320222021\\nNet\\tincome$14,974\\t$12,587\\t$5,644\\t\\nOther\\tcomprehensive\\tincome\\t(loss):\\nForeign\\tcurrency\\ttranslation\\tadjustment198\\t(392)(308)\\nUnrealized\\tnet\\tgain\\t(loss)\\ton\\tinvestments16\\t(23)(1)\\nAdjustment\\tfor\\tnet\\tloss\\trealized\\tand\\tincluded\\tin\\tnet\\tincome\\t\\t\\t\\t4\\t—\\t—\\t\\nComprehensive\\tincome15,192\\t12,172\\t5,335\\t\\nLess:\\tComprehensive\\t(loss)\\tincome\\tattributable\\tto\\tnoncontrolling\\tinterests\\tand\\nredeemable\\tnoncontrolling\\tinterests\\tin\\tsubsidiaries(23)31\\t125\\t\\nComprehensive\\tincome\\tattributable\\tto\\tcommon\\tstockholders\\n$15,215\\t$12,141\\t$5,210\\t\\nThe\\taccompanying\\tnotes\\tare\\tan\\tintegral\\tpart\\tof\\tthese\\tconsolidated\\tfinancial\\tstatements.\\n51\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 52,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 17\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Tesla,\\tInc.\\nConsolidated\\tStatements\\tof\\tRedeemable\\tNoncontrolling\\tInterests\\tand\\tEquity\\n(in\\tmillions)\\nRedeemable\\nNoncontrolling\\nInterests\\nCommon\\tStock\\nAdditional\\nPaid-In\\nCapital\\nAccumulated\\nOther\\nComprehensive\\nIncome\\t(Loss)\\n(Accumulated\\nDeficit)\\nRetained\\nEarnings\\nTotal\\nStockholders’\\nEquity\\nNoncontrolling\\nInterests\\tin\\nSubsidiaries\\nTotal\\nEquitySharesAmount\\nBalance\\tas\\tof\\tDecember\\t31,\\t2020\\n$604\\t2,879$3\\t$27,260\\t$363\\t$(5,401)$22,225\\t$850\\t$23,075\\t\\nAdjustments\\tfor\\tprior\\tperiods\\tfrom\\tadopting\\tASU\\t2020-06—\\t——\\t(474)—\\t211\\t(263)—\\t(263)\\nExercises\\tof\\tconversion\\tfeature\\tof\\tconvertible\\tsenior\\tnotes—\\t2—\\t6\\t—\\t—\\t6\\t—\\t6\\t\\nSettlements\\tof\\twarrants—\\t112—\\t—\\t—\\t—\\t—\\t—\\t—\\t\\nIssuance\\tof\\tcommon\\tstock\\tfor\\tequity\\tincentive\\tawards—\\t107—\\t707\\t—\\t—\\t707\\t—\\t707\\t\\nStock-based\\tcompensation—\\t——\\t2,299\\t—\\t—\\t2,299\\t—\\t2,299\\t\\nContributions\\tfrom\\tnoncontrolling\\tinterests2\\t——\\t—\\t—\\t—\\t—\\t—\\t—\\t\\nDistributions\\tto\\tnoncontrolling\\tinterests(66)——\\t—\\t—\\t—\\t—\\t(106)(106)\\nBuy-outs\\tof\\tnoncontrolling\\tinterests(15)——\\t5\\t—\\t—\\t5\\t—\\t5\\t\\nNet\\tincome43\\t——\\t—\\t—\\t5,519\\t5,519\\t82\\t5,601\\t\\nOther\\tcomprehensive\\tloss—\\t——\\t—\\t(309)—\\t(309)—\\t(309)\\nBalance\\tas\\tof\\tDecember\\t31,\\t2021\\n$568\\t3,100$3\\t$29,803\\t$54\\t$329\\t$30,189\\t$826\\t$31,015\\t\\nSettlements\\tof\\twarrants—\\t37—\\t—\\t—\\t—\\t—\\t—\\t—\\t\\nIssuance\\tof\\tcommon\\tstock\\tfor\\tequity\\tincentive\\tawards—\\t27—\\t541\\t—\\t—\\t541\\t—\\t541\\t\\nStock-based\\tcompensation—\\t——\\t1,806\\t—\\t—\\t1,806\\t—\\t1,806\\t\\nDistributions\\tto\\tnoncontrolling\\tinterests(46)——\\t—\\t—\\t—\\t—\\t(113)(113)\\nBuy-outs\\tof\\tnoncontrolling\\tinterests(11)——\\t27\\t—\\t—\\t27\\t(61)(34)\\nNet\\t(loss)\\tincome(102)——\\t—\\t—\\t12,556\\t12,556\\t133\\t12,689\\t\\nOther\\tcomprehensive\\tloss—\\t——\\t—\\t(415)—\\t(415)—\\t(415)\\nBalance\\tas\\tof\\tDecember\\t31,\\t2022\\n$409\\t3,164$3\\t$32,177\\t$(361)$12,885\\t$44,704\\t$785\\t$45,489\\t\\nIssuance\\tof\\tcommon\\tstock\\tfor\\tequity\\tincentive\\tawards—\\t21—\\t700\\t—\\t—\\t700\\t—\\t700\\t\\nStock-based\\tcompensation—\\t——\\t2,013\\t—\\t—\\t2,013\\t—\\t2,013\\t\\nDistributions\\tto\\tnoncontrolling\\tinterests(32)——\\t—\\t—\\t—\\t—\\t(108)(108)\\nBuy-outs\\tof\\tnoncontrolling\\tinterests(39)——\\t2\\t—\\t—\\t2\\t(17)(15)\\nNet\\t(loss)\\tincome(96)——\\t—\\t—\\t14,997\\t14,997\\t73\\t15,070\\t\\nOther\\tcomprehensive\\tincome—\\t——\\t—\\t218\\t—\\t218\\t—\\t218\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 53,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 55\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Other\\tcomprehensive\\tincome—\\t——\\t—\\t218\\t—\\t218\\t—\\t218\\t\\nBalance\\tas\\tof\\tDecember\\t31,\\t2023\\n$242\\t3,185$3\\t$34,892\\t$(143)$27,882\\t$62,634\\t$733\\t$63,367\\t\\nThe\\taccompanying\\tnotes\\tare\\tan\\tintegral\\tpart\\tof\\tthese\\tconsolidated\\tfinancial\\tstatements.\\n52\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 53,\n        \"lines\": {\n          \"from\": 55,\n          \"to\": 59\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Tesla,\\tInc.\\nConsolidated\\tStatements\\tof\\tCash\\tFlows\\n(in\\tmillions)\\nYear\\tEnded\\tDecember\\t31,\\n202320222021\\nCash\\tFlows\\tfrom\\tOperating\\tActivities\\nNet\\tincome$14,974\\t$12,587\\t$5,644\\t\\nAdjustments\\tto\\treconcile\\tnet\\tincome\\tto\\tnet\\tcash\\tprovided\\tby\\toperating\\tactivities:\\nDepreciation,\\tamortization\\tand\\timpairment4,667\\t3,747\\t2,911\\t\\nStock-based\\tcompensation1,812\\t1,560\\t2,121\\t\\nInventory\\tand\\tpurchase\\tcommitments\\twrite-downs463\\t177\\t140\\t\\nForeign\\tcurrency\\ttransaction\\tnet\\tunrealized\\t(gain)\\tloss(144)81\\t(55)\\nDeferred\\tincome\\ttaxes(6,349)(196)(149)\\nNon-cash\\tinterest\\tand\\tother\\toperating\\tactivities81\\t340\\t245\\t\\nDigital\\tassets\\tloss\\t(gain),\\tnet—\\t140\\t(27)\\nChanges\\tin\\toperating\\tassets\\tand\\tliabilities:\\nAccounts\\treceivable(586)(1,124)(130)\\nInventory(1,195)(6,465)(1,709)\\nOperating\\tlease\\tvehicles(1,952)(1,570)(2,114)\\nPrepaid\\texpenses\\tand\\tother\\tassets(2,652)(3,713)(1,540)\\nAccounts\\tpayable,\\taccrued\\tand\\tother\\tliabilities2,605\\t8,029\\t5,367\\t\\nDeferred\\trevenue1,532\\t1,131\\t793\\t\\nNet\\tcash\\tprovided\\tby\\toperating\\tactivities\\n13,256\\t14,724\\t11,497\\t\\nCash\\tFlows\\tfrom\\tInvesting\\tActivities\\nPurchases\\tof\\tproperty\\tand\\tequipment\\texcluding\\tfinance\\tleases,\\tnet\\tof\\tsales(8,898)(7,158)(6,482)\\nPurchases\\tof\\tsolar\\tenergy\\tsystems,\\tnet\\tof\\tsales(1)(5)(32)\\nPurchases\\tof\\tdigital\\tassets—\\t—\\t(1,500)\\nProceeds\\tfrom\\tsales\\tof\\tdigital\\tassets—\\t936\\t272\\t\\nPurchase\\tof\\tintangible\\tassets—\\t(9)—\\t\\nPurchases\\tof\\tinvestments(19,112)(5,835)(132)\\nProceeds\\tfrom\\tmaturities\\tof\\tinvestments12,353\\t22\\t—\\t\\nProceeds\\tfrom\\tsales\\tof\\tinvestments138\\t—\\t—\\t\\nReceipt\\tof\\tgovernment\\tgrants—\\t76\\t6\\t\\nBusiness\\tcombinations,\\tnet\\tof\\tcash\\tacquired(64)—\\t—\\t\\nNet\\tcash\\tused\\tin\\tinvesting\\tactivities\\n(15,584)(11,973)(7,868)\\nCash\\tFlows\\tfrom\\tFinancing\\tActivities\\nProceeds\\tfrom\\tissuances\\tof\\tdebt3,931\\t—\\t8,883\\t\\nRepayments\\tof\\tdebt(1,351)(3,364)(14,167)\\nCollateralized\\tlease\\trepayments—\\t—\\t(9)\\nProceeds\\tfrom\\texercises\\tof\\tstock\\toptions\\tand\\tother\\tstock\\tissuances700\\t541\\t707\\t\\nPrincipal\\tpayments\\ton\\tfinance\\tleases(464)(502)(439)\\nDebt\\tissuance\\tcosts(29)—\\t(9)\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 54,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 44\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Debt\\tissuance\\tcosts(29)—\\t(9)\\nProceeds\\tfrom\\tinvestments\\tby\\tnoncontrolling\\tinterests\\tin\\tsubsidiaries—\\t—\\t2\\t\\nDistributions\\tpaid\\tto\\tnoncontrolling\\tinterests\\tin\\tsubsidiaries(144)(157)(161)\\nPayments\\tfor\\tbuy-outs\\tof\\tnoncontrolling\\tinterests\\tin\\tsubsidiaries(54)(45)(10)\\nNet\\tcash\\tprovided\\tby\\t(used\\tin)\\tfinancing\\tactivities\\n2,589\\t(3,527)(5,203)\\nEffect\\tof\\texchange\\trate\\tchanges\\ton\\tcash\\tand\\tcash\\tequivalents\\tand\\trestricted\\tcash\\n4\\t(444)(183)\\nNet\\tincrease\\t(decrease)\\tin\\tcash\\tand\\tcash\\tequivalents\\tand\\trestricted\\tcash\\n265\\t(1,220)(1,757)\\nCash\\tand\\tcash\\tequivalents\\tand\\trestricted\\tcash,\\tbeginning\\tof\\tperiod16,924\\t18,144\\t19,901\\t\\nCash\\tand\\tcash\\tequivalents\\tand\\trestricted\\tcash,\\tend\\tof\\tperiod$17,189\\t$16,924\\t$18,144\\t\\nSupplemental\\tNon-Cash\\tInvesting\\tand\\tFinancing\\tActivities\\nAcquisitions\\tof\\tproperty\\tand\\tequipment\\tincluded\\tin\\tliabilities$2,272\\t$2,148\\t$2,251\\t\\nSupplemental\\tDisclosures\\nCash\\tpaid\\tduring\\tthe\\tperiod\\tfor\\tinterest,\\tnet\\tof\\tamounts\\tcapitalized$126\\t$152\\t$266\\t\\nCash\\tpaid\\tduring\\tthe\\tperiod\\tfor\\tincome\\ttaxes,\\tnet\\tof\\trefunds$1,119\\t$1,203\\t$561\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 54,\n        \"lines\": {\n          \"from\": 44,\n          \"to\": 60\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"The\\taccompanying\\tnotes\\tare\\tan\\tintegral\\tpart\\tof\\tthese\\tconsolidated\\tfinancial\\tstatements.\\n53\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 55,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 2\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Tesla,\\tInc.\\nNotes\\tto\\tConsolidated\\tFinancial\\tStatements\\nNote\\t1\\t–\\tOverview\\nTesla,\\tInc.\\t(“Tesla”,\\tthe\\t“Company”,\\t“we”,\\t“us”\\tor\\t“our”)\\twas\\tincorporated\\tin\\tthe\\tState\\tof\\tDelaware\\ton\\tJuly\\t1,\\t2003.\\tWe\\tdesign,\\tdevelop,\\nmanufacture,\\tsell\\tand\\tlease\\thigh-performance\\tfully\\telectric\\tvehicles\\tand\\tenergy\\tgeneration\\tand\\tstorage\\tsystems,\\tand\\toffer\\tservices\\trelated\\tto\\tour\\nproducts.\\tOur\\tChief\\tExecutive\\tOfficer,\\tas\\tthe\\tchief\\toperating\\tdecision\\tmaker\\t(“CODM”),\\torganizes\\tour\\tcompany,\\tmanages\\tresource\\tallocations\\tand\\nmeasures\\tperformance\\tamong\\ttwo\\toperating\\tand\\treportable\\tsegments:\\t(i)\\tautomotive\\tand\\t(ii)\\tenergy\\tgeneration\\tand\\tstorage.\\nNote\\t2\\t–\\tSummary\\tof\\tSignificant\\tAccounting\\tPolicies\\nPrinciples\\tof\\tConsolidation\\nThe\\taccompanying\\tconsolidated\\tfinancial\\tstatements\\thave\\tbeen\\tprepared\\tin\\tconformity\\twith\\tGAAP\\tand\\treflect\\tour\\taccounts\\tand\\toperations\\tand\\nthose\\tof\\tour\\tsubsidiaries\\tin\\twhich\\twe\\thave\\ta\\tcontrolling\\tfinancial\\tinterest.\\tIn\\taccordance\\twith\\tthe\\tprovisions\\tof\\tASC\\t810,\\tConsolidation\\t(“ASC\\t810”),\\twe\\nconsolidate\\tany\\tvariable\\tinterest\\tentity\\t(“VIE”)\\tof\\twhich\\twe\\tare\\tthe\\tprimary\\tbeneficiary.\\tWe\\thave\\tformed\\tVIEs\\twith\\tfinancing\\tfund\\tinvestors\\tin\\tthe\\tordinary\\ncourse\\tof\\tbusiness\\tin\\torder\\tto\\tfacilitate\\tthe\\tfunding\\tand\\tmonetization\\tof\\tcertain\\tattributes\\tassociated\\twith\\tsolar\\tenergy\\tsystems\\tand\\tleases\\tunder\\tour\\ndirect\\tvehicle\\tleasing\\tprograms.\\tThe\\ttypical\\tcondition\\tfor\\ta\\tcontrolling\\tfinancial\\tinterest\\townership\\tis\\tholding\\ta\\tmajority\\tof\\tthe\\tvoting\\tinterests\\tof\\tan\\tentity;\\nhowever,\\ta\\tcontrolling\\tfinancial\\tinterest\\tmay\\talso\\texist\\tin\\tentities,\\tsuch\\tas\\tVIEs,\\tthrough\\tarrangements\\tthat\\tdo\\tnot\\tinvolve\\tcontrolling\\tvoting\\tinterests.\\tASC\\n810\\trequires\\ta\\tvariable\\tinterest\\tholder\\tto\\tconsolidate\\ta\\tVIE\\tif\\tthat\\tparty\\thas\\tthe\\tpower\\tto\\tdirect\\tthe\\tactivities\\tof\\tthe\\tVIE\\tthat\\tmost\\tsignificantly\\timpact\\tthe\\nVIE’s\\teconomic\\tperformance\\tand\\tthe\\tobligation\\tto\\tabsorb\\tlosses\\tof\\tthe\\tVIE\\tthat\\tcould\\tpotentially\\tbe\\tsignificant\\tto\\tthe\\tVIE\\tor\\tthe\\tright\\tto\\treceive\\tbenefits\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 56,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 17\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"from\\tthe\\tVIE\\tthat\\tcould\\tpotentially\\tbe\\tsignificant\\tto\\tthe\\tVIE.\\tWe\\tdo\\tnot\\tconsolidate\\ta\\tVIE\\tin\\twhich\\twe\\thave\\ta\\tmajority\\townership\\tinterest\\twhen\\twe\\tare\\tnot\\nconsidered\\tthe\\tprimary\\tbeneficiary.\\tWe\\thave\\tdetermined\\tthat\\twe\\tare\\tthe\\tprimary\\tbeneficiary\\tof\\tall\\tthe\\tVIEs\\t(see\\tNote\\t16,\\tVariable\\tInterest\\tEntity\\nArrangements).\\tWe\\tevaluate\\tour\\trelationships\\twith\\tall\\tthe\\tVIEs\\ton\\tan\\tongoing\\tbasis\\tto\\tensure\\tthat\\twe\\tcontinue\\tto\\tbe\\tthe\\tprimary\\tbeneficiary.\\tAll\\nintercompany\\ttransactions\\tand\\tbalances\\thave\\tbeen\\teliminated\\tupon\\tconsolidation.\\nUse\\tof\\tEstimates\\nThe\\tpreparation\\tof\\tfinancial\\tstatements\\tin\\tconformity\\twith\\tGAAP\\trequires\\tmanagement\\tto\\tmake\\testimates\\tand\\tassumptions\\tthat\\taffect\\tthe\\treported\\namounts\\tof\\tassets,\\tliabilities,\\trevenues,\\tcosts\\tand\\texpenses\\tand\\trelated\\tdisclosures\\tin\\tthe\\taccompanying\\tnotes.\\tThe\\testimates\\tused\\tfor,\\tbut\\tnot\\tlimited\\tto,\\ndetermining\\tsignificant\\teconomic\\tincentive\\tfor\\tresale\\tvalue\\tguarantee\\tarrangements,\\tsales\\treturn\\treserves,\\tincome\\ttaxes,\\tthe\\tcollectability\\tof\\taccounts\\nand\\tfinance\\treceivables,\\tinventory\\tvaluation,\\twarranties,\\tfair\\tvalue\\tof\\tlong-lived\\tassets,\\tgoodwill,\\tfair\\tvalue\\tof\\tfinancial\\tinstruments,\\tfair\\tvalue\\tand\\tresidual\\nvalue\\tof\\toperating\\tlease\\tvehicles\\tand\\tsolar\\tenergy\\tsystems\\tsubject\\tto\\tleases\\tcould\\tbe\\timpacted.\\tWe\\thave\\tassessed\\tthe\\timpact\\tand\\tare\\tnot\\taware\\tof\\tany\\nspecific\\tevents\\tor\\tcircumstances\\tthat\\trequired\\tan\\tupdate\\tto\\tour\\testimates\\tand\\tassumptions\\tor\\tmaterially\\taffected\\tthe\\tcarrying\\tvalue\\tof\\tour\\tassets\\tor\\nliabilities\\tas\\tof\\tthe\\tdate\\tof\\tissuance\\tof\\tthis\\tAnnual\\tReport\\ton\\tForm\\t10-K.\\tThese\\testimates\\tmay\\tchange\\tas\\tnew\\tevents\\toccur\\tand\\tadditional\\tinformation\\tis\\nobtained.\\tActual\\tresults\\tcould\\tdiffer\\tmaterially\\tfrom\\tthese\\testimates\\tunder\\tdifferent\\tassumptions\\tor\\tconditions.\\nReclassifications\\nCertain\\tprior\\tperiod\\tbalances\\thave\\tbeen\\treclassified\\tto\\tconform\\tto\\tthe\\tcurrent\\tperiod\\tpresentation\\tin\\tthe\\tconsolidated\\tfinancial\\tstatements\\tand\\tthe\\naccompanying\\tnotes.\\n54\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 56,\n        \"lines\": {\n          \"from\": 18,\n          \"to\": 34\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Revenue\\tRecognition\\nRevenue\\tby\\tsource\\nThe\\tfollowing\\ttable\\tdisaggregates\\tour\\trevenue\\tby\\tmajor\\tsource\\t(in\\tmillions):\\nYear\\tEnded\\tDecember\\t31,\\n202320222021\\nAutomotive\\tsales\\n$78,509\\t$67,210\\t$44,125\\t\\nAutomotive\\tregulatory\\tcredits1,790\\t1,776\\t1,465\\t\\nEnergy\\tgeneration\\tand\\tstorage\\tsales5,515\\t3,376\\t2,279\\t\\nServices\\tand\\tother8,319\\t6,091\\t3,802\\t\\nTotal\\trevenues\\tfrom\\tsales\\tand\\tservices\\n94,133\\t78,453\\t51,671\\t\\nAutomotive\\tleasing2,120\\t2,476\\t1,642\\t\\nEnergy\\tgeneration\\tand\\tstorage\\tleasing520\\t533\\t510\\t\\nTotal\\trevenues\\n$96,773\\t$81,462\\t$53,823\\t\\nAutomotive\\tSegment\\nAutomotive\\tSales\\nAutomotive\\tsales\\trevenue\\tincludes\\trevenues\\trelated\\tto\\tcash\\tand\\tfinancing\\tdeliveries\\tof\\tnew\\tvehicles,\\tand\\tspecific\\tother\\tfeatures\\tand\\tservices\\tthat\\nmeet\\tthe\\tdefinition\\tof\\ta\\tperformance\\tobligation\\tunder\\tASC\\t606,\\tincluding\\taccess\\tto\\tour\\tFSD\\tCapability\\tfeatures\\tand\\ttheir\\tongoing\\tmaintenance,\\tinternet\\nconnectivity,\\tfree\\tSupercharging\\tprograms\\tand\\tover-the-air\\tsoftware\\tupdates.\\tWe\\trecognize\\trevenue\\ton\\tautomotive\\tsales\\tupon\\tdelivery\\tto\\tthe\\tcustomer,\\nwhich\\tis\\twhen\\tthe\\tcontrol\\tof\\ta\\tvehicle\\ttransfers.\\tPayments\\tare\\ttypically\\treceived\\tat\\tthe\\tpoint\\tcontrol\\ttransfers\\tor\\tin\\taccordance\\twith\\tpayment\\tterms\\ncustomary\\tto\\tthe\\tbusiness,\\texcept\\tsales\\twe\\tfinance\\tfor\\twhich\\tpayments\\tare\\tcollected\\tover\\tthe\\tcontractual\\tloan\\tterm.\\tWe\\talso\\trecognize\\ta\\tsales\\treturn\\nreserve\\tbased\\ton\\thistorical\\texperience\\tplus\\tconsideration\\tfor\\texpected\\tfuture\\tmarket\\tvalues,\\twhen\\twe\\toffer\\tresale\\tvalue\\tguarantees\\tor\\tsimilar\\tbuyback\\nterms.\\tOther\\tfeatures\\tand\\tservices\\tsuch\\tas\\taccess\\tto\\tour\\tinternet\\tconnectivity,\\tunlimited\\tfree\\tSupercharging\\tand\\tover-the-air\\tsoftware\\tupdates\\tare\\nprovisioned\\tupon\\tcontrol\\ttransfer\\tof\\ta\\tvehicle\\tand\\trecognized\\tover\\ttime\\ton\\ta\\tstraight-line\\tbasis\\tas\\twe\\thave\\ta\\tstand-ready\\tobligation\\tto\\tdeliver\\tsuch\\nservices\\tto\\tthe\\tcustomer.\\tOther\\tlimited\\tfree\\tSupercharging\\tincentives\\tare\\trecognized\\tbased\\ton\\tactual\\tusage\\tor\\texpiration,\\twhichever\\tis\\tearlier.\\tWe\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 57,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 27\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"recognize\\trevenue\\trelated\\tto\\tthese\\tother\\tfeatures\\tand\\tservices\\tover\\tthe\\tperformance\\tperiod,\\twhich\\tis\\tgenerally\\tthe\\texpected\\townership\\tlife\\tof\\tthe\\tvehicle.\\nRevenue\\trelated\\tto\\tFSD\\tCapability\\tfeatures\\tis\\trecognized\\twhen\\tfunctionality\\tis\\tdelivered\\tto\\tthe\\tcustomer\\tand\\ttheir\\tongoing\\tmaintenance\\tis\\trecognized\\nover\\ttime.\\tFor\\tour\\tobligations\\trelated\\tto\\tautomotive\\tsales,\\twe\\testimate\\tstandalone\\tselling\\tprice\\tby\\tconsidering\\tcosts\\tused\\tto\\tdevelop\\tand\\tdeliver\\tthe\\nservice,\\tthird-party\\tpricing\\tof\\tsimilar\\toptions\\tand\\tother\\tinformation\\tthat\\tmay\\tbe\\tavailable.\\nAny\\tfees\\tthat\\tare\\tpaid\\tor\\tpayable\\tby\\tus\\tto\\ta\\tcustomer’s\\tlender\\twhen\\twe\\tarrange\\tthe\\tfinancing\\tare\\trecognized\\tas\\tan\\toffset\\tagainst\\tautomotive\\tsales\\nrevenue.\\tCosts\\tto\\tobtain\\ta\\tcontract\\tmainly\\trelate\\tto\\tcommissions\\tpaid\\tto\\tour\\tsales\\tpersonnel\\tfor\\tthe\\tsale\\tof\\tvehicles.\\tAs\\tour\\tcontract\\tcosts\\trelated\\tto\\nautomotive\\tsales\\tare\\ttypically\\tfulfilled\\twithin\\tone\\tyear,\\tthe\\tcosts\\tto\\tobtain\\ta\\tcontract\\tare\\texpensed\\tas\\tincurred.\\tAmounts\\tbilled\\tto\\tcustomers\\trelated\\tto\\nshipping\\tand\\thandling\\tare\\tclassified\\tas\\tautomotive\\tsales\\trevenue,\\tand\\twe\\thave\\telected\\tto\\trecognize\\tthe\\tcost\\tfor\\tfreight\\tand\\tshipping\\twhen\\tcontrol\\tover\\nvehicles,\\tparts\\tor\\taccessories\\thave\\ttransferred\\tto\\tthe\\tcustomer\\tas\\tan\\texpense\\tin\\tcost\\tof\\tautomotive\\tsales\\trevenue.\\tOur\\tpolicy\\tis\\tto\\texclude\\ttaxes\\ncollected\\tfrom\\ta\\tcustomer\\tfrom\\tthe\\ttransaction\\tprice\\tof\\tautomotive\\tcontracts.\\n55\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 57,\n        \"lines\": {\n          \"from\": 28,\n          \"to\": 38\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"We\\toffer\\tresale\\tvalue\\tguarantees\\tto\\tour\\tcommercial\\tbanking\\tpartners\\tin\\tconnection\\twith\\tcertain\\tvehicle\\tleasing\\tprograms.\\tUnder\\tthese\\tprograms,\\nwe\\toriginate\\tthe\\tlease\\twith\\tour\\tend\\tcustomer\\tand\\timmediately\\ttransfer\\tthe\\tlease\\tand\\tthe\\tunderlying\\tvehicle\\tto\\tour\\tcommercial\\tbanking\\tpartner,\\twith\\tthe\\ntransaction\\tbeing\\taccounted\\tfor\\tas\\ta\\tsale\\tunder\\tASC\\t606.\\tWe\\treceive\\tupfront\\tpayment\\tfor\\tthe\\tvehicle,\\tdo\\tnot\\tbear\\tcasualty\\tand\\tcredit\\trisks\\tduring\\tthe\\nlease\\tterm,\\tand\\twe\\tprovide\\ta\\tguarantee\\tcapped\\tto\\ta\\tlimit\\tif\\tthey\\tare\\tunable\\tto\\tsell\\tthe\\tvehicle\\tat\\tor\\tabove\\tthe\\tvehicle’s\\tcontract\\tresidual\\tvalue\\tat\\tthe\\tend\\nof\\tthe\\tlease\\tterm.\\tWe\\testimate\\ta\\tguarantee\\tliability\\tin\\taccordance\\twith\\tASC\\t460,\\tGuarantees\\tand\\trecord\\tit\\twithin\\tother\\tliabilities\\ton\\tour\\tconsolidated\\nbalance\\tsheet.\\tOn\\ta\\tquarterly\\tbasis,\\twe\\tassess\\tthe\\testimated\\tmarket\\tvalue\\tof\\tvehicles\\tsold\\tunder\\tthis\\tprogram\\tto\\tdetermine\\twhether\\tthere\\thave\\tbeen\\nchanges\\tto\\tthe\\tamount\\tof\\texpected\\tresale\\tvalue\\tguarantee\\tpayments.\\tAs\\twe\\taccumulate\\tmore\\tdata\\trelated\\tto\\tthe\\tresale\\tvalues\\tof\\tour\\tvehicles\\tor\\tas\\nmarket\\tconditions\\tchange,\\tthere\\tmay\\tbe\\tmaterial\\tchanges\\tto\\ttheir\\testimated\\tvalues.\\tThe\\ttotal\\tguarantee\\tliability\\ton\\tvehicles\\tsold\\tunder\\tthis\\tprogram\\twas\\nimmaterial\\tas\\tof\\tDecember\\t31,\\t2023.\\nDeferred\\trevenue\\trelated\\tto\\tthe\\taccess\\tto\\tour\\tFSD\\tCapability\\tfeatures\\tand\\ttheir\\tongoing\\tmaintenance,\\tinternet\\tconnectivity,\\tfree\\tSupercharging\\nprograms\\tand\\tover-the-air\\tsoftware\\tupdates\\tprimarily\\ton\\tautomotive\\tsales\\tconsisted\\tof\\tthe\\tfollowing\\t(in\\tmillions):\\nYear\\tEnded\\tDecember\\t31,\\n20232022\\nDeferred\\trevenue—\\tbeginning\\tof\\tperiod\\n$2,913\\t$2,382\\t\\nAdditions1,201\\t1,178\\t\\nNet\\tchanges\\tin\\tliability\\tfor\\tpre-existing\\tcontracts17\\t(67)\\nRevenue\\trecognized(595)(580)\\nDeferred\\trevenue—\\tend\\tof\\tperiod\\n$3,536\\t$2,913\\t\\nDeferred\\trevenue\\tis\\tequivalent\\tto\\tthe\\ttotal\\ttransaction\\tprice\\tallocated\\tto\\tthe\\tperformance\\tobligations\\tthat\\tare\\tunsatisfied,\\tor\\tpartially\\tunsatisfied,\\tas\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 58,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 21\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"of\\tthe\\tbalance\\tsheet\\tdate.\\tRevenue\\trecognized\\tfrom\\tthe\\tdeferred\\trevenue\\tbalance\\tas\\tof\\tDecember\\t31,\\t2022\\twas\\t$469\\tmillion\\tfor\\tthe\\tyear\\tended\\nDecember\\t31,\\t2023.\\tWe\\thad\\trecognized\\trevenue\\tof\\t$472\\tmillion\\tfrom\\tthe\\tdeferred\\trevenue\\tbalance\\tas\\tof\\tDecember\\t31,\\t2021,\\tfor\\tthe\\tyear\\tended\\nDecember\\t31,\\t2022,\\tprimarily\\trelated\\tto\\tthe\\tgeneral\\tFSD\\tCapability\\tfeature\\trelease\\tin\\tNorth\\tAmerica\\tin\\tthe\\tfourth\\tquarter\\tof\\t2022.\\tOf\\tthe\\ttotal\\tdeferred\\nrevenue\\tbalance\\tas\\tof\\tDecember\\t31,\\t2023,\\twe\\texpect\\tto\\trecognize\\t$926\\tmillion\\tof\\trevenue\\tin\\tthe\\tnext\\t12\\tmonths.\\tThe\\tremaining\\tbalance\\twill\\tbe\\nrecognized\\tat\\tthe\\ttime\\tof\\ttransfer\\tof\\tcontrol\\tof\\tthe\\tproduct\\tor\\tover\\tthe\\tperformance\\tperiod\\tas\\tdiscussed\\tabove\\tin\\tAutomotive\\tSales.\\nWe\\thave\\tbeen\\tproviding\\tloans\\tfor\\tfinancing\\tour\\tautomotive\\tdeliveries\\tin\\tvolume\\tsince\\tfiscal\\tyear\\t2022.\\tAs\\tof\\tDecember\\t31,\\t2023\\tand\\t2022,\\twe\\thave\\nrecorded\\tnet\\tfinancing\\treceivables\\ton\\tthe\\tconsolidated\\tbalance\\tsheets,\\tof\\twhich\\t$242\\tmillion\\tand\\t$128\\tmillion,\\trespectively,\\tis\\trecorded\\twithin\\tAccounts\\nreceivable,\\tnet,\\tfor\\tthe\\tcurrent\\tportion\\tand\\t$1.04\\tbillion\\tand\\t$665\\tmillion,\\trespectively,\\tis\\trecorded\\twithin\\tOther\\tnon-current\\tassets\\tfor\\tthe\\tlong-term\\nportion.\\nAutomotive\\tRegulatory\\tCredits\\nWe\\tearn\\ttradable\\tcredits\\tin\\tthe\\toperation\\tof\\tour\\tautomotive\\tbusiness\\tunder\\tvarious\\tregulations\\trelated\\tto\\tZEVs,\\tgreenhouse\\tgas,\\tfuel\\teconomy\\tand\\nclean\\tfuel.\\tWe\\tsell\\tthese\\tcredits\\tto\\tother\\tregulated\\tentities\\twho\\tcan\\tuse\\tthe\\tcredits\\tto\\tcomply\\twith\\temission\\tstandards\\tand\\tother\\tregulatory\\trequirements.\\nPayments\\tfor\\tautomotive\\tregulatory\\tcredits\\tare\\ttypically\\treceived\\tat\\tthe\\tpoint\\tcontrol\\ttransfers\\tto\\tthe\\tcustomer,\\tor\\tin\\taccordance\\twith\\tpayment\\nterms\\tcustomary\\tto\\tthe\\tbusiness.\\tWe\\trecognize\\trevenue\\ton\\tthe\\tsale\\tof\\tautomotive\\tregulatory\\tcredits,\\twhich\\thave\\tnegligible\\tincremental\\tcosts\\tassociated\\nwith\\tthem,\\tat\\tthe\\ttime\\tcontrol\\tof\\tthe\\tregulatory\\tcredits\\tis\\ttransferred\\tto\\tthe\\tpurchasing\\tparty.\\tDeferred\\trevenue\\trelated\\tto\\tsales\\tof\\tautomotive\\tregulatory\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 58,\n        \"lines\": {\n          \"from\": 22,\n          \"to\": 36\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"credits\\twas\\timmaterial\\tas\\tof\\tDecember\\t31,\\t2023\\tand\\t2022.\\tRevenue\\trecognized\\tfrom\\tthe\\tdeferred\\trevenue\\tbalance\\tas\\tof\\tDecember\\t31,\\t2022\\tand\\t2021\\nwas\\timmaterial\\tfor\\tthe\\tyears\\tended\\tDecember\\t31,\\t2023\\tand\\t2022.\\tDuring\\tthe\\tyear\\tended\\tDecember\\t31,\\t2022,\\twe\\thad\\talso\\trecognized\\t$288\\tmillion\\tin\\nrevenue\\tdue\\tto\\tchanges\\tin\\tregulation\\twhich\\tentitled\\tus\\tto\\tadditional\\tconsideration\\tfor\\tcredits\\tsold\\tpreviously.\\n56\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 58,\n        \"lines\": {\n          \"from\": 37,\n          \"to\": 40\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Automotive\\tLeasing\\tRevenue\\nDirect\\tVehicle\\tOperating\\tLeasing\\tProgram\\nWe\\thave\\toutstanding\\tleases\\tunder\\tour\\tdirect\\tvehicle\\toperating\\tleasing\\tprograms\\tin\\tthe\\tU.S.,\\tCanada\\tand\\tin\\tcertain\\tcountries\\tin\\tEurope.\\tQualifying\\ncustomers\\tare\\tpermitted\\tto\\tlease\\ta\\tvehicle\\tdirectly\\tfrom\\tTesla\\tfor\\tup\\tto\\t48\\tmonths.\\tAt\\tthe\\tend\\tof\\tthe\\tlease\\tterm,\\tcustomers\\tare\\tgenerally\\trequired\\tto\\nreturn\\tthe\\tvehicles\\tto\\tus.\\tWe\\taccount\\tfor\\tthese\\tleasing\\ttransactions\\tas\\toperating\\tleases.\\tWe\\trecord\\tleasing\\trevenues\\tto\\tautomotive\\tleasing\\trevenue\\ton\\ta\\nstraight-line\\tbasis\\tover\\tthe\\tcontractual\\tterm,\\tand\\twe\\trecord\\tthe\\tdepreciation\\tof\\tthese\\tvehicles\\tto\\tcost\\tof\\tautomotive\\tleasing\\trevenue.\\tFor\\tthe\\tyears\\tended\\nDecember\\t31,\\t2023,\\t2022\\tand\\t2021,\\twe\\trecognized\\t$1.86\\tbillion,\\t$1.75\\tbillion\\tand\\t$1.25\\tbillion\\tof\\tdirect\\tvehicle\\tleasing\\trevenue,\\trespectively.\\tAs\\tof\\nDecember\\t31,\\t2023\\tand\\t2022,\\twe\\thad\\tdeferred\\t$458\\tmillion\\tand\\t$407\\tmillion,\\trespectively,\\tof\\tlease-related\\tupfront\\tpayments,\\twhich\\twill\\tbe\\trecognized\\non\\ta\\tstraight-line\\tbasis\\tover\\tthe\\tcontractual\\tterms\\tof\\tthe\\tindividual\\tleases.\\nOur\\tpolicy\\tis\\tto\\texclude\\ttaxes\\tcollected\\tfrom\\ta\\tcustomer\\tfrom\\tthe\\ttransaction\\tprice\\tof\\tautomotive\\tcontracts.\\nDirect\\tSales-Type\\tLeasing\\tProgram\\nWe\\thave\\toutstanding\\tdirect\\tleases\\tand\\tvehicles\\tfinanced\\tby\\tus\\tunder\\tloan\\tarrangements\\taccounted\\tfor\\tas\\tsales-type\\tleases\\tunder\\tASC\\t842,\\tLeases\\n(“ASC\\t842”),\\tin\\tcertain\\tcountries\\tin\\tAsia\\tand\\tEurope.\\tDepending\\ton\\tthe\\tspecific\\tprogram,\\tcustomers\\tmay\\tor\\tmay\\tnot\\thave\\ta\\tright\\tto\\treturn\\tthe\\tvehicle\\tto\\nus\\tduring\\tor\\tat\\tthe\\tend\\tof\\tthe\\tlease\\tterm.\\tIf\\tthe\\tcustomer\\tdoes\\tnot\\thave\\ta\\tright\\tto\\treturn,\\tthe\\tcustomer\\twill\\ttake\\ttitle\\tto\\tthe\\tvehicle\\tat\\tthe\\tend\\tof\\tthe\\tlease\\nterm\\tafter\\tmaking\\tall\\tcontractual\\tpayments.\\tUnder\\tthe\\tprograms\\tfor\\twhich\\tthere\\tis\\ta\\tright\\tto\\treturn,\\tthe\\tpurchase\\toption\\tis\\treasonably\\tcertain\\tto\\tbe\\nexercised\\tby\\tthe\\tlessee\\tand\\twe\\ttherefore\\texpect\\tthe\\tcustomer\\tto\\ttake\\ttitle\\tto\\tthe\\tvehicle\\tat\\tthe\\tend\\tof\\tthe\\tlease\\tterm\\tafter\\tmaking\\tall\\tcontractual\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 59,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 16\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"payments.\\tOur\\tarrangements\\tunder\\tthese\\tprograms\\tcan\\thave\\tterms\\tfor\\tup\\tto\\t72\\tmonths.\\tWe\\trecognize\\tall\\trevenue\\tand\\tcosts\\tassociated\\twith\\tthe\\tsales-\\ntype\\tlease\\tas\\tautomotive\\tleasing\\trevenue\\tand\\tautomotive\\tleasing\\tcost\\tof\\trevenue,\\trespectively,\\tupon\\tdelivery\\tof\\tthe\\tvehicle\\tto\\tthe\\tcustomer.\\tInterest\\nincome\\tbased\\ton\\tthe\\timplicit\\trate\\tin\\tthe\\tlease\\tis\\trecorded\\tto\\tautomotive\\tleasing\\trevenue\\tover\\ttime\\tas\\tcustomers\\tare\\tinvoiced\\ton\\ta\\tmonthly\\tbasis.\\tFor\\tthe\\nyears\\tended\\tDecember\\t31,\\t2023,\\t2022\\tand\\t2021,\\twe\\trecognized\\t$215\\tmillion,\\t$683\\tmillion\\tand\\t$369\\tmillion,\\trespectively,\\tof\\tsales-type\\tleasing\\trevenue\\nand\\t$164\\tmillion,\\t$427\\tmillion\\tand\\t$234\\tmillion,\\trespectively,\\tof\\tsales-type\\tleasing\\tcost\\tof\\trevenue.\\nServices\\tand\\tOther\\tRevenue\\nServices\\tand\\tother\\trevenue\\tconsists\\tof\\tsales\\tof\\tused\\tvehicles,\\tnon-warranty\\tafter-sales\\tvehicle\\tservices,\\tbody\\tshop\\tand\\tparts,\\tpaid\\tSupercharging,\\nvehicle\\tinsurance\\trevenue\\tand\\tretail\\tmerchandise.\\nRevenues\\trelated\\tto\\trepair,\\tmaintenance\\tand\\tvehicle\\tinsurance\\tservices\\tare\\trecognized\\tover\\ttime\\tas\\tservices\\tare\\tprovided\\tand\\textended\\tservice\\nplans\\tare\\trecognized\\tover\\tthe\\tperformance\\tperiod\\tof\\tthe\\tservice\\tcontract\\tas\\tthe\\tobligation\\trepresents\\ta\\tstand-ready\\tobligation\\tto\\tthe\\tcustomer.\\tWe\\tsell\\nused\\tvehicles,\\tservices,\\tservice\\tplans,\\tvehicle\\tcomponents\\tand\\tmerchandise\\tseparately\\tand\\tthus\\tuse\\tstandalone\\tselling\\tprices\\tas\\tthe\\tbasis\\tfor\\trevenue\\nallocation\\tto\\tthe\\textent\\tthat\\tthese\\titems\\tare\\tsold\\tin\\ttransactions\\twith\\tother\\tperformance\\tobligations.\\tPayment\\tfor\\tused\\tvehicles,\\tservices,\\tvehicle\\ncomponents,\\tand\\tmerchandise\\tare\\ttypically\\treceived\\tat\\tthe\\tpoint\\twhen\\tcontrol\\ttransfers\\tto\\tthe\\tcustomer\\tor\\tin\\taccordance\\twith\\tpayment\\tterms\\tcustomary\\nto\\tthe\\tbusiness.\\tPayments\\treceived\\tfor\\tprepaid\\tplans\\tare\\trefundable\\tupon\\tcustomer\\tcancellation\\tof\\tthe\\trelated\\tcontracts\\tand\\tare\\tincluded\\twithin\\nCustomer\\tdeposits\\ton\\tthe\\tconsolidated\\tbalance\\tsheets.\\tWe\\trecord\\tin\\tDeferred\\trevenue\\tany\\tnon-refundable\\tprepayment\\tamounts\\tthat\\tare\\tcollected\\tfrom\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 59,\n        \"lines\": {\n          \"from\": 17,\n          \"to\": 31\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"customers\\tand\\tunearned\\tinsurance\\tpremiums,\\twhich\\tis\\trecognized\\tas\\trevenue\\tratably\\tover\\tthe\\trespective\\tcustomer\\tcontract\\tterm.\\tDeferred\\trevenue\\nexcluding\\tunearned\\tinsurance\\tpremiums\\twas\\timmaterial\\tas\\tof\\tDecember\\t31,\\t2023\\tand\\t2022.\\n57\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 59,\n        \"lines\": {\n          \"from\": 32,\n          \"to\": 34\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Energy\\tGeneration\\tand\\tStorage\\tSegment\\nEnergy\\tGeneration\\tand\\tStorage\\tSales\\nEnergy\\tgeneration\\tand\\tstorage\\tsales\\trevenue\\tconsists\\tof\\tthe\\tsale\\tof\\tsolar\\tenergy\\tsystems\\tand\\tenergy\\tstorage\\tsystems\\tto\\tresidential,\\tsmall\\ncommercial,\\tlarge\\tcommercial\\tand\\tutility\\tgrade\\tcustomers.\\tSales\\tof\\tsolar\\tenergy\\tsystems\\tto\\tresidential\\tand\\tsmall\\tscale\\tcommercial\\tcustomers\\tconsist\\tof\\nthe\\tengineering,\\tdesign\\tand\\tinstallation\\tof\\tthe\\tsystem.\\tResidential\\tand\\tsmall\\tscale\\tcommercial\\tcustomers\\tpay\\tthe\\tfull\\tpurchase\\tprice\\tof\\tthe\\tsolar\\tenergy\\nsystem\\tupfront.\\tRevenue\\tfor\\tthe\\tdesign\\tand\\tinstallation\\tobligation\\tis\\trecognized\\twhen\\tcontrol\\ttransfers,\\twhich\\tis\\twhen\\twe\\tinstall\\ta\\tsolar\\tenergy\\tsystem\\nand\\tthe\\tsystem\\tpasses\\tinspection\\tby\\tthe\\tutility\\tor\\tthe\\tauthority\\thaving\\tjurisdiction.\\tSales\\tof\\tenergy\\tstorage\\tsystems\\tto\\tresidential\\tand\\tsmall\\tscale\\ncommercial\\tcustomers\\tconsist\\tof\\tthe\\tinstallation\\tof\\tthe\\tenergy\\tstorage\\tsystem\\tand\\trevenue\\tis\\trecognized\\twhen\\tcontrol\\ttransfers,\\twhich\\tis\\twhen\\tthe\\nproduct\\thas\\tbeen\\tdelivered\\tor,\\tif\\twe\\tare\\tperforming\\tinstallation,\\twhen\\tinstalled\\tand\\tcommissioned.\\tPayment\\tfor\\tsuch\\tstorage\\tsystems\\tis\\tmade\\tupon\\ninvoice\\tor\\tin\\taccordance\\twith\\tpayment\\tterms\\tcustomary\\tto\\tthe\\tbusiness.\\nFor\\tlarge\\tcommercial\\tand\\tutility\\tgrade\\tenergy\\tstorage\\tsystem\\tsales\\twhich\\tconsist\\tof\\tthe\\tengineering,\\tdesign\\tand\\tinstallation\\tof\\tthe\\tsystem,\\ncustomers\\tmake\\tmilestone\\tpayments\\tthat\\tare\\tconsistent\\twith\\tcontract-specific\\tphases\\tof\\ta\\tproject.\\tRevenue\\tfrom\\tsuch\\tcontracts\\tis\\trecognized\\tover\\ttime\\nusing\\tthe\\tpercentage\\tof\\tcompletion\\tmethod\\tbased\\ton\\tcost\\tincurred\\tas\\ta\\tpercentage\\tof\\ttotal\\testimated\\tcontract\\tcosts\\tfor\\tenergy\\tstorage\\tsystem\\tsales.\\nIn\\tinstances\\twhere\\tthere\\tare\\tmultiple\\tperformance\\tobligations\\tin\\ta\\tsingle\\tcontract,\\twe\\tallocate\\tthe\\tconsideration\\tto\\tthe\\tvarious\\tobligations\\tin\\tthe\\ncontract\\tbased\\ton\\tthe\\trelative\\tstandalone\\tselling\\tprice\\tmethod.\\tStandalone\\tselling\\tprices\\tare\\testimated\\tbased\\ton\\testimated\\tcosts\\tplus\\tmargin\\tor\\tby\\tusing\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 60,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 15\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"market\\tdata\\tfor\\tcomparable\\tproducts.\\tCosts\\tto\\tobtain\\ta\\tcontract\\trelate\\tmainly\\tto\\tcommissions\\tpaid\\tto\\tour\\tsales\\tpersonnel\\trelated\\tto\\tthe\\tsale\\tof\\tenergy\\nstorage\\tsystems.\\tAs\\tour\\tcontract\\tcosts\\trelated\\tto\\tenergy\\tstorage\\tsystem\\tsales\\tare\\ttypically\\tfulfilled\\twithin\\tone\\tyear,\\tthe\\tcosts\\tto\\tobtain\\ta\\tcontract\\tare\\nexpensed\\tas\\tincurred.\\nAs\\tpart\\tof\\tour\\tenergy\\tstorage\\tsystem\\tcontracts,\\twe\\tmay\\tprovide\\tthe\\tcustomer\\twith\\tperformance\\tguarantees\\tthat\\twarrant\\tthat\\tthe\\tunderlying\\tsystem\\nwill\\tmeet\\tor\\texceed\\tthe\\tminimum\\tenergy\\tperformance\\trequirements\\tspecified\\tin\\tthe\\tcontract.\\tIf\\tan\\tenergy\\tstorage\\tsystem\\tdoes\\tnot\\tmeet\\tthe\\nperformance\\tguarantee\\trequirements,\\twe\\tmay\\tbe\\trequired\\tto\\tpay\\tliquidated\\tdamages.\\tOther\\tforms\\tof\\tvariable\\tconsideration\\trelated\\tto\\tour\\tlarge\\ncommercial\\tand\\tutility\\tgrade\\tenergy\\tstorage\\tsystem\\tcontracts\\tinclude\\tvariable\\tcustomer\\tpayments\\tthat\\twill\\tbe\\tmade\\tbased\\ton\\tour\\tenergy\\tmarket\\nparticipation\\tactivities.\\tSuch\\tguarantees\\tand\\tvariable\\tcustomer\\tpayments\\trepresent\\ta\\tform\\tof\\tvariable\\tconsideration\\tand\\tare\\testimated\\tat\\tcontract\\ninception\\tat\\ttheir\\tmost\\tlikely\\tamount\\tand\\tupdated\\tat\\tthe\\tend\\tof\\teach\\treporting\\tperiod\\tas\\tadditional\\tperformance\\tdata\\tbecomes\\tavailable.\\tSuch\\testimates\\nare\\tincluded\\tin\\tthe\\ttransaction\\tprice\\tonly\\tto\\tthe\\textent\\tthat\\tit\\tis\\tprobable\\ta\\tsignificant\\treversal\\tof\\trevenue\\twill\\tnot\\toccur.\\nWe\\trecord\\tas\\tdeferred\\trevenue\\tany\\tnon-refundable\\tamounts\\tthat\\tare\\tcollected\\tfrom\\tcustomers\\trelated\\tto\\tfees\\tcharged\\tfor\\tprepayments,\\twhich\\tis\\nrecognized\\tas\\trevenue\\tratably\\tover\\tthe\\trespective\\tcustomer\\tcontract\\tterm.\\tAs\\tof\\tDecember\\t31,\\t2023\\tand\\t2022,\\tdeferred\\trevenue\\trelated\\tto\\tsuch\\ncustomer\\tpayments\\tamounted\\tto\\t$1.60\\tbillion\\tand\\t$863\\tmillion,\\trespectively,\\tmainly\\tdue\\tto\\tcontractual\\tpayment\\tterms.\\tRevenue\\trecognized\\tfrom\\tthe\\ndeferred\\trevenue\\tbalance\\tas\\tof\\tDecember\\t31,\\t2022\\tand\\t2021\\twas\\t$571\\tmillion\\tand\\t$171\\tmillion\\tfor\\tthe\\tyears\\tended\\tDecember\\t31,\\t2023\\tand\\t2022,\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 60,\n        \"lines\": {\n          \"from\": 16,\n          \"to\": 29\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"respectively.\\tWe\\thave\\telected\\tthe\\tpractical\\texpedient\\tto\\tomit\\tdisclosure\\tof\\tthe\\tamount\\tof\\tthe\\ttransaction\\tprice\\tallocated\\tto\\tremaining\\tperformance\\nobligations\\tfor\\tenergy\\tgeneration\\tand\\tstorage\\tsales\\twith\\tan\\toriginal\\texpected\\tcontract\\tlength\\tof\\tone\\tyear\\tor\\tless\\tand\\tthe\\tamount\\tthat\\twe\\thave\\tthe\\tright\\tto\\ninvoice\\twhen\\tthat\\tamount\\tcorresponds\\tdirectly\\twith\\tthe\\tvalue\\tof\\tthe\\tperformance\\tto\\tdate.\\tAs\\tof\\tDecember\\t31,\\t2023,\\ttotal\\ttransaction\\tprice\\tallocated\\tto\\nperformance\\tobligations\\tthat\\twere\\tunsatisfied\\tor\\tpartially\\tunsatisfied\\tfor\\tcontracts\\twith\\tan\\toriginal\\texpected\\tlength\\tof\\tmore\\tthan\\tone\\tyear\\twas\\t$3.43\\nbillion.\\tOf\\tthis\\tamount,\\twe\\texpect\\tto\\trecognize\\t$1.05\\tbillion\\tin\\tthe\\tnext\\t12\\tmonths\\tand\\tthe\\trest\\tover\\tthe\\tremaining\\tperformance\\tobligation\\tperiod.\\nWe\\thave\\tbeen\\tproviding\\tloans\\tfor\\tfinancing\\tour\\tenergy\\tgeneration\\tproducts\\tin\\tvolume\\tsince\\tfiscal\\tyear\\t2022.\\tAs\\tof\\tDecember\\t31,\\t2023\\tand\\t2022,\\nwe\\thave\\trecorded\\tnet\\tfinancing\\treceivables\\ton\\tthe\\tconsolidated\\tbalance\\tsheets,\\tof\\twhich\\t$31\\tmillion\\tand\\t$24\\tmillion,\\trespectively,\\tis\\trecorded\\twithin\\nAccounts\\treceivable,\\tnet,\\tfor\\tthe\\tcurrent\\tportion\\tand\\t$578\\tmillion\\tand\\t$387\\tmillion,\\trespectively,\\tis\\trecorded\\twithin\\tOther\\tnon-current\\tassets\\tfor\\tthe\\tlong-\\nterm\\tportion.\\n58\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 60,\n        \"lines\": {\n          \"from\": 30,\n          \"to\": 39\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Energy\\tGeneration\\tand\\tStorage\\tLeasing\\nFor\\trevenue\\tarrangements\\twhere\\twe\\tare\\tthe\\tlessor\\tunder\\toperating\\tlease\\tagreements\\tfor\\tenergy\\tgeneration\\tand\\tstorage\\tproducts,\\twe\\trecord\\tlease\\nrevenue\\tfrom\\tminimum\\tlease\\tpayments,\\tincluding\\tupfront\\trebates\\tand\\tincentives\\tearned\\tfrom\\tsuch\\tsystems,\\ton\\ta\\tstraight-line\\tbasis\\tover\\tthe\\tlife\\tof\\tthe\\nlease\\tterm,\\tassuming\\tall\\tother\\trevenue\\trecognition\\tcriteria\\thave\\tbeen\\tmet.\\tThe\\tdifference\\tbetween\\tthe\\tpayments\\treceived\\tand\\tthe\\trevenue\\trecognized\\tis\\nrecorded\\tas\\tdeferred\\trevenue\\tor\\tdeferred\\tasset\\ton\\tthe\\tconsolidated\\tbalance\\tsheet.\\nFor\\tsolar\\tenergy\\tsystems\\twhere\\tcustomers\\tpurchase\\telectricity\\tfrom\\tus\\tunder\\tPPAs\\tprior\\tto\\tJanuary\\t1,\\t2019,\\twe\\thave\\tdetermined\\tthat\\tthese\\nagreements\\tshould\\tbe\\taccounted\\tfor\\tas\\toperating\\tleases\\tpursuant\\tto\\tASC\\t840,\\tLeases.\\tRevenue\\tis\\trecognized\\tbased\\ton\\tthe\\tamount\\tof\\telectricity\\ndelivered\\tat\\trates\\tspecified\\tunder\\tthe\\tcontracts,\\tassuming\\tall\\tother\\trevenue\\trecognition\\tcriteria\\tare\\tmet.\\nWe\\trecord\\tas\\tdeferred\\trevenue\\tany\\tamounts\\tthat\\tare\\tcollected\\tfrom\\tcustomers,\\tincluding\\tlease\\tprepayments,\\tin\\texcess\\tof\\trevenue\\trecognized,\\nwhich\\tis\\trecognized\\tas\\trevenue\\tratably\\tover\\tthe\\trespective\\tcustomer\\tcontract\\tterm.\\tAs\\tof\\tDecember\\t31,\\t2023\\tand\\t2022,\\tdeferred\\trevenue\\trelated\\tto\\tsuch\\ncustomer\\tpayments\\tamounted\\tto\\t$181\\tmillion\\tand\\t$191\\tmillion,\\trespectively.\\tDeferred\\trevenue\\talso\\tincludes\\tthe\\tportion\\tof\\trebates\\tand\\tincentives\\nreceived\\tfrom\\tutility\\tcompanies\\tand\\tvarious\\tlocal\\tand\\tstate\\tgovernment\\tagencies,\\twhich\\tis\\trecognized\\tas\\trevenue\\tover\\tthe\\tlease\\tterm.\\tAs\\tof\\nDecember\\t31,\\t2023\\tand\\t2022,\\tdeferred\\trevenue\\tfrom\\trebates\\tand\\tincentives\\twas\\timmaterial.\\nWe\\tcapitalize\\tinitial\\tdirect\\tcosts\\tfrom\\tthe\\texecution\\tof\\tagreements\\tfor\\tsolar\\tenergy\\tsystems\\tand\\tPPAs,\\twhich\\tinclude\\tthe\\treferral\\tfees\\tand\\tsales\\ncommissions,\\tas\\tan\\telement\\tof\\tsolar\\tenergy\\tsystems,\\tnet,\\tand\\tsubsequently\\tamortize\\tthese\\tcosts\\tover\\tthe\\tterm\\tof\\tthe\\trelated\\tagreements.\\nCost\\tof\\tRevenues\\nAutomotive\\tSegment\\nAutomotive\\tSales\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 61,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 18\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Automotive\\tSegment\\nAutomotive\\tSales\\nCost\\tof\\tautomotive\\tsales\\trevenue\\tincludes\\tdirect\\tand\\tindirect\\tmaterials,\\tlabor\\tcosts,\\tmanufacturing\\toverhead,\\tincluding\\tdepreciation\\tcosts\\tof\\ttooling\\nand\\tmachinery,\\tshipping\\tand\\tlogistic\\tcosts,\\tvehicle\\tconnectivity\\tcosts,\\tFSD\\tCapability\\tongoing\\tmaintenance\\tcosts,\\tallocations\\tof\\telectricity\\tand\\ninfrastructure\\tcosts\\trelated\\tto\\tour\\tSupercharger\\tnetwork\\tand\\treserves\\tfor\\testimated\\twarranty\\texpenses.\\tCost\\tof\\tautomotive\\tsales\\trevenues\\talso\\tincludes\\nadjustments\\tto\\twarranty\\texpense\\tand\\tcharges\\tto\\twrite\\tdown\\tthe\\tcarrying\\tvalue\\tof\\tour\\tinventory\\twhen\\tit\\texceeds\\tits\\testimated\\tnet\\trealizable\\tvalue\\tand\\tto\\nprovide\\tfor\\tobsolete\\tand\\ton-hand\\tinventory\\tin\\texcess\\tof\\tforecasted\\tdemand.\\tAdditionally,\\tcost\\tof\\tautomotive\\tsales\\trevenue\\tbenefits\\tfrom\\tmanufacturing\\ncredits\\tearned.\\nAutomotive\\tLeasing\\nCost\\tof\\tautomotive\\tleasing\\trevenue\\tincludes\\tthe\\tdepreciation\\tof\\toperating\\tlease\\tvehicles,\\tcost\\tof\\tgoods\\tsold\\tassociated\\twith\\tdirect\\tsales-type\\tleases\\nand\\twarranty\\texpense\\trelated\\tto\\tleased\\tvehicles.\\nServices\\tand\\tOther\\nCosts\\tof\\tservices\\tand\\tother\\trevenue\\tincludes\\tcost\\tof\\tused\\tvehicles\\tincluding\\trefurbishment\\tcosts,\\tcosts\\tassociated\\twith\\tproviding\\tnon-warranty\\nafter-sales\\tservices,\\tcosts\\tassociated\\twith\\tour\\tbody\\tshops\\tand\\tpart\\tsales,\\tcosts\\tof\\tpaid\\tSupercharging,\\tcosts\\tto\\tprovide\\tvehicle\\tinsurance\\tand\\tcosts\\tfor\\nretail\\tmerchandise.\\nEnergy\\tGeneration\\tand\\tStorage\\tSegment\\nEnergy\\tGeneration\\tand\\tStorage\\nCost\\tof\\tenergy\\tgeneration\\tand\\tstorage\\trevenue\\tincludes\\tdirect\\tand\\tindirect\\tmaterial\\tand\\tlabor\\tcosts,\\toverhead\\tcosts,\\tfreight,\\twarranty\\texpense,\\tand\\namortization\\tof\\tcertain\\tacquired\\tintangible\\tassets.\\tCost\\tof\\tenergy\\tgeneration\\tand\\tstorage\\trevenue\\talso\\tincludes\\tcharges\\tto\\twrite\\tdown\\tthe\\tcarrying\\tvalue\\nof\\tour\\tinventory\\twhen\\tit\\texceeds\\tits\\testimated\\tnet\\trealizable\\tvalue\\tand\\tto\\tprovide\\tfor\\tobsolete\\tand\\ton-hand\\tinventory\\tin\\texcess\\tof\\tforecasted\\tdemand.\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 61,\n        \"lines\": {\n          \"from\": 17,\n          \"to\": 36\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Additionally,\\tcost\\tof\\tenergy\\tgeneration\\tand\\tstorage\\trevenue\\tbenefits\\tfrom\\tmanufacturing\\tcredits\\tearned.\\tIn\\tagreements\\tfor\\tsolar\\tenergy\\tsystems\\tand\\nPPAs\\twhere\\twe\\tare\\tthe\\tlessor,\\tthe\\tcost\\tof\\trevenue\\tis\\tprimarily\\tcomprised\\tof\\tdepreciation\\tof\\tthe\\tcost\\tof\\tleased\\tsolar\\tenergy\\tsystems,\\tmaintenance\\tcosts\\nassociated\\twith\\tthose\\tsystems\\tand\\tamortization\\tof\\tany\\tinitial\\tdirect\\tcosts.\\n59\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 61,\n        \"lines\": {\n          \"from\": 37,\n          \"to\": 40\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Research\\tand\\tDevelopment\\tCosts\\nResearch\\tand\\tdevelopment\\tcosts\\tare\\texpensed\\tas\\tincurred.\\nIncome\\tTaxes\\nWe\\tare\\tsubject\\tto\\tincome\\ttaxes\\tin\\tthe\\tU.S.\\tand\\tin\\tmany\\tforeign\\tjurisdictions.\\tIncome\\ttaxes\\tare\\tcomputed\\tusing\\tthe\\tasset\\tand\\tliability\\tmethod,\\tunder\\nwhich\\tdeferred\\ttax\\tassets\\tand\\tliabilities\\tare\\tdetermined\\tbased\\ton\\tthe\\tdifference\\tbetween\\tthe\\tfinancial\\tstatement\\tand\\ttax\\tbases\\tof\\tassets\\tand\\tliabilities\\nusing\\tenacted\\ttax\\trates\\tin\\teffect\\tfor\\tthe\\tyear\\tin\\twhich\\tthe\\tdifferences\\tare\\texpected\\tto\\taffect\\ttaxable\\tincome.\\tValuation\\tallowances\\tare\\testablished\\twhen\\nnecessary\\tto\\treduce\\tdeferred\\ttax\\tassets\\tto\\tthe\\tamount\\texpected\\tto\\tbe\\trealized.\\nWe\\tmonitor\\tthe\\trealizability\\tof\\tour\\tdeferred\\ttax\\tassets\\ttaking\\tinto\\taccount\\tall\\trelevant\\tfactors\\tat\\teach\\treporting\\tperiod.\\tSignificant\\tjudgment\\tis\\nrequired\\tin\\tdetermining\\tour\\tprovision\\tfor\\tincome\\ttaxes,\\tour\\tdeferred\\ttax\\tassets\\tand\\tliabilities\\tand\\tany\\tvaluation\\tallowance\\trecorded\\tagainst\\tour\\tnet\\ndeferred\\ttax\\tassets\\tthat\\tare\\tnot\\tmore\\tlikely\\tthan\\tnot\\tto\\tbe\\trealized.\\tIn\\tcompleting\\tour\\tassessment\\tof\\trealizability\\tof\\tour\\tdeferred\\ttax\\tassets,\\twe\\tconsider\\nour\\thistory\\tof\\tincome\\t(loss)\\tmeasured\\tat\\tpre-tax\\tincome\\t(loss)\\tadjusted\\tfor\\tpermanent\\tbook-tax\\tdifferences\\ton\\ta\\tjurisdictional\\tbasis,\\tvolatility\\tin\\tactual\\nearnings,\\texcess\\ttax\\tbenefits\\trelated\\tto\\tstock-based\\tcompensation\\tin\\trecent\\tprior\\tyears,\\tand\\timpacts\\tof\\tthe\\ttiming\\tof\\treversal\\tof\\texisting\\ttemporary\\ndifferences.\\tWe\\talso\\trely\\ton\\tour\\tassessment\\tof\\tthe\\tCompany’s\\tprojected\\tfuture\\tresults\\tof\\tbusiness\\toperations,\\tincluding\\tuncertainty\\tin\\tfuture\\toperating\\nresults\\trelative\\tto\\thistorical\\tresults,\\tvolatility\\tin\\tthe\\tmarket\\tprice\\tof\\tour\\tcommon\\tstock\\tand\\tits\\tperformance\\tover\\ttime,\\tvariable\\tmacroeconomic\\tconditions\\nimpacting\\tour\\tability\\tto\\tforecast\\tfuture\\ttaxable\\tincome,\\tand\\tchanges\\tin\\tbusiness\\tthat\\tmay\\taffect\\tthe\\texistence\\tand\\tmagnitude\\tof\\tfuture\\ttaxable\\tincome.\\nOur\\tvaluation\\tallowance\\tassessment\\tis\\tbased\\ton\\tour\\tbest\\testimate\\tof\\tfuture\\tresults\\tconsidering\\tall\\tavailable\\tinformation.\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 62,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 16\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"We\\trecord\\tliabilities\\trelated\\tto\\tuncertain\\ttax\\tpositions\\twhen,\\tdespite\\tour\\tbelief\\tthat\\tour\\ttax\\treturn\\tpositions\\tare\\tsupportable,\\twe\\tbelieve\\tthat\\tit\\tis\\nmore\\tlikely\\tthan\\tnot\\tthat\\tthose\\tpositions\\tmay\\tnot\\tbe\\tfully\\tsustained\\tupon\\treview\\tby\\ttax\\tauthorities.\\tAccrued\\tinterest\\tand\\tpenalties\\trelated\\tto\\nunrecognized\\ttax\\tbenefits\\tare\\tclassified\\tas\\tincome\\ttax\\texpense.\\nThe\\tTax\\tCuts\\tand\\tJobs\\tAct\\tsubjects\\ta\\tU.S.\\tshareholder\\tto\\ttax\\ton\\tglobal\\tintangible\\tlow-taxed\\tincome\\t(“GILTI”)\\tearned\\tby\\tcertain\\tforeign\\tsubsidiaries.\\nUnder\\tGAAP,\\twe\\tcan\\tmake\\tan\\taccounting\\tpolicy\\telection\\tto\\teither\\ttreat\\ttaxes\\tdue\\ton\\tthe\\tGILTI\\tinclusion\\tas\\ta\\tcurrent\\tperiod\\texpense\\tor\\tfactor\\tsuch\\namounts\\tinto\\tour\\tmeasurement\\tof\\tdeferred\\ttaxes.\\tWe\\telected\\tthe\\tdeferred\\tmethod,\\tunder\\twhich\\twe\\trecorded\\tthe\\tcorresponding\\tdeferred\\ttax\\tassets\\tand\\nliabilities\\tin\\tour\\tconsolidated\\tbalance\\tsheets.\\nComprehensive\\tIncome\\nComprehensive\\tincome\\tis\\tcomprised\\tof\\tnet\\tincome\\tand\\tother\\tcomprehensive\\tincome\\t(loss).\\tOther\\tcomprehensive\\tincome\\t(loss)\\tconsists\\tof\\tforeign\\ncurrency\\ttranslation\\tadjustments\\tand\\tunrealized\\tnet\\tgains\\tand\\tlosses\\ton\\tinvestments\\tthat\\thave\\tbeen\\texcluded\\tfrom\\tthe\\tdetermination\\tof\\tnet\\tincome.\\nStock-Based\\tCompensation\\nWe\\tuse\\tthe\\tfair\\tvalue\\tmethod\\tof\\taccounting\\tfor\\tour\\tstock\\toptions\\tand\\tRSUs\\tgranted\\tto\\temployees\\tand\\tfor\\tour\\tESPP\\tto\\tmeasure\\tthe\\tcost\\tof\\temployee\\nservices\\treceived\\tin\\texchange\\tfor\\tthe\\tstock-based\\tawards.\\tThe\\tfair\\tvalue\\tof\\tstock\\toption\\tawards\\twith\\tonly\\tservice\\tand/or\\tperformance\\tconditions\\tis\\nestimated\\ton\\tthe\\tgrant\\tor\\toffering\\tdate\\tusing\\tthe\\tBlack-Scholes\\toption-pricing\\tmodel.\\tThe\\tBlack-Scholes\\toption-pricing\\tmodel\\trequires\\tinputs\\tsuch\\tas\\tthe\\nrisk-free\\tinterest\\trate,\\texpected\\tterm\\tand\\texpected\\tvolatility.\\tThese\\tinputs\\tare\\tsubjective\\tand\\tgenerally\\trequire\\tsignificant\\tjudgment.\\tThe\\tfair\\tvalue\\tof\\nRSUs\\tis\\tmeasured\\ton\\tthe\\tgrant\\tdate\\tbased\\ton\\tthe\\tclosing\\tfair\\tmarket\\tvalue\\tof\\tour\\tcommon\\tstock.\\tThe\\tresulting\\tcost\\tis\\trecognized\\tover\\tthe\\tperiod\\tduring\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 62,\n        \"lines\": {\n          \"from\": 17,\n          \"to\": 32\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"which\\tan\\temployee\\tis\\trequired\\tto\\tprovide\\tservice\\tin\\texchange\\tfor\\tthe\\tawards,\\tusually\\tthe\\tvesting\\tperiod,\\twhich\\tis\\tgenerally\\tfour\\tyears\\tfor\\tstock\\toptions\\nand\\tRSUs\\tand\\tsix\\tmonths\\tfor\\tthe\\tESPP.\\tStock-based\\tcompensation\\texpense\\tis\\trecognized\\ton\\ta\\tstraight-line\\tbasis,\\tnet\\tof\\tactual\\tforfeitures\\tin\\tthe\\tperiod.\\nFor\\tperformance-based\\tawards,\\tstock-based\\tcompensation\\texpense\\tis\\trecognized\\tover\\tthe\\texpected\\tperformance\\tachievement\\tperiod\\tof\\tindividual\\nperformance\\tmilestones\\twhen\\tthe\\tachievement\\tof\\teach\\tindividual\\tperformance\\tmilestone\\tbecomes\\tprobable.\\n60\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 62,\n        \"lines\": {\n          \"from\": 33,\n          \"to\": 37\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"As\\twe\\taccumulate\\tadditional\\temployee\\tstock-based\\tawards\\tdata\\tover\\ttime\\tand\\tas\\twe\\tincorporate\\tmarket\\tdata\\trelated\\tto\\tour\\tcommon\\tstock,\\twe\\tmay\\ncalculate\\tsignificantly\\tdifferent\\tvolatilities\\tand\\texpected\\tlives,\\twhich\\tcould\\tmaterially\\timpact\\tthe\\tvaluation\\tof\\tour\\tstock-based\\tawards\\tand\\tthe\\tstock-based\\ncompensation\\texpense\\tthat\\twe\\twill\\trecognize\\tin\\tfuture\\tperiods.\\tStock-based\\tcompensation\\texpense\\tis\\trecorded\\tin\\tCost\\tof\\trevenues,\\tResearch\\tand\\ndevelopment\\texpense\\tand\\tSelling,\\tgeneral\\tand\\tadministrative\\texpense\\tin\\tthe\\tconsolidated\\tstatements\\tof\\toperations.\\nNoncontrolling\\tInterests\\tand\\tRedeemable\\tNoncontrolling\\tInterests\\nNoncontrolling\\tinterests\\tand\\tredeemable\\tnoncontrolling\\tinterests\\trepresent\\tthird-party\\tinterests\\tin\\tthe\\tnet\\tassets\\tunder\\tcertain\\tfunding\\narrangements,\\tor\\tfunds,\\tthat\\twe\\thave\\tentered\\tinto\\tto\\tfinance\\tthe\\tcosts\\tof\\tsolar\\tenergy\\tsystems\\tand\\tvehicles\\tunder\\toperating\\tleases.\\tWe\\thave\\tdetermined\\nthat\\tthe\\tcontractual\\tprovisions\\tof\\tthe\\tfunds\\trepresent\\tsubstantive\\tprofit-sharing\\tarrangements.\\tWe\\thave\\tfurther\\tdetermined\\tthat\\tthe\\tmethodology\\tfor\\ncalculating\\tthe\\tnoncontrolling\\tinterest\\tand\\tredeemable\\tnoncontrolling\\tinterest\\tbalances\\tthat\\treflects\\tthe\\tsubstantive\\tprofit-sharing\\tarrangements\\tis\\ta\\nbalance\\tsheet\\tapproach\\tusing\\tthe\\thypothetical\\tliquidation\\tat\\tbook\\tvalue\\t(“HLBV”)\\tmethod.\\tWe,\\ttherefore,\\tdetermine\\tthe\\tamount\\tof\\tthe\\tnoncontrolling\\ninterests\\tand\\tredeemable\\tnoncontrolling\\tinterests\\tin\\tthe\\tnet\\tassets\\tof\\tthe\\tfunds\\tat\\teach\\tbalance\\tsheet\\tdate\\tusing\\tthe\\tHLBV\\tmethod,\\twhich\\tis\\tpresented\\ton\\nthe\\tconsolidated\\tbalance\\tsheet\\tas\\tnoncontrolling\\tinterests\\tin\\tsubsidiaries\\tand\\tredeemable\\tnoncontrolling\\tinterests\\tin\\tsubsidiaries.\\tUnder\\tthe\\tHLBV\\nmethod,\\tthe\\tamounts\\treported\\tas\\tnoncontrolling\\tinterests\\tand\\tredeemable\\tnoncontrolling\\tinterests\\tin\\tthe\\tconsolidated\\tbalance\\tsheet\\trepresent\\tthe\\namounts\\tthe\\tthird\\tparties\\twould\\thypothetically\\treceive\\tat\\teach\\tbalance\\tsheet\\tdate\\tunder\\tthe\\tliquidation\\tprovisions\\tof\\tthe\\tfunds,\\tassuming\\tthe\\tnet\\tassets\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 63,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 14\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"of\\tthe\\tfunds\\twere\\tliquidated\\tat\\ttheir\\trecorded\\tamounts\\tdetermined\\tin\\taccordance\\twith\\tGAAP\\tand\\twith\\ttax\\tlaws\\teffective\\tat\\tthe\\tbalance\\tsheet\\tdate\\tand\\ndistributed\\tto\\tthe\\tthird\\tparties.\\tThe\\tthird\\tparties’\\tinterests\\tin\\tthe\\tresults\\tof\\toperations\\tof\\tthe\\tfunds\\tare\\tdetermined\\tas\\tthe\\tdifference\\tin\\tthe\\tnoncontrolling\\ninterest\\tand\\tredeemable\\tnoncontrolling\\tinterest\\tbalances\\tin\\tthe\\tconsolidated\\tbalance\\tsheets\\tbetween\\tthe\\tstart\\tand\\tend\\tof\\teach\\treporting\\tperiod,\\tafter\\ntaking\\tinto\\taccount\\tany\\tcapital\\ttransactions\\tbetween\\tthe\\tfunds\\tand\\tthe\\tthird\\tparties.\\tHowever,\\tthe\\tredeemable\\tnoncontrolling\\tinterest\\tbalance\\tis\\tat\\tleast\\nequal\\tto\\tthe\\tredemption\\tamount.\\tThe\\tredeemable\\tnoncontrolling\\tinterest\\tbalance\\tis\\tpresented\\tas\\ttemporary\\tequity\\tin\\tthe\\tmezzanine\\tsection\\tof\\tthe\\nconsolidated\\tbalance\\tsheet\\tsince\\tthese\\tthird\\tparties\\thave\\tthe\\tright\\tto\\tredeem\\ttheir\\tinterests\\tin\\tthe\\tfunds\\tfor\\tcash\\tor\\tother\\tassets.\\tFor\\tcertain\\tfunds,\\tthere\\nhave\\tbeen\\tsignificant\\tfluctuations\\tin\\tnet\\t(loss)\\tincome\\tattributable\\tto\\tnoncontrolling\\tinterests\\tand\\tredeemable\\tnoncontrolling\\tinterests\\tin\\tsubsidiaries\\tdue\\nto\\tchanges\\tin\\tthe\\tliquidation\\tprovisions\\tas\\ttime-based\\tmilestones\\thave\\tbeen\\treached.\\nNet\\tIncome\\tper\\tShare\\tof\\tCommon\\tStock\\tAttributable\\tto\\tCommon\\tStockholders\\nBasic\\tnet\\tincome\\tper\\tshare\\tof\\tcommon\\tstock\\tattributable\\tto\\tcommon\\tstockholders\\tis\\tcalculated\\tby\\tdividing\\tnet\\tincome\\tattributable\\tto\\tcommon\\nstockholders\\tby\\tthe\\tweighted-average\\tshares\\tof\\tcommon\\tstock\\toutstanding\\tfor\\tthe\\tperiod.\\tPotentially\\tdilutive\\tshares,\\twhich\\tare\\tbased\\ton\\tthe\\tweighted-\\naverage\\tshares\\tof\\tcommon\\tstock\\tunderlying\\toutstanding\\tstock-based\\tawards,\\twarrants\\tand\\tconvertible\\tsenior\\tnotes\\tusing\\tthe\\ttreasury\\tstock\\tmethod\\tor\\nthe\\tif-converted\\tmethod,\\tas\\tapplicable,\\tare\\tincluded\\twhen\\tcalculating\\tdiluted\\tnet\\tincome\\tper\\tshare\\tof\\tcommon\\tstock\\tattributable\\tto\\tcommon\\tstockholders\\nwhen\\ttheir\\teffect\\tis\\tdilutive.\\nFurthermore,\\tin\\tconnection\\twith\\tthe\\tofferings\\tof\\tour\\tconvertible\\tsenior\\tnotes,\\twe\\tentered\\tinto\\tconvertible\\tnote\\thedges\\tand\\twarrants\\t(see\\tNote\\t11,\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 63,\n        \"lines\": {\n          \"from\": 15,\n          \"to\": 29\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Debt).\\tHowever,\\tour\\tconvertible\\tnote\\thedges\\tare\\tnot\\tincluded\\twhen\\tcalculating\\tpotentially\\tdilutive\\tshares\\tsince\\ttheir\\teffect\\tis\\talways\\tanti-dilutive.\\tThe\\nstrike\\tprice\\ton\\tthe\\twarrants\\twere\\tbelow\\tour\\taverage\\tshare\\tprice\\tduring\\tthe\\tperiod\\tand\\twere\\tincluded\\tin\\tthe\\ttables\\tbelow.\\tWarrants\\tare\\tincluded\\tin\\tthe\\nweighted-average\\tshares\\tused\\tin\\tcomputing\\tbasic\\tnet\\tincome\\tper\\tshare\\tof\\tcommon\\tstock\\tin\\tthe\\tperiod(s)\\tthey\\tare\\tsettled.\\nThe\\tfollowing\\ttable\\tpresents\\tthe\\treconciliation\\tof\\tnet\\tincome\\tattributable\\tto\\tcommon\\tstockholders\\tto\\tnet\\tincome\\tused\\tin\\tcomputing\\tbasic\\tand\\ndiluted\\tnet\\tincome\\tper\\tshare\\tof\\tcommon\\tstock\\t(in\\tmillions):\\nYear\\tEnded\\tDecember\\t31,\\n202320222021\\nNet\\tincome\\tattributable\\tto\\tcommon\\tstockholders$14,997\\t$12,556\\t$5,519\\t\\nLess:\\tBuy-out\\tof\\tnoncontrolling\\tinterest(2)(27)(5)\\nNet\\tincome\\tused\\tin\\tcomputing\\tbasic\\tnet\\tincome\\tper\\tshare\\tof\\tcommon\\tstock14,999\\t12,583\\t5,524\\t\\nLess:\\tDilutive\\tconvertible\\tdebt—\\t(1)(9)\\nNet\\tincome\\tused\\tin\\tcomputing\\tdiluted\\tnet\\tincome\\tper\\tshare\\tof\\tcommon\\tstock\\n$14,999\\t$12,584\\t$5,533\\t\\n61\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 63,\n        \"lines\": {\n          \"from\": 30,\n          \"to\": 43\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"The\\tfollowing\\ttable\\tpresents\\tthe\\treconciliation\\tof\\tbasic\\tto\\tdiluted\\tweighted\\taverage\\tshares\\tused\\tin\\tcomputing\\tnet\\tincome\\tper\\tshare\\tof\\tcommon\\nstock\\tattributable\\tto\\tcommon\\tstockholders\\t(in\\tmillions):\\nYear\\tEnded\\tDecember\\t31,\\n202320222021\\nWeighted\\taverage\\tshares\\tused\\tin\\tcomputing\\tnet\\tincome\\tper\\tshare\\tof\\tcommon\\tstock,\\nbasic3,1743,1302,959\\nAdd:\\nStock-based\\tawards298310292\\nConvertible\\tsenior\\tnotes2329\\nWarrants1132106\\nWeighted\\taverage\\tshares\\tused\\tin\\tcomputing\\tnet\\tincome\\tper\\tshare\\tof\\tcommon\\tstock,\\ndiluted\\n3,4853,4753,386\\nThe\\tfollowing\\ttable\\tpresents\\tthe\\tpotentially\\tdilutive\\tshares\\tthat\\twere\\texcluded\\tfrom\\tthe\\tcomputation\\tof\\tdiluted\\tnet\\tincome\\tper\\tshare\\tof\\tcommon\\nstock\\tattributable\\tto\\tcommon\\tstockholders,\\tbecause\\ttheir\\teffect\\twas\\tanti-dilutive\\t(in\\tmillions):\\nYear\\tEnded\\tDecember\\t31,\\n202320222021\\nStock-based\\tawards\\n1241\\nBusiness\\tCombinations\\nWe\\taccount\\tfor\\tbusiness\\tacquisitions\\tunder\\tASC\\t805,\\tBusiness\\tCombinations.\\tThe\\ttotal\\tpurchase\\tconsideration\\tfor\\tan\\tacquisition\\tis\\tmeasured\\tas\\tthe\\nfair\\tvalue\\tof\\tthe\\tassets\\tgiven,\\tequity\\tinstruments\\tissued\\tand\\tliabilities\\tassumed\\tat\\tthe\\tacquisition\\tdate.\\tCosts\\tthat\\tare\\tdirectly\\tattributable\\tto\\tthe\\nacquisition\\tare\\texpensed\\tas\\tincurred.\\tIdentifiable\\tassets\\t(including\\tintangible\\tassets),\\tliabilities\\tassumed\\t(including\\tcontingent\\tliabilities)\\tand\\nnoncontrolling\\tinterests\\tin\\tan\\tacquisition\\tare\\tmeasured\\tinitially\\tat\\ttheir\\tfair\\tvalues\\tat\\tthe\\tacquisition\\tdate.\\tWe\\trecognize\\tgoodwill\\tif\\tthe\\tfair\\tvalue\\tof\\tthe\\ntotal\\tpurchase\\tconsideration\\tand\\tany\\tnoncontrolling\\tinterests\\tis\\tin\\texcess\\tof\\tthe\\tnet\\tfair\\tvalue\\tof\\tthe\\tidentifiable\\tassets\\tacquired\\tand\\tthe\\tliabilities\\nassumed.\\tWe\\trecognize\\ta\\tbargain\\tpurchase\\tgain\\twithin\\tOther\\tincome\\t(expense),\\tnet,\\tin\\tthe\\tconsolidated\\tstatement\\tof\\toperations\\tif\\tthe\\tnet\\tfair\\tvalue\\tof\\nthe\\tidentifiable\\tassets\\tacquired\\tand\\tthe\\tliabilities\\tassumed\\tis\\tin\\texcess\\tof\\tthe\\tfair\\tvalue\\tof\\tthe\\ttotal\\tpurchase\\tconsideration\\tand\\tany\\tnoncontrolling\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 64,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 27\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"interests.\\tWe\\tinclude\\tthe\\tresults\\tof\\toperations\\tof\\tthe\\tacquired\\tbusiness\\tin\\tthe\\tconsolidated\\tfinancial\\tstatements\\tbeginning\\ton\\tthe\\tacquisition\\tdate.\\nCash\\tand\\tCash\\tEquivalents\\nAll\\thighly\\tliquid\\tinvestments\\twith\\tan\\toriginal\\tmaturity\\tof\\tthree\\tmonths\\tor\\tless\\tat\\tthe\\tdate\\tof\\tpurchase\\tare\\tconsidered\\tcash\\tequivalents.\\tOur\\tcash\\nequivalents\\tare\\tprimarily\\tcomprised\\tof\\tU.S.\\tgovernment\\tsecurities,\\tmoney\\tmarket\\tfunds\\tand\\tcommercial\\tpaper.\\nRestricted\\tCash\\nWe\\tmaintain\\tcertain\\tcash\\tbalances\\trestricted\\tas\\tto\\twithdrawal\\tor\\tuse.\\tOur\\trestricted\\tcash\\tis\\tcomprised\\tprimarily\\tof\\tcash\\theld\\tto\\tservice\\tcertain\\npayments\\tunder\\tvarious\\tsecured\\tdebt\\tfacilities.\\tIn\\taddition,\\trestricted\\tcash\\tincludes\\tcash\\theld\\tas\\tcollateral\\tfor\\tsales\\tto\\tlease\\tpartners\\twith\\ta\\tresale\\tvalue\\nguarantee,\\tletters\\tof\\tcredit,\\treal\\testate\\tleases\\tand\\tdeposits\\theld\\tfor\\tour\\tinsurance\\tservices.\\tWe\\trecord\\trestricted\\tcash\\tas\\tother\\tassets\\tin\\tthe\\tconsolidated\\nbalance\\tsheets\\tand\\tdetermine\\tcurrent\\tor\\tnon-current\\tclassification\\tbased\\ton\\tthe\\texpected\\tduration\\tof\\tthe\\trestriction.\\n62\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 64,\n        \"lines\": {\n          \"from\": 28,\n          \"to\": 37\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Our\\ttotal\\tcash\\tand\\tcash\\tequivalents\\tand\\trestricted\\tcash,\\tas\\tpresented\\tin\\tthe\\tconsolidated\\tstatements\\tof\\tcash\\tflows,\\twas\\tas\\tfollows\\t(in\\tmillions):\\nDecember\\t31,\\n2023\\nDecember\\t31,\\n2022\\nDecember\\t31,\\n2021\\nCash\\tand\\tcash\\tequivalents\\n$16,398\\t$16,253\\t$17,576\\t\\nRestricted\\tcash\\tincluded\\tin\\tprepaid\\texpenses\\tand\\tother\\tcurrent\\tassets543\\t294\\t345\\t\\nRestricted\\tcash\\tincluded\\tin\\tother\\tnon-current\\tassets248\\t377\\t223\\t\\nTotal\\tas\\tpresented\\tin\\tthe\\tconsolidated\\tstatements\\tof\\tcash\\tflows\\n$17,189\\t$16,924\\t$18,144\\t\\nInvestments\\nInvestments\\tmay\\tbe\\tcomprised\\tof\\ta\\tcombination\\tof\\tmarketable\\tsecurities,\\tincluding\\tU.S.\\tgovernment\\tsecurities,\\tcorporate\\tdebt\\tsecurities,\\ncommercial\\tpaper,\\ttime\\tdeposits,\\tand\\tcertain\\tcertificates\\tof\\tdeposit,\\twhich\\tare\\tall\\tdesignated\\tas\\tavailable-for-sale\\tand\\treported\\tat\\testimated\\tfair\\tvalue,\\nwith\\tunrealized\\tgains\\tand\\tlosses\\trecorded\\tin\\taccumulated\\tother\\tcomprehensive\\tincome\\twhich\\tis\\tincluded\\twithin\\tstockholders’\\tequity.\\tAvailable-for-sale\\nmarketable\\tsecurities\\twith\\tmaturities\\tgreater\\tthan\\tthree\\tmonths\\tat\\tthe\\tdate\\tof\\tpurchase\\tare\\tincluded\\tin\\tshort-term\\tinvestments\\tin\\tour\\tconsolidated\\nbalance\\tsheets.\\tInterest,\\tdividends,\\tamortization\\tand\\taccretion\\tof\\tpurchase\\tpremiums\\tand\\tdiscounts\\ton\\tthese\\tinvestments\\tare\\tincluded\\twithin\\tInterest\\nincome\\tin\\tour\\tconsolidated\\tstatements\\tof\\toperations.\\nThe\\tcost\\tof\\tavailable-for-sale\\tinvestments\\tsold\\tis\\tbased\\ton\\tthe\\tspecific\\tidentification\\tmethod.\\tRealized\\tgains\\tand\\tlosses\\ton\\tthe\\tsale\\tof\\tavailable-for-\\nsale\\tinvestments\\tare\\trecorded\\tin\\tOther\\tincome\\t(expense),\\tnet.\\nWe\\tregularly\\treview\\tall\\tof\\tour\\tinvestments\\tfor\\tdeclines\\tin\\tfair\\tvalue.\\tThe\\treview\\tincludes\\tbut\\tis\\tnot\\tlimited\\tto\\t(i)\\tthe\\tconsideration\\tof\\tthe\\tcause\\tof\\tthe\\ndecline,\\t(ii)\\tany\\tcurrently\\trecorded\\texpected\\tcredit\\tlosses\\tand\\t(iii)\\tthe\\tcreditworthiness\\tof\\tthe\\trespective\\tsecurity\\tissuers.\\tThe\\tamortized\\tcost\\tbasis\\tof\\tour\\ninvestments\\tapproximates\\tits\\tfair\\tvalue.\\nAccounts\\tReceivable\\tand\\tAllowance\\tfor\\tDoubtful\\tAccounts\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 65,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 26\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Accounts\\treceivable\\tprimarily\\tinclude\\tamounts\\trelated\\tto\\treceivables\\tfrom\\tfinancial\\tinstitutions\\tand\\tleasing\\tcompanies\\toffering\\tvarious\\tfinancing\\nproducts\\tto\\tour\\tcustomers,\\tsales\\tof\\tenergy\\tgeneration\\tand\\tstorage\\tproducts,\\tsales\\tof\\tregulatory\\tcredits\\tto\\tother\\tautomotive\\tmanufacturers\\tand\\ngovernment\\trebates\\talready\\tpassed\\tthrough\\tto\\tcustomers.\\tWe\\tprovide\\tan\\tallowance\\tagainst\\taccounts\\treceivable\\tfor\\tthe\\tamount\\twe\\texpect\\tto\\tbe\\nuncollectible.\\tWe\\twrite-off\\taccounts\\treceivable\\tagainst\\tthe\\tallowance\\twhen\\tthey\\tare\\tdeemed\\tuncollectible.\\nDepending\\ton\\tthe\\tday\\tof\\tthe\\tweek\\ton\\twhich\\tthe\\tend\\tof\\ta\\tfiscal\\tquarter\\tfalls,\\tour\\taccounts\\treceivable\\tbalance\\tmay\\tfluctuate\\tas\\twe\\tare\\twaiting\\tfor\\ncertain\\tcustomer\\tpayments\\tto\\tclear\\tthrough\\tour\\tbanking\\tinstitutions\\tand\\treceipts\\tof\\tpayments\\tfrom\\tour\\tfinancing\\tpartners,\\twhich\\tcan\\ttake\\tup\\tto\\napproximately\\ttwo\\tweeks\\tbased\\ton\\tthe\\tcontractual\\tpayment\\tterms\\twith\\tsuch\\tpartners.\\tOur\\taccounts\\treceivable\\tbalances\\tassociated\\twith\\tour\\tsales\\tof\\nregulatory\\tcredits\\tare\\tdependent\\ton\\tcontractual\\tpayment\\tterms.\\tAdditionally,\\tgovernment\\trebates\\tcan\\ttake\\tup\\tto\\ta\\tyear\\tor\\tmore\\tto\\tbe\\tcollected\\ndepending\\ton\\tthe\\tcustomary\\tprocessing\\ttimelines\\tof\\tthe\\tspecific\\tjurisdictions\\tissuing\\tthem.\\tThese\\tvarious\\tfactors\\tmay\\thave\\ta\\tsignificant\\timpact\\ton\\tour\\naccounts\\treceivable\\tbalance\\tfrom\\tperiod\\tto\\tperiod.\\tAs\\tof\\tDecember\\t31,\\t2023\\tand\\t2022,\\twe\\thad\\t$207\\tmillion\\tand\\t$753\\tmillion,\\trespectively,\\tof\\tlong-term\\ngovernment\\trebates\\treceivable\\tin\\tOther\\tnon-current\\tassets\\tin\\tour\\tconsolidated\\tbalance\\tsheets.\\nFinancing\\tReceivables\\nWe\\tprovide\\tfinancing\\toptions\\tto\\tour\\tcustomers\\tfor\\tour\\tautomotive\\tand\\tenergy\\tproducts.\\tFinancing\\treceivables\\tare\\tcarried\\tat\\tamortized\\tcost,\\tnet\\tof\\nallowance\\tfor\\tloan\\tlosses.\\tProvisions\\tfor\\tloan\\tlosses\\tare\\tcharged\\tto\\toperations\\tin\\tamounts\\tsufficient\\tto\\tmaintain\\tthe\\tallowance\\tfor\\tloan\\tlosses\\tat\\tlevels\\nconsidered\\tadequate\\tto\\tcover\\texpected\\tcredit\\tlosses\\ton\\tthe\\tfinancing\\treceivables.\\tIn\\tdetermining\\texpected\\tcredit\\tlosses,\\twe\\tconsider\\tour\\thistorical\\tlevel\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 65,\n        \"lines\": {\n          \"from\": 27,\n          \"to\": 41\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"of\\tcredit\\tlosses,\\tcurrent\\teconomic\\ttrends,\\tand\\treasonable\\tand\\tsupportable\\tforecasts\\tthat\\taffect\\tthe\\tcollectability\\tof\\tthe\\tfuture\\tcash\\tflows.\\nWhen\\toriginating\\tconsumer\\treceivables,\\twe\\treview\\tthe\\tcredit\\tapplication,\\tthe\\tproposed\\tcontract\\tterms,\\tcredit\\tbureau\\tinformation\\t(e.g.,\\tFICO\\tscore)\\nand\\tother\\tinformation.\\tOur\\tevaluation\\temphasizes\\tthe\\tapplicant’s\\tability\\tto\\tpay\\tand\\tcreditworthiness\\tfocusing\\ton\\tpayment,\\taffordability,\\tand\\tapplicant\\ncredit\\thistory\\tas\\tkey\\tconsiderations.\\tGenerally,\\tall\\tcustomers\\tin\\tthis\\tportfolio\\thave\\tstrong\\tcreditworthiness\\tat\\tloan\\torigination.\\n63\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 65,\n        \"lines\": {\n          \"from\": 42,\n          \"to\": 46\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"After\\torigination,\\twe\\treview\\tthe\\tcredit\\tquality\\tof\\tretail\\tfinancing\\tbased\\ton\\tcustomer\\tpayment\\tactivity\\tand\\taging\\tanalysis.\\tFor\\tall\\tfinancing\\nreceivables,\\twe\\tdefine\\t“past\\tdue”\\tas\\tany\\tpayment,\\tincluding\\tprincipal\\tand\\tinterest,\\twhich\\tis\\tat\\tleast\\t31\\tdays\\tpast\\tthe\\tcontractual\\tdue\\tdate.\\tAs\\tof\\nDecember\\t31,\\t2023\\tand\\t2022,\\tthe\\tvast\\tmajority\\tof\\tour\\tfinancing\\treceivables\\twere\\tat\\tcurrent\\tstatus\\twith\\tonly\\tan\\timmaterial\\tbalance\\tbeing\\tpast\\tdue.\\tAs\\tof\\nDecember\\t31,\\t2023,\\tthe\\tmajority\\tof\\tour\\tfinancing\\treceivables,\\texcluding\\tMyPower\\tnotes\\treceivable,\\twere\\toriginated\\tin\\t2023\\tand\\t2022,\\tand\\tas\\tof\\nDecember\\t31,\\t2022,\\tthe\\tmajority\\tof\\tour\\tfinancing\\treceivables,\\texcluding\\tMyPower\\tnotes\\treceivable,\\twere\\toriginated\\tin\\t2022.\\nWe\\thave\\tcustomer\\tnotes\\treceivable\\tunder\\tthe\\tlegacy\\tMyPower\\tloan\\tprogram,\\twhich\\tprovided\\tresidential\\tcustomers\\twith\\tthe\\toption\\tto\\tfinance\\tthe\\npurchase\\tof\\ta\\tsolar\\tenergy\\tsystem\\tthrough\\ta\\t30-year\\tloan\\tand\\twere\\tall\\toriginated\\tprior\\tto\\tyear\\t2018.\\tThe\\toutstanding\\tbalances,\\tnet\\tof\\tany\\tallowance\\tfor\\nexpected\\tcredit\\tlosses,\\tare\\tpresented\\ton\\tthe\\tconsolidated\\tbalance\\tsheets\\tas\\ta\\tcomponent\\tof\\tPrepaid\\texpenses\\tand\\tother\\tcurrent\\tassets\\tfor\\tthe\\tcurrent\\nportion\\tand\\tas\\tOther\\tnon-current\\tassets\\tfor\\tthe\\tlong-term\\tportion.\\tAs\\tof\\tDecember\\t31,\\t2023\\tand\\t2022,\\tthe\\ttotal\\toutstanding\\tbalance\\tof\\tMyPower\\ncustomer\\tnotes\\treceivable,\\tnet\\tof\\tallowance\\tfor\\texpected\\tcredit\\tlosses,\\twas\\t$266\\tmillion\\tand\\t$280\\tmillion,\\trespectively,\\tof\\twhich\\t$5\\tmillion\\tand\\t$7\\tmillion\\nwere\\tdue\\tin\\tthe\\tnext\\t12\\tmonths\\tas\\tof\\tDecember\\t31,\\t2023\\tand\\t2022,\\trespectively.\\tAs\\tof\\tDecember\\t31,\\t2023\\tand\\t2022,\\tthe\\tallowance\\tfor\\texpected\\tcredit\\nlosses\\twas\\t$36\\tmillion\\tand\\t$37\\tmillion,\\trespectively.\\nConcentration\\tof\\tRisk\\nCredit\\tRisk\\nFinancial\\tinstruments\\tthat\\tpotentially\\tsubject\\tus\\tto\\ta\\tconcentration\\tof\\tcredit\\trisk\\tconsist\\tof\\tcash,\\tcash\\tequivalents,\\tinvestments,\\trestricted\\tcash,\\naccounts\\treceivable\\tand\\tother\\tfinance\\treceivables.\\tOur\\tcash\\tand\\tinvestments\\tbalances\\tare\\tprimarily\\ton\\tdeposit\\tat\\thigh\\tcredit\\tquality\\tfinancial\\tinstitutions\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 66,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 16\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"or\\tinvested\\tin\\tmoney\\tmarket\\tfunds.\\tThese\\tdeposits\\tare\\ttypically\\tin\\texcess\\tof\\tinsured\\tlimits.\\tAs\\tof\\tDecember\\t31,\\t2023\\tand\\t2022,\\tno\\tentity\\trepresented\\n10%\\tor\\tmore\\tof\\tour\\ttotal\\treceivables\\tbalance.\\nSupply\\tRisk\\nWe\\tare\\tdependent\\ton\\tour\\tsuppliers,\\tincluding\\tsingle\\tsource\\tsuppliers,\\tand\\tthe\\tinability\\tof\\tthese\\tsuppliers\\tto\\tdeliver\\tnecessary\\tcomponents\\tof\\tour\\nproducts\\tin\\ta\\ttimely\\tmanner\\tat\\tprices,\\tquality\\tlevels\\tand\\tvolumes\\tacceptable\\tto\\tus,\\tor\\tour\\tinability\\tto\\tefficiently\\tmanage\\tthese\\tcomponents\\tfrom\\tthese\\nsuppliers,\\tcould\\thave\\ta\\tmaterial\\tadverse\\teffect\\ton\\tour\\tbusiness,\\tprospects,\\tfinancial\\tcondition\\tand\\toperating\\tresults.\\nInventory\\tValuation\\nInventories\\tare\\tstated\\tat\\tthe\\tlower\\tof\\tcost\\tor\\tnet\\trealizable\\tvalue.\\tCost\\tis\\tcomputed\\tusing\\tstandard\\tcost\\tfor\\tvehicles\\tand\\tenergy\\tproducts,\\twhich\\napproximates\\tactual\\tcost\\ton\\ta\\tfirst-in,\\tfirst-out\\tbasis.\\tWe\\trecord\\tinventory\\twrite-downs\\tfor\\texcess\\tor\\tobsolete\\tinventories\\tbased\\tupon\\tassumptions\\tabout\\ncurrent\\tand\\tfuture\\tdemand\\tforecasts.\\tIf\\tour\\tinventory\\ton-hand\\tis\\tin\\texcess\\tof\\tour\\tfuture\\tdemand\\tforecast,\\tthe\\texcess\\tamounts\\tare\\twritten-off.\\nWe\\talso\\treview\\tour\\tinventory\\tto\\tdetermine\\twhether\\tits\\tcarrying\\tvalue\\texceeds\\tthe\\tnet\\tamount\\trealizable\\tupon\\tthe\\tultimate\\tsale\\tof\\tthe\\tinventory.\\nThis\\trequires\\tus\\tto\\tdetermine\\tthe\\testimated\\tselling\\tprice\\tof\\tour\\tvehicles\\tless\\tthe\\testimated\\tcost\\tto\\tconvert\\tthe\\tinventory\\ton-hand\\tinto\\ta\\tfinished\\tproduct.\\nOnce\\tinventory\\tis\\twritten-down,\\ta\\tnew,\\tlower\\tcost\\tbasis\\tfor\\tthat\\tinventory\\tis\\testablished\\tand\\tsubsequent\\tchanges\\tin\\tfacts\\tand\\tcircumstances\\tdo\\tnot\\tresult\\nin\\tthe\\trestoration\\tor\\tincrease\\tin\\tthat\\tnewly\\testablished\\tcost\\tbasis.\\nShould\\tour\\testimates\\tof\\tfuture\\tselling\\tprices\\tor\\tproduction\\tcosts\\tchange,\\tadditional\\tand\\tpotentially\\tmaterial\\twrite-downs\\tmay\\tbe\\trequired.\\tA\\tsmall\\nchange\\tin\\tour\\testimates\\tmay\\tresult\\tin\\ta\\tmaterial\\tcharge\\tto\\tour\\treported\\tfinancial\\tresults.\\nOperating\\tLease\\tVehicles\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 66,\n        \"lines\": {\n          \"from\": 17,\n          \"to\": 33\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Operating\\tLease\\tVehicles\\nVehicles\\tthat\\tare\\tleased\\tas\\tpart\\tof\\tour\\tdirect\\tvehicle\\tleasing\\tprogram\\tare\\tclassified\\tas\\toperating\\tlease\\tvehicles\\tat\\tcost\\tless\\taccumulated\\ndepreciation.\\tWe\\tgenerally\\tdepreciate\\ttheir\\tcost,\\tless\\tresidual\\tvalue,\\tusing\\tthe\\tstraight-line-method\\tto\\tcost\\tof\\tautomotive\\tleasing\\trevenue\\tover\\tthe\\ncontractual\\tperiod.\\tThe\\tgross\\tcost\\tof\\toperating\\tlease\\tvehicles\\tas\\tof\\tDecember\\t31,\\t2023\\tand\\t2022\\twas\\t$7.36\\tbillion\\tand\\t$6.08\\tbillion,\\trespectively.\\nOperating\\tlease\\tvehicles\\ton\\tthe\\tconsolidated\\tbalance\\tsheets\\tare\\tpresented\\tnet\\tof\\taccumulated\\tdepreciation\\tof\\t$1.38\\tbillion\\tand\\t$1.04\\tbillion\\tas\\tof\\nDecember\\t31,\\t2023\\tand\\t2022,\\trespectively.\\n64\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 66,\n        \"lines\": {\n          \"from\": 33,\n          \"to\": 39\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Digital\\tAssets,\\tNet\\nWe\\tcurrently\\taccount\\tfor\\tall\\tdigital\\tassets\\theld\\tas\\tindefinite-lived\\tintangible\\tassets\\tin\\taccordance\\twith\\tASC\\t350,\\tIntangibles—Goodwill\\tand\\tOther.\\tWe\\nhave\\townership\\tof\\tand\\tcontrol\\tover\\tour\\tdigital\\tassets\\tand\\twe\\tmay\\tuse\\tthird-party\\tcustodial\\tservices\\tto\\tsecure\\tit.\\tThe\\tdigital\\tassets\\tare\\tinitially\\trecorded\\tat\\ncost\\tand\\tare\\tsubsequently\\tremeasured\\ton\\tthe\\tconsolidated\\tbalance\\tsheet\\tat\\tcost,\\tnet\\tof\\tany\\timpairment\\tlosses\\tincurred\\tsince\\tacquisition.\\nWe\\tdetermine\\tthe\\tfair\\tvalue\\tof\\tour\\tdigital\\tassets\\ton\\ta\\tnonrecurring\\tbasis\\tin\\taccordance\\twith\\tASC\\t820,\\tFair\\tValue\\tMeasurement\\t(“ASC\\t820”),\\tbased\\non\\tquoted\\tprices\\ton\\tthe\\tactive\\texchange(s)\\tthat\\twe\\thave\\tdetermined\\tis\\tthe\\tprincipal\\tmarket\\tfor\\tsuch\\tassets\\t(Level\\tI\\tinputs).\\tWe\\tperform\\tan\\tanalysis\\teach\\nquarter\\tto\\tidentify\\twhether\\tevents\\tor\\tchanges\\tin\\tcircumstances,\\tprincipally\\tdecreases\\tin\\tthe\\tquoted\\tprices\\ton\\tactive\\texchanges,\\tindicate\\tthat\\tit\\tis\\tmore\\nlikely\\tthan\\tnot\\tthat\\tour\\tdigital\\tassets\\tare\\timpaired.\\tIn\\tdetermining\\tif\\tan\\timpairment\\thas\\toccurred,\\twe\\tconsider\\tthe\\tlowest\\tmarket\\tprice\\tof\\tone\\tunit\\tof\\ndigital\\tasset\\tquoted\\ton\\tthe\\tactive\\texchange\\tsince\\tacquiring\\tthe\\tdigital\\tasset.\\tWhen\\tthe\\tthen\\tcurrent\\tcarrying\\tvalue\\tof\\ta\\tdigital\\tasset\\texceeds\\tthe\\tfair\\nvalue\\tdetermined\\teach\\tquarter,\\tan\\timpairment\\tloss\\thas\\toccurred\\twith\\trespect\\tto\\tthose\\tdigital\\tassets\\tin\\tthe\\tamount\\tequal\\tto\\tthe\\tdifference\\tbetween\\ttheir\\ncarrying\\tvalues\\tand\\tthe\\tprices\\tdetermined.\\nImpairment\\tlosses\\tare\\trecognized\\twithin\\tRestructuring\\tand\\tother\\tin\\tthe\\tconsolidated\\tstatements\\tof\\toperations\\tin\\tthe\\tperiod\\tin\\twhich\\tthe\\timpairment\\nis\\tidentified.\\tGains\\tare\\tnot\\trecorded\\tuntil\\trealized\\tupon\\tsale(s),\\tat\\twhich\\tpoint\\tthey\\tare\\tpresented\\tnet\\tof\\tany\\timpairment\\tlosses\\tfor\\tthe\\tsame\\tdigital\\tassets\\nheld\\twithin\\tRestructuring\\tand\\tother.\\tIn\\tdetermining\\tthe\\tgain\\tto\\tbe\\trecognized\\tupon\\tsale,\\twe\\tcalculate\\tthe\\tdifference\\tbetween\\tthe\\tsales\\tprice\\tand\\tcarrying\\nvalue\\tof\\tthe\\tdigital\\tassets\\tsold\\timmediately\\tprior\\tto\\tsale.\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 67,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 15\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"See\\tNote\\t3,\\tDigital\\tAssets,\\tNet,\\tfor\\tfurther\\tinformation\\tregarding\\tdigital\\tassets.\\nSolar\\tEnergy\\tSystems,\\tNet\\nWe\\tare\\tthe\\tlessor\\tof\\tsolar\\tenergy\\tsystems.\\tSolar\\tenergy\\tsystems\\tare\\tstated\\tat\\tcost\\tless\\taccumulated\\tdepreciation.\\nDepreciation\\tand\\tamortization\\tis\\tcalculated\\tusing\\tthe\\tstraight-line\\tmethod\\tover\\tthe\\testimated\\tuseful\\tlives\\tof\\tthe\\trespective\\tassets,\\tas\\tfollows:\\nSolar\\tenergy\\tsystems\\tin\\tservice30\\tto\\t35\\tyears\\nInitial\\tdirect\\tcosts\\trelated\\tto\\tcustomer\\tsolar\\tenergy\\tsystem\\tlease\\tacquisition\\tcostsLease\\tterm\\t(up\\tto\\t25\\tyears)\\nSolar\\tenergy\\tsystems\\tpending\\tinterconnection\\twill\\tbe\\tdepreciated\\tas\\tsolar\\tenergy\\tsystems\\tin\\tservice\\twhen\\tthey\\thave\\tbeen\\tinterconnected\\tand\\nplaced\\tin-service.\\tSolar\\tenergy\\tsystems\\tunder\\tconstruction\\trepresents\\tsystems\\tthat\\tare\\tunder\\tinstallation,\\twhich\\twill\\tbe\\tdepreciated\\tas\\tsolar\\tenergy\\nsystems\\tin\\tservice\\twhen\\tthey\\tare\\tcompleted,\\tinterconnected\\tand\\tplaced\\tin\\tservice.\\tInitial\\tdirect\\tcosts\\trelated\\tto\\tcustomer\\tsolar\\tenergy\\tsystem\\tagreement\\nacquisition\\tcosts\\tare\\tcapitalized\\tand\\tamortized\\tover\\tthe\\tterm\\tof\\tthe\\trelated\\tcustomer\\tagreements.\\nProperty,\\tPlant\\tand\\tEquipment,\\tNet\\nProperty,\\tplant\\tand\\tequipment,\\tnet,\\tincluding\\tleasehold\\timprovements,\\tare\\trecognized\\tat\\tcost\\tless\\taccumulated\\tdepreciation.\\tDepreciation\\tis\\ngenerally\\tcomputed\\tusing\\tthe\\tstraight-line\\tmethod\\tover\\tthe\\testimated\\tuseful\\tlives\\tof\\tthe\\trespective\\tassets,\\tas\\tfollows:\\nMachinery,\\tequipment,\\tvehicles\\tand\\toffice\\tfurniture3\\tto\\t15\\tyears\\nTooling4\\tto\\t7\\tyears\\nBuilding\\tand\\tbuilding\\timprovements15\\tto\\t30\\tyears\\nComputer\\tequipment\\tand\\tsoftware3\\tto\\t10\\tyears\\nLeasehold\\timprovements\\tare\\tdepreciated\\ton\\ta\\tstraight-line\\tbasis\\tover\\tthe\\tshorter\\tof\\ttheir\\testimated\\tuseful\\tlives\\tor\\tthe\\tterms\\tof\\tthe\\trelated\\tleases.\\nUpon\\tthe\\tretirement\\tor\\tsale\\tof\\tour\\tproperty,\\tplant\\tand\\tequipment,\\tthe\\tcost\\tand\\tassociated\\taccumulated\\tdepreciation\\tare\\tremoved\\tfrom\\tthe\\nconsolidated\\tbalance\\tsheet,\\tand\\tthe\\tresulting\\tgain\\tor\\tloss\\tis\\treflected\\ton\\tthe\\tconsolidated\\tstatement\\tof\\toperations.\\tMaintenance\\tand\\trepair\\texpenditures\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 67,\n        \"lines\": {\n          \"from\": 16,\n          \"to\": 35\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"are\\texpensed\\tas\\tincurred\\twhile\\tmajor\\timprovements\\tthat\\tincrease\\tthe\\tfunctionality,\\toutput\\tor\\texpected\\tlife\\tof\\tan\\tasset\\tare\\tcapitalized\\tand\\tdepreciated\\nratably\\tover\\tthe\\tidentified\\tuseful\\tlife.\\n65\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 67,\n        \"lines\": {\n          \"from\": 36,\n          \"to\": 38\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Interest\\texpense\\ton\\toutstanding\\tdebt\\tis\\tcapitalized\\tduring\\tthe\\tperiod\\tof\\tsignificant\\tcapital\\tasset\\tconstruction.\\tCapitalized\\tinterest\\ton\\tconstruction\\tin\\nprogress\\tis\\tincluded\\twithin\\tProperty,\\tplant\\tand\\tequipment,\\tnet\\tand\\tis\\tamortized\\tover\\tthe\\tlife\\tof\\tthe\\trelated\\tassets.\\nLong-Lived\\tAssets\\tIncluding\\tAcquired\\tIntangible\\tAssets\\nWe\\treview\\tour\\tproperty,\\tplant\\tand\\tequipment,\\tsolar\\tenergy\\tsystems,\\tlong-term\\tprepayments\\tand\\tintangible\\tassets\\tfor\\timpairment\\twhenever\\tevents\\nor\\tchanges\\tin\\tcircumstances\\tindicate\\tthat\\tthe\\tcarrying\\tamount\\tof\\tan\\tasset\\t(or\\tasset\\tgroup)\\tmay\\tnot\\tbe\\trecoverable.\\tWe\\tmeasure\\trecoverability\\tby\\ncomparing\\tthe\\tcarrying\\tamount\\tto\\tthe\\tfuture\\tundiscounted\\tcash\\tflows\\tthat\\tthe\\tasset\\tis\\texpected\\tto\\tgenerate.\\tIf\\tthe\\tasset\\tis\\tnot\\trecoverable,\\tits\\tcarrying\\namount\\twould\\tbe\\tadjusted\\tdown\\tto\\tits\\tfair\\tvalue.\\tFor\\tthe\\tyears\\tended\\tDecember\\t31,\\t2023,\\t2022\\tand\\t2021,\\twe\\thave\\trecognized\\tno\\tmaterial\\timpairments\\nof\\tour\\tlong-lived\\tassets.\\nIntangible\\tassets\\twith\\tdefinite\\tlives\\tare\\tamortized\\ton\\ta\\tstraight-line\\tbasis\\tover\\ttheir\\testimated\\tuseful\\tlives,\\twhich\\trange\\tfrom\\tseven\\tto\\tthirty\\tyears.\\nGoodwill\\nWe\\tassess\\tgoodwill\\tfor\\timpairment\\tannually\\tin\\tthe\\tfourth\\tquarter,\\tor\\tmore\\tfrequently\\tif\\tevents\\tor\\tchanges\\tin\\tcircumstances\\tindicate\\tthat\\tit\\tmight\\tbe\\nimpaired,\\tby\\tcomparing\\tits\\tcarrying\\tvalue\\tto\\tthe\\treporting\\tunit’s\\tfair\\tvalue.\\tFor\\tthe\\tyears\\tended\\tDecember\\t31,\\t2023,\\t2022,\\tand\\t2021,\\twe\\tdid\\tnot\\nrecognize\\tany\\timpairment\\tof\\tgoodwill.\\nCapitalization\\tof\\tSoftware\\tCosts\\nWe\\tcapitalize\\tcosts\\tincurred\\tin\\tthe\\tdevelopment\\tof\\tinternal\\tuse\\tsoftware,\\tduring\\tthe\\tapplication\\tdevelopment\\tstage\\tto\\tProperty,\\tplant\\tand\\nequipment,\\tnet\\ton\\tthe\\tconsolidated\\tbalance\\tsheets.\\tCosts\\trelated\\tto\\tpreliminary\\tproject\\tactivities\\tand\\tpost-implementation\\tactivities\\tare\\texpensed\\tas\\nincurred.\\tSuch\\tcosts\\tare\\tamortized\\ton\\ta\\tstraight-line\\tbasis\\tover\\ttheir\\testimated\\tuseful\\tlife\\tof\\tthree\\tto\\tfive\\tyears.\\nSoftware\\tdevelopment\\tcosts\\tincurred\\tin\\tdevelopment\\tof\\tsoftware\\tto\\tbe\\tsold,\\tleased,\\tor\\totherwise\\tmarketed,\\tincurred\\tsubsequent\\tto\\tthe\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 68,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 18\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"establishment\\tof\\ttechnological\\tfeasibility\\tand\\tprior\\tto\\tthe\\tgeneral\\tavailability\\tof\\tthe\\tsoftware\\tare\\tcapitalized\\twhen\\tthey\\tare\\texpected\\tto\\tbecome\\nsignificant.\\tSuch\\tcosts\\tare\\tamortized\\tover\\tthe\\testimated\\tuseful\\tlife\\tof\\tthe\\tapplicable\\tsoftware\\tonce\\tit\\tis\\tmade\\tgenerally\\tavailable\\tto\\tour\\tcustomers.\\nWe\\tevaluate\\tthe\\tuseful\\tlives\\tof\\tthese\\tassets\\ton\\tan\\tannual\\tbasis,\\tand\\twe\\ttest\\tfor\\timpairment\\twhenever\\tevents\\tor\\tchanges\\tin\\tcircumstances\\toccur\\nthat\\tcould\\timpact\\tthe\\trecoverability\\tof\\tthese\\tassets.\\tFor\\tthe\\tyears\\tended\\tDecember\\t31,\\t2023,\\t2022,\\tand\\t2021,\\twe\\thave\\trecognized\\tno\\timpairments\\tof\\ncapitalized\\tsoftware\\tcosts.\\nForeign\\tCurrency\\nWe\\tdetermine\\tthe\\tfunctional\\tand\\treporting\\tcurrency\\tof\\teach\\tof\\tour\\tinternational\\tsubsidiaries\\tand\\ttheir\\toperating\\tdivisions\\tbased\\ton\\tthe\\tprimary\\ncurrency\\tin\\twhich\\tthey\\toperate.\\tIn\\tcases\\twhere\\tthe\\tfunctional\\tcurrency\\tis\\tnot\\tthe\\tU.S.\\tdollar,\\twe\\trecognize\\ta\\tcumulative\\ttranslation\\tadjustment\\tcreated\\tby\\nthe\\tdifferent\\trates\\twe\\tapply\\tto\\tcurrent\\tperiod\\tincome\\tor\\tloss\\tand\\tthe\\tbalance\\tsheet.\\tFor\\teach\\tsubsidiary,\\twe\\tapply\\tthe\\tmonthly\\taverage\\tfunctional\\nexchange\\trate\\tto\\tits\\tmonthly\\tincome\\tor\\tloss\\tand\\tthe\\tmonth-end\\tfunctional\\tcurrency\\trate\\tto\\ttranslate\\tthe\\tbalance\\tsheet.\\nForeign\\tcurrency\\ttransaction\\tgains\\tand\\tlosses\\tare\\ta\\tresult\\tof\\tthe\\teffect\\tof\\texchange\\trate\\tchanges\\ton\\ttransactions\\tdenominated\\tin\\tcurrencies\\tother\\nthan\\tthe\\tfunctional\\tcurrency\\tof\\tthe\\trespective\\tsubsidiary.\\tTransaction\\tgains\\tand\\tlosses\\tare\\trecognized\\tin\\tOther\\tincome\\t(expense),\\tnet,\\tin\\tthe\\tconsolidated\\nstatements\\tof\\toperations.\\tFor\\tthe\\tyears\\tended\\tDecember\\t31,\\t2023,\\t2022\\tand\\t2021,\\twe\\trecorded\\ta\\tnet\\tforeign\\tcurrency\\ttransaction\\tgain\\tof\\t$122\\tmillion,\\nloss\\tof\\t$89\\tmillion\\tand\\tgain\\tof\\t$97\\tmillion,\\trespectively.\\n66\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 68,\n        \"lines\": {\n          \"from\": 19,\n          \"to\": 33\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Warranties\\nWe\\tprovide\\ta\\tmanufacturer’s\\twarranty\\ton\\tall\\tnew\\tand\\tused\\tvehicles\\tand\\ta\\twarranty\\ton\\tthe\\tinstallation\\tand\\tcomponents\\tof\\tthe\\tenergy\\tgeneration\\nand\\tstorage\\tsystems\\twe\\tsell\\tfor\\tperiods\\ttypically\\tbetween\\t10\\tto\\t25\\tyears.\\tWe\\taccrue\\ta\\twarranty\\treserve\\tfor\\tthe\\tproducts\\tsold\\tby\\tus,\\twhich\\tincludes\\tour\\nbest\\testimate\\tof\\tthe\\tprojected\\tcosts\\tto\\trepair\\tor\\treplace\\titems\\tunder\\twarranties\\tand\\trecalls\\tif\\tidentified.\\tThese\\testimates\\tare\\tbased\\ton\\tactual\\tclaims\\nincurred\\tto\\tdate\\tand\\tan\\testimate\\tof\\tthe\\tnature,\\tfrequency\\tand\\tcosts\\tof\\tfuture\\tclaims.\\tThese\\testimates\\tare\\tinherently\\tuncertain\\tand\\tchanges\\tto\\tour\\nhistorical\\tor\\tprojected\\twarranty\\texperience\\tmay\\tcause\\tmaterial\\tchanges\\tto\\tthe\\twarranty\\treserve\\tin\\tthe\\tfuture.\\tThe\\twarranty\\treserve\\tdoes\\tnot\\tinclude\\nprojected\\twarranty\\tcosts\\tassociated\\twith\\tour\\tvehicles\\tsubject\\tto\\toperating\\tlease\\taccounting\\tand\\tour\\tsolar\\tenergy\\tsystems\\tunder\\tlease\\tcontracts\\tor\\tPPAs,\\nas\\tthe\\tcosts\\tto\\trepair\\tthese\\twarranty\\tclaims\\tare\\texpensed\\tas\\tincurred.\\tThe\\tportion\\tof\\tthe\\twarranty\\treserve\\texpected\\tto\\tbe\\tincurred\\twithin\\tthe\\tnext\\t12\\nmonths\\tis\\tincluded\\twithin\\tAccrued\\tliabilities\\tand\\tother,\\twhile\\tthe\\tremaining\\tbalance\\tis\\tincluded\\twithin\\tOther\\tlong-term\\tliabilities\\ton\\tthe\\tconsolidated\\nbalance\\tsheets.\\tFor\\tliabilities\\tthat\\twe\\tare\\tentitled\\tto\\treceive\\tindemnification\\tfrom\\tour\\tsuppliers,\\twe\\trecord\\treceivables\\tfor\\tthe\\tcontractually\\tobligated\\namounts\\ton\\tthe\\tconsolidated\\tbalance\\tsheets\\tas\\ta\\tcomponent\\tof\\tPrepaid\\texpenses\\tand\\tother\\tcurrent\\tassets\\tfor\\tthe\\tcurrent\\tportion\\tand\\tas\\tOther\\tnon-\\ncurrent\\tassets\\tfor\\tthe\\tlong-term\\tportion.\\tWarranty\\texpense\\tis\\trecorded\\tas\\ta\\tcomponent\\tof\\tCost\\tof\\trevenues\\tin\\tthe\\tconsolidated\\tstatements\\tof\\toperations.\\nDue\\tto\\tthe\\tmagnitude\\tof\\tour\\tautomotive\\tbusiness,\\tour\\taccrued\\twarranty\\tbalance\\tis\\tprimarily\\trelated\\tto\\tour\\tautomotive\\tsegment.\\tAccrued\\twarranty\\nactivity\\tconsisted\\tof\\tthe\\tfollowing\\t(in\\tmillions):\\nYear\\tEnded\\tDecember\\t31,\\n202320222021\\nAccrued\\twarranty—beginning\\tof\\tperiod\\n$3,505\\t$2,101\\t$1,468\\t\\nWarranty\\tcosts\\tincurred(1,225)(803)(525)\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 69,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 19\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Warranty\\tcosts\\tincurred(1,225)(803)(525)\\nNet\\tchanges\\tin\\tliability\\tfor\\tpre-existing\\twarranties,\\tincluding\\texpirations\\tand\\tforeign\\nexchange\\timpact539\\t522\\t102\\t\\nProvision\\tfor\\twarranty2,333\\t1,685\\t1,056\\t\\nAccrued\\twarranty—end\\tof\\tperiod\\n$5,152\\t$3,505\\t$2,101\\t\\nCustomer\\tDeposits\\nCustomer\\tdeposits\\tprimarily\\tconsist\\tof\\trefundable\\tcash\\tpayments\\tfrom\\tcustomers\\tat\\tthe\\ttime\\tthey\\tplace\\tan\\torder\\tor\\treservation\\tfor\\ta\\tvehicle\\tor\\tan\\nenergy\\tproduct\\tand\\tany\\tadditional\\tpayments\\tup\\tto\\tthe\\tpoint\\tof\\tdelivery\\tor\\tthe\\tcompletion\\tof\\tinstallation.\\tCustomer\\tdeposits\\talso\\tinclude\\tprepayments\\ton\\ncontracts\\tthat\\tcan\\tbe\\tcancelled\\twithout\\tsignificant\\tpenalties,\\tsuch\\tas\\tvehicle\\tmaintenance\\tplans.\\tCustomer\\tdeposits\\tare\\tincluded\\tin\\tAccrued\\tliabilities\\tand\\nother\\ton\\tthe\\tconsolidated\\tbalance\\tsheets\\tuntil\\trefunded,\\tforfeited\\tor\\tapplied\\ttowards\\tthe\\tcustomer’s\\tpurchase\\tbalance.\\nGovernment\\tAssistance\\tPrograms\\tand\\tIncentives\\nGlobally,\\tthe\\toperation\\tof\\tour\\tbusiness\\tis\\timpacted\\tby\\tvarious\\tgovernment\\tprograms,\\tincentives,\\tand\\tother\\tarrangements.\\tGovernment\\tincentives\\nare\\trecorded\\tin\\tour\\tconsolidated\\tfinancial\\tstatements\\tin\\taccordance\\twith\\ttheir\\tpurpose\\tas\\ta\\treduction\\tof\\texpense,\\tor\\tan\\toffset\\tto\\tthe\\trelated\\tcapital\\tasset.\\nThe\\tbenefit\\tis\\tgenerally\\trecorded\\twhen\\tall\\tconditions\\tattached\\tto\\tthe\\tincentive\\thave\\tbeen\\tmet\\tor\\tare\\texpected\\tto\\tbe\\tmet\\tand\\tthere\\tis\\treasonable\\nassurance\\tof\\ttheir\\treceipt.\\nThe\\tIRA\\tIncentives\\nOn\\tAugust\\t16,\\t2022,\\tthe\\tIRA\\twas\\tenacted\\tinto\\tlaw\\tand\\tis\\teffective\\tfor\\ttaxable\\tyears\\tbeginning\\tafter\\tDecember\\t31,\\t2022.\\tThe\\tIRA\\tincludes\\tmultiple\\nincentives\\tto\\tpromote\\tclean\\tenergy,\\telectric\\tvehicles,\\tbattery\\tand\\tenergy\\tstorage\\tmanufacture\\tor\\tpurchase,\\tin\\taddition\\tto\\ta\\tnew\\tcorporate\\talternative\\nminimum\\ttax\\tof\\t15%\\ton\\tadjusted\\tfinancial\\tstatement\\tincome\\tof\\tcorporations\\twith\\tprofits\\tgreater\\tthan\\t$1\\tbillion.\\tSome\\tof\\tthese\\tmeasures\\tare\\texpected\\tto\\nmaterially\\taffect\\tour\\tconsolidated\\tfinancial\\tstatements.\\tFor\\tthe\\tyear\\tended\\tDecember\\t31,\\t2023,\\tthe\\timpact\\tfrom\\tour\\tIRA\\tincentive\\twas\\tprimarily\\ta\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 69,\n        \"lines\": {\n          \"from\": 19,\n          \"to\": 39\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"reduction\\tof\\tour\\tmaterial\\tcosts\\tin\\tour\\tconsolidated\\tstatement\\tof\\toperations.\\tWe\\twill\\tcontinue\\tto\\tevaluate\\tthe\\teffects\\tof\\tthe\\tIRA\\tas\\tmore\\tguidance\\tis\\tissued\\nand\\tthe\\trelevant\\timplications\\tto\\tour\\tconsolidated\\tfinancial\\tstatements.\\n67\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 69,\n        \"lines\": {\n          \"from\": 40,\n          \"to\": 42\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Gigafactory\\tNew\\tYork—New\\tYork\\tState\\tInvestment\\tand\\tLease\\nWe\\thave\\ta\\tlease\\tthrough\\tthe\\tResearch\\tFoundation\\tfor\\tthe\\tSUNY\\tFoundation\\twith\\trespect\\tto\\tGigafactory\\tNew\\tYork.\\tUnder\\tthe\\tlease\\tand\\ta\\trelated\\nresearch\\tand\\tdevelopment\\tagreement,\\twe\\tare\\tcontinuing\\tto\\tdesignate\\tfurther\\tbuildouts\\tat\\tthe\\tfacility.\\tWe\\tare\\trequired\\tto\\tcomply\\twith\\tcertain\\tcovenants,\\nincluding\\thiring\\tand\\tcumulative\\tinvestment\\ttargets.\\tUnder\\tthe\\tterms\\tof\\tthe\\tarrangement,\\tthe\\tSUNY\\tFoundation\\tpaid\\tfor\\ta\\tmajority\\tof\\tthe\\tconstruction\\ncosts\\trelated\\tto\\tthe\\tmanufacturing\\tfacility\\tand\\tthe\\tacquisition\\tand\\tcommissioning\\tof\\tcertain\\tmanufacturing\\tequipment;\\tand\\twe\\tare\\tresponsible\\tfor\\tany\\nconstruction\\tor\\tequipment\\tcosts\\tin\\texcess\\tof\\tsuch\\tamount\\t(refer\\tto\\tNote\\t15,\\tCommitments\\tand\\tContingencies).\\tThis\\tincentive\\treduces\\tthe\\trelated\\tlease\\ncosts\\tof\\tthe\\tfacility\\twithin\\tthe\\tEnergy\\tgeneration\\tand\\tstorage\\tcost\\tof\\trevenues\\tand\\toperating\\texpense\\tline\\titems\\tin\\tour\\tconsolidated\\tstatements\\tof\\noperations.\\nGigafactory\\tShanghai—Land\\tUse\\tRights\\tand\\tEconomic\\tBenefits\\nWe\\thave\\tan\\tagreement\\twith\\tthe\\tlocal\\tgovernment\\tof\\tShanghai\\tfor\\tland\\tuse\\trights\\tat\\tGigafactory\\tShanghai.\\tUnder\\tthe\\tterms\\tof\\tthe\\tarrangement,\\twe\\nare\\trequired\\tto\\tmeet\\ta\\tcumulative\\tcapital\\texpenditure\\ttarget\\tand\\tan\\tannual\\ttax\\trevenue\\ttarget\\tstarting\\tat\\tthe\\tend\\tof\\t2023.\\tIn\\taddition,\\tthe\\tShanghai\\ngovernment\\thas\\tgranted\\tto\\tour\\tGigafactory\\tShanghai\\tsubsidiary\\tcertain\\tincentives\\tto\\tbe\\tused\\tin\\tconnection\\twith\\teligible\\tcapital\\tinvestments\\tat\\nGigafactory\\tShanghai\\t(refer\\tto\\tNote\\t15,\\tCommitments\\tand\\tContingencies).\\tFor\\tthe\\tyear\\tended\\tDecember\\t31,\\t2022,\\twe\\treceived\\tgrant\\tfunding\\tof\\t$76\\nmillion.\\tThese\\tincentives\\toffset\\tthe\\trelated\\tcosts\\tof\\tour\\tfacilities\\tand\\tare\\trecorded\\tas\\ta\\treduction\\tof\\tthe\\tcost\\tof\\tthe\\tcapital\\tinvestment\\twithin\\tthe\\tProperty,\\nplant\\tand\\tequipment,\\tnet\\tline\\titem\\tin\\tour\\tconsolidated\\tbalance\\tsheets.\\tThe\\tincentive\\ttherefore\\treduces\\tthe\\tdepreciation\\texpense\\tover\\tthe\\tuseful\\tlives\\tof\\nthe\\trelated\\tequipment.\\nNevada\\tTax\\tIncentives\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 70,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 17\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"the\\trelated\\tequipment.\\nNevada\\tTax\\tIncentives\\nIn\\tconnection\\twith\\tthe\\tconstruction\\tof\\tGigafactory\\tNevada,\\twe\\tentered\\tinto\\tagreements\\twith\\tthe\\tState\\tof\\tNevada\\tand\\tStorey\\tCounty\\tin\\tNevada\\tthat\\nprovide\\tabatements\\tfor\\tspecified\\ttaxes,\\tdiscounts\\tto\\tthe\\tbase\\ttariff\\tenergy\\trates\\tand\\ttransferable\\ttax\\tcredits\\tof\\tup\\tto\\t$195\\tmillion\\tin\\tconsideration\\tof\\ncapital\\tinvestment\\tand\\thiring\\ttargets\\tthat\\twere\\tmet\\tat\\tGigafactory\\tNevada.\\nGigafactory\\tTexas\\tTax\\tIncentives\\nIn\\tconnection\\twith\\tthe\\tconstruction\\tof\\tGigafactory\\tTexas,\\twe\\tentered\\tinto\\ta\\t20-year\\tagreement\\twith\\tTravis\\tCounty\\tin\\tTexas\\tpursuant\\tto\\twhich\\twe\\nwould\\treceive\\tgrant\\tfunding\\tequal\\tto\\t70-80%\\tof\\tproperty\\ttaxes\\tpaid\\tby\\tus\\tto\\tTravis\\tCounty\\tand\\ta\\tseparate\\t10-year\\tagreement\\twith\\tthe\\tDel\\tValle\\nIndependent\\tSchool\\tDistrict\\tin\\tTexas\\tpursuant\\tto\\twhich\\ta\\tportion\\tof\\tthe\\ttaxable\\tvalue\\tof\\tour\\tproperty\\twould\\tbe\\tcapped\\tat\\ta\\tspecified\\tamount,\\tin\\teach\\tcase\\nsubject\\tto\\tour\\tmeeting\\tcertain\\tminimum\\teconomic\\tdevelopment\\tmetrics\\tthrough\\tour\\tconstruction\\tand\\toperations\\tat\\tGigafactory\\tTexas.\\tThis\\tincentive\\tis\\nrecorded\\tas\\ta\\treduction\\tof\\tthe\\trelated\\texpenses\\twithin\\tthe\\tCost\\tof\\tautomotive\\trevenues\\tand\\toperating\\texpense\\tline\\titems\\tof\\tour\\tconsolidated\\tstatements\\nof\\toperations.\\tAs\\tof\\tDecember\\t31,\\t2023,\\tthe\\tgrant\\tfunding\\trelated\\tto\\tproperty\\ttaxes\\tpaid\\twere\\timmaterial.\\nDefined\\tContribution\\tPlan\\nWe\\thave\\ta\\t401(k)\\tsavings\\tplan\\tin\\tthe\\tU.S.\\tthat\\tis\\tintended\\tto\\tqualify\\tas\\ta\\tdeferred\\tsalary\\tarrangement\\tunder\\tSection\\t401(k)\\tof\\tthe\\tInternal\\tRevenue\\nCode\\tand\\ta\\tnumber\\tof\\tsavings\\tplans\\tinternationally.\\tUnder\\tthe\\t401(k)\\tsavings\\tplan,\\tparticipating\\temployees\\tmay\\telect\\tto\\tcontribute\\tup\\tto\\t90%\\tof\\ttheir\\neligible\\tcompensation,\\tsubject\\tto\\tcertain\\tlimitations.\\tBeginning\\tin\\tJanuary\\t2022,\\twe\\tbegan\\tto\\tmatch\\t50%\\tof\\teach\\temployee’s\\tcontributions\\tup\\tto\\ta\\nmaximum\\tof\\t6%\\t(capped\\tat\\t$3,000)\\tof\\tthe\\temployee’s\\teligible\\tcompensation,\\tvested\\tupon\\tone\\tyear\\tof\\tservice.\\tDuring\\tthe\\tyears\\tended\\tDecember\\t31,\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 70,\n        \"lines\": {\n          \"from\": 16,\n          \"to\": 32\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"2023\\tand\\t2022,\\twe\\trecognized\\t$99\\tmillion\\tand\\t$91\\tmillion,\\trespectively,\\tof\\texpenses\\trelated\\tto\\temployer\\tcontributions\\tfor\\tthe\\t401(k)\\tsavings\\tplan.\\n68\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 70,\n        \"lines\": {\n          \"from\": 33,\n          \"to\": 34\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Recent\\tAccounting\\tPronouncements\\nRecently\\tissued\\taccounting\\tpronouncements\\tnot\\tyet\\tadopted\\nIn\\tNovember\\t2023,\\tthe\\tFinancial\\tAccounting\\tStandards\\tBoard\\t(“FASB”)\\tissued\\tASU\\tNo.\\t2023-07,\\tImprovements\\tto\\tReportable\\tSegment\\tDisclosures\\n(Topic\\t280).\\tThis\\tASU\\tupdates\\treportable\\tsegment\\tdisclosure\\trequirements\\tby\\trequiring\\tdisclosures\\tof\\tsignificant\\treportable\\tsegment\\texpenses\\tthat\\tare\\nregularly\\tprovided\\tto\\tthe\\tChief\\tOperating\\tDecision\\tMaker\\t(“CODM”)\\tand\\tincluded\\twithin\\teach\\treported\\tmeasure\\tof\\ta\\tsegment's\\tprofit\\tor\\tloss.\\tThis\\tASU\\talso\\nrequires\\tdisclosure\\tof\\tthe\\ttitle\\tand\\tposition\\tof\\tthe\\tindividual\\tidentified\\tas\\tthe\\tCODM\\tand\\tan\\texplanation\\tof\\thow\\tthe\\tCODM\\tuses\\tthe\\treported\\tmeasures\\tof\\ta\\nsegment’s\\tprofit\\tor\\tloss\\tin\\tassessing\\tsegment\\tperformance\\tand\\tdeciding\\thow\\tto\\tallocate\\tresources.\\tThe\\tASU\\tis\\teffective\\tfor\\tannual\\tperiods\\tbeginning\\tafter\\nDecember\\t15,\\t2023,\\tand\\tinterim\\tperiods\\twithin\\tfiscal\\tyears\\tbeginning\\tafter\\tDecember\\t15,\\t2024.\\tAdoption\\tof\\tthe\\tASU\\tshould\\tbe\\tapplied\\tretrospectively\\tto\\nall\\tprior\\tperiods\\tpresented\\tin\\tthe\\tfinancial\\tstatements.\\tEarly\\tadoption\\tis\\talso\\tpermitted.\\tThis\\tASU\\twill\\tlikely\\tresult\\tin\\tus\\tincluding\\tthe\\tadditional\\trequired\\ndisclosures\\twhen\\tadopted.\\tWe\\tare\\tcurrently\\tevaluating\\tthe\\tprovisions\\tof\\tthis\\tASU\\tand\\texpect\\tto\\tadopt\\tthem\\tfor\\tthe\\tyear\\tending\\tDecember\\t31,\\t2024.\\nIn\\tDecember\\t2023,\\tthe\\tFASB\\tissued\\tASU\\tNo.\\t2023-08,\\tAccounting\\tfor\\tand\\tDisclosure\\tof\\tCrypto\\tAssets\\t(Subtopic\\t350-60).\\tThis\\tASU\\trequires\\tcertain\\ncrypto\\tassets\\tto\\tbe\\tmeasured\\tat\\tfair\\tvalue\\tseparately\\tin\\tthe\\tbalance\\tsheet\\tand\\tincome\\tstatement\\teach\\treporting\\tperiod.\\tThis\\tASU\\talso\\tenhances\\tthe\\tother\\nintangible\\tasset\\tdisclosure\\trequirements\\tby\\trequiring\\tthe\\tname,\\tcost\\tbasis,\\tfair\\tvalue,\\tand\\tnumber\\tof\\tunits\\tfor\\teach\\tsignificant\\tcrypto\\tholding.\\tThe\\tASU\\tis\\neffective\\tfor\\tannual\\tperiods\\tbeginning\\tafter\\tDecember\\t15,\\t2024,\\tincluding\\tinterim\\tperiods\\twithin\\tthose\\tfiscal\\tyears.\\tAdoption\\tof\\tthe\\tASU\\trequires\\ta\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 71,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 14\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"cumulative-effect\\tadjustment\\tto\\tthe\\topening\\tbalance\\tof\\tretained\\tearnings\\tas\\tof\\tthe\\tbeginning\\tof\\tthe\\tannual\\treporting\\tperiod\\tin\\twhich\\tan\\tentity\\tadopts\\tthe\\namendments.\\tEarly\\tadoption\\tis\\talso\\tpermitted,\\tincluding\\tadoption\\tin\\tan\\tinterim\\tperiod.\\tHowever,\\tif\\tthe\\tASU\\tis\\tearly\\tadopted\\tin\\tan\\tinterim\\tperiod,\\tan\\tentity\\nmust\\tadopt\\tthe\\tASU\\tas\\tof\\tthe\\tbeginning\\tof\\tthe\\tfiscal\\tyear\\tthat\\tincludes\\tthe\\tinterim\\tperiod.\\tThis\\tASU\\twill\\tresult\\tin\\tgains\\tand\\tlosses\\trecorded\\tin\\tthe\\nconsolidated\\tfinancial\\tstatements\\tof\\toperations\\tand\\tadditional\\tdisclosures\\twhen\\tadopted.\\tWe\\tare\\tcurrently\\tevaluating\\tthe\\tadoption\\tof\\tthis\\tASU\\tand\\tit\\twill\\naffect\\tthe\\tcarrying\\tvalue\\tof\\tour\\tcrypto\\tassets\\theld\\tand\\tthe\\tgains\\tand\\tlosses\\trelating\\tthereto,\\tonce\\tadopted.\\nIn\\tDecember\\t2023,\\tthe\\tFASB\\tissued\\tASU\\tNo.\\t2023-09,\\tImprovements\\tto\\tIncome\\tTax\\tDisclosures\\t(Topic\\t740).\\tThe\\tASU\\trequires\\tdisaggregated\\ninformation\\tabout\\ta\\treporting\\tentity’s\\teffective\\ttax\\trate\\treconciliation\\tas\\twell\\tas\\tadditional\\tinformation\\ton\\tincome\\ttaxes\\tpaid.\\tThe\\tASU\\tis\\teffective\\ton\\ta\\nprospective\\tbasis\\tfor\\tannual\\tperiods\\tbeginning\\tafter\\tDecember\\t15,\\t2024.\\tEarly\\tadoption\\tis\\talso\\tpermitted\\tfor\\tannual\\tfinancial\\tstatements\\tthat\\thave\\tnot\\nyet\\tbeen\\tissued\\tor\\tmade\\tavailable\\tfor\\tissuance.\\tThis\\tASU\\twill\\tresult\\tin\\tthe\\trequired\\tadditional\\tdisclosures\\tbeing\\tincluded\\tin\\tour\\tconsolidated\\tfinancial\\nstatements,\\tonce\\tadopted.\\nRecently\\tadopted\\taccounting\\tpronouncements\\nIn\\tOctober\\t2021,\\tthe\\tFASB\\tissued\\tASU\\tNo.\\t2021-08,\\tAccounting\\tfor\\tContract\\tAssets\\tand\\tContract\\tLiabilities\\tfrom\\tContracts\\twith\\tCustomers\\t(Topic\\n805).\\tThis\\tASU\\trequires\\tan\\tacquirer\\tin\\ta\\tbusiness\\tcombination\\tto\\trecognize\\tand\\tmeasure\\tcontract\\tassets\\tand\\tcontract\\tliabilities\\t(deferred\\trevenue)\\tfrom\\nacquired\\tcontracts\\tusing\\tthe\\trevenue\\trecognition\\tguidance\\tin\\tTopic\\t606.\\tAt\\tthe\\tacquisition\\tdate,\\tthe\\tacquirer\\tapplies\\tthe\\trevenue\\tmodel\\tas\\tif\\tit\\thad\\noriginated\\tthe\\tacquired\\tcontracts.\\tThe\\tASU\\tis\\teffective\\tfor\\tannual\\tperiods\\tbeginning\\tafter\\tDecember\\t15,\\t2022,\\tincluding\\tinterim\\tperiods\\twithin\\tthose\\tfiscal\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 71,\n        \"lines\": {\n          \"from\": 15,\n          \"to\": 29\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"years.\\tWe\\tadopted\\tthis\\tASU\\tprospectively\\ton\\tJanuary\\t1,\\t2023.\\tThis\\tASU\\thas\\tnot\\tand\\tis\\tcurrently\\tnot\\texpected\\tto\\thave\\ta\\tmaterial\\timpact\\ton\\tour\\nconsolidated\\tfinancial\\tstatements.\\nIn\\tMarch\\t2022,\\tthe\\tFASB\\tissued\\tASU\\t2022-02,\\tTroubled\\tDebt\\tRestructurings\\tand\\tVintage\\tDisclosures.\\tThis\\tASU\\teliminates\\tthe\\taccounting\\tguidance\\nfor\\ttroubled\\tdebt\\trestructurings\\tby\\tcreditors\\tthat\\thave\\tadopted\\tASU\\t2016-13,\\tMeasurement\\tof\\tCredit\\tLosses\\ton\\tFinancial\\tInstruments,\\twhich\\twe\\tadopted\\non\\tJanuary\\t1,\\t2020.\\tThis\\tASU\\talso\\tenhances\\tthe\\tdisclosure\\trequirements\\tfor\\tcertain\\tloan\\trefinancing\\tand\\trestructurings\\tby\\tcreditors\\twhen\\ta\\tborrower\\tis\\nexperiencing\\tfinancial\\tdifficulty.\\tIn\\taddition,\\tthe\\tASU\\tamends\\tthe\\tguidance\\ton\\tvintage\\tdisclosures\\tto\\trequire\\tentities\\tto\\tdisclose\\tcurrent\\tperiod\\tgross\\twrite-\\noffs\\tby\\tyear\\tof\\torigination\\tfor\\tfinancing\\treceivables\\tand\\tnet\\tinvestments\\tin\\tleases\\twithin\\tthe\\tscope\\tof\\tASC\\t326-20.\\tThe\\tASU\\tis\\teffective\\tfor\\tannual\\tperiods\\nbeginning\\tafter\\tDecember\\t15,\\t2022,\\tincluding\\tinterim\\tperiods\\twithin\\tthose\\tfiscal\\tyears.\\tWe\\tadopted\\tthe\\tASU\\tprospectively\\ton\\tJanuary\\t1,\\t2023.\\tThis\\tASU\\nhas\\tnot\\tand\\tis\\tcurrently\\tnot\\texpected\\tto\\thave\\ta\\tmaterial\\timpact\\ton\\tour\\tconsolidated\\tfinancial\\tstatements.\\n69\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 71,\n        \"lines\": {\n          \"from\": 30,\n          \"to\": 39\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"ASU\\t2020-06\\nIn\\tAugust\\t2020,\\tthe\\tFASB\\tissued\\tASU\\t2020-06,\\tAccounting\\tfor\\tConvertible\\tInstruments\\tand\\tContracts\\tin\\tan\\tEntity’s\\tOwn\\tEquity.\\tThe\\tASU\\tsimplifies\\nthe\\taccounting\\tfor\\tconvertible\\tinstruments\\tby\\tremoving\\tcertain\\tseparation\\tmodels\\tin\\tASC\\t470-20,\\tDebt—Debt\\twith\\tConversion\\tand\\tOther\\tOptions,\\tfor\\nconvertible\\tinstruments.\\tThe\\tASU\\tupdates\\tthe\\tguidance\\ton\\tcertain\\tembedded\\tconversion\\tfeatures\\tthat\\tare\\tnot\\trequired\\tto\\tbe\\taccounted\\tfor\\tas\\tderivatives\\nunder\\tTopic\\t815,\\tDerivatives\\tand\\tHedging,\\tor\\tthat\\tdo\\tnot\\tresult\\tin\\tsubstantial\\tpremiums\\taccounted\\tfor\\tas\\tpaid-in\\tcapital,\\tsuch\\tthat\\tthose\\tfeatures\\tare\\tno\\nlonger\\trequired\\tto\\tbe\\tseparated\\tfrom\\tthe\\thost\\tcontract.\\tThe\\tconvertible\\tdebt\\tinstruments\\twill\\tbe\\taccounted\\tfor\\tas\\ta\\tsingle\\tliability\\tmeasured\\tat\\tamortized\\ncost.\\tThis\\twill\\talso\\tresult\\tin\\tthe\\tinterest\\texpense\\trecognized\\tfor\\tconvertible\\tdebt\\tinstruments\\tto\\tbe\\ttypically\\tcloser\\tto\\tthe\\tcoupon\\tinterest\\trate\\twhen\\napplying\\tthe\\tguidance\\tin\\tTopic\\t835,\\tInterest.\\tFurther,\\tthe\\tASU\\tmade\\tamendments\\tto\\tthe\\tEPS\\tguidance\\tin\\tTopic\\t260\\tfor\\tconvertible\\tdebt\\tinstruments,\\tthe\\nmost\\tsignificant\\timpact\\tof\\twhich\\tis\\trequiring\\tthe\\tuse\\tof\\tthe\\tif-converted\\tmethod\\tfor\\tdiluted\\tEPS\\tcalculation,\\tand\\tno\\tlonger\\tallowing\\tthe\\tnet\\tshare\\nsettlement\\tmethod.\\tThe\\tASU\\talso\\tmade\\trevisions\\tto\\tTopic\\t815-40,\\twhich\\tprovides\\tguidance\\ton\\thow\\tan\\tentity\\tmust\\tdetermine\\twhether\\ta\\tcontract\\tqualifies\\nfor\\ta\\tscope\\texception\\tfrom\\tderivative\\taccounting.\\tThe\\tamendments\\tto\\tTopic\\t815-40\\tchange\\tthe\\tscope\\tof\\tcontracts\\tthat\\tare\\trecognized\\tas\\tassets\\tor\\nliabilities.\\nOn\\tJanuary\\t1,\\t2021,\\twe\\tadopted\\tthe\\tASU\\tusing\\tthe\\tmodified\\tretrospective\\tmethod.\\tWe\\trecognized\\ta\\tfavorable\\t$211\\tmillion\\tcumulative\\teffect\\tof\\ninitially\\tapplying\\tthe\\tASU\\tas\\tan\\tadjustment\\tto\\tthe\\tJanuary\\t1,\\t2021\\topening\\tbalance\\tof\\taccumulated\\tdeficit.\\tDue\\tto\\tthe\\trecombination\\tof\\tthe\\tequity\\nconversion\\tcomponent\\tof\\tour\\tconvertible\\tdebt\\tremaining\\toutstanding,\\tadditional\\tpaid\\tin\\tcapital\\twas\\treduced\\tby\\t$474\\tmillion\\tand\\tconvertible\\tsenior\\tnotes\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 72,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 15\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"(mezzanine\\tequity)\\twas\\treduced\\tby\\t$51\\tmillion.\\tThe\\tremoval\\tof\\tthe\\tremaining\\tdebt\\tdiscounts\\trecorded\\tfor\\tthis\\tprevious\\tseparation\\thad\\tthe\\teffect\\tof\\nincreasing\\tour\\tnet\\tdebt\\tbalance\\tby\\t$269\\tmillion\\tand\\twe\\treduced\\tproperty,\\tplant\\tand\\tequipment\\tby\\t$45\\tmillion\\trelated\\tto\\tpreviously\\tcapitalized\\tinterest.\\nThe\\tprior\\tperiod\\tconsolidated\\tfinancial\\tstatements\\thave\\tnot\\tbeen\\tretrospectively\\tadjusted\\tand\\tcontinue\\tto\\tbe\\treported\\tunder\\tthe\\taccounting\\tstandards\\tin\\neffect\\tfor\\tthose\\tperiods.\\nNote\\t3\\t–\\tDigital\\tAssets,\\tNet\\nDuring\\tthe\\tyears\\tended\\tDecember\\t31,\\t2023\\tand\\t2022,\\twe\\tpurchased\\tand/or\\treceived\\timmaterial\\tamounts\\tof\\tdigital\\tassets.\\tDuring\\tthe\\tyear\\tended\\nDecember\\t31,\\t2023,\\twe\\trecorded\\tan\\timmaterial\\tamount\\tof\\timpairment\\tlosses\\ton\\tdigital\\tassets.\\tDuring\\tthe\\tyear\\tended\\tDecember\\t31,\\t2022,\\twe\\trecorded\\n$204\\tmillion\\tof\\timpairment\\tlosses\\ton\\tdigital\\tassets\\tand\\trealized\\tgains\\tof\\t$64\\tmillion\\tin\\tconnection\\twith\\tconverting\\tour\\tholdings\\tof\\tdigital\\tassets\\tinto\\tfiat\\ncurrency.\\tThe\\tgains\\tare\\tpresented\\tnet\\tof\\timpairment\\tlosses\\tin\\tRestructuring\\tand\\tother\\tin\\tthe\\tconsolidated\\tstatements\\tof\\toperations.\\tAs\\tof\\tDecember\\t31,\\n2023\\tand\\t2022,\\tthe\\tcarrying\\tvalue\\tof\\tour\\tdigital\\tassets\\theld\\treflects\\tcumulative\\timpairment\\tof\\t$204\\tmillion.\\nNote\\t4\\t–\\tGoodwill\\tand\\tIntangible\\tAssets\\nGoodwill\\tincreased\\t$59\\tmillion\\twithin\\tthe\\tautomotive\\tsegment\\tfrom\\t$194\\tmillion\\tas\\tof\\tDecember\\t31,\\t2022\\tto\\t$253\\tmillion\\tas\\tof\\tDecember\\t31,\\t2023\\nprimarily\\tfrom\\ta\\tbusiness\\tcombination,\\tnet\\tof\\tthe\\timpact\\tof\\ta\\tdivestiture.\\tThere\\twere\\tno\\taccumulated\\timpairment\\tlosses\\tas\\tof\\tDecember\\t31,\\t2023\\tand\\n2022.\\nThe\\tnet\\tcarrying\\tvalue\\tof\\tour\\tintangible\\tassets\\tdecreased\\tfrom\\t$215\\tmillion\\tas\\tof\\tDecember\\t31,\\t2022\\tto\\t$178\\tmillion\\tas\\tof\\tDecember\\t31,\\t2023\\nmainly\\tfrom\\tamortization.\\nNote\\t5\\t–\\tFair\\tValue\\tof\\tFinancial\\tInstruments\\nASC\\t820,\\tFair\\tValue\\tMeasurements\\t(“ASC\\t820”)\\tstates\\tthat\\tfair\\tvalue\\tis\\tan\\texit\\tprice,\\trepresenting\\tthe\\tamount\\tthat\\twould\\tbe\\treceived\\tto\\tsell\\tan\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 72,\n        \"lines\": {\n          \"from\": 16,\n          \"to\": 33\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"asset\\tor\\tpaid\\tto\\ttransfer\\ta\\tliability\\tin\\tan\\torderly\\ttransaction\\tbetween\\tmarket\\tparticipants.\\tAs\\tsuch,\\tfair\\tvalue\\tis\\ta\\tmarket-based\\tmeasurement\\tthat\\tshould\\nbe\\tdetermined\\tbased\\ton\\tassumptions\\tthat\\tmarket\\tparticipants\\twould\\tuse\\tin\\tpricing\\tan\\tasset\\tor\\ta\\tliability.\\tThe\\tthree-tiered\\tfair\\tvalue\\thierarchy,\\twhich\\nprioritizes\\twhich\\tinputs\\tshould\\tbe\\tused\\tin\\tmeasuring\\tfair\\tvalue,\\tis\\tcomprised\\tof:\\t(Level\\tI)\\tobservable\\tinputs\\tsuch\\tas\\tquoted\\tprices\\tin\\tactive\\tmarkets;\\t(Level\\nII)\\tinputs\\tother\\tthan\\tquoted\\tprices\\tin\\tactive\\tmarkets\\tthat\\tare\\tobservable\\teither\\tdirectly\\tor\\tindirectly\\tand\\t(Level\\tIII)\\tunobservable\\tinputs\\tfor\\twhich\\tthere\\tis\\nlittle\\tor\\tno\\tmarket\\tdata.\\tThe\\tfair\\tvalue\\thierarchy\\trequires\\tthe\\tuse\\tof\\tobservable\\tmarket\\tdata\\twhen\\tavailable\\tin\\tdetermining\\tfair\\tvalue.\\tOur\\tassets\\tand\\nliabilities\\tthat\\twere\\tmeasured\\tat\\tfair\\tvalue\\ton\\ta\\trecurring\\tbasis\\twere\\tas\\tfollows\\t(in\\tmillions):\\n70\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 72,\n        \"lines\": {\n          \"from\": 34,\n          \"to\": 40\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"December\\t31,\\t2023December\\t31,\\t2022\\n\\tFair\\tValueLevel\\tILevel\\tIILevel\\tIIIFair\\tValueLevel\\tILevel\\tIILevel\\tIII\\nMoney\\tmarket\\tfunds$109\\t$109\\t$—\\t$—\\t$2,188\\t$2,188\\t$—\\t$—\\t\\nU.S.\\tgovernment\\tsecurities5,136\\t—\\t5,136\\t—\\t894\\t—\\t894\\t—\\t\\nCorporate\\tdebt\\tsecurities480\\t—\\t480\\t—\\t885\\t—\\t885\\t—\\t\\nCertificates\\tof\\tdeposit\\tand\\ttime\\ndeposits6,996\\t—\\t6,996\\t—\\t4,253\\t—\\t4,253\\t—\\t\\nCommercial\\tpaper470\\t—\\t470\\t—\\t—\\t—\\t—\\t—\\t\\nTotal\\n$13,191\\t$109\\t$13,082\\t$—\\t$8,220\\t$2,188\\t$6,032\\t$—\\t\\nAll\\tof\\tour\\tmoney\\tmarket\\tfunds\\twere\\tclassified\\twithin\\tLevel\\tI\\tof\\tthe\\tfair\\tvalue\\thierarchy\\tbecause\\tthey\\twere\\tvalued\\tusing\\tquoted\\tprices\\tin\\tactive\\nmarkets.\\tOur\\tU.S.\\tgovernment\\tsecurities,\\tcertificates\\tof\\tdeposit,\\tcommercial\\tpaper,\\ttime\\tdeposits\\tand\\tcorporate\\tdebt\\tsecurities\\tare\\tclassified\\twithin\\tLevel\\nII\\tof\\tthe\\tfair\\tvalue\\thierarchy\\tand\\tthe\\tmarket\\tapproach\\twas\\tused\\tto\\tdetermine\\tfair\\tvalue\\tof\\tthese\\tinvestments.\\nOur\\tcash,\\tcash\\tequivalents\\tand\\tinvestments\\tclassified\\tby\\tsecurity\\ttype\\tas\\tof\\tDecember\\t31,\\t2023\\tand\\t2022\\tconsisted\\tof\\tthe\\tfollowing\\t(in\\tmillions):\\n\\tDecember\\t31,\\t2023\\n\\tAdjusted\\tCost\\nGross\\nUnrealized\\nGains\\nGross\\nUnrealized\\nLossesFair\\tValue\\nCash\\tand\\tCash\\nEquivalents\\nShort-Term\\nInvestments\\nCash$15,903\\t$—\\t$—\\t$15,903\\t$15,903\\t$—\\t\\nMoney\\tmarket\\tfunds109\\t—\\t—\\t109\\t109\\t—\\t\\nU.S.\\tgovernment\\tsecurities5,136\\t1\\t(1)5,136\\t277\\t4,859\\t\\nCorporate\\tdebt\\tsecurities485\\t1\\t(6)480\\t—\\t480\\t\\nCertificates\\tof\\tdeposit\\tand\\ttime\\tdeposits6,995\\t1\\t—\\t6,996\\t—\\t6,996\\t\\nCommercial\\tpaper470\\t—\\t—\\t470\\t109\\t361\\t\\nTotal\\tcash,\\tcash\\tequivalents\\tand\\tshort-term\\ninvestments\\n$29,098\\t$3\\t$(7)$29,094\\t$16,398\\t$12,696\\t\\n\\tDecember\\t31,\\t2022\\n\\tAdjusted\\tCost\\nGross\\nUnrealized\\nGains\\nGross\\nUnrealized\\nLossesFair\\tValue\\nCash\\tand\\tCash\\nEquivalents\\nShort-Term\\nInvestments\\nCash$13,965\\t$—\\t$—\\t$13,965\\t$13,965\\t$—\\t\\nMoney\\tmarket\\tfunds2,188\\t—\\t—\\t2,188\\t2,188\\t—\\t\\nU.S.\\tgovernment\\tsecurities897\\t—\\t(3)894\\t—\\t894\\t\\nCorporate\\tdebt\\tsecurities907\\t—\\t(22)885\\t—\\t885\\t\\nCertificates\\tof\\tdeposit\\tand\\ttime\\tdeposits4,252\\t1\\t—\\t4,253\\t100\\t4,153\\t\\nTotal\\tcash,\\tcash\\tequivalents\\tand\\tshort-term\\ninvestments\\n$22,209\\t$1\\t$(25)$22,185\\t$16,253\\t$5,932\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 73,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 55\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"$22,209\\t$1\\t$(25)$22,185\\t$16,253\\t$5,932\\t\\nWe\\trecord\\tgross\\trealized\\tgains,\\tlosses\\tand\\tcredit\\tlosses\\tas\\ta\\tcomponent\\tof\\tOther\\tincome\\t(expense),\\tnet\\tin\\tthe\\tconsolidated\\tstatements\\tof\\noperations.\\tFor\\tthe\\tyears\\tended\\tDecember\\t31,\\t2023\\tand\\t2022,\\twe\\tdid\\tnot\\trecognize\\tany\\tmaterial\\tgross\\trealized\\tgains,\\tlosses\\tor\\tcredit\\tlosses.\\tThe\\tending\\nallowance\\tbalances\\tfor\\tcredit\\tlosses\\twere\\timmaterial\\tas\\tof\\tDecember\\t31,\\t2023\\tand\\t2022.\\tWe\\thave\\tdetermined\\tthat\\tthe\\tgross\\tunrealized\\tlosses\\ton\\tour\\ninvestments\\tas\\tof\\tDecember\\t31,\\t2023\\tand\\t2022\\twere\\ttemporary\\tin\\tnature.\\n71\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 73,\n        \"lines\": {\n          \"from\": 55,\n          \"to\": 60\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"The\\tfollowing\\ttable\\tsummarizes\\tthe\\tfair\\tvalue\\tof\\tour\\tinvestments\\tby\\tstated\\tcontractual\\tmaturities\\tas\\tof\\tDecember\\t31,\\t2023\\t(in\\tmillions):\\nDue\\tin\\t1\\tyear\\tor\\tless$12,374\\t\\nDue\\tin\\t1\\tyear\\tthrough\\t5\\tyears297\\t\\nDue\\tin\\t5\\tyears\\tthrough\\t10\\tyears25\\t\\nTotal\\n$12,696\\t\\nDisclosure\\tof\\tFair\\tValues\\nOur\\tfinancial\\tinstruments\\tthat\\tare\\tnot\\tre-measured\\tat\\tfair\\tvalue\\tinclude\\taccounts\\treceivable,\\tfinancing\\treceivables,\\tother\\treceivables,\\tdigital\\tassets,\\naccounts\\tpayable,\\taccrued\\tliabilities,\\tcustomer\\tdeposits\\tand\\tdebt.\\tThe\\tcarrying\\tvalues\\tof\\tthese\\tfinancial\\tinstruments\\tmaterially\\tapproximate\\ttheir\\tfair\\nvalues,\\tother\\tthan\\tour\\t2.00%\\tConvertible\\tSenior\\tNotes\\tdue\\tin\\t2024\\t(“2024\\tNotes”)\\tand\\tdigital\\tassets.\\nWe\\testimate\\tthe\\tfair\\tvalue\\tof\\tthe\\t2024\\tNotes\\tusing\\tcommonly\\taccepted\\tvaluation\\tmethodologies\\tand\\tmarket-based\\trisk\\tmeasurements\\tthat\\tare\\nindirectly\\tobservable,\\tsuch\\tas\\tcredit\\trisk\\t(Level\\tII).\\tIn\\taddition,\\twe\\testimate\\tthe\\tfair\\tvalues\\tof\\tour\\tdigital\\tassets\\tbased\\ton\\tquoted\\tprices\\tin\\tactive\\tmarkets\\n(Level\\tI).\\tThe\\tfollowing\\ttable\\tpresents\\tthe\\testimated\\tfair\\tvalues\\tand\\tthe\\tcarrying\\tvalues\\t(in\\tmillions):\\n\\tDecember\\t31,\\t2023December\\t31,\\t2022\\n\\tCarrying\\tValueFair\\tValueCarrying\\tValueFair\\tValue\\n2024\\tNotes$37\\t$443\\t$37\\t$223\\t\\nDigital\\tassets,\\tnet$184\\t$487\\t$184\\t$191\\t\\nNote\\t6\\t–\\tInventory\\nOur\\tinventory\\tconsisted\\tof\\tthe\\tfollowing\\t(in\\tmillions):\\n\\t\\nDecember\\t31,\\n2023\\nDecember\\t31,\\n2022\\nRaw\\tmaterials$5,390\\t$6,137\\t\\nWork\\tin\\tprocess2,016\\t2,385\\t\\nFinished\\tgoods\\t(1)5,049\\t3,475\\t\\nService\\tparts1,171\\t842\\t\\nTotal\\n$13,626\\t$12,839\\t\\n(1)Finished\\tgoods\\tinventory\\tincludes\\tproducts\\tin\\ttransit\\tto\\tfulfill\\tcustomer\\torders,\\tnew\\tvehicles\\tavailable\\tfor\\tsale,\\tused\\tvehicles\\tand\\tenergy\\tproducts\\navailable\\tfor\\tsale.\\nWe\\twrite-down\\tinventory\\tfor\\tany\\texcess\\tor\\tobsolete\\tinventories\\tor\\twhen\\twe\\tbelieve\\tthat\\tthe\\tnet\\trealizable\\tvalue\\tof\\tinventories\\tis\\tless\\tthan\\tthe\\ncarrying\\tvalue.\\tDuring\\tthe\\tyears\\tended\\tDecember\\t31,\\t2023,\\t2022\\tand\\t2021\\twe\\trecorded\\twrite-downs\\tof\\t$233\\tmillion,\\t$144\\tmillion\\tand\\t$106\\tmillion,\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 74,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 34\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"respectively,\\tin\\tCost\\tof\\trevenues\\tin\\tthe\\tconsolidated\\tstatements\\tof\\toperations.\\n72\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 74,\n        \"lines\": {\n          \"from\": 35,\n          \"to\": 36\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Note\\t7\\t–\\tSolar\\tEnergy\\tSystems,\\tNet\\nOur\\tsolar\\tenergy\\tsystems,\\tnet,\\tconsisted\\tof\\tthe\\tfollowing\\t(in\\tmillions):\\nDecember\\t31,\\n2023\\nDecember\\t31,\\n2022\\nSolar\\tenergy\\tsystems\\tin\\tservice\\n$6,755\\t$6,785\\t\\nInitial\\tdirect\\tcosts\\trelated\\tto\\tcustomer\\tsolar\\tenergy\\tsystem\\tlease\\tacquisition\\tcosts104\\t104\\t\\n6,859\\t6,889\\t\\nLess:\\taccumulated\\tdepreciation\\tand\\tamortization\\t(1)(1,643)(1,418)\\n5,216\\t5,471\\t\\nSolar\\tenergy\\tsystems\\tunder\\tconstruction1\\t2\\t\\nSolar\\tenergy\\tsystems\\tpending\\tinterconnection12\\t16\\t\\nSolar\\tenergy\\tsystems,\\tnet\\t(2)\\n$5,229\\t$5,489\\t\\n(1)Depreciation\\tand\\tamortization\\texpense\\tduring\\tthe\\tyears\\tended\\tDecember\\t31,\\t2023,\\t2022\\tand\\t2021\\twas\\t$235\\tmillion,\\t$235\\tmillion\\tand\\t$236\\nmillion,\\trespectively.\\n(2)As\\tof\\tDecember\\t31,\\t2023\\tand\\t2022,\\tthere\\twere\\t$740\\tmillion\\tand\\t$802\\tmillion,\\trespectively,\\tof\\tgross\\tsolar\\tenergy\\tsystems\\tunder\\tlease\\tpass-through\\nfund\\tarrangements\\twith\\taccumulated\\tdepreciation\\tof\\t$157\\tmillion\\tand\\t$148\\tmillion,\\trespectively.\\nNote\\t8\\t–\\tProperty,\\tPlant\\tand\\tEquipment,\\tNet\\nOur\\tproperty,\\tplant\\tand\\tequipment,\\tnet,\\tconsisted\\tof\\tthe\\tfollowing\\t(in\\tmillions):\\nDecember\\t31,\\n2023\\nDecember\\t31,\\n2022\\nMachinery,\\tequipment,\\tvehicles\\tand\\toffice\\tfurniture$16,372\\t$13,558\\t\\nTooling3,147\\t2,579\\t\\nLeasehold\\timprovements3,168\\t2,366\\t\\nLand\\tand\\tbuildings9,505\\t7,751\\t\\nComputer\\tequipment,\\thardware\\tand\\tsoftware3,799\\t2,072\\t\\nConstruction\\tin\\tprogress5,791\\t4,263\\t\\n\\t41,782\\t32,589\\t\\nLess:\\tAccumulated\\tdepreciation(12,057)(9,041)\\nTotal\\n$29,725\\t$23,548\\t\\nConstruction\\tin\\tprogress\\tis\\tprimarily\\tcomprised\\tof\\tongoing\\tconstruction\\tand\\texpansion\\tof\\tour\\tfacilities,\\tand\\tequipment\\tand\\ttooling\\trelated\\tto\\tthe\\nmanufacturing\\tof\\tour\\tproducts.\\tCompleted\\tassets\\tare\\ttransferred\\tto\\ttheir\\trespective\\tasset\\tclasses\\tand\\tdepreciation\\tbegins\\twhen\\tan\\tasset\\tis\\tready\\tfor\\tits\\nintended\\tuse.\\nDepreciation\\texpense\\tduring\\tthe\\tyears\\tended\\tDecember\\t31,\\t2023,\\t2022\\tand\\t2021\\twas\\t$3.33\\tbillion,\\t$2.42\\tbillion\\tand\\t$1.91\\tbillion,\\trespectively.\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 75,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 40\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Panasonic\\thas\\tpartnered\\twith\\tus\\ton\\tGigafactory\\tNevada\\twith\\tinvestments\\tin\\tthe\\tproduction\\tequipment\\tthat\\tit\\tuses\\tto\\tmanufacture\\tand\\tsupply\\tus\\nwith\\tbattery\\tcells.\\tUnder\\tour\\tarrangement\\twith\\tPanasonic,\\twe\\tplan\\tto\\tpurchase\\tthe\\tfull\\toutput\\tfrom\\ttheir\\tproduction\\tequipment\\tat\\tnegotiated\\tprices.\\tAs\\nthe\\tterms\\tof\\tthe\\tarrangement\\tconvey\\ta\\tfinance\\tlease\\tunder\\tASC\\t842,\\twe\\taccount\\tfor\\ttheir\\tproduction\\tequipment\\tas\\tleased\\tassets\\twhen\\tproduction\\ncommences.\\tWe\\taccount\\tfor\\teach\\tlease\\tand\\tany\\tnon-lease\\tcomponents\\tassociated\\twith\\tthat\\tlease\\tas\\ta\\tsingle\\tlease\\tcomponent\\tfor\\tall\\tasset\\tclasses,\\nexcept\\tproduction\\tequipment\\tclasses\\tembedded\\tin\\tsupply\\tagreements.\\tThis\\tresults\\tin\\tus\\trecording\\tthe\\tcost\\tof\\ttheir\\tproduction\\tequipment\\twithin\\tProperty,\\nplant\\tand\\tequipment,\\tnet,\\ton\\tthe\\tconsolidated\\tbalance\\tsheets\\twith\\ta\\tcorresponding\\tliability\\trecorded\\tto\\tdebt\\tand\\tfinance\\tleases.\\tDepreciation\\ton\\nPanasonic\\tproduction\\tequipment\\tis\\tcomputed\\tusing\\tthe\\tunits-of-production\\tmethod\\twhereby\\tcapitalized\\tcosts\\tare\\tamortized\\tover\\tthe\\ttotal\\testimated\\nproductive\\tlife\\tof\\tthe\\trespective\\tassets.\\tAs\\tof\\tDecember\\t31,\\t2023\\tand\\t2022,\\twe\\thad\\tcumulatively\\tcapitalized\\tgross\\tcosts\\tof\\t$2.02\\tbillion\\tand\\t$2.01\\tbillion,\\nrespectively,\\ton\\tthe\\tconsolidated\\tbalance\\tsheets\\tin\\trelation\\tto\\tthe\\tproduction\\tequipment\\tunder\\tour\\tPanasonic\\tarrangement.\\n73\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 75,\n        \"lines\": {\n          \"from\": 41,\n          \"to\": 50\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Note\\t9\\t–\\tAccrued\\tLiabilities\\tand\\tOther\\nOur\\taccrued\\tliabilities\\tand\\tother\\tcurrent\\tliabilities\\tconsisted\\tof\\tthe\\tfollowing\\t(in\\tmillions):\\nDecember\\t31,\\n2023\\nDecember\\t31,\\n2022\\nAccrued\\tpurchases\\t(1)$2,721\\t$2,747\\t\\nAccrued\\twarranty\\treserve,\\tcurrent\\tportion1,546\\t1,025\\t\\nPayroll\\tand\\trelated\\tcosts1,325\\t1,026\\t\\nTaxes\\tpayable\\t(2)1,204\\t1,235\\t\\nCustomer\\tdeposits876\\t1,063\\t\\nOperating\\tlease\\tliabilities,\\tcurrent\\tportion672\\t485\\t\\nSales\\treturn\\treserve,\\tcurrent\\tportion219\\t270\\t\\nOther\\tcurrent\\tliabilities517\\t354\\t\\nTotal\\n$9,080\\t$8,205\\t\\n(1)Accrued\\tpurchases\\tprimarily\\treflects\\treceipts\\tof\\tgoods\\tand\\tservices\\tfor\\twhich\\twe\\thad\\tnot\\tyet\\tbeen\\tinvoiced.\\tAs\\twe\\tare\\tinvoiced\\tfor\\tthese\\tgoods\\tand\\nservices,\\tthis\\tbalance\\twill\\treduce\\tand\\taccounts\\tpayable\\twill\\tincrease.\\n(2)Taxes\\tpayable\\tincludes\\tvalue\\tadded\\ttax,\\tincome\\ttax,\\tsales\\ttax,\\tproperty\\ttax\\tand\\tuse\\ttax\\tpayables.\\nNote\\t10\\t–\\tOther\\tLong-Term\\tLiabilities\\nOur\\tother\\tlong-term\\tliabilities\\tconsisted\\tof\\tthe\\tfollowing\\t(in\\tmillions):\\nDecember\\t31,\\n2023\\nDecember\\t31,\\n2022\\nOperating\\tlease\\tliabilities$3,671\\t$2,164\\t\\nAccrued\\twarranty\\treserve3,606\\t2,480\\t\\nOther\\tnon-current\\tliabilities876\\t686\\t\\nTotal\\tother\\tlong-term\\tliabilities\\n$8,153\\t$5,330\\t\\nNote\\t11\\t–\\tDebt\\nThe\\tfollowing\\tis\\ta\\tsummary\\tof\\tour\\tdebt\\tand\\tfinance\\tleases\\tas\\tof\\tDecember\\t31,\\t2023\\t(in\\tmillions):\\n\\tNet\\tCarrying\\tValueUnpaid\\nPrincipal\\nBalance\\nUnused\\nCommitted\\nAmount\\t(1)\\nContractual\\nInterest\\tRates\\nContractual\\nMaturity\\tDate\\tCurrentLong-Term\\nRecourse\\tdebt:\\t\\t\\t\\n2024\\tNotes$37\\t$—\\t$37\\t$—\\t2.00\\t%May\\t2024\\nRCF\\tCredit\\tAgreement—\\t—\\t—\\t5,000\\tNot\\tapplicableJanuary\\t2028\\nSolar\\tBonds—\\t7\\t7\\t—\\t4.70-5.75%March\\t2025\\t-\\tJanuary\\t2031\\nOther—\\t—\\t—\\t28\\tNot\\tapplicableDecember\\t2026\\nTotal\\trecourse\\tdebt37\\t7\\t44\\t5,028\\t\\nNon-recourse\\tdebt:\\nAutomotive\\tAsset-backed\\tNotes1,906\\t2,337\\t4,259\\t—\\t0.60-6.57%July\\t2024-May\\t2031\\nSolar\\tAsset-backed\\tNotes4\\t8\\t13\\t—\\t4.80\\t%December\\t2026\\nCash\\tEquity\\tDebt28\\t330\\t367\\t—\\t5.25-5.81%July\\t2033-January\\t2035\\nTotal\\tnon-recourse\\tdebt1,938\\t2,675\\t4,639\\t—\\t\\nTotal\\tdebt1,975\\t2,682\\t\\n$4,683\\t$5,028\\t\\nFinance\\tleases398\\t175\\t\\nTotal\\tdebt\\tand\\tfinance\\tleases\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 76,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 57\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Total\\tdebt\\tand\\tfinance\\tleases\\n$2,373\\t$2,857\\t\\n74\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 76,\n        \"lines\": {\n          \"from\": 57,\n          \"to\": 59\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"The\\tfollowing\\tis\\ta\\tsummary\\tof\\tour\\tdebt\\tand\\tfinance\\tleases\\tas\\tof\\tDecember\\t31,\\t2022\\t(in\\tmillions):\\nNet\\tCarrying\\tValueUnpaid\\nPrincipal\\nBalance\\nUnused\\nCommitted\\nAmount\\t(2)\\nContractual\\nInterest\\tRates\\nContractual\\nMaturity\\tDateCurrentLong-Term\\nRecourse\\tdebt:\\t\\t\\t\\n2024\\tNotes$—\\t$37\\t$37\\t$—\\t2.00\\t%May\\t2024\\nCredit\\tAgreement—\\t—\\t—\\t2,266\\tNot\\tapplicableJuly\\t2023\\nSolar\\tBonds—\\t7\\t7\\t—\\t4.70-5.75%March\\t2025\\t-\\tJanuary\\t2031\\nTotal\\trecourse\\tdebt—\\t44\\t44\\t2,266\\t\\nNon-recourse\\tdebt:\\nAutomotive\\tAsset-backed\\tNotes984\\t613\\t1,603\\t—\\t0.36-4.64%December\\t2023-September\\t2025\\nSolar\\tAsset-backed\\tNotes4\\t13\\t17\\t—\\t4.80\\t%December\\t2026\\nCash\\tEquity\\tDebt28\\t359\\t397\\t—\\t5.25-5.81%July\\t2033-January\\t2035\\nAutomotive\\tLease-backed\\tCredit\\tFacilities—\\t—\\t—\\t151\\tNot\\tapplicableSeptember\\t2024\\nTotal\\tnon-recourse\\tdebt1,016\\t985\\t2,017\\t151\\t\\nTotal\\tdebt1,016\\t1,029\\t\\n$2,061\\t$2,417\\t\\nFinance\\tleases486\\t568\\t\\nTotal\\tdebt\\tand\\tfinance\\tleases\\n$1,502\\t$1,597\\t\\n(1)There\\tare\\tno\\trestrictions\\ton\\tdraw-down\\tor\\tuse\\tfor\\tgeneral\\tcorporate\\tpurposes\\twith\\trespect\\tto\\tany\\tavailable\\tcommitted\\tfunds\\tunder\\tour\\tRCF\\tCredit\\nAgreement,\\texcept\\tcertain\\tspecified\\tconditions\\tprior\\tto\\tdraw-down.\\tRefer\\tto\\tthe\\tsection\\tbelow\\tfor\\tthe\\tterms\\tof\\tthe\\tfacility.\\n(2)There\\twere\\tno\\trestrictions\\ton\\tdraw-down\\tor\\tuse\\tfor\\tgeneral\\tcorporate\\tpurposes\\twith\\trespect\\tto\\tany\\tavailable\\tcommitted\\tfunds\\tunder\\tour\\tcredit\\nfacilities,\\texcept\\tcertain\\tspecified\\tconditions\\tprior\\tto\\tdraw-down,\\tincluding\\tpledging\\tto\\tour\\tlenders\\tsufficient\\tamounts\\tof\\tqualified\\treceivables,\\ninventories,\\tleased\\tvehicles\\tand\\tour\\tinterests\\tin\\tthose\\tleases\\tor\\tvarious\\tother\\tassets\\tas\\tdescribed\\tbelow.\\nRecourse\\tdebt\\trefers\\tto\\tdebt\\tthat\\tis\\trecourse\\tto\\tour\\tgeneral\\tassets.\\tNon-recourse\\tdebt\\trefers\\tto\\tdebt\\tthat\\tis\\trecourse\\tto\\tonly\\tassets\\tof\\tour\\nsubsidiaries.\\tThe\\tdifferences\\tbetween\\tthe\\tunpaid\\tprincipal\\tbalances\\tand\\tthe\\tnet\\tcarrying\\tvalues\\tare\\tdue\\tto\\tdebt\\tdiscounts\\tor\\tdeferred\\tissuance\\tcosts.\\tAs\\nof\\tDecember\\t31,\\t2023,\\twe\\twere\\tin\\tmaterial\\tcompliance\\twith\\tall\\tfinancial\\tdebt\\tcovenants.\\n2024\\tNotes\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 77,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 36\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"2024\\tNotes\\nThe\\tclosing\\tprice\\tof\\tour\\tcommon\\tstock\\tcontinued\\tto\\texceed\\t130%\\tof\\tthe\\tapplicable\\tconversion\\tprice\\tof\\tour\\t2024\\tNotes\\ton\\tat\\tleast\\t20\\tof\\tthe\\tlast\\t30\\nconsecutive\\ttrading\\tdays\\tof\\teach\\tquarter\\tin\\t2023,\\tcausing\\tthe\\t2024\\tNotes\\tto\\tbe\\tconvertible\\tby\\ttheir\\tholders\\tin\\tthe\\tsubsequent\\tquarter.\\tAs\\tof\\tDecember\\n31,\\t2023,\\tthe\\tif-converted\\tvalue\\tof\\tthe\\tnotes\\texceeds\\tthe\\toutstanding\\tprincipal\\tamount\\tby\\t$406\\tmillion.\\tUpon\\tconversion,\\tthe\\t2024\\tNotes\\twill\\tbe\\tsettled\\nin\\tcash,\\tshares\\tof\\tour\\tcommon\\tstock\\tor\\ta\\tcombination\\tthereof,\\tat\\tour\\telection.\\nCredit\\tAgreement\\nIn\\tJune\\t2015,\\twe\\tentered\\tinto\\ta\\tsenior\\tasset-based\\trevolving\\tcredit\\tagreement\\t(as\\tamended\\tfrom\\ttime\\tto\\ttime,\\tthe\\t“Credit\\tAgreement”)\\twith\\ta\\nsyndicate\\tof\\tbanks.\\tBorrowed\\tfunds\\tbear\\tinterest,\\tat\\tour\\toption,\\tat\\tan\\tannual\\trate\\tof\\t(a)\\t1%\\tplus\\tLIBOR\\tor\\t(b)\\tthe\\thighest\\tof\\t(i)\\tthe\\tfederal\\tfunds\\trate\\tplus\\n0.50%,\\t(ii)\\tthe\\tlenders’\\t“prime\\trate”\\tor\\t(iii)\\t1%\\tplus\\tLIBOR.\\tThe\\tfee\\tfor\\tundrawn\\tamounts\\tis\\t0.25%\\tper\\tannum.\\tThe\\tCredit\\tAgreement\\tis\\tsecured\\tby\\tcertain\\nof\\tour\\taccounts\\treceivable,\\tinventory\\tand\\tequipment.\\tAvailability\\tunder\\tthe\\tCredit\\tAgreement\\tis\\tbased\\ton\\tthe\\tvalue\\tof\\tsuch\\tassets,\\tas\\treduced\\tby\\tcertain\\nreserves.\\nIn\\tJanuary\\t2023,\\twe\\tentered\\tinto\\ta\\t5-year\\tsenior\\tunsecured\\trevolving\\tcredit\\tfacility\\t(the\\t“RCF\\tCredit\\tAgreement”)\\twith\\ta\\tsyndicate\\tof\\tbanks\\tto\\nreplace\\tthe\\texisting\\tCredit\\tAgreement,\\twhich\\twas\\tterminated.\\tThe\\tRCF\\tCredit\\tAgreement\\tcontains\\ttwo\\toptional\\tone-year\\textensions\\tand\\thas\\ta\\ttotal\\ncommitment\\tof\\tup\\tto\\t$5.00\\tbillion,\\twhich\\tcould\\tbe\\tincreased\\tup\\tto\\t$7.00\\tbillion\\tunder\\tcertain\\tcircumstances.\\tThe\\tunderlying\\tborrowings\\tmay\\tbe\\tused\\tfor\\ngeneral\\tcorporate\\tpurposes.\\tBorrowed\\tfunds\\taccrue\\tinterest\\tat\\ta\\tvariable\\trate\\tequal\\tto:\\t(i)\\tfor\\tdollar-denominated\\tloans,\\tat\\tour\\telection,\\t(a)\\tTerm\\tSOFR\\n(the\\tforward-looking\\tsecured\\tovernight\\tfinancing\\trate)\\tplus\\t0.10%,\\tor\\t(b)\\tan\\talternate\\tbase\\trate;\\t(ii)\\tfor\\tloans\\tdenominated\\tin\\tpounds\\tsterling,\\tSONIA\\t(the\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 77,\n        \"lines\": {\n          \"from\": 36,\n          \"to\": 51\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"sterling\\tovernight\\tindex\\taverage\\treference\\trate);\\tor\\t(iii)\\tfor\\tloans\\tdenominated\\tin\\teuros,\\tan\\tadjusted\\tEURIBOR\\t(euro\\tinterbank\\toffered\\trate);\\tin\\teach\\tcase,\\nplus\\tan\\tapplicable\\tmargin.\\tThe\\tapplicable\\tmargin\\twill\\tbe\\tbased\\ton\\tthe\\trating\\tassigned\\tto\\tour\\tsenior,\\tunsecured\\tlong-term\\tindebtedness\\t(the\\t“Credit\\nRating”)\\tfrom\\ttime\\tto\\ttime.\\tThe\\tfee\\tfor\\tundrawn\\tamounts\\tis\\tvariable\\tbased\\ton\\tthe\\tCredit\\tRating\\tand\\tis\\tcurrently\\t0.125%\\tper\\tannum.\\n75\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 77,\n        \"lines\": {\n          \"from\": 52,\n          \"to\": 55\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Automotive\\tAsset-backed\\tNotes\\nFrom\\ttime\\tto\\ttime,\\twe\\ttransfer\\treceivables\\tand/or\\tbeneficial\\tinterests\\trelated\\tto\\tcertain\\tvehicles\\t(either\\tleased\\tor\\tfinanced)\\tinto\\tspecial\\tpurpose\\nentities\\t(“SPEs”)\\tand\\tissue\\tAutomotive\\tAsset-backed\\tNotes,\\tbacked\\tby\\tthese\\tautomotive\\tassets\\tto\\tinvestors.\\tThe\\tSPEs\\tare\\tconsolidated\\tin\\tthe\\tfinancial\\nstatements.\\tThe\\tcash\\tflows\\tgenerated\\tby\\tthese\\tautomotive\\tassets\\tare\\tused\\tto\\tservice\\tthe\\tprincipal\\tand\\tinterest\\tpayments\\ton\\tthe\\tAutomotive\\tAsset-\\nbacked\\tNotes\\tand\\tsatisfy\\tthe\\tSPEs’\\texpenses,\\tand\\tany\\tremaining\\tcash\\tis\\tdistributed\\tto\\tthe\\towners\\tof\\tthe\\tSPEs.\\tWe\\trecognize\\trevenue\\tearned\\tfrom\\tthe\\nassociated\\tcustomer\\tlease\\tor\\tfinancing\\tcontracts\\tin\\taccordance\\twith\\tour\\trevenue\\trecognition\\tpolicy.\\tThe\\tSPEs’\\tassets\\tand\\tcash\\tflows\\tare\\tnot\\tavailable\\tto\\nour\\tother\\tcreditors,\\tand\\tthe\\tcreditors\\tof\\tthe\\tSPEs,\\tincluding\\tthe\\tAutomotive\\tAsset-backed\\tNote\\tholders,\\thave\\tno\\trecourse\\tto\\tour\\tother\\tassets.\\nIn\\t2023,\\twe\\ttransferred\\tbeneficial\\tinterests\\trelated\\tto\\tcertain\\tleased\\tvehicles\\tand\\tfinancing\\treceivables\\tinto\\tSPEs\\tand\\tissued\\t$3.93\\tbillion\\tin\\naggregate\\tprincipal\\tamount\\tof\\tAutomotive\\tAsset-backed\\tNotes,\\twith\\tterms\\tsimilar\\tto\\tour\\tother\\tpreviously\\tissued\\tAutomotive\\tAsset-backed\\tNotes.\\tThe\\nproceeds\\tfrom\\tthe\\tissuance,\\tnet\\tof\\tdebt\\tissuance\\tcosts,\\twere\\t$3.92\\tbillion.\\nCash\\tEquity\\tDebt\\nIn\\tconnection\\twith\\tthe\\tcash\\tequity\\tfinancing\\tdeals\\tclosed\\tin\\t2016,\\tour\\tsubsidiaries\\tissued\\t$502\\tmillion\\tin\\taggregate\\tprincipal\\tamount\\tof\\tdebt\\tthat\\nbears\\tinterest\\tat\\tfixed\\trates.\\tThis\\tdebt\\tis\\tsecured\\tby,\\tamong\\tother\\tthings,\\tour\\tinterests\\tin\\tcertain\\tfinancing\\tfunds\\tand\\tis\\tnon-recourse\\tto\\tour\\tother\\tassets.\\nAutomotive\\tLease-backed\\tCredit\\tFacilities\\nIn\\tthe\\tthird\\tquarter\\tof\\t2023,\\twe\\tterminated\\tour\\tAutomotive\\tLease-backed\\tCredit\\tFacilities\\tand\\tthe\\tpreviously\\tcommitted\\tfunds\\tare\\tno\\tlonger\\navailable\\tfor\\tfuture\\tborrowings.\\nPledged\\tAssets\\nAs\\tof\\tDecember\\t31,\\t2023\\tand\\t2022,\\twe\\thad\\tpledged\\tor\\trestricted\\t$4.64\\tbillion\\tand\\t$2.02\\tbillion\\tof\\tour\\tassets\\t(consisting\\tprincipally\\tof\\toperating\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 78,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 18\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"lease\\tvehicles,\\tfinancing\\treceivables,\\trestricted\\tcash,\\tand\\tequity\\tinterests\\tin\\tcertain\\tSPEs)\\tas\\tcollateral\\tfor\\tour\\toutstanding\\tdebt.\\nSchedule\\tof\\tPrincipal\\tMaturities\\tof\\tDebt\\nThe\\tfuture\\tscheduled\\tprincipal\\tmaturities\\tof\\tdebt\\tas\\tof\\tDecember\\t31,\\t2023\\twere\\tas\\tfollows\\t(in\\tmillions):\\nRecourse\\tdebtNon-recourse\\tdebtTotal\\n2024\\n$37\\t$1,941\\t$1,978\\t\\n20254\\t1,663\\t1,667\\t\\n2026—\\t494\\t494\\t\\n2027—\\t276\\t276\\t\\n2028—\\t44\\t44\\t\\nThereafter3\\t221\\t224\\t\\nTotal\\n$44\\t$4,639\\t$4,683\\t\\nNote\\t12\\t–\\tLeases\\nWe\\thave\\tentered\\tinto\\tvarious\\toperating\\tand\\tfinance\\tlease\\tagreements\\tfor\\tcertain\\tof\\tour\\toffices,\\tmanufacturing\\tand\\twarehouse\\tfacilities,\\tretail\\tand\\nservice\\tlocations,\\tdata\\tcenters,\\tequipment,\\tvehicles,\\tand\\tsolar\\tenergy\\tsystems,\\tworldwide.\\tWe\\tdetermine\\tif\\tan\\tarrangement\\tis\\ta\\tlease,\\tor\\tcontains\\ta\\nlease,\\tat\\tinception\\tand\\trecord\\tthe\\tleases\\tin\\tour\\tfinancial\\tstatements\\tupon\\tlease\\tcommencement,\\twhich\\tis\\tthe\\tdate\\twhen\\tthe\\tunderlying\\tasset\\tis\\tmade\\navailable\\tfor\\tuse\\tby\\tthe\\tlessor.\\nWe\\thave\\tlease\\tagreements\\twith\\tlease\\tand\\tnon-lease\\tcomponents,\\tand\\thave\\telected\\tto\\tutilize\\tthe\\tpractical\\texpedient\\tto\\taccount\\tfor\\tlease\\tand\\tnon-\\nlease\\tcomponents\\ttogether\\tas\\ta\\tsingle\\tcombined\\tlease\\tcomponent,\\tfrom\\tboth\\ta\\tlessee\\tand\\tlessor\\tperspective\\twith\\tthe\\texception\\tof\\tdirect\\tsales-type\\nleases\\tand\\tproduction\\tequipment\\tclasses\\tembedded\\tin\\tsupply\\tagreements.\\tFrom\\ta\\tlessor\\tperspective,\\tthe\\ttiming\\tand\\tpattern\\tof\\ttransfer\\tare\\tthe\\tsame\\tfor\\nthe\\tnon-lease\\tcomponents\\tand\\tassociated\\tlease\\tcomponent\\tand,\\tthe\\tlease\\tcomponent,\\tif\\taccounted\\tfor\\tseparately,\\twould\\tbe\\tclassified\\tas\\tan\\toperating\\nlease.\\n76\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 78,\n        \"lines\": {\n          \"from\": 19,\n          \"to\": 42\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"We\\thave\\telected\\tnot\\tto\\tpresent\\tshort-term\\tleases\\ton\\tthe\\tconsolidated\\tbalance\\tsheet\\tas\\tthese\\tleases\\thave\\ta\\tlease\\tterm\\tof\\t12\\tmonths\\tor\\tless\\tat\\tlease\\ninception\\tand\\tdo\\tnot\\tcontain\\tpurchase\\toptions\\tor\\trenewal\\tterms\\tthat\\twe\\tare\\treasonably\\tcertain\\tto\\texercise.\\tAll\\tother\\tlease\\tassets\\tand\\tlease\\tliabilities\\tare\\nrecognized\\tbased\\ton\\tthe\\tpresent\\tvalue\\tof\\tlease\\tpayments\\tover\\tthe\\tlease\\tterm\\tat\\tcommencement\\tdate.\\tBecause\\tmost\\tof\\tour\\tleases\\tdo\\tnot\\tprovide\\tan\\nimplicit\\trate\\tof\\treturn,\\twe\\tused\\tour\\tincremental\\tborrowing\\trate\\tbased\\ton\\tthe\\tinformation\\tavailable\\tat\\tlease\\tcommencement\\tdate\\tin\\tdetermining\\tthe\\npresent\\tvalue\\tof\\tlease\\tpayments.\\nOur\\tleases,\\twhere\\twe\\tare\\tthe\\tlessee,\\toften\\tinclude\\toptions\\tto\\textend\\tthe\\tlease\\tterm\\tfor\\tup\\tto\\t10\\tyears.\\tSome\\tof\\tour\\tleases\\talso\\tinclude\\toptions\\tto\\nterminate\\tthe\\tlease\\tprior\\tto\\tthe\\tend\\tof\\tthe\\tagreed\\tupon\\tlease\\tterm.\\tFor\\tpurposes\\tof\\tcalculating\\tlease\\tliabilities,\\tlease\\tterms\\tinclude\\toptions\\tto\\textend\\tor\\nterminate\\tthe\\tlease\\twhen\\tit\\tis\\treasonably\\tcertain\\tthat\\twe\\twill\\texercise\\tsuch\\toptions.\\nLease\\texpense\\tfor\\toperating\\tleases\\tis\\trecognized\\ton\\ta\\tstraight-line\\tbasis\\tover\\tthe\\tlease\\tterm\\tas\\tcost\\tof\\trevenues\\tor\\toperating\\texpenses\\tdepending\\non\\tthe\\tnature\\tof\\tthe\\tleased\\tasset.\\tCertain\\toperating\\tleases\\tprovide\\tfor\\tannual\\tincreases\\tto\\tlease\\tpayments\\tbased\\ton\\tan\\tindex\\tor\\trate.\\tWe\\tcalculate\\tthe\\npresent\\tvalue\\tof\\tfuture\\tlease\\tpayments\\tbased\\ton\\tthe\\tindex\\tor\\trate\\tat\\tthe\\tlease\\tcommencement\\tdate\\tfor\\tnew\\tleases.\\tDifferences\\tbetween\\tthe\\tcalculated\\nlease\\tpayment\\tand\\tactual\\tpayment\\tare\\texpensed\\tas\\tincurred.\\tAmortization\\tof\\tfinance\\tlease\\tassets\\tis\\trecognized\\tover\\tthe\\tlease\\tterm\\tas\\tcost\\tof\\trevenues\\nor\\toperating\\texpenses\\tdepending\\ton\\tthe\\tnature\\tof\\tthe\\tleased\\tasset.\\tInterest\\texpense\\ton\\tfinance\\tlease\\tliabilities\\tis\\trecognized\\tover\\tthe\\tlease\\tterm\\twithin\\nInterest\\texpense\\tin\\tthe\\tconsolidated\\tstatements\\tof\\toperations.\\nThe\\tbalances\\tfor\\tthe\\toperating\\tand\\tfinance\\tleases\\twhere\\twe\\tare\\tthe\\tlessee\\tare\\tpresented\\tas\\tfollows\\t(in\\tmillions)\\twithin\\tour\\tconsolidated\\tbalance\\nsheets:\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 79,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 16\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"sheets:\\nDecember\\t31,\\t2023December\\t31,\\t2022\\nOperating\\tleases:\\n\\t\\t\\nOperating\\tlease\\tright-of-use\\tassets$4,180\\t$2,563\\t\\n\\t\\nAccrued\\tliabilities\\tand\\tother$672\\t$485\\t\\nOther\\tlong-term\\tliabilities3,671\\t2,164\\t\\nTotal\\toperating\\tlease\\tliabilities\\n$4,343\\t$2,649\\t\\n\\t\\nFinance\\tleases:\\t\\t\\nSolar\\tenergy\\tsystems,\\tnet$23\\t$25\\t\\nProperty,\\tplant\\tand\\tequipment,\\tnet601\\t1,094\\t\\nTotal\\tfinance\\tlease\\tassets\\n$624\\t$1,119\\t\\n\\t\\nCurrent\\tportion\\tof\\tlong-term\\tdebt\\tand\\tfinance\\tleases$398\\t$486\\t\\nLong-term\\tdebt\\tand\\tfinance\\tleases,\\tnet\\tof\\tcurrent\\tportion175\\t568\\t\\nTotal\\tfinance\\tlease\\tliabilities\\n$573\\t$1,054\\t\\n77\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 79,\n        \"lines\": {\n          \"from\": 16,\n          \"to\": 37\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"The\\tcomponents\\tof\\tlease\\texpense\\tare\\tas\\tfollows\\t(in\\tmillions)\\twithin\\tour\\tconsolidated\\tstatements\\tof\\toperations:\\nYear\\tEnded\\tDecember\\t31,\\n202320222021\\nOperating\\tlease\\texpense:\\t\\t\\t\\nOperating\\tlease\\texpense\\t(1)$1,153\\t$798\\t$627\\t\\n\\t\\nFinance\\tlease\\texpense:\\nAmortization\\tof\\tleased\\tassets$506\\t$493\\t$415\\t\\nInterest\\ton\\tlease\\tliabilities45\\t72\\t89\\t\\nTotal\\tfinance\\tlease\\texpense$551\\t$565\\t$504\\t\\n\\t\\nTotal\\tlease\\texpense\\n$1,704\\t$1,363\\t$1,131\\t\\n(1)Includes\\tshort-term\\tleases\\tand\\tvariable\\tlease\\tcosts,\\twhich\\tare\\timmaterial.\\nOther\\tinformation\\trelated\\tto\\tleases\\twhere\\twe\\tare\\tthe\\tlessee\\tis\\tas\\tfollows:\\nDecember\\t31,\\t2023December\\t31,\\t2022\\nWeighted-average\\tremaining\\tlease\\tterm:\\nOperating\\tleases7.4\\tyears6.4\\tyears\\nFinance\\tleases2.3\\tyears3.1\\tyears\\n\\t\\nWeighted-average\\tdiscount\\trate:\\nOperating\\tleases5.6\\t%5.3\\t%\\nFinance\\tleases5.5\\t%5.7\\t%\\nSupplemental\\tcash\\tflow\\tinformation\\trelated\\tto\\tleases\\twhere\\twe\\tare\\tthe\\tlessee\\tis\\tas\\tfollows\\t(in\\tmillions):\\nYear\\tEnded\\tDecember\\t31,\\n202320222021\\nCash\\tpaid\\tfor\\tamounts\\tincluded\\tin\\tthe\\tmeasurement\\tof\\tlease\\tliabilities:\\nOperating\\tcash\\toutflows\\tfrom\\toperating\\tleases$1,084\\t$754\\t$616\\t\\nOperating\\tcash\\toutflows\\tfrom\\tfinance\\tleases\\t(interest\\tpayments)$47\\t$75\\t$89\\t\\nLeased\\tassets\\tobtained\\tin\\texchange\\tfor\\tfinance\\tlease\\tliabilities$10\\t$58\\t$486\\t\\nLeased\\tassets\\tobtained\\tin\\texchange\\tfor\\toperating\\tlease\\tliabilities$2,170\\t$1,059\\t$818\\t\\n78\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 80,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 32\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"As\\tof\\tDecember\\t31,\\t2023,\\tthe\\tmaturities\\tof\\tour\\toperating\\tand\\tfinance\\tlease\\tliabilities\\t(excluding\\tshort-term\\tleases)\\tare\\tas\\tfollows\\t(in\\tmillions):\\n\\t\\nOperating\\nLeases\\nFinance\\nLeases\\n2024\\n$892\\t$418\\t\\n2025831\\t81\\t\\n2026706\\t57\\t\\n2027603\\t38\\t\\n2028508\\t2\\t\\nThereafter1,820\\t4\\t\\nTotal\\tminimum\\tlease\\tpayments\\n5,360\\t600\\t\\nLess:\\tInterest1,017\\t27\\t\\nPresent\\tvalue\\tof\\tlease\\tobligations\\n4,343\\t573\\t\\nLess:\\tCurrent\\tportion672\\t398\\t\\nLong-term\\tportion\\tof\\tlease\\tobligations\\n$3,671\\t$175\\t\\nAs\\tof\\tDecember\\t31,\\t2023,\\twe\\thave\\texcluded\\tfrom\\tthe\\ttable\\tabove\\tadditional\\toperating\\tleases\\tthat\\thave\\tnot\\tyet\\tcommenced\\twith\\taggregate\\trent\\npayments\\tof\\t$1.53\\tbillion.\\tThese\\toperating\\tleases\\twill\\tcommence\\tbetween\\tfiscal\\tyear\\t2024\\tand\\t2025\\twith\\tlease\\tterms\\tof\\t2\\tyears\\tto\\t20\\tyears.\\nOperating\\tLease\\tand\\tSales-type\\tLease\\tReceivables\\nWe\\tare\\tthe\\tlessor\\tof\\tcertain\\tvehicle\\tand\\tsolar\\tenergy\\tsystem\\tarrangements\\tas\\tdescribed\\tin\\tNote\\t2,\\tSummary\\tof\\tSignificant\\tAccounting\\tPolicies.\\tAs\\tof\\nDecember\\t31,\\t2023,\\tmaturities\\tof\\tour\\toperating\\tlease\\tand\\tsales-type\\tlease\\treceivables\\tfrom\\tcustomers\\tfor\\teach\\tof\\tthe\\tnext\\tfive\\tyears\\tand\\tthereafter\\twere\\nas\\tfollows\\t(in\\tmillions):\\nOperating\\nLeases\\nSales-type\\nLeases\\n2024\\n$1,405\\t$227\\t\\n2025960\\t214\\t\\n2026461\\t210\\t\\n2027227\\t102\\t\\n2028197\\t25\\t\\nThereafter1,492\\t2\\t\\nGross\\tlease\\treceivables\\n$4,742\\t$780\\t\\nThe\\tabove\\ttable\\tdoes\\tnot\\tinclude\\tvehicle\\tsales\\tto\\tcustomers\\tor\\tleasing\\tpartners\\twith\\ta\\tresale\\tvalue\\tguarantee\\tas\\tthe\\tcash\\tpayments\\twere\\treceived\\nupfront.\\tFor\\tour\\tsolar\\tPPA\\tarrangements,\\tcustomers\\tare\\tcharged\\tsolely\\tbased\\ton\\tactual\\tpower\\tproduced\\tby\\tthe\\tinstalled\\tsolar\\tenergy\\tsystem\\tat\\ta\\npredefined\\trate\\tper\\tkilowatt-hour\\tof\\tpower\\tproduced.\\tThe\\tfuture\\tpayments\\tfrom\\tsuch\\tarrangements\\tare\\tnot\\tincluded\\tin\\tthe\\tabove\\ttable\\tas\\tthey\\tare\\ta\\nfunction\\tof\\tthe\\tpower\\tgenerated\\tby\\tthe\\trelated\\tsolar\\tenergy\\tsystems\\tin\\tthe\\tfuture.\\n79\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 81,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 45\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Net\\tInvestment\\tin\\tSales-type\\tLeases\\nNet\\tinvestment\\tin\\tsales-type\\tleases,\\twhich\\tis\\tthe\\tsum\\tof\\tthe\\tpresent\\tvalue\\tof\\tthe\\tfuture\\tcontractual\\tlease\\tpayments,\\tis\\tpresented\\ton\\tthe\\nconsolidated\\tbalance\\tsheets\\tas\\ta\\tcomponent\\tof\\tPrepaid\\texpenses\\tand\\tother\\tcurrent\\tassets\\tfor\\tthe\\tcurrent\\tportion\\tand\\tas\\tOther\\tnon-current\\tassets\\tfor\\tthe\\nlong-term\\tportion.\\tLease\\treceivables\\trelating\\tto\\tsales-type\\tleases\\tare\\tpresented\\ton\\tthe\\tconsolidated\\tbalance\\tsheets\\tas\\tfollows\\t(in\\tmillions):\\nDecember\\t31,\\t2023December\\t31,\\t2022\\nGross\\tlease\\treceivables\\n$780\\t$837\\t\\nUnearned\\tinterest\\tincome(78)(95)\\nAllowance\\tfor\\texpected\\tcredit\\tlosses(6)(4)\\nNet\\tinvestment\\tin\\tsales-type\\tleases\\n$696\\t$738\\t\\n\\t\\nReported\\tas:\\nPrepaid\\texpenses\\tand\\tother\\tcurrent\\tassets$189\\t$164\\t\\nOther\\tnon-current\\tassets507\\t574\\t\\nNet\\tinvestment\\tin\\tsales-type\\tleases\\n$696\\t$738\\t\\nLease\\tPass-Through\\tFinancing\\tObligation\\nAs\\tof\\tDecember\\t31,\\t2023,\\twe\\thave\\tfive\\ttransactions\\treferred\\tto\\tas\\t“lease\\tpass-through\\tfund\\tarrangements.”\\tUnder\\tthese\\tarrangements,\\tour\\twholly\\nowned\\tsubsidiaries\\tfinance\\tthe\\tcost\\tof\\tsolar\\tenergy\\tsystems\\twith\\tinvestors\\tthrough\\tarrangements\\tcontractually\\tstructured\\tas\\tmaster\\tleases\\tfor\\tan\\tinitial\\nterm\\tranging\\tbetween\\t10\\tand\\t25\\tyears.\\tThese\\tsolar\\tenergy\\tsystems\\tare\\tsubject\\tto\\tlease\\tor\\tPPAs\\twith\\tcustomers\\twith\\tan\\tinitial\\tterm\\tnot\\texceeding\\t25\\nyears.\\nUnder\\ta\\tlease\\tpass-through\\tfund\\tarrangement,\\tthe\\tinvestor\\tmakes\\ta\\tlarge\\tupfront\\tpayment\\tto\\tthe\\tlessor,\\twhich\\tis\\tone\\tof\\tour\\tsubsidiaries,\\tand\\tin\\nsome\\tcases,\\tsubsequent\\tperiodic\\tpayments.\\tAs\\tof\\tDecember\\t31,\\t2023,\\tthe\\tfuture\\tminimum\\tmaster\\tlease\\tpayments\\tto\\tbe\\treceived\\tfrom\\tinvestors,\\tfor\\neach\\tof\\tthe\\tnext\\tfive\\tyears\\tand\\tthereafter,\\twere\\tas\\tfollows\\t(in\\tmillions):\\n2024$18\\t\\n202527\\t\\n202628\\t\\n202729\\t\\n202829\\t\\nThereafter337\\t\\nTotal\\n$468\\t\\nNote\\t13\\t–\\tEquity\\tIncentive\\tPlans\\nIn\\tJune\\t2019,\\twe\\tadopted\\tthe\\t2019\\tEquity\\tIncentive\\tPlan\\t(the\\t“2019\\tPlan”).\\tThe\\t2019\\tPlan\\tprovides\\tfor\\tthe\\tgrant\\tof\\tstock\\toptions,\\trestricted\\tstock,\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 82,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 35\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"RSUs,\\tstock\\tappreciation\\trights,\\tperformance\\tunits\\tand\\tperformance\\tshares\\tto\\tour\\temployees,\\tdirectors\\tand\\tconsultants.\\tStock\\toptions\\tgranted\\tunder\\tthe\\n2019\\tPlan\\tmay\\tbe\\teither\\tincentive\\tstock\\toptions\\tor\\tnonstatutory\\tstock\\toptions.\\tIncentive\\tstock\\toptions\\tmay\\tonly\\tbe\\tgranted\\tto\\tour\\temployees.\\nNonstatutory\\tstock\\toptions\\tmay\\tbe\\tgranted\\tto\\tour\\temployees,\\tdirectors\\tand\\tconsultants.\\tGenerally,\\tour\\tstock\\toptions\\tand\\tRSUs\\tvest\\tover\\tfour\\tyears\\tand\\nour\\tstock\\toptions\\tare\\texercisable\\tover\\ta\\tmaximum\\tperiod\\tof\\t10\\tyears\\tfrom\\ttheir\\tgrant\\tdates.\\tVesting\\ttypically\\tterminates\\twhen\\tthe\\temployment\\tor\\nconsulting\\trelationship\\tends.\\nAs\\tof\\tDecember\\t31,\\t2023,\\t131.1\\tmillion\\tshares\\twere\\treserved\\tand\\tavailable\\tfor\\tissuance\\tunder\\tthe\\t2019\\tPlan.\\n80\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 82,\n        \"lines\": {\n          \"from\": 36,\n          \"to\": 42\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"The\\tfollowing\\ttable\\tsummarizes\\tour\\tstock\\toption\\tand\\tRSU\\tactivity\\tfor\\tthe\\tyear\\tended\\tDecember\\t31,\\t2023:\\nStock\\tOptionsRSUs\\nNumber\\tof\\nOptions\\n(in\\tthousands)\\nWeighted-\\nAverage\\nExercise\\nPrice\\nWeighted-\\nAverage\\nRemaining\\nContractual\\nLife\\t(years)\\nAggregate\\nIntrinsic\\nValue\\n(in\\tbillions)\\nNumber\\nof\\tRSUs\\n(in\\tthousands)\\nWeighted-\\nAverage\\nGrant\\nDate\\tFair\\nValue\\nBeginning\\tof\\tperiod\\n343,564$30.65\\t21,333$162.32\\t\\nGranted9,521$226.50\\t11,743$228.33\\t\\nExercised\\tor\\treleased(7,626)$43.07\\t(11,085)$116.47\\t\\nCancelled(1,438)$194.23\\t(2,903)$192.22\\t\\nEnd\\tof\\tperiod\\n344,021\\n$35.11\\t4.31$73.57\\t\\n19,088\\n$225.01\\t\\nVested\\tand\\texpected\\tto\\tvest,\\tDecember\\t31,\\t2023\\n340,884$33.38\\t4.27$73.45\\t18,446$225.76\\t\\nExercisable\\tand\\tvested,\\tDecember\\t31,\\t2023329,124$27.07\\t4.11$72.90\\t\\nThe\\tweighted-average\\tgrant\\tdate\\tfair\\tvalue\\tof\\tRSUs\\tgranted\\tin\\tthe\\tyears\\tended\\tDecember\\t31,\\t2023,\\t2022\\tand\\t2021\\twas\\t$228.33,\\t$239.85\\tand\\n$261.33,\\trespectively.\\tThe\\taggregate\\trelease\\tdate\\tfair\\tvalue\\tof\\tRSUs\\tin\\tthe\\tyears\\tended\\tDecember\\t31,\\t2023,\\t2022\\tand\\t2021\\twas\\t$2.50\\tbillion,\\t$4.32\\nbillion\\tand\\t$5.70\\tbillion,\\trespectively.\\nThe\\taggregate\\tintrinsic\\tvalue\\tof\\toptions\\texercised\\tin\\tthe\\tyears\\tended\\tDecember\\t31,\\t2023,\\t2022,\\tand\\t2021\\twas\\t$1.33\\tbillion,\\t$1.90\\tbillion\\tand\\n$26.88\\tbillion,\\trespectively.\\tDuring\\tthe\\tyear\\tended\\tDecember\\t31,\\t2021,\\tour\\tCEO\\texercised\\tall\\tof\\tthe\\tremaining\\tvested\\toptions\\tfrom\\tthe\\t2012\\tCEO\\nPerformance\\tAward,\\twhich\\tamounted\\tto\\tan\\tintrinsic\\tvalue\\tof\\t$23.45\\tbillion.\\nESPP\\nOur\\temployees\\tare\\teligible\\tto\\tpurchase\\tour\\tcommon\\tstock\\tthrough\\tpayroll\\tdeductions\\tof\\tup\\tto\\t15%\\tof\\ttheir\\teligible\\tcompensation,\\tsubject\\tto\\tany\\nplan\\tlimitations.\\tThe\\tpurchase\\tprice\\twould\\tbe\\t85%\\tof\\tthe\\tlower\\tof\\tthe\\tfair\\tmarket\\tvalue\\ton\\tthe\\tfirst\\tand\\tlast\\ttrading\\tdays\\tof\\teach\\tsix-month\\toffering\\nperiod.\\tDuring\\tthe\\tyears\\tended\\tDecember\\t31,\\t2023,\\t2022\\tand\\t2021,\\tunder\\tthe\\tESPP\\twe\\tissued\\t2.1\\tmillion,\\t1.4\\tmillion\\tand\\t1.5\\tmillion\\tshares,\\trespectively.\\nAs\\tof\\tDecember\\t31,\\t2023,\\tthere\\twere\\t97.8\\tmillion\\tshares\\tavailable\\tfor\\tissuance\\tunder\\tthe\\tESPP.\\nFair\\tValue\\tAssumptions\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 83,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 51\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Fair\\tValue\\tAssumptions\\nWe\\tuse\\tthe\\tfair\\tvalue\\tmethod\\tin\\trecognizing\\tstock-based\\tcompensation\\texpense.\\tUnder\\tthe\\tfair\\tvalue\\tmethod,\\twe\\testimate\\tthe\\tfair\\tvalue\\tof\\teach\\nstock\\toption\\taward\\twith\\tservice\\tor\\tservice\\tand\\tperformance\\tconditions\\tand\\tthe\\tESPP\\ton\\tthe\\tgrant\\tdate\\tgenerally\\tusing\\tthe\\tBlack-Scholes\\toption\\tpricing\\nmodel.\\tThe\\tweighted-average\\tassumptions\\tused\\tin\\tthe\\tBlack-Scholes\\tmodel\\tfor\\tstock\\toptions\\tare\\tas\\tfollows:\\nYear\\tEnded\\tDecember\\t31,\\n202320222021\\nRisk-free\\tinterest\\trate\\n3.90\\t%3.11\\t%0.66\\t%\\nExpected\\tterm\\t(in\\tyears)4.54.14.3\\nExpected\\tvolatility63\\t%63\\t%59\\t%\\nDividend\\tyield0.0\\t%0.0\\t%0.0\\t%\\nGrant\\tdate\\tfair\\tvalue\\tper\\tshare$121.62\\t$114.51\\t$128.02\\t\\nThe\\tfair\\tvalue\\tof\\tRSUs\\twith\\tservice\\tor\\tservice\\tand\\tperformance\\tconditions\\tis\\tmeasured\\ton\\tthe\\tgrant\\tdate\\tbased\\ton\\tthe\\tclosing\\tfair\\tmarket\\tvalue\\tof\\nour\\tcommon\\tstock.\\tThe\\trisk-free\\tinterest\\trate\\tis\\tbased\\ton\\tthe\\tU.S.\\tTreasury\\tyield\\tfor\\tzero-coupon\\tU.S.\\tTreasury\\tnotes\\twith\\tmaturities\\tapproximating\\teach\\ngrant’s\\texpected\\tlife.\\tWe\\tuse\\tour\\thistorical\\tdata\\tin\\testimating\\tthe\\texpected\\tterm\\tof\\tour\\temployee\\tgrants.\\tThe\\texpected\\tvolatility\\tis\\tbased\\ton\\tthe\\taverage\\nof\\tthe\\timplied\\tvolatility\\tof\\tpublicly\\ttraded\\toptions\\tfor\\tour\\tcommon\\tstock\\tand\\tthe\\thistorical\\tvolatility\\tof\\tour\\tcommon\\tstock.\\n81\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 83,\n        \"lines\": {\n          \"from\": 51,\n          \"to\": 67\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"2018\\tCEO\\tPerformance\\tAward\\nIn\\tMarch\\t2018,\\tour\\tstockholders\\tapproved\\tthe\\tBoard\\tof\\tDirectors’\\tgrant\\tof\\t304.0\\tmillion\\tstock\\toption\\tawards,\\tas\\tadjusted\\tto\\tgive\\teffect\\tto\\tthe\\t2020\\nStock\\tSplit\\tand\\tthe\\t2022\\tStock\\tSplit,\\tto\\tour\\tCEO\\t(the\\t“2018\\tCEO\\tPerformance\\tAward”).\\tThe\\t2018\\tCEO\\tPerformance\\tAward\\tconsisted\\tof\\t12\\tvesting\\ntranches\\twith\\ta\\tvesting\\tschedule\\tbased\\tentirely\\ton\\tthe\\tattainment\\tof\\tboth\\toperational\\tmilestones\\t(performance\\tconditions)\\tand\\tmarket\\tconditions,\\nassuming\\tcontinued\\temployment\\teither\\tas\\tthe\\tCEO\\tor\\tas\\tboth\\tExecutive\\tChairman\\tand\\tChief\\tProduct\\tOfficer\\tand\\tservice\\tthrough\\teach\\tvesting\\tdate.\\tEach\\nof\\tthe\\t12\\tvesting\\ttranches\\tof\\tthe\\t2018\\tCEO\\tPerformance\\tAward\\tvested\\tupon\\tcertification\\tby\\tthe\\tBoard\\tof\\tDirectors\\tthat\\tboth\\t(i)\\tthe\\tmarket\\tcapitalization\\nmilestone\\tfor\\tsuch\\ttranche,\\twhich\\tbegan\\tat\\t$100.0\\tbillion\\tfor\\tthe\\tfirst\\ttranche\\tand\\tincreases\\tby\\tincrements\\tof\\t$50.0\\tbillion\\tthereafter\\t(based\\ton\\tboth\\ta\\tsix\\ncalendar\\tmonth\\ttrailing\\taverage\\tand\\ta\\t30\\tcalendar\\tday\\ttrailing\\taverage,\\tcounting\\tonly\\ttrading\\tdays),\\thad\\tbeen\\tachieved,\\tand\\t(ii)\\tany\\tone\\tof\\tthe\\tfollowing\\neight\\toperational\\tmilestones\\tfocused\\ton\\ttotal\\trevenue\\tor\\tany\\tone\\tof\\tthe\\teight\\toperational\\tmilestones\\tfocused\\ton\\tAdjusted\\tEBITDA\\thad\\tbeen\\tachieved\\tfor\\nthe\\tfour\\tconsecutive\\tfiscal\\tquarters\\ton\\tan\\tannualized\\tbasis\\tand\\tsubsequently\\treported\\tby\\tus\\tin\\tour\\tconsolidated\\tfinancial\\tstatements\\tfiled\\twith\\tour\\tForms\\n10-Q\\tand/or\\t10-K.\\tAdjusted\\tEBITDA\\twas\\tdefined\\tas\\tnet\\tincome\\t(loss)\\tattributable\\tto\\tcommon\\tstockholders\\tbefore\\tinterest\\texpense,\\tprovision\\t(benefit)\\tfor\\nincome\\ttaxes,\\tdepreciation\\tand\\tamortization\\tand\\tstock-based\\tcompensation.\\tUpon\\tvesting\\tand\\texercise,\\tincluding\\tthe\\tpayment\\tof\\tthe\\texercise\\tprice\\tof\\n$23.34\\tper\\tshare\\tas\\tadjusted\\tto\\tgive\\teffect\\tto\\tthe\\t2020\\tStock\\tSplit\\tand\\tthe\\t2022\\tStock\\tSplit,\\tour\\tCEO\\tmust\\thold\\tshares\\tthat\\the\\tacquires\\tfor\\tfive\\tyears\\npost-exercise,\\tother\\tthan\\ta\\tcashless\\texercise\\twhere\\tshares\\tare\\tsimultaneously\\tsold\\tto\\tpay\\tfor\\tthe\\texercise\\tprice\\tand\\tany\\trequired\\ttax\\twithholding.\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 84,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 14\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"The\\tachievement\\tstatus\\tof\\tthe\\toperational\\tmilestones\\tas\\tof\\tDecember\\t31,\\t2023\\tis\\tprovided\\tbelow.\\nTotal\\tAnnualized\\tRevenueAnnualized\\tAdjusted\\tEBITDA\\nMilestone\\n(in\\tbillions)Achievement\\tStatus\\nMilestone\\n(in\\tbillions)Achievement\\tStatus\\n$20.0\\tAchieved$1.5\\tAchieved\\n$35.0\\tAchieved$3.0\\tAchieved\\n$55.0\\tAchieved$4.5\\tAchieved\\n$75.0\\tAchieved$6.0\\tAchieved\\n$100.0\\t-$8.0\\tAchieved\\n$125.0\\t-$10.0\\tAchieved\\n$150.0\\t-$12.0\\tAchieved\\n$175.0\\t-$14.0\\tAchieved\\nStock-based\\tcompensation\\tunder\\tthe\\t2018\\tCEO\\tPerformance\\tAward\\trepresented\\ta\\tnon-cash\\texpense\\tand\\twas\\trecorded\\tas\\ta\\tSelling,\\tgeneral,\\tand\\nadministrative\\toperating\\texpense\\tin\\tour\\tconsolidated\\tstatements\\tof\\toperations.\\tIn\\teach\\tquarter\\tsince\\tthe\\tgrant\\tof\\tthe\\t2018\\tCEO\\tPerformance\\tAward,\\twe\\nhad\\trecognized\\texpense,\\tgenerally\\ton\\ta\\tpro-rated\\tbasis,\\tfor\\tonly\\tthe\\tnumber\\tof\\ttranches\\t(up\\tto\\tthe\\tmaximum\\tof\\t12\\ttranches)\\tthat\\tcorresponded\\tto\\tthe\\nnumber\\tof\\toperational\\tmilestones\\tthat\\thad\\tbeen\\tachieved\\tor\\thad\\tbeen\\tdetermined\\tprobable\\tof\\tbeing\\tachieved\\tin\\tthe\\tfuture,\\tin\\taccordance\\twith\\tthe\\nfollowing\\tprinciples.\\nOn\\tthe\\tgrant\\tdate,\\ta\\tMonte\\tCarlo\\tsimulation\\twas\\tused\\tto\\tdetermine\\tfor\\teach\\ttranche\\t(i)\\ta\\tfixed\\tamount\\tof\\texpense\\tfor\\tsuch\\ttranche\\tand\\t(ii)\\tthe\\nfuture\\ttime\\twhen\\tthe\\tmarket\\tcapitalization\\tmilestone\\tfor\\tsuch\\ttranche\\twas\\texpected\\tto\\tbe\\tachieved,\\tor\\tits\\t“expected\\tmarket\\tcapitalization\\tmilestone\\nachievement\\ttime.”\\tSeparately,\\tbased\\ton\\ta\\tsubjective\\tassessment\\tof\\tour\\tfuture\\tfinancial\\tperformance\\teach\\tquarter,\\twe\\tdetermined\\twhether\\tit\\twas\\nprobable\\tthat\\twe\\twould\\tachieve\\teach\\toperational\\tmilestone\\tthat\\thad\\tnot\\tpreviously\\tbeen\\tachieved\\tor\\tdeemed\\tprobable\\tof\\tachievement\\tand\\tif\\tso,\\tthe\\nfuture\\ttime\\twhen\\twe\\texpected\\tto\\tachieve\\tthat\\toperational\\tmilestone,\\tor\\tits\\t“expected\\toperational\\tmilestone\\tachievement\\ttime.”\\nAs\\tof\\tDecember\\t31,\\t2022,\\tall\\tremaining\\tunrecognized\\tstock-based\\tcompensation\\texpense\\tunder\\tthe\\t2018\\tCEO\\tPerformance\\tAward\\thad\\tbeen\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 84,\n        \"lines\": {\n          \"from\": 15,\n          \"to\": 39\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"recognized.\\tFor\\tthe\\tyears\\tended\\tDecember\\t31,\\t2022\\tand\\t2021,\\twe\\trecorded\\tstock-based\\tcompensation\\texpense\\tof\\t$66\\tmillion\\tand\\t$910\\tmillion,\\nrespectively,\\trelated\\tto\\tthe\\t2018\\tCEO\\tPerformance\\tAward.\\n82\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 84,\n        \"lines\": {\n          \"from\": 40,\n          \"to\": 42\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Other\\tPerformance-Based\\tGrants\\nFrom\\ttime\\tto\\ttime,\\tthe\\tCompensation\\tCommittee\\tof\\tour\\tBoard\\tof\\tDirectors\\tgrants\\tcertain\\temployees\\tperformance-based\\tRSUs\\tand\\tstock\\toptions.\\nAs\\tof\\tDecember\\t31,\\t2023,\\twe\\thad\\tunrecognized\\tstock-based\\tcompensation\\texpense\\tof\\t$655\\tmillion\\tunder\\tthese\\tgrants\\tto\\tpurchase\\tor\\treceive\\tan\\naggregate\\t5.3\\tmillion\\tshares\\tof\\tour\\tcommon\\tstock.\\tFor\\tawards\\tprobable\\tof\\tachievement,\\twe\\testimate\\tthe\\tunrecognized\\tstock-based\\tcompensation\\nexpense\\tof\\t$110\\tmillion\\twill\\tbe\\trecognized\\tover\\ta\\tweighted-average\\tperiod\\tof\\t4.0\\tyears.\\nFor\\tthe\\tyears\\tended\\tDecember\\t31,\\t2023\\tand\\t2022,\\twe\\trecorded\\t$57\\tmillion\\tand\\t$159\\tmillion,\\trespectively,\\tof\\tstock-based\\tcompensation\\texpense\\nrelated\\tto\\tthese\\tgrants,\\tnet\\tof\\tforfeitures.\\nSummary\\tStock-Based\\tCompensation\\tInformation\\nThe\\tfollowing\\ttable\\tsummarizes\\tour\\tstock-based\\tcompensation\\texpense\\tby\\tline\\titem\\tin\\tthe\\tconsolidated\\tstatements\\tof\\toperations\\t(in\\tmillions):\\nYear\\tEnded\\tDecember\\t31,\\n202320222021\\nCost\\tof\\trevenues\\n$741\\t$594\\t$421\\t\\nResearch\\tand\\tdevelopment689\\t536\\t448\\t\\nSelling,\\tgeneral\\tand\\tadministrative382\\t430\\t1,252\\t\\nTotal\\n$1,812\\t$1,560\\t$2,121\\t\\nOur\\tincome\\ttax\\tbenefits\\trecognized\\tfrom\\tstock-based\\tcompensation\\tarrangements\\twere\\timmaterial\\twhile\\twe\\twere\\tunder\\tfull\\tvaluation\\tallowances\\non\\tour\\tU.S.\\tdeferred\\ttax\\tassets\\tduring\\tthe\\tyears\\tended\\tDecember\\t31,\\t2022\\tand\\t2021.\\tWith\\tthe\\trelease\\tof\\tthe\\tvaluation\\tallowance\\tassociated\\twith\\tour\\nfederal\\tand\\tcertain\\tstate\\tdeferred\\ttax\\tassets\\tin\\t2023,\\tincome\\ttax\\tbenefits\\trecognized\\tfrom\\tstock-based\\tcompensation\\texpense\\twere\\t$326\\tmillion\\tduring\\nthe\\tyear\\tended\\tDecember\\t31,\\t2023.\\tDuring\\tthe\\tyears\\tended\\tDecember\\t31,\\t2023,\\t2022\\tand\\t2021,\\tstock-based\\tcompensation\\texpense\\tcapitalized\\tto\\tour\\nconsolidated\\tbalance\\tsheets\\twas\\t$199\\tmillion,\\t$245\\tmillion\\tand\\t$182\\tmillion,\\trespectively.\\tAs\\tof\\tDecember\\t31,\\t2023,\\twe\\thad\\t$4.82\\tbillion\\tof\\ttotal\\nunrecognized\\tstock-based\\tcompensation\\texpense\\trelated\\tto\\tnon-performance\\tawards,\\twhich\\twill\\tbe\\trecognized\\tover\\ta\\tweighted-average\\tperiod\\tof\\t2.8\\nyears.\\nNote\\t14\\t–\\tIncome\\tTaxes\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 85,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 25\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"years.\\nNote\\t14\\t–\\tIncome\\tTaxes\\nOur\\tincome\\tbefore\\t(benefit\\tfrom)\\tprovision\\tfor\\tincome\\ttaxes\\tfor\\tthe\\tyears\\tended\\tDecember\\t31,\\t2023,\\t2022\\tand\\t2021\\twas\\tas\\tfollows\\t(in\\tmillions):\\nYear\\tEnded\\tDecember\\t31,\\n202320222021\\nDomestic\\n$3,196\\t$5,524\\t$(130)\\nNoncontrolling\\tinterest\\tand\\tredeemable\\tnoncontrolling\\tinterest(23)31\\t125\\t\\nForeign6,800\\t8,164\\t6,348\\t\\nIncome\\tbefore\\tincome\\ttaxes\\n$9,973\\t$13,719\\t$6,343\\t\\n83\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 85,\n        \"lines\": {\n          \"from\": 24,\n          \"to\": 35\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"A\\t(benefit\\tfrom)\\tprovision\\tfor\\tincome\\ttaxes\\tof\\t$(5.00)\\tbillion,\\t$1.13\\tbillion\\tand\\t$699\\tmillion\\thas\\tbeen\\trecognized\\tfor\\tthe\\tyears\\tended\\tDecember\\t31,\\n2023,\\t2022\\tand\\t2021,\\trespectively.\\tThe\\tcomponents\\tof\\tthe\\t(benefit\\tfrom)\\tprovision\\tfor\\tincome\\ttaxes\\tfor\\tthe\\tyears\\tended\\tDecember\\t31,\\t2023,\\t2022\\tand\\n2021\\tconsisted\\tof\\tthe\\tfollowing\\t(in\\tmillions):\\nYear\\tEnded\\tDecember\\t31,\\n202320222021\\nCurrent:\\nFederal$48\\t$—\\t$—\\t\\nState57\\t62\\t9\\t\\nForeign1,243\\t1,266\\t839\\t\\nTotal\\tcurrent\\n1,348\\t1,328\\t848\\t\\nDeferred:\\nFederal(5,246)26\\t—\\t\\nState(653)1\\t—\\t\\nForeign(450)(223)(149)\\nTotal\\tdeferred\\n(6,349)(196)(149)\\nTotal\\t(Benefit\\tfrom)\\tprovision\\tfor\\tincome\\ttaxes\\n$(5,001)$1,132\\t$699\\t\\nThe\\treconciliation\\tof\\ttaxes\\tat\\tthe\\tfederal\\tstatutory\\trate\\tto\\tour\\t(benefit\\tfrom)\\tprovision\\tfor\\tincome\\ttaxes\\tfor\\tthe\\tyears\\tended\\tDecember\\t31,\\t2023,\\n2022\\tand\\t2021\\twas\\tas\\tfollows\\t(in\\tmillions):\\nYear\\tEnded\\tDecember\\t31,\\n202320222021\\nTax\\tat\\tstatutory\\tfederal\\trate\\n$2,094\\t$2,881\\t$1,332\\t\\nState\\ttax,\\tnet\\tof\\tfederal\\tbenefit(372)51\\t6\\t\\nNondeductible\\texecutive\\tcompensation23\\t14\\t201\\t\\nExcess\\ttax\\tbenefits\\trelated\\tto\\tstock-based\\tcompensation(288)(745)(7,123)\\nNontaxable\\tmanufacturing\\tcredit(101)—\\t—\\t\\nForeign\\tincome\\trate\\tdifferential(816)(923)(668)\\nU.S.\\ttax\\tcredits(593)(276)(328)\\nGILTI\\tinclusion670\\t1,279\\t1,008\\t\\nUnrecognized\\ttax\\tbenefits183\\t252\\t28\\t\\nChange\\tin\\tvaluation\\tallowance(5,962)(1,532)6,165\\t\\nOther161\\t131\\t78\\t\\n(Benefit\\tfrom)\\tprovision\\tfor\\tincome\\ttaxes\\n$(5,001)$1,132\\t$699\\t\\nWe\\tmonitor\\tthe\\trealizability\\tof\\tour\\tdeferred\\ttax\\tassets\\ttaking\\tinto\\taccount\\tall\\trelevant\\tfactors\\tat\\teach\\treporting\\tperiod.\\tAs\\tof\\tDecember\\t31,\\t2023,\\nbased\\ton\\tthe\\trelevant\\tweight\\tof\\tpositive\\tand\\tnegative\\tevidence,\\tincluding\\tthe\\tamount\\tof\\tour\\ttaxable\\tincome\\tin\\trecent\\tyears\\twhich\\tis\\tobjective\\tand\\nverifiable,\\tand\\tconsideration\\tof\\tour\\texpected\\tfuture\\ttaxable\\tearnings,\\twe\\tconcluded\\tthat\\tit\\tis\\tmore\\tlikely\\tthan\\tnot\\tthat\\tour\\tU.S.\\tfederal\\tand\\tcertain\\tstate\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 86,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 40\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"deferred\\ttax\\tassets\\tare\\trealizable.\\tAs\\tsuch,\\twe\\treleased\\t$6.54\\tbillion\\tof\\tour\\tvaluation\\tallowance\\tassociated\\twith\\tthe\\tU.S.\\tfederal\\tand\\tstate\\tdeferred\\ttax\\nassets,\\twith\\tthe\\texception\\tof\\tour\\tCalifornia\\tdeferred\\ttax\\tassets.\\tWe\\tcontinue\\tto\\tmaintain\\ta\\tfull\\tvaluation\\tallowance\\tagainst\\tour\\tCalifornia\\tdeferred\\ttax\\nassets\\tas\\tof\\tDecember\\t31,\\t2023,\\tbecause\\twe\\tconcluded\\tthey\\tare\\tnot\\tmore\\tlikely\\tthan\\tnot\\tto\\tbe\\trealized\\tas\\twe\\texpect\\tour\\tCalifornia\\tdeferred\\ttax\\tassets\\ngeneration\\tin\\tfuture\\tyears\\tto\\texceed\\tour\\tability\\tto\\tuse\\tthese\\tdeferred\\ttax\\tassets.\\n84\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 86,\n        \"lines\": {\n          \"from\": 41,\n          \"to\": 45\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Deferred\\ttax\\tassets\\t(liabilities)\\tas\\tof\\tDecember\\t31,\\t2023\\tand\\t2022\\tconsisted\\tof\\tthe\\tfollowing\\t(in\\tmillions):\\nDecember\\t31,\\n2023\\nDecember\\t31,\\n2022\\nDeferred\\ttax\\tassets:\\nNet\\toperating\\tloss\\tcarry-forwards$2,826\\t$4,486\\t\\nResearch\\tand\\tdevelopment\\tcredits1,358\\t1,184\\t\\nOther\\ttax\\tcredits\\tand\\tattributes827\\t217\\t\\nDeferred\\trevenue1,035\\t751\\t\\nInventory\\tand\\twarranty\\treserves1,258\\t819\\t\\nStock-based\\tcompensation230\\t185\\t\\nOperating\\tlease\\tright-of-use\\tliabilities930\\t554\\t\\nCapitalized\\tresearch\\tand\\tdevelopment\\tcosts1,344\\t693\\t\\nDeferred\\tGILTI\\ttax\\tassets760\\t466\\t\\nAccruals\\tand\\tothers206\\t178\\t\\nTotal\\tdeferred\\ttax\\tassets\\n10,774\\t9,533\\t\\nValuation\\tallowance(892)(7,349)\\nDeferred\\ttax\\tassets,\\tnet\\tof\\tvaluation\\tallowance\\n9,882\\t2,184\\t\\nDeferred\\ttax\\tliabilities:\\nDepreciation\\tand\\tamortization(2,122)(1,178)\\nInvestment\\tin\\tcertain\\tfinancing\\tfunds(133)(238)\\nOperating\\tlease\\tright-of-use\\tassets(859)(506)\\nOther(116)(15)\\nTotal\\tdeferred\\ttax\\tliabilities\\n(3,230)(1,937)\\nDeferred\\ttax\\tassets\\t(liabilities),\\tnet\\tof\\tvaluation\\tallowance\\n$6,652\\t$247\\t\\nAs\\tof\\tDecember\\t31,\\t2023,\\twe\\tmaintained\\tvaluation\\tallowances\\tof\\t$892\\tmillion\\tfor\\tdeferred\\ttax\\tassets\\tthat\\tare\\tnot\\tmore\\tlikely\\tthan\\tnot\\tto\\tbe\\nrealized,\\twhich\\tprimarily\\tincluded\\tdeferred\\ttax\\tassets\\tin\\tthe\\tstate\\tof\\tCalifornia\\tand\\tcertain\\tforeign\\toperating\\tlosses.\\tThe\\tvaluation\\tallowance\\ton\\tour\\tnet\\ndeferred\\ttax\\tassets\\tdecreased\\tby\\t$6.46\\tbillion\\tand\\t$1.73\\tbillion\\tduring\\tthe\\tyears\\tended\\tDecember\\t31,\\t2023\\tand\\t2022,\\trespectively,\\tand\\tincreased\\tby\\n$6.14\\tbillion\\tduring\\tthe\\tyear\\tended\\tDecember\\t31,\\t2021.\\tThe\\tvaluation\\tallowance\\tdecrease\\tduring\\tthe\\tyear\\tended\\tDecember\\t31,\\t2023\\twas\\tprimarily\\tdue\\nto\\tthe\\trelease\\tof\\tour\\tvaluation\\tallowance\\twith\\trespect\\tto\\tour\\tU.S.\\tfederal\\tand\\tcertain\\tstate\\tdeferred\\ttax\\tassets.\\tThe\\tchanges\\tin\\tvaluation\\tallowances\\nduring\\tthe\\tyears\\tended\\tDecember\\t31,\\t2022\\tand\\t2021\\twere\\tprimarily\\tdue\\tto\\tchanges\\tin\\tour\\tU.S.\\tdeferred\\ttax\\tassets\\tand\\tliabilities\\tin\\tthe\\trespective\\tyear.\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 87,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 36\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Among\\tour\\tdeferred\\ttax\\tassets\\tin\\tforeign\\tjurisdictions,\\twe\\trecorded\\ta\\tvaluation\\tallowance\\ton\\tcertain\\tforeign\\tnet\\toperating\\tlosses\\tthat\\tare\\tnot\\tmore\\tlikely\\nthan\\tnot\\tto\\tbe\\trealized.\\tThe\\tremainder\\tof\\tour\\tforeign\\tdeferred\\ttax\\tassets\\tare\\tmore\\tlikely\\tthan\\tnot\\tto\\tbe\\trealized\\tgiven\\tthe\\texpectation\\tof\\tfuture\\tearnings\\nin\\tthese\\tjurisdictions.\\nAs\\tof\\tDecember\\t31,\\t2023,\\twe\\thad\\t$10.31\\tbillion\\tof\\tfederal\\tand\\t$10.36\\tbillion\\tof\\tstate\\tnet\\toperating\\tloss\\tcarry-forwards\\tavailable\\tto\\toffset\\tfuture\\ntaxable\\tincome,\\tsome\\tof\\twhich,\\tif\\tnot\\tutilized,\\twill\\tbegin\\tto\\texpire\\tin\\t2024\\tfor\\tfederal\\tand\\tstate\\tpurposes.\\tFederal\\tand\\tstate\\tlaws\\tcan\\timpose\\tsubstantial\\nrestrictions\\ton\\tthe\\tutilization\\tof\\tnet\\toperating\\tloss\\tand\\ttax\\tcredit\\tcarry-forwards\\tin\\tthe\\tevent\\tof\\tan\\t“ownership\\tchange,”\\tas\\tdefined\\tin\\tSection\\t382\\tof\\tthe\\nInternal\\tRevenue\\tCode.\\tWe\\thave\\tdetermined\\tthat\\tno\\tsignificant\\tlimitation\\twould\\tbe\\tplaced\\ton\\tthe\\tutilization\\tof\\tour\\tnet\\toperating\\tloss\\tand\\ttax\\tcredit\\tcarry-\\nforwards\\tdue\\tto\\tprior\\townership\\tchanges\\tor\\texpirations.\\nAs\\tof\\tDecember\\t31,\\t2023,\\twe\\thad\\tfederal\\tresearch\\tand\\tdevelopment\\ttax\\tcredits\\tof\\t$1.10\\tbillion,\\tfederal\\trenewable\\tenergy\\ttax\\tcredits\\tof\\n$605\\tmillion,\\tand\\tstate\\tresearch\\tand\\tdevelopment\\ttax\\tcredits\\tof\\t$923\\tmillion.\\tMost\\tof\\tour\\tstate\\tresearch\\tand\\tdevelopment\\ttax\\tcredits\\twere\\tin\\tthe\\tstate\\tof\\nCalifornia.\\tIf\\tnot\\tutilized,\\tsome\\tof\\tthe\\tfederal\\ttax\\tcredits\\tmay\\texpire\\tin\\tvarious\\tamounts\\tbeginning\\tin\\t2036.\\tHowever,\\tCalifornia\\tresearch\\tand\\tdevelopment\\ntax\\tcredits\\tcan\\tbe\\tcarried\\tforward\\tindefinitely.\\n85\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 87,\n        \"lines\": {\n          \"from\": 37,\n          \"to\": 49\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"The\\tlocal\\tgovernment\\tof\\tShanghai\\tgranted\\ta\\tbeneficial\\tcorporate\\tincome\\ttax\\trate\\tof\\t15%\\tto\\tcertain\\teligible\\tenterprises,\\tcompared\\tto\\tthe\\t25%\\nstatutory\\tcorporate\\tincome\\ttax\\trate\\tin\\tChina.\\tOur\\tGigafactory\\tShanghai\\tsubsidiary\\twas\\tgranted\\tthis\\tbeneficial\\tincome\\ttax\\trate\\tof\\t15%\\tfor\\t2019\\tthrough\\n2023.\\tStarting\\tin\\t2024,\\tGigafactory\\tShanghai\\tis\\tsubject\\tto\\t25%\\tstatutory\\tcorporate\\tincome\\ttax\\trate\\tin\\tChina.\\nAs\\tof\\tDecember\\t31,\\t2023,\\twe\\tintend\\tto\\tindefinitely\\treinvest\\tour\\tforeign\\tearnings\\tand\\tcash\\tunless\\tsuch\\trepatriation\\tresults\\tin\\tno\\tor\\tminimal\\ttax\\tcosts.\\nWe\\thave\\trecorded\\tthe\\ttaxes\\tassociated\\twith\\tthe\\tforeign\\tearnings\\twe\\tintend\\tto\\trepatriate\\tin\\tthe\\tfuture.\\tFor\\tthe\\tearnings\\twe\\tintend\\tto\\tindefinitely\\treinvest,\\nno\\tdeferred\\ttax\\tliabilities\\tfor\\tforeign\\twithholding\\tor\\tother\\ttaxes\\thave\\tbeen\\trecorded.\\tThe\\testimated\\tamount\\tof\\tsuch\\tunrecognized\\twithholding\\ttax\\tliability\\nassociated\\twith\\tthe\\tindefinitely\\treinvested\\tearnings\\tis\\tapproximately\\t$245\\tmillion.\\nUncertain\\tTax\\tPositions\\nThe\\tchanges\\tto\\tour\\tgross\\tunrecognized\\ttax\\tbenefits\\twere\\tas\\tfollows\\t(in\\tmillions):\\nDecember\\t31,\\t2020$380\\t\\nIncreases\\tin\\tbalances\\trelated\\tto\\tprior\\tyear\\ttax\\tpositions117\\t\\nDecreases\\tin\\tbalances\\trelated\\tto\\tprior\\tyear\\ttax\\tpositions(90)\\nIncreases\\tin\\tbalances\\trelated\\tto\\tcurrent\\tyear\\ttax\\tpositions124\\t\\nDecember\\t31,\\t2021\\n531\\t\\nIncreases\\tin\\tbalances\\trelated\\tto\\tprior\\tyear\\ttax\\tpositions136\\t\\nDecreases\\tin\\tbalances\\trelated\\tto\\tprior\\tyear\\ttax\\tpositions(12)\\nIncreases\\tin\\tbalances\\trelated\\tto\\tcurrent\\tyear\\ttax\\tpositions222\\t\\nDecreases\\tin\\tbalances\\trelated\\tto\\texpiration\\tof\\tthe\\tstatute\\tof\\tlimitations(7)\\nDecember\\t31,\\t2022\\n870\\t\\nIncreases\\tin\\tbalances\\trelated\\tto\\tprior\\tyear\\ttax\\tpositions59\\t\\nDecreases\\trelated\\tto\\tsettlement\\twith\\ttax\\tauthorities(6)\\nIncreases\\tin\\tbalances\\trelated\\tto\\tcurrent\\tyear\\ttax\\tpositions255\\t\\nDecreases\\tin\\tbalances\\trelated\\tto\\texpiration\\tof\\tthe\\tstatute\\tof\\tlimitations(4)\\nDecember\\t31,\\t2023\\n$1,174\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 88,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 27\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"December\\t31,\\t2023\\n$1,174\\t\\nWe\\tinclude\\tinterest\\tand\\tpenalties\\trelated\\tto\\tunrecognized\\ttax\\tbenefits\\tin\\tincome\\ttax\\texpense.\\tWe\\trecognized\\tnet\\tinterest\\tand\\tpenalties\\trelated\\tto\\nunrecognized\\ttax\\tbenefits\\tin\\tprovision\\tfor\\tincome\\ttaxes\\tline\\tof\\tour\\tconsolidated\\tstatements\\tof\\toperations\\tof\\t$17\\tmillion,\\t$27\\tmillion\\tand\\t$4\\tmillion\\tfor\\tthe\\nyears\\tended\\tDecember\\t31,\\t2023,\\t2022\\tand\\t2021,\\trespectively.\\tAs\\tof\\tDecember\\t31,\\t2023,\\tand\\t2022,\\twe\\thave\\taccrued\\t$47\\tmillion\\tand\\t$31\\tmillion,\\nrespectively,\\trelated\\tto\\tinterest\\tand\\tpenalties\\ton\\tour\\tunrecognized\\ttax\\tbenefits.\\tUnrecognized\\ttax\\tbenefits\\tof\\t$901\\tmillion,\\tif\\trecognized,\\twould\\taffect\\tour\\neffective\\ttax\\trate.\\nWe\\tfile\\tincome\\ttax\\treturns\\tin\\tthe\\tU.S.\\tand\\tvarious\\tstate\\tand\\tforeign\\tjurisdictions.\\tWe\\tare\\tcurrently\\tunder\\texamination\\tby\\tthe\\tInternal\\tRevenue\\nService\\t(“IRS”)\\tfor\\tthe\\tyears\\t2015\\tto\\t2018.\\tAdditional\\ttax\\tyears\\twithin\\tthe\\tperiods\\t2004\\tto\\t2014\\tand\\t2019\\tto\\t2022\\tremain\\tsubject\\tto\\texamination\\tfor\\nfederal\\tincome\\ttax\\tpurposes.\\tAll\\tnet\\toperating\\tlosses\\tand\\ttax\\tcredits\\tgenerated\\tto\\tdate\\tare\\tsubject\\tto\\tadjustment\\tfor\\tU.S.\\tfederal\\tand\\tstate\\tincome\\ttax\\npurposes.\\tOur\\treturns\\tfor\\t2004\\tand\\tsubsequent\\ttax\\tyears\\tremain\\tsubject\\tto\\texamination\\tin\\tU.S.\\tstate\\tand\\tforeign\\tjurisdictions.\\nGiven\\tthe\\tuncertainty\\tin\\ttiming\\tand\\toutcome\\tof\\tour\\ttax\\texaminations,\\tan\\testimate\\tof\\tthe\\trange\\tof\\tthe\\treasonably\\tpossible\\tchange\\tin\\tgross\\nunrecognized\\ttax\\tbenefits\\twithin\\ttwelve\\tmonths\\tcannot\\tbe\\tmade\\tat\\tthis\\ttime.\\nNote\\t15\\t–\\tCommitments\\tand\\tContingencies\\nOperating\\tLease\\tArrangement\\tin\\tBuffalo,\\tNew\\tYork\\nWe\\thave\\tan\\toperating\\tlease\\tarrangement\\tthrough\\tthe\\tResearch\\tFoundation\\tfor\\tthe\\tSUNY\\tFoundation\\twith\\trespect\\tto\\tGigafactory\\tNew\\tYork.\\tUnder\\nthe\\tlease\\tand\\ta\\trelated\\tresearch\\tand\\tdevelopment\\tagreement,\\twe\\tare\\tcontinuing\\tto\\tfurther\\tdevelop\\tthe\\tfacility.\\n86\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 88,\n        \"lines\": {\n          \"from\": 26,\n          \"to\": 43\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Under\\tthis\\tagreement,\\twe\\tare\\tobligated\\tto,\\tamong\\tother\\tthings,\\tmeet\\temployment\\ttargets\\tas\\twell\\tas\\tspecified\\tminimum\\tnumbers\\tof\\tpersonnel\\tin\\nthe\\tState\\tof\\tNew\\tYork\\tand\\tin\\tBuffalo,\\tNew\\tYork\\tand\\tspend\\tor\\tincur\\t$5.00\\tbillion\\tin\\tcombined\\tcapital,\\toperational\\texpenses,\\tcosts\\tof\\tgoods\\tsold\\tand\\tother\\ncosts\\tin\\tthe\\tState\\tof\\tNew\\tYork\\tduring\\tthe\\t10-year\\tperiod\\tbeginning\\tApril\\t30,\\t2018.\\tOn\\tan\\tannual\\tbasis\\tduring\\tthe\\tinitial\\tlease\\tterm,\\tas\\tmeasured\\ton\\teach\\nanniversary\\tof\\tsuch\\tdate,\\tif\\twe\\tfail\\tto\\tmeet\\tthese\\tspecified\\tinvestment\\tand\\tjob\\tcreation\\trequirements,\\tthen\\twe\\twould\\tbe\\tobligated\\tto\\tpay\\ta\\t$41\\tmillion\\n“program\\tpayment”\\tto\\tthe\\tSUNY\\tFoundation\\tfor\\teach\\tyear\\tthat\\twe\\tfail\\tto\\tmeet\\tthese\\trequirements.\\tFurthermore,\\tif\\tthe\\tarrangement\\tis\\tterminated\\tdue\\tto\\na\\tmaterial\\tbreach\\tby\\tus,\\tthen\\tadditional\\tamounts\\tmay\\tbecome\\tpayable\\tby\\tus.\\nIn\\t2021,\\tan\\tamendment\\twas\\texecuted\\tto\\textend\\tour\\toverall\\tagreement\\tto\\tspend\\tor\\tincur\\t$5.00\\tbillion\\tin\\tcombined\\tcapital,\\toperational\\texpenses,\\ncosts\\tof\\tgoods\\tsold\\tand\\tother\\tcosts\\tin\\tthe\\tState\\tof\\tNew\\tYork\\tthrough\\tDecember\\t31,\\t2029.\\tOn\\tFebruary\\t1,\\t2022,\\twe\\treported\\tto\\tthe\\tState\\tof\\tNew\\tYork\\tthat\\nwe\\thad\\tmet\\tand\\texceeded\\tour\\tannual\\trequirements\\tfor\\tjobs\\tand\\tinvestment\\tin\\tBuffalo\\tand\\tNew\\tYork\\tState.\\tAs\\tof\\tDecember\\t31,\\t2023,\\twe\\thave\\tmet\\tand\\nexpect\\tto\\tmeet\\tthe\\trequirements\\tunder\\tthis\\tarrangement\\tbased\\ton\\tour\\tcurrent\\tand\\tanticipated\\tlevel\\tof\\toperations.\\tHowever,\\tif\\tour\\texpectations\\tas\\tto\\tthe\\ncosts\\tand\\ttimelines\\tof\\tour\\tinvestment\\tand\\toperations\\tat\\tBuffalo\\tprove\\tincorrect,\\twe\\tmay\\tincur\\tadditional\\texpenses\\tor\\tbe\\trequired\\tto\\tmake\\tsubstantial\\npayments\\tto\\tthe\\tSUNY\\tFoundation.\\nOperating\\tLease\\tArrangement\\tin\\tShanghai,\\tChina\\nWe\\thave\\tan\\toperating\\tlease\\tarrangement\\tfor\\tan\\tinitial\\tterm\\tof\\t50\\tyears\\twith\\tthe\\tlocal\\tgovernment\\tof\\tShanghai\\tfor\\tland\\tuse\\trights\\twhere\\twe\\thave\\nbeen\\tconstructing\\tGigafactory\\tShanghai.\\tUnder\\tthe\\tterms\\tof\\tthe\\tarrangement,\\twe\\tare\\trequired\\tto\\tspend\\tRMB\\t14.08\\tbillion\\tin\\tcapital\\texpenditures\\tby\\tthe\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 89,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 15\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"end\\tof\\t2023,\\twhich\\thas\\tbeen\\tachieved\\tin\\t2023,\\tand\\tto\\tgenerate\\tRMB\\t2.23\\tbillion\\tof\\tannual\\ttax\\trevenues\\tstarting\\tat\\tthe\\tend\\tof\\t2023.\\tAs\\tof\\tDecember\\t31,\\n2023,\\twe\\thave\\tmet\\tand\\texpect\\tto\\tmeet\\tthe\\ttax\\trevenue\\trequirements\\tbased\\ton\\tour\\tcurrent\\tlevel\\tof\\tspend\\tand\\tsales.\\nLegal\\tProceedings\\nLitigation\\tRelating\\tto\\t2018\\tCEO\\tPerformance\\tAward\\nOn\\tJune\\t4,\\t2018,\\ta\\tpurported\\tTesla\\tstockholder\\tfiled\\ta\\tputative\\tclass\\tand\\tderivative\\taction\\tin\\tthe\\tDelaware\\tCourt\\tof\\tChancery\\tagainst\\tElon\\tMusk\\tand\\nthe\\tmembers\\tof\\tTesla’s\\tboard\\tof\\tdirectors\\tas\\tthen\\tconstituted,\\talleging\\tcorporate\\twaste,\\tunjust\\tenrichment\\tand\\tthat\\tsuch\\tboard\\tmembers\\tbreached\\ttheir\\nfiduciary\\tduties\\tby\\tapproving\\tthe\\tstock-based\\tcompensation\\tplan\\tawarded\\tto\\tElon\\tMusk\\tin\\t2018.\\tTrial\\twas\\theld\\tNovember\\t14-18,\\t2022.\\tPost-trial\\tbriefing\\nand\\targument\\tare\\tnow\\tcomplete.\\nLitigation\\tRelated\\tto\\tDirectors’\\tCompensation\\nOn\\tJune\\t17,\\t2020,\\ta\\tpurported\\tTesla\\tstockholder\\tfiled\\ta\\tderivative\\taction\\tin\\tthe\\tDelaware\\tCourt\\tof\\tChancery,\\tpurportedly\\ton\\tbehalf\\tof\\tTesla,\\tagainst\\ncertain\\tof\\tTesla’s\\tcurrent\\tand\\tformer\\tdirectors\\tregarding\\tcompensation\\tawards\\tgranted\\tto\\tTesla’s\\tdirectors,\\tother\\tthan\\tElon\\tMusk,\\tbetween\\t2017\\tand\\n2020.\\tThe\\tsuit\\tasserts\\tclaims\\tfor\\tbreach\\tof\\tfiduciary\\tduty\\tand\\tunjust\\tenrichment\\tand\\tseeks\\tdeclaratory\\tand\\tinjunctive\\trelief,\\tunspecified\\tdamages\\tand\\nother\\trelief.\\tDefendants\\tfiled\\ttheir\\tanswer\\ton\\tSeptember\\t17,\\t2020.\\nOn\\tJuly\\t14,\\t2023,\\tthe\\tparties\\tfiled\\ta\\tStipulation\\tand\\tAgreement\\tof\\tCompromise\\tand\\tSettlement,\\twhich\\tdoes\\tnot\\tinvolve\\tan\\tadmission\\tof\\tany\\nwrongdoing\\tby\\tany\\tparty.\\tIf\\tthe\\tsettlement\\tis\\tapproved\\tby\\tthe\\tCourt,\\tthis\\taction\\twill\\tbe\\tfully\\tsettled\\tand\\tdismissed\\twith\\tprejudice.\\tPursuant\\tto\\tthe\\tterms\\tof\\nthe\\tagreement,\\tTesla\\tprovided\\tnotice\\tof\\tthe\\tproposed\\tsettlement\\tto\\tstockholders\\tof\\trecord\\tas\\tof\\tJuly\\t14,\\t2023.\\tThe\\tCourt\\theld\\ta\\thearing\\tregarding\\tthe\\nsettlement\\ton\\tOctober\\t13,\\t2023,\\tafter\\twhich\\tit\\ttook\\tthe\\tsettlement\\tand\\tplaintiff\\tcounsels’\\tfee\\trequest\\tunder\\tadvisement.\\tThe\\tsettlement\\tis\\tnot\\texpected\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 89,\n        \"lines\": {\n          \"from\": 16,\n          \"to\": 32\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"to\\thave\\tan\\tadverse\\timpact\\ton\\tour\\tresults\\tof\\toperations,\\tcash\\tflows\\tor\\tfinancial\\tposition.\\nLitigation\\tRelating\\tto\\tPotential\\tGoing\\tPrivate\\tTransaction\\nBetween\\tAugust\\t10,\\t2018\\tand\\tSeptember\\t6,\\t2018,\\tnine\\tpurported\\tstockholder\\tclass\\tactions\\twere\\tfiled\\tagainst\\tTesla\\tand\\tElon\\tMusk\\tin\\tconnection\\nwith\\tMr.\\tMusk’s\\tAugust\\t7,\\t2018\\tTwitter\\tpost\\tthat\\the\\twas\\tconsidering\\ttaking\\tTesla\\tprivate.\\tOn\\tJanuary\\t16,\\t2019,\\tPlaintiffs\\tfiled\\ttheir\\tconsolidated\\tcomplaint\\nin\\tthe\\tUnited\\tStates\\tDistrict\\tCourt\\tfor\\tthe\\tNorthern\\tDistrict\\tof\\tCalifornia\\tand\\tadded\\tas\\tdefendants\\tthe\\tmembers\\tof\\tTesla’s\\tboard\\tof\\tdirectors.\\tThe\\nconsolidated\\tcomplaint\\tasserts\\tclaims\\tfor\\tviolations\\tof\\tthe\\tfederal\\tsecurities\\tlaws\\tand\\tseeks\\tunspecified\\tdamages\\tand\\tother\\trelief.\\tThe\\tparties\\tstipulated\\nto\\tcertification\\tof\\ta\\tclass\\tof\\tstockholders,\\twhich\\tthe\\tcourt\\tgranted\\ton\\tNovember\\t25,\\t2020.\\tTrial\\tstarted\\ton\\tJanuary\\t17,\\t2023,\\tand\\ton\\tFebruary\\t3,\\t2023,\\ta\\njury\\trendered\\ta\\tverdict\\tin\\tfavor\\tof\\tthe\\tdefendants\\ton\\tall\\tcounts.\\tAfter\\ttrial,\\tplaintiffs\\tfiled\\ta\\tmotion\\tfor\\tjudgment\\tas\\ta\\tmatter\\tof\\tlaw\\tand\\ta\\tmotion\\tfor\\tnew\\ntrial,\\twhich\\tthe\\tCourt\\tdenied\\tand\\tjudgement\\twas\\tentered\\tin\\tfavor\\tof\\tdefendants\\ton\\tJuly\\t11,\\t2023.\\tOn\\tJuly\\t14,\\t2023,\\tplaintiffs\\tfiled\\ta\\tnotice\\tof\\tappeal.\\n87\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 89,\n        \"lines\": {\n          \"from\": 33,\n          \"to\": 42\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Between\\tOctober\\t17,\\t2018\\tand\\tMarch\\t8,\\t2021,\\tseven\\tderivative\\tlawsuits\\twere\\tfiled\\tin\\tthe\\tDelaware\\tCourt\\tof\\tChancery,\\tpurportedly\\ton\\tbehalf\\tof\\nTesla,\\tagainst\\tMr.\\tMusk\\tand\\tthe\\tmembers\\tof\\tTesla’s\\tboard\\tof\\tdirectors,\\tas\\tconstituted\\tat\\trelevant\\ttimes,\\tin\\trelation\\tto\\tstatements\\tmade\\tand\\tactions\\nconnected\\tto\\ta\\tpotential\\tgoing\\tprivate\\ttransaction,\\twith\\tcertain\\tof\\tthe\\tlawsuits\\tchallenging\\tadditional\\tTwitter\\tposts\\tby\\tMr.\\tMusk,\\tamong\\tother\\tthings.\\tFive\\nof\\tthose\\tactions\\twere\\tconsolidated,\\tand\\tall\\tseven\\tactions\\thave\\tbeen\\tstayed\\tpending\\tresolution\\tof\\tthe\\tappeal\\tin\\tthe\\tabove-referenced\\tconsolidated\\npurported\\tstockholder\\tclass\\taction.\\tIn\\taddition\\tto\\tthese\\tcases,\\ttwo\\tderivative\\tlawsuits\\twere\\tfiled\\ton\\tOctober\\t25,\\t2018\\tand\\tFebruary\\t11,\\t2019\\tin\\tthe\\tU.S.\\nDistrict\\tCourt\\tfor\\tthe\\tDistrict\\tof\\tDelaware,\\tpurportedly\\ton\\tbehalf\\tof\\tTesla,\\tagainst\\tMr.\\tMusk\\tand\\tthe\\tmembers\\tof\\tthe\\tTesla\\tboard\\tof\\tdirectors\\tas\\tthen\\nconstituted.\\tThose\\tcases\\thave\\talso\\tbeen\\tconsolidated\\tand\\tstayed\\tpending\\tresolution\\tof\\tthe\\tappeal\\tin\\tthe\\tabove-referenced\\tconsolidated\\tpurported\\nstockholder\\tclass\\taction.\\nOn\\tOctober\\t21,\\t2022,\\ta\\tlawsuit\\twas\\tfiled\\tin\\tthe\\tDelaware\\tCourt\\tof\\tChancery\\tby\\ta\\tpurported\\tshareholder\\tof\\tTesla\\talleging,\\tamong\\tother\\tthings,\\tthat\\nboard\\tmembers\\tbreached\\ttheir\\tfiduciary\\tduties\\tin\\tconnection\\twith\\ttheir\\toversight\\tof\\tthe\\tCompany’s\\t2018\\tsettlement\\twith\\tthe\\tSEC,\\tas\\tamended.\\tAmong\\nother\\tthings,\\tthe\\tplaintiff\\tseeks\\treforms\\tto\\tthe\\tCompany’s\\tcorporate\\tgovernance\\tand\\tinternal\\tprocedures,\\tunspecified\\tdamages,\\tand\\tattorneys’\\tfees.\\tThe\\nparties\\treached\\tan\\tagreement\\tto\\tstay\\tthe\\tcase\\tuntil\\tMarch\\t5,\\t2024.\\nOn\\tNovember\\t15,\\t2021,\\tJPMorgan\\tChase\\tBank\\t(“JP\\tMorgan”)\\tfiled\\ta\\tlawsuit\\tagainst\\tTesla\\tin\\tthe\\tSouthern\\tDistrict\\tof\\tNew\\tYork\\talleging\\tbreach\\tof\\ta\\nstock\\twarrant\\tagreement\\tthat\\twas\\tentered\\tinto\\tas\\tpart\\tof\\ta\\tconvertible\\tnotes\\toffering\\tin\\t2014.\\tIn\\t2018,\\tJP\\tMorgan\\tinformed\\tTesla\\tthat\\tit\\thad\\tadjusted\\tthe\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 90,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 14\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"strike\\tprice\\tbased\\tupon\\tMr.\\tMusk’s\\tAugust\\t7,\\t2018\\tTwitter\\tpost\\tthat\\the\\twas\\tconsidering\\ttaking\\tTesla\\tprivate.\\tTesla\\tdisputed\\tJP\\tMorgan’s\\tadjustment\\tas\\ta\\nviolation\\tof\\tthe\\tparties’\\tagreement.\\tIn\\t2021,\\tTesla\\tdelivered\\tshares\\tto\\tJP\\tMorgan\\tper\\tthe\\tagreement,\\twhich\\tthey\\tduly\\taccepted.\\tJP\\tMorgan\\tnow\\talleges\\nthat\\tit\\tis\\towed\\tapproximately\\t$162\\tmillion\\tas\\tthe\\tvalue\\tof\\tadditional\\tshares\\tthat\\tit\\tclaims\\tshould\\thave\\tbeen\\tdelivered\\tas\\ta\\tresult\\tof\\tthe\\tadjustment\\tto\\tthe\\nstrike\\tprice\\tin\\t2018.\\tOn\\tJanuary\\t24,\\t2022,\\tTesla\\tfiled\\tmultiple\\tcounterclaims\\tas\\tpart\\tof\\tits\\tanswer\\tto\\tthe\\tunderlying\\tlawsuit,\\tasserting\\tamong\\tother\\tpoints\\nthat\\tJP\\tMorgan\\tshould\\thave\\tterminated\\tthe\\tstock\\twarrant\\tagreement\\tin\\t2018\\trather\\tthan\\tmake\\tan\\tadjustment\\tto\\tthe\\tstrike\\tprice\\tthat\\tit\\tshould\\thave\\nknown\\twould\\tlead\\tto\\ta\\tcommercially\\tunreasonable\\tresult.\\tTesla\\tbelieves\\tthat\\tthe\\tadjustments\\tmade\\tby\\tJP\\tMorgan\\twere\\tneither\\tproper\\tnor\\tcommercially\\nreasonable,\\tas\\trequired\\tunder\\tthe\\tstock\\twarrant\\tagreements.\\tJP\\tMorgan\\tfiled\\ta\\tmotion\\tfor\\tjudgment\\ton\\tthe\\tpleadings,\\twhich\\tTesla\\topposed,\\tand\\tthat\\nmotion\\tis\\tcurrently\\tpending\\tbefore\\tthe\\tCourt.\\nLitigation\\tand\\tInvestigations\\tRelating\\tto\\tAlleged\\tDiscrimination\\tand\\tHarassment\\nOn\\tOctober\\t4,\\t2021,\\tin\\ta\\tcase\\tcaptioned\\tDiaz\\tv.\\tTesla,\\ta\\tjury\\tin\\tthe\\tNorthern\\tDistrict\\tof\\tCalifornia\\treturned\\ta\\tverdict\\tagainst\\tTesla\\ton\\tclaims\\tby\\ta\\nformer\\tcontingent\\tworker\\tthat\\the\\twas\\tsubjected\\tto\\trace\\tdiscrimination\\twhile\\tassigned\\tto\\twork\\tat\\tTesla’s\\tFremont\\tFactory\\tfrom\\t2015-2016.\\tA\\tretrial\\twas\\nheld\\tstarting\\ton\\tMarch\\t27,\\t2023,\\tafter\\twhich\\ta\\tjury\\treturned\\ta\\tverdict\\tof\\t$3,175,000.\\tAs\\ta\\tresult,\\tthe\\tdamages\\tawarded\\tagainst\\tTesla\\twere\\treduced\\tfrom\\nan\\tinitial\\t$136.9\\tmillion\\t(October\\t4,\\t2021)\\tdown\\tto\\t$15\\tmillion\\t(April\\t13,\\t2022),\\tand\\tthen\\tfurther\\tdown\\tto\\t$3.175\\tmillion\\t(April\\t3,\\t2023).\\tOn\\tNovember\\t2,\\n2023,\\tthe\\tplaintiff\\tfiled\\ta\\tnotice\\tof\\tappeal,\\tand\\ton\\tNovember\\t16,\\t2023,\\tTesla\\tfiled\\ta\\tnotice\\tof\\tcross\\tappeal.\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 90,\n        \"lines\": {\n          \"from\": 15,\n          \"to\": 28\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"On\\tFebruary\\t9,\\t2022,\\tshortly\\tafter\\tthe\\tfirst\\tDiaz\\tjury\\tverdict,\\tthe\\tCalifornia\\tCivil\\tRights\\tDepartment\\t(“CRD,”\\tformerly\\t“DFEH”)\\tfiled\\ta\\tcivil\\tcomplaint\\nagainst\\tTesla\\tin\\tAlameda\\tCounty,\\tCalifornia\\tSuperior\\tCourt,\\talleging\\tsystemic\\trace\\tdiscrimination,\\thostile\\twork\\tenvironment\\tand\\tpay\\tequity\\tclaims,\\tamong\\nothers.\\tCRD’s\\tamended\\tcomplaint\\tseeks\\tmonetary\\tdamages\\tand\\tinjunctive\\trelief.\\tOn\\tSeptember\\t22,\\t2022,\\tTesla\\tfiled\\ta\\tcross\\tcomplaint\\tagainst\\tCRD,\\nalleging\\tthat\\tit\\tviolated\\tthe\\tAdministrative\\tProcedures\\tAct\\tby\\tfailing\\tto\\tfollow\\tstatutory\\tpre-requisites\\tprior\\tto\\tfiling\\tsuit\\tand\\tthat\\tcross\\tcomplaint\\twas\\nsubject\\tto\\ta\\tsustained\\tdemurrer,\\twhich\\tTesla\\tlater\\tamended\\tand\\trefiled.\\tThe\\tcase\\tis\\tcurrently\\tin\\tdiscovery.\\nAdditionally,\\ton\\tJune\\t1,\\t2022\\tthe\\tEqual\\tEmployment\\tOpportunity\\tCommission\\t(“EEOC”)\\tissued\\ta\\tcause\\tfinding\\tagainst\\tTesla\\tthat\\tclosely\\tparallels\\tthe\\nCRD’s\\tallegations.\\tOn\\tSeptember\\t28,\\t2023,\\tthe\\tEEOC\\tfiled\\ta\\tcivil\\tcomplaint\\tagainst\\tTesla\\tin\\tthe\\tUnited\\tStates\\tDistrict\\tCourt\\tfor\\tthe\\tNorthern\\tDistrict\\tof\\nCalifornia\\tasserting\\tclaims\\tfor\\trace\\tharassment\\tand\\tretaliation\\tand\\tseeking,\\tamong\\tother\\tthings,\\tmonetary\\tand\\tinjunctive\\trelief.\\tOn\\tDecember\\t18,\\t2023,\\nTesla\\tfiled\\ta\\tmotion\\tto\\tstay\\tthe\\tcase.\\tSeparately,\\ton\\tDecember\\t26,\\t2023,\\tTesla\\tfiled\\ta\\tmotion\\tto\\tdismiss\\tthe\\tcase.\\nOn\\tJune\\t16,\\t2022,\\ttwo\\tTesla\\tstockholders\\tfiled\\tseparate\\tderivative\\tactions\\tin\\tthe\\tU.S.\\tDistrict\\tCourt\\tfor\\tthe\\tWestern\\tDistrict\\tof\\tTexas,\\tpurportedly\\ton\\nbehalf\\tof\\tTesla,\\tagainst\\tcertain\\tof\\tTesla’s\\tcurrent\\tand\\tformer\\tdirectors.\\tBoth\\tsuits\\tassert\\tclaims\\tfor\\tbreach\\tof\\tfiduciary\\tduty,\\tunjust\\tenrichment,\\tand\\nviolation\\tof\\tthe\\tfederal\\tsecurities\\tlaws\\tin\\tconnection\\twith\\talleged\\trace\\tand\\tgender\\tdiscrimination\\tand\\tsexual\\tharassment.\\tAmong\\tother\\tthings,\\tplaintiffs\\nseek\\tdeclaratory\\tand\\tinjunctive\\trelief,\\tunspecified\\tdamages\\tpayable\\tto\\tTesla,\\tand\\tattorneys’\\tfees.\\tOn\\tJuly\\t22,\\t2022,\\tthe\\tCourt\\tconsolidated\\tthe\\ttwo\\tcases\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 90,\n        \"lines\": {\n          \"from\": 29,\n          \"to\": 41\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"and\\ton\\tSeptember\\t6,\\t2022,\\tplaintiffs\\tfiled\\ta\\tconsolidated\\tcomplaint.\\tOn\\tNovember\\t7,\\t2022,\\tthe\\tdefendants\\tfiled\\ta\\tmotion\\tto\\tdismiss\\tthe\\tcase\\tand\\ton\\nSeptember\\t15,\\t2023,\\tthe\\tCourt\\tdismissed\\tthe\\taction\\tbut\\tgranted\\tplaintiffs\\tleave\\tto\\tfile\\tan\\tamended\\tcomplaint.\\tOn\\tNovember\\t2,\\t2023,\\tplaintiff\\tfiled\\tan\\namended\\tcomplaint\\tpurportedly\\ton\\tbehalf\\tof\\tTesla,\\tagainst\\tElon\\tMusk.\\tOn\\tDecember\\t19,\\t2023,\\tthe\\tdefendants\\tmoved\\tto\\tdismiss\\tthe\\tamended\\tcomplaint.\\n88\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 90,\n        \"lines\": {\n          \"from\": 42,\n          \"to\": 45\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Other\\tLitigation\\tRelated\\tto\\tOur\\tProducts\\tand\\tServices\\nWe\\tare\\talso\\tsubject\\tto\\tvarious\\tlawsuits\\tthat\\tseek\\tmonetary\\tand\\tother\\tinjunctive\\trelief.\\tThese\\tlawsuits\\tinclude\\tproposed\\tclass\\tactions\\tand\\tother\\nconsumer\\tclaims\\tthat\\tallege,\\tamong\\tother\\tthings,\\tpurported\\tdefects\\tand\\tmisrepresentations\\trelated\\tto\\tour\\tproducts\\tand\\tservices.\\tFor\\texample,\\ton\\nSeptember\\t14,\\t2022,\\ta\\tproposed\\tclass\\taction\\twas\\tfiled\\tagainst\\tTesla,\\tInc.\\tand\\trelated\\tentities\\tin\\tthe\\tU.S.\\tDistrict\\tCourt\\tfor\\tthe\\tNorthern\\tDistrict\\tof\\nCalifornia,\\talleging\\tvarious\\tclaims\\tabout\\tthe\\tCompany’s\\tdriver\\tassistance\\ttechnology\\tsystems\\tunder\\tstate\\tand\\tfederal\\tlaw.\\tThis\\tcase\\twas\\tlater\\nconsolidated\\twith\\tseveral\\tother\\tproposed\\tclass\\tactions,\\tand\\ta\\tConsolidated\\tAmended\\tComplaint\\twas\\tfiled\\ton\\tOctober\\t28,\\t2022,\\twhich\\tseeks\\tdamages\\tand\\nother\\trelief\\ton\\tbehalf\\tof\\tall\\tpersons\\twho\\tpurchased\\tor\\tleased\\tfrom\\tTesla\\tbetween\\tJanuary\\t1,\\t2016\\tto\\tthe\\tpresent.\\tOn\\tOctober\\t5,\\t2022\\ta\\tproposed\\tclass\\naction\\tcomplaint\\twas\\tfiled\\tin\\tthe\\tU.S.\\tDistrict\\tCourt\\tfor\\tthe\\tEastern\\tDistrict\\tof\\tNew\\tYork\\tasserting\\tsimilar\\tstate\\tand\\tfederal\\tlaw\\tclaims\\tagainst\\tthe\\tsame\\ndefendants.\\tOn\\tSeptember\\t30,\\t2023,\\tthe\\tCourt\\tdismissed\\tthis\\taction\\twith\\tleave\\tto\\tamend\\tthe\\tcomplaint.\\tOn\\tNovember\\t20,\\t2023,\\tthe\\tplaintiff\\tmoved\\tto\\namend\\tthe\\tcomplaint,\\twhich\\tTesla\\topposed.\\tOn\\tMarch\\t22,\\t2023,\\tthe\\tplaintiffs\\tin\\tthe\\tNorthern\\tDistrict\\tof\\tCalifornia\\tconsolidated\\taction\\tfiled\\ta\\tmotion\\tfor\\ta\\npreliminary\\tinjunction\\tto\\torder\\tTesla\\tto\\t(1)\\tcease\\tusing\\tthe\\tterm\\t“Full\\tSelf-Driving\\tCapability”\\t(FSD\\tCapability),\\t(2)\\tcease\\tthe\\tsale\\tand\\tactivation\\tof\\tFSD\\nCapability\\tand\\tdeactivate\\tFSD\\tCapability\\ton\\tTesla\\tvehicles,\\tand\\t(3)\\tprovide\\tcertain\\tnotices\\tto\\tconsumers\\tabout\\tproposed\\tcourt-findings\\tabout\\tthe\\naccuracy\\tof\\tthe\\tuse\\tof\\tthe\\tterms\\tAutopilot\\tand\\tFSD\\tCapability.\\tTesla\\topposed\\tthe\\tmotion.\\tOn\\tSeptember\\t30,\\t2023,\\tthe\\tCourt\\tdenied\\tthe\\trequest\\tfor\\ta\\npreliminary\\tinjunction,\\tcompelled\\tfour\\tof\\tfive\\tplaintiffs\\tto\\tarbitration,\\tand\\tdismissed\\tthe\\tclaims\\tof\\tthe\\tfifth\\tplaintiff\\twith\\tleave\\tto\\tamend\\tthe\\tcomplaint.\\tOn\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 91,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 14\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"October\\t31,\\t2023,\\tthe\\tremaining\\tplaintiff\\tin\\tthe\\tNorthern\\tDistrict\\tof\\tCalifornia\\taction\\tfiled\\tan\\tamended\\tcomplaint,\\twhich\\tTesla\\thas\\tmoved\\tto\\tdismiss.\\tOn\\nOctober\\t2,\\t2023,\\ta\\tsimilar\\tproposed\\tclass\\taction\\twas\\tfiled\\tin\\tSan\\tDiego\\tCounty\\tSuperior\\tCourt\\tin\\tCalifornia.\\tTesla\\tsubsequently\\tremoved\\tthe\\tSan\\tDiego\\nCounty\\tcase\\tto\\tfederal\\tcourt\\tand\\ton\\tJanuary\\t8,\\t2024,\\tthe\\tfederal\\tcourt\\tgranted\\tTesla’s\\tmotion\\tto\\ttransfer\\tthe\\tcase\\tto\\tthe\\tU.S.\\tDistrict\\tCourt\\tfor\\tthe\\nNorthern\\tDistrict\\tof\\tCalifornia.\\nOn\\tFebruary\\t27,\\t2023,\\ta\\tproposed\\tclass\\taction\\twas\\tfiled\\tin\\tthe\\tU.S.\\tDistrict\\tCourt\\tfor\\tthe\\tNorthern\\tDistrict\\tof\\tCalifornia\\tagainst\\tTesla,\\tInc.,\\tElon\\tMusk\\nand\\tcertain\\tcurrent\\tand\\tformer\\tCompany\\texecutives.\\tThe\\tcomplaint\\talleges\\tthat\\tthe\\tdefendants\\tmade\\tmaterial\\tmisrepresentations\\tand\\tomissions\\tabout\\nthe\\tCompany’s\\tAutopilot\\tand\\tFSD\\tCapability\\ttechnologies\\tand\\tseeks\\tmoney\\tdamages\\tand\\tother\\trelief\\ton\\tbehalf\\tof\\tpersons\\twho\\tpurchased\\tTesla\\tstock\\nbetween\\tFebruary\\t19,\\t2019\\tand\\tFebruary\\t17,\\t2023.\\tAn\\tamended\\tcomplaint\\twas\\tfiled\\ton\\tSeptember\\t5,\\t2023,\\tnaming\\tonly\\tTesla,\\tInc.\\tand\\tElon\\tMusk\\tas\\ndefendants.\\tOn\\tNovember\\t6,\\t2023,\\tTesla\\tmoved\\tto\\tdismiss\\tthe\\tamended\\tcomplaint.\\nOn\\tMarch\\t14,\\t2023,\\ta\\tproposed\\tclass\\taction\\twas\\tfiled\\tagainst\\tTesla,\\tInc.\\tin\\tthe\\tU.S.\\tDistrict\\tCourt\\tfor\\tthe\\tNorthern\\tDistrict\\tof\\tCalifornia.\\tSeveral\\nsimilar\\tcomplaints\\thave\\talso\\tbeen\\tfiled\\tin\\tthe\\tsame\\tcourt\\tand\\tthese\\tcases\\thave\\tnow\\tall\\tbeen\\tconsolidated.\\tThese\\tcomplaints\\tallege\\tthat\\tTesla\\tviolates\\nfederal\\tantitrust\\tand\\twarranty\\tlaws\\tthrough\\tits\\trepair,\\tservice,\\tand\\tmaintenance\\tpractices\\tand\\tseeks,\\tamong\\tother\\trelief,\\tdamages\\tfor\\tpersons\\twho\\tpaid\\nTesla\\tfor\\trepairs\\tservices\\tor\\tTesla\\tcompatible\\treplacement\\tparts\\tfrom\\tMarch\\t2019\\tto\\tMarch\\t2023.\\tOn\\tJuly\\t17,\\t2023,\\tthese\\tplaintiffs\\tfiled\\ta\\tconsolidated\\namended\\tcomplaint.\\tOn\\tSeptember\\t27,\\t2023,\\tthe\\tcourt\\tgranted\\tTesla’s\\tmotion\\tto\\tcompel\\tarbitration\\tas\\tto\\tthree\\tof\\tthe\\tplaintiffs,\\tand\\ton\\tNovember\\t17,\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 91,\n        \"lines\": {\n          \"from\": 15,\n          \"to\": 28\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"2023,\\tthe\\tcourt\\tgranted\\tTesla’s\\tmotion\\tto\\tdismiss\\twithout\\tprejudice.\\tThe\\tplaintiffs\\tfiled\\ta\\tConsolidated\\tSecond\\tAmended\\tComplaint\\ton\\tDecember\\t12,\\n2023,\\twhich\\tTesla\\thas\\tmoved\\tto\\tdismiss.\\tPlaintiffs\\thave\\talso\\tappealed\\tthe\\tcourt’s\\tarbitration\\torder.\\tTrial\\tis\\tcurrently\\tset\\tfor\\tJuly\\t7,\\t2025.\\nThe\\tCompany\\tintends\\tto\\tvigorously\\tdefend\\titself\\tin\\tthese\\tmatters;\\thowever,\\twe\\tcannot\\tpredict\\tthe\\toutcome\\tor\\timpact.\\tWe\\tare\\tunable\\tto\\treasonably\\nestimate\\tthe\\tpossible\\tloss\\tor\\trange\\tof\\tloss,\\tif\\tany,\\tassociated\\twith\\tthese\\tclaims,\\tunless\\tnoted.\\nCertain\\tInvestigations\\tand\\tOther\\tMatters\\nWe\\tregularly\\treceive\\trequests\\tfor\\tinformation,\\tincluding\\tsubpoenas,\\tfrom\\tregulators\\tand\\tgovernmental\\tauthorities\\tsuch\\tas\\tthe\\tNational\\tHighway\\nTraffic\\tSafety\\tAdministration,\\tthe\\tNational\\tTransportation\\tSafety\\tBoard,\\tthe\\tSecurities\\tand\\tExchange\\tCommission\\t(“SEC”),\\tthe\\tDepartment\\tof\\tJustice\\n(“DOJ”),\\tand\\tvarious\\tlocal,\\tstate,\\tfederal,\\tand\\tinternational\\tagencies.\\tThe\\tongoing\\trequests\\tfor\\tinformation\\tinclude\\ttopics\\tsuch\\tas\\toperations,\\ttechnology\\n(e.g.,\\tvehicle\\tfunctionality,\\tAutopilot\\tand\\tFSD\\tCapability),\\tcompliance,\\tfinance,\\tdata\\tprivacy,\\tand\\tother\\tmatters\\trelated\\tto\\tTesla’s\\tbusiness,\\tits\\tpersonnel,\\nand\\trelated\\tparties.\\tWe\\troutinely\\tcooperate\\twith\\tsuch\\tformal\\tand\\tinformal\\trequests\\tfor\\tinformation,\\tinvestigations,\\tand\\tother\\tinquiries.\\tTo\\tour\\tknowledge\\nno\\tgovernment\\tagency\\tin\\tany\\tongoing\\tinvestigation\\thas\\tconcluded\\tthat\\tany\\twrongdoing\\toccurred.\\tWe\\tcannot\\tpredict\\tthe\\toutcome\\tor\\timpact\\tof\\tany\\nongoing\\tmatters.\\tShould\\tthe\\tgovernment\\tdecide\\tto\\tpursue\\tan\\tenforcement\\taction,\\tthere\\texists\\tthe\\tpossibility\\tof\\ta\\tmaterial\\tadverse\\timpact\\ton\\tour\\nbusiness,\\tresults\\tof\\toperation,\\tprospects,\\tcash\\tflows,\\tfinancial\\tposition\\tor\\tbrand.\\n89\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 91,\n        \"lines\": {\n          \"from\": 29,\n          \"to\": 42\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"We\\tare\\talso\\tsubject\\tto\\tvarious\\tother\\tlegal\\tproceedings,\\trisks\\tand\\tclaims\\tthat\\tarise\\tfrom\\tthe\\tnormal\\tcourse\\tof\\tbusiness\\tactivities.\\tFor\\texample,\\tduring\\nthe\\tsecond\\tquarter\\tof\\t2023,\\ta\\tforeign\\tnews\\toutlet\\treported\\tthat\\tit\\tobtained\\tcertain\\tmisappropriated\\tdata\\tincluding,\\tpurportedly\\tnon-public\\tTesla\\tbusiness\\nand\\tpersonal\\tinformation.\\tTesla\\thas\\tmade\\tnotifications\\tto\\tpotentially\\taffected\\tindividuals\\t(current\\tand\\tformer\\temployees)\\tand\\tregulatory\\tauthorities\\tand\\nwe\\tare\\tworking\\twith\\tcertain\\tlaw\\tenforcement\\tand\\tother\\tauthorities.\\tOn\\tAugust\\t5,\\t2023,\\ta\\tputative\\tclass\\taction\\twas\\tfiled\\tin\\tthe\\tUnited\\tStates\\tDistrict\\tCourt\\nfor\\tthe\\tNorthern\\tDistrict\\tof\\tCalifornia,\\tpurportedly\\ton\\tbehalf\\tof\\tall\\tU.S.\\tindividuals\\timpacted\\tby\\tthe\\tdata\\tincident,\\tfollowed\\tby\\tseveral\\tadditional\\tlawsuits,\\nthat\\teach\\tassert\\tclaims\\tunder\\tvarious\\tstate\\tlaws\\tand\\tseeks\\tmonetary\\tdamages\\tand\\tother\\trelief.\\tIf\\tan\\tunfavorable\\truling\\tor\\tdevelopment\\twere\\tto\\toccur\\tin\\nthese\\tor\\tother\\tpossible\\tlegal\\tproceedings,\\trisks\\tand\\tclaims,\\tthere\\texists\\tthe\\tpossibility\\tof\\ta\\tmaterial\\tadverse\\timpact\\ton\\tour\\tbusiness,\\tresults\\tof\\toperations,\\nprospects,\\tcash\\tflows,\\tfinancial\\tposition\\tor\\tbrand.\\nLetters\\tof\\tCredit\\nAs\\tof\\tDecember\\t31,\\t2023,\\twe\\thad\\t$525\\tmillion\\tof\\tunused\\tletters\\tof\\tcredit\\toutstanding.\\nNote\\t16\\t–\\tVariable\\tInterest\\tEntity\\tArrangements\\nWe\\thave\\tentered\\tinto\\tvarious\\tarrangements\\twith\\tinvestors\\tto\\tfacilitate\\tthe\\tfunding\\tand\\tmonetization\\tof\\tour\\tsolar\\tenergy\\tsystems\\tand\\tvehicles.\\tIn\\nparticular,\\tour\\twholly\\towned\\tsubsidiaries\\tand\\tfund\\tinvestors\\thave\\tformed\\tand\\tcontributed\\tcash\\tand\\tassets\\tinto\\tvarious\\tfinancing\\tfunds\\tand\\tentered\\tinto\\nrelated\\tagreements.\\tWe\\thave\\tdetermined\\tthat\\tthe\\tfunds\\tare\\tVIEs\\tand\\twe\\tare\\tthe\\tprimary\\tbeneficiary\\tof\\tthese\\tVIEs\\tby\\treference\\tto\\tthe\\tpower\\tand\\tbenefits\\ncriterion\\tunder\\tASC\\t810.\\tWe\\thave\\tconsidered\\tthe\\tprovisions\\twithin\\tthe\\tagreements,\\twhich\\tgrant\\tus\\tthe\\tpower\\tto\\tmanage\\tand\\tmake\\tdecisions\\tthat\\taffect\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 92,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 15\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"the\\toperation\\tof\\tthese\\tVIEs,\\tincluding\\tdetermining\\tthe\\tsolar\\tenergy\\tsystems\\tand\\tthe\\tassociated\\tcustomer\\tcontracts\\tto\\tbe\\tsold\\tor\\tcontributed\\tto\\tthese\\nVIEs,\\tredeploying\\tsolar\\tenergy\\tsystems\\tand\\tmanaging\\tcustomer\\treceivables.\\tWe\\tconsider\\tthat\\tthe\\trights\\tgranted\\tto\\tthe\\tfund\\tinvestors\\tunder\\tthe\\nagreements\\tare\\tmore\\tprotective\\tin\\tnature\\trather\\tthan\\tparticipating.\\nAs\\tthe\\tprimary\\tbeneficiary\\tof\\tthese\\tVIEs,\\twe\\tconsolidate\\tin\\tthe\\tfinancial\\tstatements\\tthe\\tfinancial\\tposition,\\tresults\\tof\\toperations\\tand\\tcash\\tflows\\tof\\nthese\\tVIEs,\\tand\\tall\\tintercompany\\tbalances\\tand\\ttransactions\\tbetween\\tus\\tand\\tthese\\tVIEs\\tare\\teliminated\\tin\\tthe\\tconsolidated\\tfinancial\\tstatements.\\tCash\\ndistributions\\tof\\tincome\\tand\\tother\\treceipts\\tby\\ta\\tfund,\\tnet\\tof\\tagreed\\tupon\\texpenses,\\testimated\\texpenses,\\ttax\\tbenefits\\tand\\tdetriments\\tof\\tincome\\tand\\tloss\\nand\\ttax\\tcredits,\\tare\\tallocated\\tto\\tthe\\tfund\\tinvestor\\tand\\tour\\tsubsidiary\\tas\\tspecified\\tin\\tthe\\tagreements.\\nGenerally,\\tour\\tsubsidiary\\thas\\tthe\\toption\\tto\\tacquire\\tthe\\tfund\\tinvestor’s\\tinterest\\tin\\tthe\\tfund\\tfor\\tan\\tamount\\tbased\\ton\\tthe\\tmarket\\tvalue\\tof\\tthe\\tfund\\tor\\nthe\\tformula\\tspecified\\tin\\tthe\\tagreements.\\nUpon\\tthe\\tsale\\tor\\tliquidation\\tof\\ta\\tfund,\\tdistributions\\twould\\toccur\\tin\\tthe\\torder\\tand\\tpriority\\tspecified\\tin\\tthe\\tagreements.\\nPursuant\\tto\\tmanagement\\tservices,\\tmaintenance\\tand\\twarranty\\tarrangements,\\twe\\thave\\tbeen\\tcontracted\\tto\\tprovide\\tservices\\tto\\tthe\\tfunds,\\tsuch\\tas\\noperations\\tand\\tmaintenance\\tsupport,\\taccounting,\\tlease\\tservicing\\tand\\tperformance\\treporting.\\tIn\\tsome\\tinstances,\\twe\\thave\\tguaranteed\\tpayments\\tto\\tthe\\nfund\\tinvestors\\tas\\tspecified\\tin\\tthe\\tagreements.\\tA\\tfund’s\\tcreditors\\thave\\tno\\trecourse\\tto\\tour\\tgeneral\\tcredit\\tor\\tto\\tthat\\tof\\tother\\tfunds.\\tCertain\\tassets\\tof\\tthe\\nfunds\\thave\\tbeen\\tpledged\\tas\\tcollateral\\tfor\\ttheir\\tobligations.\\n90\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 92,\n        \"lines\": {\n          \"from\": 16,\n          \"to\": 30\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"The\\taggregate\\tcarrying\\tvalues\\tof\\tthe\\tVIEs’\\tassets\\tand\\tliabilities,\\tafter\\telimination\\tof\\tany\\tintercompany\\ttransactions\\tand\\tbalances,\\tin\\tthe\\nconsolidated\\tbalance\\tsheets\\twere\\tas\\tfollows\\t(in\\tmillions):\\nDecember\\t31,\\n2023\\nDecember\\t31,\\n2022\\nAssets\\t\\t\\nCurrent\\tassets\\t\\t\\nCash\\tand\\tcash\\tequivalents$66\\t$68\\t\\nAccounts\\treceivable,\\tnet13\\t22\\t\\nPrepaid\\texpenses\\tand\\tother\\tcurrent\\tassets361\\t274\\t\\nTotal\\tcurrent\\tassets440\\t364\\t\\nSolar\\tenergy\\tsystems,\\tnet3,278\\t4,060\\t\\nOther\\tnon-current\\tassets369\\t404\\t\\nTotal\\tassets\\n$4,087\\t$4,828\\t\\nLiabilities\\t\\t\\nCurrent\\tliabilities\\t\\t\\nAccrued\\tliabilities\\tand\\tother$67\\t$69\\t\\nDeferred\\trevenue6\\t10\\t\\nCurrent\\tportion\\tof\\tdebt\\tand\\tfinance\\tleases1,564\\t1,013\\t\\nTotal\\tcurrent\\tliabilities1,637\\t1,092\\t\\nDeferred\\trevenue,\\tnet\\tof\\tcurrent\\tportion99\\t149\\t\\nDebt\\tand\\tfinance\\tleases,\\tnet\\tof\\tcurrent\\tportion2,041\\t971\\t\\nOther\\tlong-term\\tliabilities—\\t3\\t\\nTotal\\tliabilities\\n$3,777\\t$2,215\\t\\nNote\\t17\\t–\\tRelated\\tParty\\tTransactions\\nIn\\trelation\\tto\\tour\\tCEO’s\\texercise\\tof\\tstock\\toptions\\tand\\tsale\\tof\\tcommon\\tstock\\tfrom\\tthe\\t2012\\tCEO\\tPerformance\\tAward,\\tTesla\\twithheld\\tthe\\tappropriate\\namount\\tof\\ttaxes.\\tHowever,\\tgiven\\tthe\\tsignificant\\tamounts\\tinvolved,\\tour\\tCEO\\tentered\\tinto\\tan\\tindemnification\\tagreement\\twith\\tus\\tin\\tNovember\\t2021\\tfor\\nadditional\\ttaxes\\towed,\\tif\\tany.\\nTesla\\tperiodically\\tdoes\\tbusiness\\twith\\tcertain\\tentities\\twith\\twhich\\tits\\tCEO\\tand\\tdirectors\\tare\\taffiliated,\\tsuch\\tas\\tSpaceX\\tand\\tX\\tCorp.,\\tin\\taccordance\\twith\\nour\\tRelated\\tPerson\\tTransactions\\tPolicy.\\tSuch\\ttransactions\\thave\\tnot\\thad\\tto\\tdate,\\tand\\tare\\tnot\\tcurrently\\texpected\\tto\\thave,\\ta\\tmaterial\\timpact\\ton\\tour\\nconsolidated\\tfinancial\\tstatements.\\n91\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 93,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 35\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Note\\t18\\t–\\tSegment\\tReporting\\tand\\tInformation\\tabout\\tGeographic\\tAreas\\nWe\\thave\\ttwo\\toperating\\tand\\treportable\\tsegments:\\t(i)\\tautomotive\\tand\\t(ii)\\tenergy\\tgeneration\\tand\\tstorage.\\tThe\\tautomotive\\tsegment\\tincludes\\tthe\\ndesign,\\tdevelopment,\\tmanufacturing,\\tsales\\tand\\tleasing\\tof\\telectric\\tvehicles\\tas\\twell\\tas\\tsales\\tof\\tautomotive\\tregulatory\\tcredits.\\tAdditionally,\\tthe\\tautomotive\\nsegment\\tis\\talso\\tcomprised\\tof\\tservices\\tand\\tother,\\twhich\\tincludes\\tsales\\tof\\tused\\tvehicles,\\tnon-warranty\\tafter-sales\\tvehicle\\tservices,\\tbody\\tshop\\tand\\tparts,\\npaid\\tSupercharging,\\tvehicle\\tinsurance\\trevenue\\tand\\tretail\\tmerchandise.\\tThe\\tenergy\\tgeneration\\tand\\tstorage\\tsegment\\tincludes\\tthe\\tdesign,\\tmanufacture,\\ninstallation,\\tsales\\tand\\tleasing\\tof\\tsolar\\tenergy\\tgeneration\\tand\\tenergy\\tstorage\\tproducts\\tand\\trelated\\tservices\\tand\\tsales\\tof\\tsolar\\tenergy\\tsystems\\tincentives.\\nOur\\tCODM\\tdoes\\tnot\\tevaluate\\toperating\\tsegments\\tusing\\tasset\\tor\\tliability\\tinformation.\\tThe\\tfollowing\\ttable\\tpresents\\trevenues\\tand\\tgross\\tprofit\\tby\\treportable\\nsegment\\t(in\\tmillions):\\nYear\\tEnded\\tDecember\\t31,\\n202320222021\\nAutomotive\\tsegment\\t\\t\\nRevenues$90,738\\t$77,553\\t$51,034\\t\\nGross\\tprofit$16,519\\t$20,565\\t$13,735\\t\\nEnergy\\tgeneration\\tand\\tstorage\\tsegment\\t\\t\\nRevenues$6,035\\t$3,909\\t$2,789\\t\\nGross\\tprofit$1,141\\t$288\\t$(129)\\nThe\\tfollowing\\ttable\\tpresents\\trevenues\\tby\\tgeographic\\tarea\\tbased\\ton\\tthe\\tsales\\tlocation\\tof\\tour\\tproducts\\t(in\\tmillions):\\nYear\\tEnded\\tDecember\\t31,\\n202320222021\\nUnited\\tStates$45,235\\t$40,553\\t$23,973\\t\\nChina21,745\\t18,145\\t13,844\\t\\nOther\\tinternational29,793\\t22,764\\t16,006\\t\\nTotal\\n$96,773\\t$81,462\\t$53,823\\t\\nThe\\tfollowing\\ttable\\tpresents\\tlong-lived\\tassets\\tby\\tgeographic\\tarea\\t(in\\tmillions):\\nDecember\\t31,\\n2023\\nDecember\\t31,\\n2022\\nUnited\\tStates$26,629\\t$21,667\\t\\nGermany4,258\\t3,547\\t\\nChina2,820\\t2,978\\t\\nOther\\tinternational1,247\\t845\\t\\nTotal\\n$34,954\\t$29,037\\t\\nThe\\tfollowing\\ttable\\tpresents\\tinventory\\tby\\treportable\\tsegment\\t(in\\tmillions):\\nDecember\\t31,\\n2023\\nDecember\\t31,\\n2022\\nAutomotive$11,139\\t$10,996\\t\\nEnergy\\tgeneration\\tand\\tstorage2,487\\t1,843\\t\\nTotal\\n$13,626\\t$12,839\\t\\nNote\\t19\\t–\\tRestructuring\\tand\\tOther\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 94,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 45\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Note\\t19\\t–\\tRestructuring\\tand\\tOther\\nDuring\\tthe\\tyears\\tended\\tDecember\\t31,\\t2022\\tand\\t2021,\\twe\\trecorded\\t$204\\tmillion\\tand\\t$101\\tmillion,\\trespectively,\\tof\\timpairment\\tlosses\\ton\\tdigital\\nassets.\\tDuring\\tthe\\tyears\\tended\\tDecember\\t31,\\t2022\\tand\\t2021\\twe\\talso\\trealized\\tgains\\tof\\t$64\\tmillion\\tand\\t$128\\tmillion,\\trespectively,\\tin\\tconnection\\twith\\nconverting\\tour\\tholdings\\tof\\tdigital\\tassets\\tinto\\tfiat\\tcurrency.\\tWe\\talso\\trecorded\\tother\\texpenses\\tof\\t$36\\tmillion\\tduring\\tthe\\tsecond\\tquarter\\tof\\tthe\\tyear\\tended\\nDecember\\t31,\\t2022,\\trelated\\tto\\temployee\\tterminations.\\n92\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 94,\n        \"lines\": {\n          \"from\": 45,\n          \"to\": 50\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"ITEM\\t9.\\tCHANGES\\tIN\\tAND\\tDISAGREEMENTS\\tWITH\\tACCOUNTANTS\\tON\\tACCOUNTING\\tAND\\tFINANCIAL\\tDISCLOSURE\\nNone.\\nITEM\\t9A.\\tCONTROLS\\tAND\\tPROCEDURES\\nEvaluation\\tof\\tDisclosure\\tControls\\tand\\tProcedures\\nOur\\tmanagement,\\twith\\tthe\\tparticipation\\tof\\tour\\tChief\\tExecutive\\tOfficer\\tand\\tour\\tChief\\tFinancial\\tOfficer,\\tevaluated\\tthe\\teffectiveness\\tof\\tour\\tdisclosure\\ncontrols\\tand\\tprocedures\\tpursuant\\tto\\tRule\\t13a-15\\tunder\\tthe\\tSecurities\\tExchange\\tAct\\tof\\t1934,\\tas\\tamended\\t(the\\t“Exchange\\tAct”).\\tIn\\tdesigning\\tand\\nevaluating\\tthe\\tdisclosure\\tcontrols\\tand\\tprocedures,\\tour\\tmanagement\\trecognizes\\tthat\\tany\\tcontrols\\tand\\tprocedures,\\tno\\tmatter\\thow\\twell\\tdesigned\\tand\\noperated,\\tcan\\tprovide\\tonly\\treasonable\\tassurance\\tof\\tachieving\\tthe\\tdesired\\tcontrol\\tobjectives.\\tIn\\taddition,\\tthe\\tdesign\\tof\\tdisclosure\\tcontrols\\tand\\tprocedures\\nmust\\treflect\\tthe\\tfact\\tthat\\tthere\\tare\\tresource\\tconstraints\\tand\\tthat\\tour\\tmanagement\\tis\\trequired\\tto\\tapply\\tits\\tjudgment\\tin\\tevaluating\\tthe\\tbenefits\\tof\\tpossible\\ncontrols\\tand\\tprocedures\\trelative\\tto\\ttheir\\tcosts.\\nBased\\ton\\tthis\\tevaluation,\\tour\\tChief\\tExecutive\\tOfficer\\tand\\tour\\tChief\\tFinancial\\tOfficer\\tconcluded\\tthat,\\tas\\tof\\tDecember\\t31,\\t2023,\\tour\\tdisclosure\\ncontrols\\tand\\tprocedures\\twere\\tdesigned\\tat\\ta\\treasonable\\tassurance\\tlevel\\tand\\twere\\teffective\\tto\\tprovide\\treasonable\\tassurance\\tthat\\tthe\\tinformation\\twe\\tare\\nrequired\\tto\\tdisclose\\tin\\treports\\tthat\\twe\\tfile\\tor\\tsubmit\\tunder\\tthe\\tExchange\\tAct\\tis\\trecorded,\\tprocessed,\\tsummarized\\tand\\treported\\twithin\\tthe\\ttime\\tperiods\\nspecified\\tin\\tthe\\tSEC\\trules\\tand\\tforms,\\tand\\tthat\\tsuch\\tinformation\\tis\\taccumulated\\tand\\tcommunicated\\tto\\tour\\tmanagement,\\tincluding\\tour\\tChief\\tExecutive\\nOfficer\\tand\\tour\\tChief\\tFinancial\\tOfficer,\\tas\\tappropriate,\\tto\\tallow\\ttimely\\tdecisions\\tregarding\\trequired\\tdisclosures.\\nManagement’s\\tReport\\ton\\tInternal\\tControl\\tover\\tFinancial\\tReporting\\nOur\\tmanagement\\tis\\tresponsible\\tfor\\testablishing\\tand\\tmaintaining\\tadequate\\tinternal\\tcontrol\\tover\\tfinancial\\treporting.\\tInternal\\tcontrol\\tover\\tfinancial\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 95,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 17\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"reporting\\tis\\ta\\tprocess\\tdesigned\\tby,\\tor\\tunder\\tthe\\tsupervision\\tof,\\tour\\tChief\\tExecutive\\tOfficer\\tand\\tChief\\tFinancial\\tOfficer\\tto\\tprovide\\treasonable\\tassurance\\nregarding\\tthe\\treliability\\tof\\tfinancial\\treporting\\tand\\tthe\\tpreparation\\tof\\tfinancial\\tstatements\\tfor\\texternal\\tpurposes\\tin\\taccordance\\twith\\tgenerally\\taccepted\\naccounting\\tprinciples\\tand\\tincludes\\tthose\\tpolicies\\tand\\tprocedures\\tthat\\t(1)\\tpertain\\tto\\tthe\\tmaintenance\\tof\\trecords\\tthat\\tin\\treasonable\\tdetail\\taccurately\\tand\\nfairly\\treflect\\tthe\\ttransactions\\tand\\tdispositions\\tof\\tour\\tassets;\\t(2)\\tprovide\\treasonable\\tassurance\\tthat\\ttransactions\\tare\\trecorded\\tas\\tnecessary\\tto\\tpermit\\npreparation\\tof\\tfinancial\\tstatements\\tin\\taccordance\\twith\\tgenerally\\taccepted\\taccounting\\tprinciples,\\tand\\tthat\\tour\\treceipts\\tand\\texpenditures\\tare\\tbeing\\tmade\\nonly\\tin\\taccordance\\twith\\tauthorizations\\tof\\tour\\tmanagement\\tand\\tdirectors\\tand\\t(3)\\tprovide\\treasonable\\tassurance\\tregarding\\tprevention\\tor\\ttimely\\tdetection\\nof\\tunauthorized\\tacquisition,\\tuse\\tor\\tdisposition\\tof\\tour\\tassets\\tthat\\tcould\\thave\\ta\\tmaterial\\teffect\\ton\\tthe\\tfinancial\\tstatements.\\nUnder\\tthe\\tsupervision\\tand\\twith\\tthe\\tparticipation\\tof\\tour\\tmanagement,\\tincluding\\tour\\tChief\\tExecutive\\tOfficer\\tand\\tChief\\tFinancial\\tOfficer,\\twe\\tconducted\\nan\\tevaluation\\tof\\tthe\\teffectiveness\\tof\\tour\\tinternal\\tcontrol\\tover\\tfinancial\\treporting\\tbased\\ton\\tcriteria\\testablished\\tin\\tInternal\\tControl\\t–\\tIntegrated\\tFramework\\n(2013)\\tissued\\tby\\tthe\\tCommittee\\tof\\tSponsoring\\tOrganizations\\tof\\tthe\\tTreadway\\tCommission\\t(“COSO”).\\tOur\\tmanagement\\tconcluded\\tthat\\tour\\tinternal\\ncontrol\\tover\\tfinancial\\treporting\\twas\\teffective\\tas\\tof\\tDecember\\t31,\\t2023.\\nOur\\tindependent\\tregistered\\tpublic\\taccounting\\tfirm,\\tPricewaterhouseCoopers\\tLLP,\\thas\\taudited\\tthe\\teffectiveness\\tof\\tour\\tinternal\\tcontrol\\tover\\tfinancial\\nreporting\\tas\\tof\\tDecember\\t31,\\t2023,\\tas\\tstated\\tin\\ttheir\\treport\\twhich\\tis\\tincluded\\therein.\\nLimitations\\ton\\tthe\\tEffectiveness\\tof\\tControls\\nBecause\\tof\\tinherent\\tlimitations,\\tinternal\\tcontrol\\tover\\tfinancial\\treporting\\tmay\\tnot\\tprevent\\tor\\tdetect\\tmisstatements\\tand\\tprojections\\tof\\tany\\tevaluation\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 95,\n        \"lines\": {\n          \"from\": 18,\n          \"to\": 32\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"of\\teffectiveness\\tto\\tfuture\\tperiods\\tare\\tsubject\\tto\\tthe\\trisk\\tthat\\tcontrols\\tmay\\tbecome\\tinadequate\\tbecause\\tof\\tchanges\\tin\\tconditions,\\tor\\tthat\\tthe\\tdegree\\tof\\ncompliance\\twith\\tthe\\tpolicies\\tor\\tprocedures\\tmay\\tdeteriorate.\\nChanges\\tin\\tInternal\\tControl\\tover\\tFinancial\\tReporting\\nThere\\twas\\tno\\tchange\\tin\\tour\\tinternal\\tcontrol\\tover\\tfinancial\\treporting\\tthat\\toccurred\\tduring\\tthe\\tquarter\\tended\\tDecember\\t31,\\t2023,\\twhich\\thas\\nmaterially\\taffected,\\tor\\tis\\treasonably\\tlikely\\tto\\tmaterially\\taffect,\\tour\\tinternal\\tcontrol\\tover\\tfinancial\\treporting.\\n93\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 95,\n        \"lines\": {\n          \"from\": 33,\n          \"to\": 38\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"ITEM\\t9B.\\tOTHER\\tINFORMATION\\nNone\\tof\\tthe\\tCompany’s\\tdirectors\\tor\\tofficers\\tadopted,\\tmodified\\tor\\tterminated\\ta\\tRule\\t10b5-1\\ttrading\\tarrangement\\tor\\ta\\tnon-Rule\\t10b5-1\\ttrading\\narrangement\\tduring\\tthe\\tCompany’s\\tfiscal\\tquarter\\tended\\tDecember\\t31,\\t2023,\\tas\\tsuch\\tterms\\tare\\tdefined\\tunder\\tItem\\t408(a)\\tof\\tRegulation\\tS-K,\\texcept\\tas\\nfollows:\\nOn\\tOctober\\t23,\\t2023,\\tRobyn\\tDenholm,\\tone\\tof\\tour\\tdirectors,\\tadopted\\ta\\tRule\\t10b5-1\\ttrading\\tarrangement\\tfor\\tthe\\tpotential\\tsale\\tof\\tup\\tto\\t281,116\\nshares\\tof\\tour\\tcommon\\tstock,\\tsubject\\tto\\tcertain\\tconditions.\\tThe\\ttrading\\tarrangement\\tcovers\\tstock\\toptions\\tthat\\texpire\\tin\\tAugust\\t2024.\\tThe\\tarrangement's\\nexpiration\\tdate\\tis\\tAugust\\t16,\\t2024.\\nOn\\tNovember\\t13,\\t2023,\\tAndrew\\tBaglino,\\tSenior\\tVice\\tPresident,\\tPowertrain\\tand\\tEnergy\\tEngineering,\\tadopted\\ta\\tRule\\t10b5-1\\ttrading\\tarrangement\\tfor\\nthe\\tpotential\\tsale\\tof\\tup\\tto\\t115,500\\tshares\\tof\\tour\\tcommon\\tstock,\\tsubject\\tto\\tcertain\\tconditions.\\tThe\\tarrangement's\\texpiration\\tdate\\tis\\tDecember\\t31,\\t2024.\\nITEM\\t9C.\\tDISCLOSURE\\tREGARDING\\tFOREIGN\\tJURISDICTIONS\\tTHAT\\tPREVENT\\tINSPECTIONS\\nNot\\tapplicable.\\n94\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 96,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 12\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"PART\\tIII\\nITEM\\t10.\\tDIRECTORS,\\tEXECUTIVE\\tOFFICERS\\tAND\\tCORPORATE\\tGOVERNANCE\\nThe\\tinformation\\trequired\\tby\\tthis\\tItem\\t10\\tof\\tForm\\t10-K\\twill\\tbe\\tincluded\\tin\\tour\\t2024\\tProxy\\tStatement\\tto\\tbe\\tfiled\\twith\\tthe\\tSecurities\\tand\\tExchange\\nCommission\\tin\\tconnection\\twith\\tthe\\tsolicitation\\tof\\tproxies\\tfor\\tour\\t2024\\tAnnual\\tMeeting\\tof\\tStockholders\\tand\\tis\\tincorporated\\therein\\tby\\treference.\\tThe\\t2024\\nProxy\\tStatement\\twill\\tbe\\tfiled\\twith\\tthe\\tSecurities\\tand\\tExchange\\tCommission\\twithin\\t120\\tdays\\tafter\\tthe\\tend\\tof\\tthe\\tfiscal\\tyear\\tto\\twhich\\tthis\\treport\\trelates.\\nITEM\\t11.\\tEXECUTIVE\\tCOMPENSATION\\nThe\\tinformation\\trequired\\tby\\tthis\\tItem\\t11\\tof\\tForm\\t10-K\\twill\\tbe\\tincluded\\tin\\tour\\t2024\\tProxy\\tStatement\\tand\\tis\\tincorporated\\therein\\tby\\treference.\\nITEM\\t12.\\tSECURITY\\tOWNERSHIP\\tOF\\tCERTAIN\\tBENEFICIAL\\tOWNERS\\tAND\\tMANAGEMENT\\tAND\\tRELATED\\tSTOCKHOLDER\\tMATTERS\\nThe\\tinformation\\trequired\\tby\\tthis\\tItem\\t12\\tof\\tForm\\t10-K\\twill\\tbe\\tincluded\\tin\\tour\\t2024\\tProxy\\tStatement\\tand\\tis\\tincorporated\\therein\\tby\\treference.\\nITEM\\t13.\\tCERTAIN\\tRELATIONSHIPS\\tAND\\tRELATED\\tTRANSACTIONS\\tAND\\tDIRECTOR\\tINDEPENDENCE\\nThe\\tinformation\\trequired\\tby\\tthis\\tItem\\t13\\tof\\tForm\\t10-K\\twill\\tbe\\tincluded\\tin\\tour\\t2024\\tProxy\\tStatement\\tand\\tis\\tincorporated\\therein\\tby\\treference.\\nITEM\\t14.\\tPRINCIPAL\\tACCOUNTANT\\tFEES\\tAND\\tSERVICES\\nThe\\tinformation\\trequired\\tby\\tthis\\tItem\\t14\\tof\\tForm\\t10-K\\twill\\tbe\\tincluded\\tin\\tour\\t2024\\tProxy\\tStatement\\tand\\tis\\tincorporated\\therein\\tby\\treference.\\n95\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 97,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 14\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"PART\\tIV\\nITEM\\t15.\\tEXHIBITS\\tAND\\tFINANCIAL\\tSTATEMENT\\tSCHEDULES\\n1.Financial\\tstatements\\t(see\\tIndex\\tto\\tConsolidated\\tFinancial\\tStatements\\tin\\tPart\\tII,\\tItem\\t8\\tof\\tthis\\treport)\\n2.All\\tfinancial\\tstatement\\tschedules\\thave\\tbeen\\tomitted\\tsince\\tthe\\trequired\\tinformation\\twas\\tnot\\tapplicable\\tor\\twas\\tnot\\tpresent\\tin\\tamounts\\tsufficient\\tto\\nrequire\\tsubmission\\tof\\tthe\\tschedules,\\tor\\tbecause\\tthe\\tinformation\\trequired\\tis\\tincluded\\tin\\tthe\\tconsolidated\\tfinancial\\tstatements\\tor\\tthe\\taccompanying\\nnotes\\n3.The\\texhibits\\tlisted\\tin\\tthe\\tfollowing\\tIndex\\tto\\tExhibits\\tare\\tfiled\\tor\\tincorporated\\tby\\treference\\tas\\tpart\\tof\\tthis\\treport\\nINDEX\\tTO\\tEXHIBITS\\nExhibit\\nNumber\\nIncorporated\\tby\\tReference\\nFiled\\nHerewithExhibit\\tDescriptionFormFile\\tNo.ExhibitFiling\\tDate\\n3.1Amended\\tand\\tRestated\\tCertificate\\tof\\nIncorporation\\tof\\tthe\\tRegistrant.\\n10-K001-347563.1March\\t1,\\t2017\\n3.2Certificate\\tof\\tAmendment\\tto\\tthe\\tAmended\\tand\\nRestated\\tCertificate\\tof\\tIncorporation\\tof\\tthe\\nRegistrant.\\n10-K001-347563.2March\\t1,\\t2017\\n3.3Amended\\tand\\tRestated\\tBylaws\\tof\\tthe\\tRegistrant.8-K001-347563.1April\\t5,\\t2023\\n4.1Specimen\\tcommon\\tstock\\tcertificate\\tof\\tthe\\nRegistrant.\\n10-K001-347564.1March\\t1,\\t2017\\n4.2Fifth\\tAmended\\tand\\tRestated\\tInvestors’\\tRights\\nAgreement,\\tdated\\tas\\tof\\tAugust\\t31,\\t2009,\\tbetween\\nRegistrant\\tand\\tcertain\\tholders\\tof\\tthe\\tRegistrant’s\\ncapital\\tstock\\tnamed\\ttherein.\\nS-1333-1645934.2January\\t29,\\t2010\\n4.3Amendment\\tto\\tFifth\\tAmended\\tand\\tRestated\\nInvestors’\\tRights\\tAgreement,\\tdated\\tas\\tof\\tMay\\t20,\\n2010,\\tbetween\\tRegistrant\\tand\\tcertain\\tholders\\tof\\nthe\\tRegistrant’s\\tcapital\\tstock\\tnamed\\ttherein.\\nS-1/A333-1645934.2AMay\\t27,\\t2010\\n4.4Amendment\\tto\\tFifth\\tAmended\\tand\\tRestated\\nInvestors’\\tRights\\tAgreement\\tbetween\\tRegistrant,\\nToyota\\tMotor\\tCorporation\\tand\\tcertain\\tholders\\tof\\nthe\\tRegistrant’s\\tcapital\\tstock\\tnamed\\ttherein.\\nS-1/A333-1645934.2BMay\\t27,\\t2010\\n4.5Amendment\\tto\\tFifth\\tAmended\\tand\\tRestated\\nInvestor’s\\tRights\\tAgreement,\\tdated\\tas\\tof\\tJune\\t14,\\n2010,\\tbetween\\tRegistrant\\tand\\tcertain\\tholders\\tof\\nthe\\tRegistrant’s\\tcapital\\tstock\\tnamed\\ttherein.\\nS-1/A333-1645934.2CJune\\t15,\\t2010\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 98,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 44\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"S-1/A333-1645934.2CJune\\t15,\\t2010\\n4.6Amendment\\tto\\tFifth\\tAmended\\tand\\tRestated\\nInvestor’s\\tRights\\tAgreement,\\tdated\\tas\\tof\\nNovember\\t2,\\t2010,\\tbetween\\tRegistrant\\tand\\ncertain\\tholders\\tof\\tthe\\tRegistrant’s\\tcapital\\tstock\\nnamed\\ttherein.\\n8-K001-347564.1November\\t4,\\t2010\\n96\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 98,\n        \"lines\": {\n          \"from\": 44,\n          \"to\": 51\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Exhibit\\nNumber\\nIncorporated\\tby\\tReference\\nFiled\\nHerewithExhibit\\tDescriptionFormFile\\tNo.ExhibitFiling\\tDate\\n4.7Waiver\\tto\\tFifth\\tAmended\\tand\\tRestated\\tInvestor’s\\nRights\\tAgreement,\\tdated\\tas\\tof\\tMay\\t22,\\t2011,\\nbetween\\tRegistrant\\tand\\tcertain\\tholders\\tof\\tthe\\nRegistrant’s\\tcapital\\tstock\\tnamed\\ttherein.\\nS-1/A333-1744664.2EJune\\t2,\\t2011\\n4.8Amendment\\tto\\tFifth\\tAmended\\tand\\tRestated\\nInvestor’s\\tRights\\tAgreement,\\tdated\\tas\\tof\\tMay\\t30,\\n2011,\\tbetween\\tRegistrant\\tand\\tcertain\\tholders\\tof\\nthe\\tRegistrant’s\\tcapital\\tstock\\tnamed\\ttherein.\\n8-K001-347564.1June\\t1,\\t2011\\n4.9Sixth\\tAmendment\\tto\\tFifth\\tAmended\\tand\\tRestated\\nInvestors’\\tRights\\tAgreement,\\tdated\\tas\\tof\\tMay\\t15,\\n2013\\tamong\\tthe\\tRegistrant,\\tthe\\tElon\\tMusk\\nRevocable\\tTrust\\tdated\\tJuly\\t22,\\t2003\\tand\\tcertain\\nother\\tholders\\tof\\tthe\\tcapital\\tstock\\tof\\tthe\\tRegistrant\\nnamed\\ttherein.\\n8-K001-347564.1May\\t20,\\t2013\\n4.10Waiver\\tto\\tFifth\\tAmended\\tand\\tRestated\\tInvestor’s\\nRights\\tAgreement,\\tdated\\tas\\tof\\tMay\\t14,\\t2013,\\nbetween\\tthe\\tRegistrant\\tand\\tcertain\\tholders\\tof\\tthe\\ncapital\\tstock\\tof\\tthe\\tRegistrant\\tnamed\\ttherein.\\n8-K001-347564.2May\\t20,\\t2013\\n4.11Waiver\\tto\\tFifth\\tAmended\\tand\\tRestated\\tInvestor’s\\nRights\\tAgreement,\\tdated\\tas\\tof\\tAugust\\t13,\\t2015,\\nbetween\\tthe\\tRegistrant\\tand\\tcertain\\tholders\\tof\\tthe\\ncapital\\tstock\\tof\\tthe\\tRegistrant\\tnamed\\ttherein.\\n8-K001-347564.1August\\t19,\\t2015\\n4.12Waiver\\tto\\tFifth\\tAmended\\tand\\tRestated\\tInvestors’\\nRights\\tAgreement,\\tdated\\tas\\tof\\tMay\\t18,\\t2016,\\nbetween\\tthe\\tRegistrant\\tand\\tcertain\\tholders\\tof\\tthe\\ncapital\\tstock\\tof\\tthe\\tRegistrant\\tnamed\\ttherein.\\n8-K001-347564.1May\\t24,\\t2016\\n4.13Waiver\\tto\\tFifth\\tAmended\\tand\\tRestated\\tInvestors’\\nRights\\tAgreement,\\tdated\\tas\\tof\\tMarch\\t15,\\t2017,\\nbetween\\tthe\\tRegistrant\\tand\\tcertain\\tholders\\tof\\tthe\\ncapital\\tstock\\tof\\tthe\\tRegistrant\\tnamed\\ttherein.\\n8-K001-347564.1March\\t17,\\t2017\\n4.14Waiver\\tto\\tFifth\\tAmended\\tand\\tRestated\\tInvestors’\\nRights\\tAgreement,\\tdated\\tas\\tof\\tMay\\t1,\\t2019,\\nbetween\\tthe\\tRegistrant\\tand\\tcertain\\tholders\\tof\\tthe\\ncapital\\tstock\\tof\\tthe\\tRegistrant\\tnamed\\ttherein.\\n8-K001-347564.1May\\t3,\\t2019\\n4.15Indenture,\\tdated\\tas\\tof\\tMay\\t22,\\t2013,\\tby\\tand\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 99,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 48\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"4.15Indenture,\\tdated\\tas\\tof\\tMay\\t22,\\t2013,\\tby\\tand\\nbetween\\tthe\\tRegistrant\\tand\\tU.S.\\tBank\\tNational\\nAssociation.\\n8-K001-347564.1May\\t22,\\t2013\\n97\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 99,\n        \"lines\": {\n          \"from\": 48,\n          \"to\": 52\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Exhibit\\nNumber\\nIncorporated\\tby\\tReference\\nFiled\\nHerewithExhibit\\tDescriptionFormFile\\tNo.ExhibitFiling\\tDate\\n4.16Fifth\\tSupplemental\\tIndenture,\\tdated\\tas\\tof\\tMay\\t7,\\n2019,\\tby\\tand\\tbetween\\tRegistrant\\tand\\tU.S.\\tBank\\nNational\\tAssociation,\\trelated\\tto\\t2.00%\\tConvertible\\nSenior\\tNotes\\tdue\\tMay\\t15,\\t2024.\\n8-K001-347564.2May\\t8,\\t2019\\n4.17Form\\tof\\t2.00%\\tConvertible\\tSenior\\tNotes\\tdue\\tMay\\n15,\\t2024\\t(included\\tin\\tExhibit\\t4.16).\\n8-K001-347564.2May\\t8,\\t2019\\n4.18Indenture,\\tdated\\tas\\tof\\tOctober\\t15,\\t2014,\\tbetween\\nSolarCity\\tand\\tU.S.\\tBank\\tNational\\tAssociation,\\tas\\ntrustee.\\nS-3ASR(1)333-1993214.1October\\t15,\\t2014\\n4.19Tenth\\tSupplemental\\tIndenture,\\tdated\\tas\\tof\\tMarch\\n9,\\t2015,\\tby\\tand\\tbetween\\tSolarCity\\tand\\tthe\\nTrustee,\\trelated\\tto\\tSolarCity’s\\t5.00%\\tSolar\\tBonds,\\nSeries\\t2015/6-10.\\n8-K(1)001-357584.3March\\t9,\\t2015\\n4.20Eleventh\\tSupplemental\\tIndenture,\\tdated\\tas\\tof\\nMarch\\t9,\\t2015,\\tby\\tand\\tbetween\\tSolarCity\\tand\\tthe\\nTrustee,\\trelated\\tto\\tSolarCity’s\\t5.75%\\tSolar\\tBonds,\\nSeries\\t2015/7-15.\\n8-K(1)001-357584.4March\\t9,\\t2015\\n4.21Fifteenth\\tSupplemental\\tIndenture,\\tdated\\tas\\tof\\nMarch\\t19,\\t2015,\\tby\\tand\\tbetween\\tSolarCity\\tand\\nthe\\tTrustee,\\trelated\\tto\\tSolarCity’s\\t4.70%\\tSolar\\nBonds,\\tSeries\\t2015/C4-10.\\n8-K(1)001-357584.5March\\t19,\\t2015\\n4.22Sixteenth\\tSupplemental\\tIndenture,\\tdated\\tas\\tof\\nMarch\\t19,\\t2015,\\tby\\tand\\tbetween\\tSolarCity\\tand\\nthe\\tTrustee,\\trelated\\tto\\tSolarCity’s\\t5.45%\\tSolar\\nBonds,\\tSeries\\t2015/C5-15.\\n8-K(1)001-357584.6March\\t19,\\t2015\\n4.23Twentieth\\tSupplemental\\tIndenture,\\tdated\\tas\\tof\\nMarch\\t26,\\t2015,\\tby\\tand\\tbetween\\tSolarCity\\tand\\nthe\\tTrustee,\\trelated\\tto\\tSolarCity’s\\t4.70%\\tSolar\\nBonds,\\tSeries\\t2015/C9-10.\\n8-K(1)001-357584.5March\\t26,\\t2015\\n4.24Twenty-First\\tSupplemental\\tIndenture,\\tdated\\tas\\tof\\nMarch\\t26,\\t2015,\\tby\\tand\\tbetween\\tSolarCity\\tand\\nthe\\tTrustee,\\trelated\\tto\\tSolarCity’s\\t5.45%\\tSolar\\nBonds,\\tSeries\\t2015/C10-15.\\n8-K(1)001-357584.6March\\t26,\\t2015\\n4.25Twenty-Sixth\\tSupplemental\\tIndenture,\\tdated\\tas\\tof\\nApril\\t2,\\t2015,\\tby\\tand\\tbetween\\tSolarCity\\tand\\tthe\\nTrustee,\\trelated\\tto\\tSolarCity’s\\t4.70%\\tSolar\\tBonds,\\nSeries\\t2015/C14-10.\\n8-K(1)001-357584.5April\\t2,\\t2015\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 100,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 52\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"8-K(1)001-357584.5April\\t2,\\t2015\\n4.26Thirtieth\\tSupplemental\\tIndenture,\\tdated\\tas\\tof\\nApril\\t9,\\t2015,\\tby\\tand\\tbetween\\tSolarCity\\tand\\tthe\\nTrustee,\\trelated\\tto\\tSolarCity’s\\t4.70%\\tSolar\\tBonds,\\nSeries\\t2015/C19-10.\\n8-K(1)001-357584.5April\\t9,\\t2015\\n98\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 100,\n        \"lines\": {\n          \"from\": 52,\n          \"to\": 58\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Exhibit\\nNumber\\nIncorporated\\tby\\tReference\\nFiled\\nHerewithExhibit\\tDescriptionFormFile\\tNo.ExhibitFiling\\tDate\\n4.27Thirty-First\\tSupplemental\\tIndenture,\\tdated\\tas\\tof\\nApril\\t9,\\t2015,\\tby\\tand\\tbetween\\tSolarCity\\tand\\tthe\\nTrustee,\\trelated\\tto\\tSolarCity’s\\t5.45%\\tSolar\\tBonds,\\nSeries\\t2015/C20-15.\\n8-K(1)001-357584.6April\\t9,\\t2015\\n4.28Thirty-Fifth\\tSupplemental\\tIndenture,\\tdated\\tas\\tof\\nApril\\t14,\\t2015,\\tby\\tand\\tbetween\\tSolarCity\\tand\\tthe\\nTrustee,\\trelated\\tto\\tSolarCity’s\\t4.70%\\tSolar\\tBonds,\\nSeries\\t2015/C24-10.\\n8-K(1)001-357584.5April\\t14,\\t2015\\n4.29Thirty-Sixth\\tSupplemental\\tIndenture,\\tdated\\tas\\tof\\nApril\\t14,\\t2015,\\tby\\tand\\tbetween\\tSolarCity\\tand\\tthe\\nTrustee,\\trelated\\tto\\tSolarCity’s\\t5.45%\\tSolar\\tBonds,\\nSeries\\t2015/C25-15.\\n8-K(1)001-357584.6April\\t14,\\t2015\\n4.30Thirty-Eighth\\tSupplemental\\tIndenture,\\tdated\\tas\\tof\\nApril\\t21,\\t2015,\\tby\\tand\\tbetween\\tSolarCity\\tand\\tthe\\nTrustee,\\trelated\\tto\\tSolarCity’s\\t4.70%\\tSolar\\tBonds,\\nSeries\\t2015/C27-10.\\n8-K(1)001-357584.3April\\t21,\\t2015\\n4.31Thirty-Ninth\\tSupplemental\\tIndenture,\\tdated\\tas\\tof\\nApril\\t21,\\t2015,\\tby\\tand\\tbetween\\tSolarCity\\tand\\tthe\\nTrustee,\\trelated\\tto\\tSolarCity’s\\t5.45%\\tSolar\\tBonds,\\nSeries\\t2015/C28-15.\\n8-K(1)001-357584.4April\\t21,\\t2015\\n4.32Forty-Third\\tSupplemental\\tIndenture,\\tdated\\tas\\tof\\nApril\\t27,\\t2015,\\tby\\tand\\tbetween\\tSolarCity\\tand\\tthe\\nTrustee,\\trelated\\tto\\tSolarCity’s\\t4.70%\\tSolar\\tBonds,\\nSeries\\t2015/C32-10.\\n8-K(1)001-357584.5April\\t27,\\t2015\\n4.33Forty-Fourth\\tSupplemental\\tIndenture,\\tdated\\tas\\tof\\nApril\\t27,\\t2015,\\tby\\tand\\tbetween\\tSolarCity\\tand\\tthe\\nTrustee,\\trelated\\tto\\tSolarCity’s\\t5.45%\\tSolar\\tBonds,\\nSeries\\t2015/C33-15.\\n8-K(1)001-357584.6April\\t27,\\t2015\\n4.34Forty-Eighth\\tSupplemental\\tIndenture,\\tdated\\tas\\tof\\nMay\\t1,\\t2015,\\tby\\tand\\tbetween\\tSolarCity\\tand\\tthe\\nTrustee,\\trelated\\tto\\tSolarCity’s\\t5.00%\\tSolar\\tBonds,\\nSeries\\t2015/12-10.\\n8-K(1)001-357584.5May\\t1,\\t2015\\n4.35Forty-Ninth\\tSupplemental\\tIndenture,\\tdated\\tas\\tof\\nMay\\t1,\\t2015,\\tby\\tand\\tbetween\\tSolarCity\\tand\\tthe\\nTrustee,\\trelated\\tto\\tSolarCity’s\\t5.75%\\tSolar\\tBonds,\\nSeries\\t2015/13-15.\\n8-K(1)001-357584.6May\\t1,\\t2015\\n4.36Fifty-Second\\tSupplemental\\tIndenture,\\tdated\\tas\\tof\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 101,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 51\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"May\\t11,\\t2015,\\tby\\tand\\tbetween\\tSolarCity\\tand\\tthe\\nTrustee,\\trelated\\tto\\tSolarCity’s\\t4.70%\\tSolar\\tBonds,\\nSeries\\t2015/C36-10.\\n8-K(1)001-357584.4May\\t11,\\t2015\\n99\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 101,\n        \"lines\": {\n          \"from\": 52,\n          \"to\": 56\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Exhibit\\nNumber\\nIncorporated\\tby\\tReference\\nFiled\\nHerewithExhibit\\tDescriptionFormFile\\tNo.ExhibitFiling\\tDate\\n4.37Fifty-Third\\tSupplemental\\tIndenture,\\tdated\\tas\\tof\\nMay\\t11,\\t2015,\\tby\\tand\\tbetween\\tSolarCity\\tand\\tthe\\nTrustee,\\trelated\\tto\\tSolarCity’s\\t5.45%\\tSolar\\tBonds,\\nSeries\\t2015/C37-15.\\n8-K(1)001-357584.5May\\t11,\\t2015\\n4.38Fifty-Seventh\\tSupplemental\\tIndenture,\\tdated\\tas\\tof\\nMay\\t18,\\t2015,\\tby\\tand\\tbetween\\tSolarCity\\tand\\tthe\\nTrustee,\\trelated\\tto\\tSolarCity’s\\t4.70%\\tSolar\\tBonds,\\nSeries\\t2015/C40-10.\\n8-K(1)001-357584.4May\\t18,\\t2015\\n4.39Fifty-Eighth\\tSupplemental\\tIndenture,\\tdated\\tas\\tof\\nMay\\t18,\\t2015,\\tby\\tand\\tbetween\\tSolarCity\\tand\\tthe\\nTrustee,\\trelated\\tto\\tSolarCity’s\\t5.45%\\tSolar\\tBonds,\\nSeries\\t2015/C41-15.\\n8-K(1)001-357584.5May\\t18,\\t2015\\n4.40Sixty-First\\tSupplemental\\tIndenture,\\tdated\\tas\\tof\\nMay\\t26,\\t2015,\\tby\\tand\\tbetween\\tSolarCity\\tand\\tthe\\nTrustee,\\trelated\\tto\\tSolarCity’s\\t4.70%\\tSolar\\tBonds,\\nSeries\\t2015/C44-10.\\n8-K(1)001-357584.4May\\t26,\\t2015\\n4.41Sixty-Second\\tSupplemental\\tIndenture,\\tdated\\tas\\tof\\nMay\\t26,\\t2015,\\tby\\tand\\tbetween\\tSolarCity\\tand\\tthe\\nTrustee,\\trelated\\tto\\tSolarCity’s\\t5.45%\\tSolar\\tBonds,\\nSeries\\t2015/C45-15.\\n8-K(1)001-357584.5May\\t26,\\t2015\\n4.42Seventieth\\tSupplemental\\tIndenture,\\tdated\\tas\\tof\\nJune\\t16,\\t2015,\\tby\\tand\\tbetween\\tSolarCity\\tand\\tthe\\nTrustee,\\trelated\\tto\\tSolarCity’s\\t4.70%\\tSolar\\tBonds,\\nSeries\\t2015/C52-10.\\n8-K(1)001-357584.4June\\t16,\\t2015\\n4.43Seventy-First\\tSupplemental\\tIndenture,\\tdated\\tas\\tof\\nJune\\t16,\\t2015,\\tby\\tand\\tbetween\\tSolarCity\\tand\\tthe\\nTrustee,\\trelated\\tto\\tSolarCity’s\\t5.45%\\tSolar\\tBonds,\\nSeries\\t2015/C53-15.\\n8-K(1)001-357584.5June\\t16,\\t2015\\n4.44Seventy-Fourth\\tSupplemental\\tIndenture,\\tdated\\tas\\nof\\tJune\\t22,\\t2015,\\tby\\tand\\tbetween\\tSolarCity\\tand\\nthe\\tTrustee,\\trelated\\tto\\tSolarCity’s\\t4.70%\\tSolar\\nBonds,\\tSeries\\t2015/C56-10.\\n8-K(1)001-357584.4June\\t23,\\t2015\\n4.45Seventy-Fifth\\tSupplemental\\tIndenture,\\tdated\\tas\\tof\\nJune\\t22,\\t2015,\\tby\\tand\\tbetween\\tSolarCity\\tand\\tthe\\nTrustee,\\trelated\\tto\\tSolarCity’s\\t5.45%\\tSolar\\tBonds,\\nSeries\\t2015/C57-15.\\n8-K(1)001-357584.5June\\t23,\\t2015\\n4.46Eightieth\\tSupplemental\\tIndenture,\\tdated\\tas\\tof\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 102,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 51\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"4.46Eightieth\\tSupplemental\\tIndenture,\\tdated\\tas\\tof\\nJune\\t29,\\t2015,\\tby\\tand\\tbetween\\tSolarCity\\tand\\tthe\\nTrustee,\\trelated\\tto\\tSolarCity’s\\t4.70%\\tSolar\\tBonds,\\nSeries\\t2015/C61-10.\\n8-K(1)001-357584.5June\\t29,\\t2015\\n100\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 102,\n        \"lines\": {\n          \"from\": 51,\n          \"to\": 56\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Exhibit\\nNumber\\nIncorporated\\tby\\tReference\\nFiled\\nHerewithExhibit\\tDescriptionFormFile\\tNo.ExhibitFiling\\tDate\\n4.47Eighty-First\\tSupplemental\\tIndenture,\\tdated\\tas\\tof\\nJune\\t29,\\t2015,\\tby\\tand\\tbetween\\tSolarCity\\tand\\tthe\\nTrustee,\\trelated\\tto\\tSolarCity’s\\t5.45%\\tSolar\\tBonds,\\nSeries\\t2015/C62-15.\\n8-K(1)001-357584.6June\\t29,\\t2015\\n4.48Ninetieth\\tSupplemental\\tIndenture,\\tdated\\tas\\tof\\tJuly\\n20,\\t2015,\\tby\\tand\\tbetween\\tSolarCity\\tand\\tthe\\nTrustee,\\trelated\\tto\\tSolarCity’s\\t4.70%\\tSolar\\tBonds,\\nSeries\\t2015/C71-10.\\n8-K(1)001-357584.5July\\t21,\\t2015\\n4.49Ninety-First\\tSupplemental\\tIndenture,\\tdated\\tas\\tof\\nJuly\\t20,\\t2015,\\tby\\tand\\tbetween\\tSolarCity\\tand\\tthe\\nTrustee,\\trelated\\tto\\tSolarCity’s\\t5.45%\\tSolar\\tBonds,\\nSeries\\t2015/C72-15.\\n8-K(1)001-357584.6July\\t21,\\t2015\\n4.50Ninety-Fifth\\tSupplemental\\tIndenture,\\tdated\\tas\\tof\\nJuly\\t31,\\t2015,\\tby\\tand\\tbetween\\tSolarCity\\tand\\tthe\\nTrustee,\\trelated\\tto\\tSolarCity’s\\t5.00%\\tSolar\\tBonds,\\nSeries\\t2015/20-10.\\n8-K(1)001-357584.5July\\t31,\\t2015\\n4.51Ninety-Sixth\\tSupplemental\\tIndenture,\\tdated\\tas\\tof\\nJuly\\t31,\\t2015,\\tby\\tand\\tbetween\\tSolarCity\\tand\\tthe\\nTrustee,\\trelated\\tto\\tSolarCity’s\\t5.75%\\tSolar\\tBonds,\\nSeries\\t2015/21-15.\\n8-K(1)001-357584.6July\\t31,\\t2015\\n4.52One\\tHundred-and-Fifth\\tSupplemental\\tIndenture,\\ndated\\tas\\tof\\tAugust\\t10,\\t2015,\\tby\\tand\\tbetween\\nSolarCity\\tand\\tthe\\tTrustee,\\trelated\\tto\\tSolarCity’s\\n4.70%\\tSolar\\tBonds,\\tSeries\\t2015/C81-10.\\n8-K(1)001-357584.5August\\t10,\\t2015\\n4.53One\\tHundred-and-Eleventh\\tSupplemental\\nIndenture,\\tdated\\tas\\tof\\tAugust\\t17,\\t2015,\\tby\\tand\\nbetween\\tSolarCity\\tand\\tthe\\tTrustee,\\trelated\\tto\\nSolarCity’s\\t5.45%\\tSolar\\tBonds,\\tSeries\\t2015/C87-\\n15.\\n8-K(1)001-357584.6August\\t17,\\t2015\\n4.54One\\tHundred-and-Sixteenth\\tSupplemental\\nIndenture,\\tdated\\tas\\tof\\tAugust\\t24,\\t2015,\\tby\\tand\\nbetween\\tSolarCity\\tand\\tthe\\tTrustee,\\trelated\\tto\\nSolarCity’s\\t5.45%\\tSolar\\tBonds,\\tSeries\\t2015/C92-\\n15.\\n8-K(1)001-357584.6August\\t24,\\t2015\\n4.55One\\tHundred-and-Twenty-First\\tSupplemental\\nIndenture,\\tdated\\tas\\tof\\tAugust\\t31,\\t2015,\\tby\\tand\\nbetween\\tSolarCity\\tand\\tthe\\tTrustee,\\trelated\\tto\\nSolarCity’s\\t5.45%\\tSolar\\tBonds,\\tSeries\\t2015/C97-\\n15.\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 103,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 52\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"15.\\n8-K(1)001-357584.6August\\t31,\\t2015\\n4.56One\\tHundred-and-Twenty-Eighth\\tSupplemental\\nIndenture,\\tdated\\tas\\tof\\tSeptember\\t14,\\t2015,\\tby\\nand\\tbetween\\tSolarCity\\tand\\tthe\\tTrustee,\\trelated\\tto\\nSolarCity’s\\t4.70%\\tSolar\\tBonds,\\tSeries\\t2015/C101-\\n10.\\n8-K(1)001-357584.5September\\t15,\\t2015\\n101\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 103,\n        \"lines\": {\n          \"from\": 52,\n          \"to\": 60\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Exhibit\\nNumber\\nIncorporated\\tby\\tReference\\nFiled\\nHerewithExhibit\\tDescriptionFormFile\\tNo.ExhibitFiling\\tDate\\n4.57One\\tHundred-and-Twenty-Ninth\\tSupplemental\\nIndenture,\\tdated\\tas\\tof\\tSeptember\\t14,\\t2015,\\tby\\nand\\tbetween\\tSolarCity\\tand\\tthe\\tTrustee,\\trelated\\tto\\nSolarCity’s\\t5.45%\\tSolar\\tBonds,\\tSeries\\t2015/C102-\\n15.\\n8-K(1)001-357584.6September\\t15,\\t2015\\n4.58One\\tHundred-and-Thirty-Third\\tSupplemental\\nIndenture,\\tdated\\tas\\tof\\tSeptember\\t28,\\t2015,\\tby\\nand\\tbetween\\tSolarCity\\tand\\tthe\\tTrustee,\\trelated\\tto\\nSolarCity’s\\t4.70%\\tSolar\\tBonds,\\tSeries\\t2015/C106-\\n10.\\n8-K(1)001-357584.5September\\t29,\\t2015\\n4.59One\\tHundred-and-Thirty-Fourth\\tSupplemental\\nIndenture,\\tdated\\tas\\tof\\tSeptember\\t28,\\t2015,\\tby\\nand\\tbetween\\tSolarCity\\tand\\tthe\\tTrustee,\\trelated\\tto\\nSolarCity’s\\t5.45%\\tSolar\\tBonds,\\tSeries\\t2015/C107-\\n15.\\n8-K(1)001-357584.6September\\t29,\\t2015\\n4.60One\\tHundred-and-Thirty-Eighth\\tSupplemental\\nIndenture,\\tdated\\tas\\tof\\tOctober\\t13,\\t2015,\\tby\\tand\\nbetween\\tSolarCity\\tand\\tthe\\tTrustee,\\trelated\\tto\\nSolarCity’s\\t4.70%\\tSolar\\tBonds,\\tSeries\\t2015/C111-\\n10.\\n8-K(1)001-357584.5October\\t13,\\t2015\\n4.61One\\tHundred-and-Forty-Third\\tSupplemental\\nIndenture,\\tdated\\tas\\tof\\tOctober\\t30,\\t2015,\\tby\\tand\\nbetween\\tSolarCity\\tand\\tthe\\tTrustee,\\trelated\\tto\\nSolarCity’s\\t5.00%\\tSolar\\tBonds,\\tSeries\\t2015/25-10.\\n8-K(1)001-357584.5October\\t30,\\t2015\\n4.62One\\tHundred-and-Forty-Fourth\\tSupplemental\\nIndenture,\\tdated\\tas\\tof\\tOctober\\t30,\\t2015,\\tby\\tand\\nbetween\\tSolarCity\\tand\\tthe\\tTrustee,\\trelated\\tto\\nSolarCity’s\\t5.75%\\tSolar\\tBonds,\\tSeries\\t2015/26-15.\\n8-K(1)001-357584.6October\\t30,\\t2015\\n4.63One\\tHundred-and-Forty-Eighth\\tSupplemental\\nIndenture,\\tdated\\tas\\tof\\tNovember\\t4,\\t2015,\\tby\\tand\\nbetween\\tSolarCity\\tand\\tthe\\tTrustee,\\trelated\\tto\\nSolarCity’s\\t4.70%\\tSolar\\tBonds,\\tSeries\\t2015/C116-\\n10.\\n8-K(1)001-357584.5November\\t4,\\t2015\\n4.64One\\tHundred-and-Fifty-Third\\tSupplemental\\nIndenture,\\tdated\\tas\\tof\\tNovember\\t16,\\t2015,\\tby\\nand\\tbetween\\tSolarCity\\tand\\tthe\\tTrustee,\\trelated\\tto\\nSolarCity’s\\t4.70%\\tSolar\\tBonds,\\tSeries\\t2015/C121-\\n10.\\n8-K(1)001-357584.5November\\t17,\\t2015\\n4.65One\\tHundred-and-Fifty-Fourth\\tSupplemental\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 104,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 52\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"4.65One\\tHundred-and-Fifty-Fourth\\tSupplemental\\nIndenture,\\tdated\\tas\\tof\\tNovember\\t16,\\t2015,\\tby\\nand\\tbetween\\tSolarCity\\tand\\tthe\\tTrustee,\\trelated\\tto\\nSolarCity’s\\t5.45%\\tSolar\\tBonds,\\tSeries\\t2015/C122-\\n15.\\n8-K(1)001-357584.6November\\t17,\\t2015\\n102\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 104,\n        \"lines\": {\n          \"from\": 52,\n          \"to\": 58\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Exhibit\\nNumber\\nIncorporated\\tby\\tReference\\nFiled\\nHerewithExhibit\\tDescriptionFormFile\\tNo.ExhibitFiling\\tDate\\n4.66One\\tHundred-and-Fifty-Eighth\\tSupplemental\\nIndenture,\\tdated\\tas\\tof\\tNovember\\t30,\\t2015,\\tby\\nand\\tbetween\\tSolarCity\\tand\\tthe\\tTrustee,\\trelated\\tto\\nSolarCity’s\\t4.70%\\tSolar\\tBonds,\\tSeries\\t2015/C126-\\n10.\\n8-K(1)001-357584.5November\\t30,\\t2015\\n4.67One\\tHundred-and-Fifty-Ninth\\tSupplemental\\nIndenture,\\tdated\\tas\\tof\\tNovember\\t30,\\t2015,\\tby\\nand\\tbetween\\tSolarCity\\tand\\tthe\\tTrustee,\\trelated\\tto\\nSolarCity’s\\t5.45%\\tSolar\\tBonds,\\tSeries\\t2015/C127-\\n15.\\n8-K(1)001-357584.6November\\t30,\\t2015\\n4.68One\\tHundred-and-Sixty-Third\\tSupplemental\\nIndenture,\\tdated\\tas\\tof\\tDecember\\t14,\\t2015,\\tby\\tand\\nbetween\\tSolarCity\\tand\\tthe\\tTrustee,\\trelated\\tto\\nSolarCity’s\\t4.70%\\tSolar\\tBonds,\\tSeries\\t2015/C131-\\n10.\\n8-K(1)001-357584.5December\\t14,\\t2015\\n4.69One\\tHundred-and-Sixty-Fourth\\tSupplemental\\nIndenture,\\tdated\\tas\\tof\\tDecember\\t14,\\t2015,\\tby\\tand\\nbetween\\tSolarCity\\tand\\tthe\\tTrustee,\\trelated\\tto\\nSolarCity’s\\t5.45%\\tSolar\\tBonds,\\tSeries\\t2015/C132-\\n15.\\n8-K(1)001-357584.6December\\t14,\\t2015\\n4.70One\\tHundred-and-Sixty-Eighth\\tSupplemental\\nIndenture,\\tdated\\tas\\tof\\tDecember\\t28,\\t2015,\\tby\\tand\\nbetween\\tSolarCity\\tand\\tthe\\tTrustee,\\trelated\\tto\\nSolarCity’s\\t4.70%\\tSolar\\tBonds,\\tSeries\\t2015/C136-\\n10.\\n8-K(1)001-357584.5December\\t28,\\t2015\\n4.71One\\tHundred-and-Sixty-Ninth\\tSupplemental\\nIndenture,\\tdated\\tas\\tof\\tDecember\\t28,\\t2015,\\tby\\tand\\nbetween\\tSolarCity\\tand\\tthe\\tTrustee,\\trelated\\tto\\nSolarCity’s\\t5.45%\\tSolar\\tBonds,\\tSeries\\t2015/C137-\\n15.\\n8-K(1)001-357584.6December\\t28,\\t2015\\n4.72One\\tHundred-and-Seventy-Third\\tSupplemental\\nIndenture,\\tdated\\tas\\tof\\tJanuary\\t29,\\t2016,\\tby\\tand\\nbetween\\tSolarCity\\tand\\tthe\\tTrustee,\\trelated\\tto\\nSolarCity’s\\t5.00%\\tSolar\\tBonds,\\tSeries\\t2016/4-10.\\n8-K(1)001-357584.5January\\t29,\\t2016\\n4.73One\\tHundred-and-Seventy-Fourth\\tSupplemental\\nIndenture,\\tdated\\tas\\tof\\tJanuary\\t29,\\t2016,\\tby\\tand\\nbetween\\tSolarCity\\tand\\tthe\\tTrustee,\\trelated\\tto\\nSolarCity’s\\t5.75%\\tSolar\\tBonds,\\tSeries\\t2016/5-15.\\n8-K(1)001-357584.6January\\t29,\\t2016\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 105,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 51\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"8-K(1)001-357584.6January\\t29,\\t2016\\n4.74Description\\tof\\tRegistrant’s\\tSecurities10-K001-347564.119February\\t13,\\t2020\\n10.1**Form\\tof\\tIndemnification\\tAgreement\\tbetween\\tthe\\nRegistrant\\tand\\tits\\tdirectors\\tand\\tofficers.\\nS-1/A333-16459310.1June\\t15,\\t2010\\n10.2**2003\\tEquity\\tIncentive\\tPlan.S-1/A333-16459310.2May\\t27,\\t2010\\n103\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 105,\n        \"lines\": {\n          \"from\": 51,\n          \"to\": 57\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Exhibit\\nNumber\\nIncorporated\\tby\\tReference\\nFiled\\nHerewithExhibit\\tDescriptionFormFile\\tNo.ExhibitFiling\\tDate\\n10.3**Form\\tof\\tStock\\tOption\\tAgreement\\tunder\\t2003\\nEquity\\tIncentive\\tPlan.\\nS-1333-16459310.3January\\t29,\\t2010\\n10.4**Amended\\tand\\tRestated\\t2010\\tEquity\\tIncentive\\nPlan.\\n10-K001-3475610.4February\\t23,\\t2018\\n10.5**Form\\tof\\tStock\\tOption\\tAgreement\\tunder\\t2010\\nEquity\\tIncentive\\tPlan.\\n10-K001-3475610.6March\\t1,\\t2017\\n10.6**Form\\tof\\tRestricted\\tStock\\tUnit\\tAward\\tAgreement\\nunder\\t2010\\tEquity\\tIncentive\\tPlan.\\n10-K001-3475610.7March\\t1,\\t2017\\n10.7**Amended\\tand\\tRestated\\t2010\\tEmployee\\tStock\\nPurchase\\tPlan,\\teffective\\tas\\tof\\tFebruary\\t1,\\t2017.\\n10-K001-3475610.8March\\t1,\\t2017\\n10.8**2019\\tEquity\\tIncentive\\tPlan.S-8333-2320794.2June\\t12,\\t2019\\n10.9**Form\\tof\\tStock\\tOption\\tAgreement\\tunder\\t2019\\nEquity\\tIncentive\\tPlan.\\nS-8333-2320794.3June\\t12,\\t2019\\n10.10**Form\\tof\\tRestricted\\tStock\\tUnit\\tAward\\tAgreement\\nunder\\t2019\\tEquity\\tIncentive\\tPlan.\\nS-8333-2320794.4June\\t12,\\t2019\\n10.11**Employee\\tStock\\tPurchase\\tPlan,\\teffective\\tas\\tof\\nJune\\t12,\\t2019.\\nS-8333-2320794.5June\\t12,\\t2019\\n10.12**2007\\tSolarCity\\tStock\\tPlan\\tand\\tform\\tof\\tagreements\\nused\\tthereunder.\\nS-1(1)333-18431710.2October\\t5,\\t2012\\n10.13**2012\\tSolarCity\\tEquity\\tIncentive\\tPlan\\tand\\tform\\tof\\nagreements\\tused\\tthereunder.\\nS-1(1)333-18431710.3October\\t5,\\t2012\\n10.14**2010\\tZep\\tSolar,\\tInc.\\tEquity\\tIncentive\\tPlan\\tand\\nform\\tof\\tagreements\\tused\\tthereunder.\\nS-8(1)333-1929964.5December\\t20,\\t2013\\n10.15**Offer\\tLetter\\tbetween\\tthe\\tRegistrant\\tand\\tElon\\nMusk\\tdated\\tOctober\\t13,\\t2008.\\nS-1333-16459310.9January\\t29,\\t2010\\n10.16**Performance\\tStock\\tOption\\tAgreement\\tbetween\\nthe\\tRegistrant\\tand\\tElon\\tMusk\\tdated\\tJanuary\\t21,\\n2018.\\nDEF\\t14A001-34756Appendix\\tAFebruary\\t8,\\t2018\\n10.17**Maxwell\\tTechnologies,\\tInc.\\t2005\\tOmnibus\\tEquity\\nIncentive\\tPlan,\\tas\\tamended\\tthrough\\tMay\\t6,\\t2010\\n8-K(2)001-1547710.1May\\t10,\\t2010\\n10.18**Maxwell\\tTechnologies,\\tInc.\\t2013\\tOmnibus\\tEquity\\nIncentive\\tPlan\\nDEF\\t14A(2)001-15477Appendix\\tAJune\\t2,\\t2017\\n10.19Indemnification\\tAgreement,\\teffective\\tas\\tof\\tJune\\n23,\\t2020,\\tbetween\\tRegistrant\\tand\\tElon\\tR.\\tMusk.\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 106,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 54\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"23,\\t2020,\\tbetween\\tRegistrant\\tand\\tElon\\tR.\\tMusk.\\n10-Q001-3475610.4July\\t28,\\t2020\\n104\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 106,\n        \"lines\": {\n          \"from\": 54,\n          \"to\": 56\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Exhibit\\nNumber\\nIncorporated\\tby\\tReference\\nFiled\\nHerewithExhibit\\tDescriptionFormFile\\tNo.ExhibitFiling\\tDate\\n10.20Indemnification\\tAgreement,\\tdated\\tas\\tof\\tFebruary\\n27,\\t2014,\\tby\\tand\\tbetween\\tthe\\tRegistrant\\tand\\tJ.P.\\nMorgan\\tSecurities\\tLLC.\\n8-K001-3475610.1March\\t5,\\t2014\\n10.21Form\\tof\\tCall\\tOption\\tConfirmation\\trelating\\tto\\n1.25%\\tConvertible\\tSenior\\tNotes\\tDue\\tMarch\\t1,\\n2021.\\n8-K001-3475610.3March\\t5,\\t2014\\n10.22Form\\tof\\tWarrant\\tConfirmation\\trelating\\tto\\t1.25%\\nConvertible\\tSenior\\tNotes\\tDue\\tMarch\\t1,\\t2021.\\n8-K001-3475610.5March\\t5,\\t2014\\n10.23Form\\tof\\tCall\\tOption\\tConfirmation\\trelating\\tto\\n2.00%\\tConvertible\\tSenior\\tNotes\\tdue\\tMay\\t15,\\n2024.\\n8-K001-3475610.1May\\t3,\\t2019\\n10.24Form\\tof\\tWarrant\\tConfirmation\\trelating\\tto\\t2.00%\\nConvertible\\tSenior\\tNotes\\tdue\\tMay\\t15,\\t2024.\\n8-K001-3475610.2May\\t3,\\t2019\\n10.25†Supply\\tAgreement\\tbetween\\tPanasonic\\nCorporation\\tand\\tthe\\tRegistrant\\tdated\\tOctober\\t5,\\n2011.\\n10-K001-3475610.50February\\t27,\\t2012\\n10.26†Amendment\\tNo.\\t1\\tto\\tSupply\\tAgreement\\tbetween\\nPanasonic\\tCorporation\\tand\\tthe\\tRegistrant\\tdated\\nOctober\\t29,\\t2013.\\n10-K001-3475610.35AFebruary\\t26,\\t2014\\n10.27Agreement\\tbetween\\tPanasonic\\tCorporation\\tand\\nthe\\tRegistrant\\tdated\\tJuly\\t31,\\t2014.\\n10-Q001-3475610.1November\\t7,\\t2014\\n10.28†General\\tTerms\\tand\\tConditions\\tbetween\\tPanasonic\\nCorporation\\tand\\tthe\\tRegistrant\\tdated\\tOctober\\t1,\\n2014.\\n8-K001-3475610.2October\\t11,\\t2016\\n10.29Letter\\tAgreement,\\tdated\\tas\\tof\\tFebruary\\t24,\\t2015,\\nregarding\\taddition\\tof\\tco-party\\tto\\tGeneral\\tTerms\\nand\\tConditions,\\tProduction\\tPricing\\tAgreement\\tand\\nInvestment\\tLetter\\tAgreement\\tbetween\\tPanasonic\\nCorporation\\tand\\tthe\\tRegistrant.\\n10-K001-3475610.25AFebruary\\t24,\\t2016\\n10.30†Amendment\\tto\\tGigafactory\\tGeneral\\tTerms,\\tdated\\nMarch\\t1,\\t2016,\\tby\\tand\\tamong\\tthe\\tRegistrant,\\nPanasonic\\tCorporation\\tand\\tPanasonic\\tEnergy\\nCorporation\\tof\\tNorth\\tAmerica.\\n8-K001-3475610.1October\\t11,\\t2016\\n10.31††Amended\\tand\\tRestated\\tGeneral\\tTerms\\tand\\nConditions\\tfor\\tGigafactory,\\tentered\\tinto\\ton\\tJune\\n10,\\t2020,\\tby\\tand\\tamong\\tRegistrant,\\tTesla\\tMotors\\nNetherlands\\tB.V.,\\tPanasonic\\tCorporation\\tand\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 107,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 53\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Netherlands\\tB.V.,\\tPanasonic\\tCorporation\\tand\\nPanasonic\\tCorporation\\tof\\tNorth\\tAmerica.\\n10-Q001-3475610.2July\\t28,\\t2020\\n10.32†Production\\tPricing\\tAgreement\\tbetween\\tPanasonic\\nCorporation\\tand\\tthe\\tRegistrant\\tdated\\tOctober\\t1,\\n2014.\\n10-Q001-3475610.3November\\t7,\\t2014\\n105\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 107,\n        \"lines\": {\n          \"from\": 53,\n          \"to\": 60\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Exhibit\\nNumber\\nIncorporated\\tby\\tReference\\nFiled\\nHerewithExhibit\\tDescriptionFormFile\\tNo.ExhibitFiling\\tDate\\n10.33†Investment\\tLetter\\tAgreement\\tbetween\\tPanasonic\\nCorporation\\tand\\tthe\\tRegistrant\\tdated\\tOctober\\t1,\\n2014.\\n10-Q001-3475610.4November\\t7,\\t2014\\n10.34Amendment\\tto\\tGigafactory\\tDocuments,\\tdated\\nApril\\t5,\\t2016,\\tby\\tand\\tamong\\tthe\\tRegistrant,\\nPanasonic\\tCorporation,\\tPanasonic\\tCorporation\\tof\\nNorth\\tAmerica\\tand\\tPanasonic\\tEnergy\\tCorporation\\nof\\tNorth\\tAmerica.\\n10-Q001-3475610.2May\\t10,\\t2016\\n10.35††2019\\tPricing\\tAgreement\\t(Japan\\tCells)\\twith\\trespect\\nto\\t2011\\tSupply\\tAgreement,\\texecuted\\tSeptember\\n20,\\t2019,\\tby\\tand\\tamong\\tthe\\tRegistrant,\\tTesla\\nMotors\\tNetherlands\\tB.V.,\\tPanasonic\\tCorporation\\nand\\tSANYO\\tElectric\\tCo.,\\tLtd.\\n10-Q001-3475610.6October\\t29,\\t2019\\n10.36††2020\\tPricing\\tAgreement\\t(Gigafactory\\t2170\\tCells),\\nentered\\tinto\\ton\\tJune\\t9,\\t2020,\\tby\\tand\\tamong\\nRegistrant,\\tTesla\\tMotors\\tNetherlands\\tB.V.,\\nPanasonic\\tCorporation\\tand\\tPanasonic\\tCorporation\\nof\\tNorth\\tAmerica.\\n10-Q001-3475610.3July\\t28,\\t2020\\n10.37††2021\\tPricing\\tAgreement\\t(Japan\\tCells)\\twith\\trespect\\nto\\t2011\\tSupply\\tAgreement,\\texecuted\\tDecember\\n29,\\t2020,\\tby\\tand\\tamong\\tthe\\tRegistrant,\\tTesla\\nMotors\\tNetherlands\\tB.V.,\\tPanasonic\\tCorporation\\tof\\nNorth\\tAmerica\\tand\\tSANYO\\tElectric\\tCo.,\\tLtd.\\n10-K001-3475610.39February\\t8,\\t2021\\n10.38††Amended\\tand\\tRestated\\tFactory\\tLease,\\texecuted\\nas\\tof\\tMarch\\t26,\\t2019,\\tby\\tand\\tbetween\\tthe\\nRegistrant\\tand\\tPanasonic\\tEnergy\\tNorth\\tAmerica,\\ta\\ndivision\\tof\\tPanasonic\\tCorporation\\tof\\tNorth\\nAmerica,\\tas\\ttenant.\\n10-Q001-3475610.3July\\t29,\\t2019\\n10.39††Lease\\tAmendment,\\texecuted\\tSeptember\\t20,\\n2019,\\tby\\tand\\tamong\\tthe\\tRegistrant,\\tPanasonic\\nCorporation\\tof\\tNorth\\tAmerica,\\ton\\tbehalf\\tof\\tits\\ndivision\\tPanasonic\\tEnergy\\tof\\tNorth\\tAmerica,\\twith\\nrespect\\tto\\tthe\\tAmended\\tand\\tRestated\\tFactory\\nLease,\\texecuted\\tas\\tof\\tMarch\\t26,\\t2019.\\n10-Q001-3475610.7October\\t29,\\t2019\\n10.40††Second\\tLease\\tAmendment,\\tentered\\tinto\\ton\\tJune\\n9,\\t2020,\\tby\\tand\\tbetween\\tthe\\tRegistrant\\tand\\nPanasonic\\tEnergy\\tof\\tNorth\\tAmerica,\\ta\\tdivision\\tof\\nPanasonic\\tCorporation\\tof\\tNorth\\tAmerica,\\twith\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 108,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 50\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Panasonic\\tCorporation\\tof\\tNorth\\tAmerica,\\twith\\nrespect\\tto\\tthe\\tAmended\\tand\\tRestated\\tFactory\\nLease\\tdated\\tJanuary\\t1,\\t2017.\\n10-Q001-3475610.1July\\t28,\\t2020\\n106\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 108,\n        \"lines\": {\n          \"from\": 50,\n          \"to\": 54\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Exhibit\\nNumber\\nIncorporated\\tby\\tReference\\nFiled\\nHerewithExhibit\\tDescriptionFormFile\\tNo.ExhibitFiling\\tDate\\n10.41Amendment\\tand\\tRestatement\\tin\\trespect\\tof\\tABL\\nCredit\\tAgreement,\\tdated\\tas\\tof\\tMarch\\t6,\\t2019,\\tby\\nand\\tamong\\tcertain\\tof\\tthe\\tRegistrant’s\\tand\\tTesla\\nMotors\\tNetherlands\\tB.V.’s\\tdirect\\tor\\tindirect\\nsubsidiaries\\tfrom\\ttime\\tto\\ttime\\tparty\\tthereto,\\tas\\nborrowers,\\tWells\\tFargo\\tBank,\\tNational\\nAssociation,\\tas\\tdocumentation\\tagent,\\tJPMorgan\\nChase\\tBank,\\tN.A.,\\tGoldman\\tSachs\\tBank\\tUSA,\\nMorgan\\tStanley\\tSenior\\tFunding\\tInc.\\tand\\tBank\\tof\\nAmerica,\\tN.A.,\\tas\\tsyndication\\tagents,\\tthe\\tlenders\\nfrom\\ttime\\tto\\ttime\\tparty\\tthereto,\\tand\\tDeutsche\\nBank\\tAG\\tNew\\tYork\\tBranch,\\tas\\tadministrative\\nagent\\tand\\tcollateral\\tagent.\\nS-4/A333-22974910.68April\\t3,\\t2019\\n10.42First\\tAmendment\\tto\\tAmended\\tand\\tRestated\\tABL\\nCredit\\tAgreement,\\tdated\\tas\\tof\\tDecember\\t23,\\n2020,\\tin\\trespect\\tof\\tthe\\tAmended\\tand\\tRestated\\nABL\\tCredit\\tAgreement,\\tdated\\tas\\tof\\tMarch\\t6,\\t2019,\\nby\\tand\\tamong\\tcertain\\tof\\tthe\\tRegistrant’s\\tand\\nTesla\\tMotors\\tNetherlands\\tB.V.’s\\tdirect\\tor\\tindirect\\nsubsidiaries\\tfrom\\ttime\\tto\\ttime\\tparty\\tthereto,\\tas\\nborrowers,\\tWells\\tFargo\\tBank,\\tNational\\nAssociation,\\tas\\tdocumentation\\tagent,\\tJPMorgan\\nChase\\tBank,\\tN.A.,\\tGoldman\\tSachs\\tBank\\tUSA,\\nMorgan\\tStanley\\tSenior\\tFunding\\tInc.\\tand\\tBank\\tof\\nAmerica,\\tN.A.,\\tas\\tsyndication\\tagents,\\tthe\\tlenders\\nfrom\\ttime\\tto\\ttime\\tparty\\tthereto,\\tand\\tDeutsche\\nBank\\tAG\\tNew\\tYork\\tBranch,\\tas\\tadministrative\\nagent\\tand\\tcollateral\\tagent.\\n10-K001-3475610.44February\\t8,\\t2021\\n10.43†Agreement\\tfor\\tTax\\tAbatement\\tand\\tIncentives,\\ndated\\tas\\tof\\tMay\\t7,\\t2015,\\tby\\tand\\tbetween\\tTesla\\nMotors,\\tInc.\\tand\\tthe\\tState\\tof\\tNevada,\\tacting\\tby\\nand\\tthrough\\tthe\\tNevada\\tGovernor’s\\tOffice\\tof\\nEconomic\\tDevelopment.\\n10-Q001-3475610.1August\\t7,\\t2015\\n10.44Purchase\\tAgreement,\\tdated\\tas\\tof\\tAugust\\t11,\\n2017,\\tby\\tand\\tamong\\tthe\\tRegistrant,\\tSolarCity\\tand\\nGoldman\\tSachs\\t&\\tCo.\\tLLC\\tand\\tMorgan\\tStanley\\t&\\nCo.\\tLLC\\tas\\trepresentatives\\tof\\tthe\\tseveral\\tinitial\\npurchasers\\tnamed\\ttherein.\\n8-K001-3475610.1August\\t23,\\t2017\\n10.45Amended\\tand\\tRestated\\tAgreement\\tFor\\tResearch\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 109,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 48\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"10.45Amended\\tand\\tRestated\\tAgreement\\tFor\\tResearch\\n&\\tDevelopment\\tAlliance\\ton\\tTriex\\tModule\\nTechnology,\\teffective\\tas\\tof\\tSeptember\\t2,\\t2014,\\tby\\nand\\tbetween\\tThe\\tResearch\\tFoundation\\tFor\\tThe\\nState\\tUniversity\\tof\\tNew\\tYork,\\ton\\tbehalf\\tof\\tthe\\nCollege\\tof\\tNanoscale\\tScience\\tand\\tEngineering\\tof\\nthe\\tState\\tUniversity\\tof\\tNew\\tYork,\\tand\\tSilevo,\\tInc.\\n10-Q(1)001-3575810.16November\\t6,\\t2014\\n107\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 109,\n        \"lines\": {\n          \"from\": 48,\n          \"to\": 56\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Exhibit\\nNumber\\nIncorporated\\tby\\tReference\\nFiled\\nHerewithExhibit\\tDescriptionFormFile\\tNo.ExhibitFiling\\tDate\\n10.46First\\tAmendment\\tto\\tAmended\\tand\\tRestated\\nAgreement\\tFor\\tResearch\\t&\\tDevelopment\\tAlliance\\non\\tTriex\\tModule\\tTechnology,\\teffective\\tas\\tof\\nOctober\\t31,\\t2014,\\tby\\tand\\tbetween\\tThe\\tResearch\\nFoundation\\tFor\\tThe\\tState\\tUniversity\\tof\\tNew\\tYork,\\non\\tbehalf\\tof\\tthe\\tCollege\\tof\\tNanoscale\\tScience\\tand\\nEngineering\\tof\\tthe\\tState\\tUniversity\\tof\\tNew\\tYork,\\nand\\tSilevo,\\tInc.\\n10-K(1)001-3575810.16aFebruary\\t24,\\t2015\\n10.47Second\\tAmendment\\tto\\tAmended\\tand\\tRestated\\nAgreement\\tFor\\tResearch\\t&\\tDevelopment\\tAlliance\\non\\tTriex\\tModule\\tTechnology,\\teffective\\tas\\tof\\nDecember\\t15,\\t2014,\\tby\\tand\\tbetween\\tThe\\nResearch\\tFoundation\\tFor\\tThe\\tState\\tUniversity\\tof\\nNew\\tYork,\\ton\\tbehalf\\tof\\tthe\\tCollege\\tof\\tNanoscale\\nScience\\tand\\tEngineering\\tof\\tthe\\tState\\tUniversity\\tof\\nNew\\tYork,\\tand\\tSilevo,\\tInc.\\n10-K(1)001-3575810.16bFebruary\\t24,\\t2015\\n10.48Third\\tAmendment\\tto\\tAmended\\tand\\tRestated\\nAgreement\\tFor\\tResearch\\t&\\tDevelopment\\tAlliance\\non\\tTriex\\tModule\\tTechnology,\\teffective\\tas\\tof\\nFebruary\\t12,\\t2015,\\tby\\tand\\tbetween\\tThe\\tResearch\\nFoundation\\tFor\\tThe\\tState\\tUniversity\\tof\\tNew\\tYork,\\non\\tbehalf\\tof\\tthe\\tCollege\\tof\\tNanoscale\\tScience\\tand\\nEngineering\\tof\\tthe\\tState\\tUniversity\\tof\\tNew\\tYork,\\nand\\tSilevo,\\tInc.\\n10-Q(1)001-3575810.16cMay\\t6,\\t2015\\n10.49Fourth\\tAmendment\\tto\\tAmended\\tand\\tRestated\\nAgreement\\tFor\\tResearch\\t&\\tDevelopment\\tAlliance\\non\\tTriex\\tModule\\tTechnology,\\teffective\\tas\\tof\\tMarch\\n30,\\t2015,\\tby\\tand\\tbetween\\tThe\\tResearch\\nFoundation\\tFor\\tThe\\tState\\tUniversity\\tof\\tNew\\tYork,\\non\\tbehalf\\tof\\tthe\\tCollege\\tof\\tNanoscale\\tScience\\tand\\nEngineering\\tof\\tthe\\tState\\tUniversity\\tof\\tNew\\tYork,\\nand\\tSilevo,\\tInc.\\n10-Q(1)001-3575810.16dMay\\t6,\\t2015\\n10.50Fifth\\tAmendment\\tto\\tAmended\\tand\\tRestated\\nAgreement\\tFor\\tResearch\\t&\\tDevelopment\\tAlliance\\non\\tTriex\\tModule\\tTechnology,\\teffective\\tas\\tof\\tJune\\n30,\\t2015,\\tby\\tand\\tbetween\\tThe\\tResearch\\nFoundation\\tFor\\tThe\\tState\\tUniversity\\tof\\tNew\\tYork,\\non\\tbehalf\\tof\\tthe\\tCollege\\tof\\tNanoscale\\tScience\\tand\\nEngineering\\tof\\tthe\\tState\\tUniversity\\tof\\tNew\\tYork,\\nand\\tSilevo,\\tLLC.\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 110,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 49\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"and\\tSilevo,\\tLLC.\\n10-Q(1)001-3575810.16eJuly\\t30,\\t2015\\n10.51Sixth\\tAmendment\\tto\\tAmended\\tand\\tRestated\\nAgreement\\tFor\\tResearch\\t&\\tDevelopment\\tAlliance\\non\\tTriex\\tModule\\tTechnology,\\teffective\\tas\\tof\\nSeptember\\t1,\\t2015,\\tby\\tand\\tbetween\\tThe\\nResearch\\tFoundation\\tFor\\tThe\\tState\\tUniversity\\tof\\nNew\\tYork,\\ton\\tbehalf\\tof\\tthe\\tCollege\\tof\\tNanoscale\\nScience\\tand\\tEngineering\\tof\\tthe\\tState\\tUniversity\\tof\\nNew\\tYork,\\tand\\tSilevo,\\tLLC.\\n10-Q(1)001-3575810.16fOctober\\t30,\\t2015\\n108\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 110,\n        \"lines\": {\n          \"from\": 49,\n          \"to\": 60\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Exhibit\\nNumber\\nIncorporated\\tby\\tReference\\nFiled\\nHerewithExhibit\\tDescriptionFormFile\\tNo.ExhibitFiling\\tDate\\n10.52Seventh\\tAmendment\\tto\\tAmended\\tand\\tRestated\\nAgreement\\tFor\\tResearch\\t&\\tDevelopment\\tAlliance\\non\\tTriex\\tModule\\tTechnology,\\teffective\\tas\\tof\\nOctober\\t9,\\t2015,\\tby\\tand\\tbetween\\tThe\\tResearch\\nFoundation\\tFor\\tThe\\tState\\tUniversity\\tof\\tNew\\tYork,\\non\\tbehalf\\tof\\tthe\\tCollege\\tof\\tNanoscale\\tScience\\tand\\nEngineering\\tof\\tthe\\tState\\tUniversity\\tof\\tNew\\tYork,\\nand\\tSilevo,\\tLLC.\\n10-Q(1)001-3575810.16gOctober\\t30,\\t2015\\n10.53Eighth\\tAmendment\\tto\\tAmended\\tand\\tRestated\\nAgreement\\tFor\\tResearch\\t&\\tDevelopment\\tAlliance\\non\\tTriex\\tModule\\tTechnology,\\teffective\\tas\\tof\\nOctober\\t26,\\t2015,\\tby\\tand\\tbetween\\tThe\\tResearch\\nFoundation\\tFor\\tThe\\tState\\tUniversity\\tof\\tNew\\tYork,\\non\\tbehalf\\tof\\tthe\\tCollege\\tof\\tNanoscale\\tScience\\tand\\nEngineering\\tof\\tthe\\tState\\tUniversity\\tof\\tNew\\tYork,\\nand\\tSilevo,\\tLLC.\\n10-Q(1)001-3575810.16hOctober\\t30,\\t2015\\n10.54Ninth\\tAmendment\\tto\\tAmended\\tand\\tRestated\\nAgreement\\tFor\\tResearch\\t&\\tDevelopment\\tAlliance\\non\\tTriex\\tModule\\tTechnology,\\teffective\\tas\\tof\\nDecember\\t9,\\t2015,\\tby\\tand\\tbetween\\tThe\\tResearch\\nFoundation\\tFor\\tThe\\tState\\tUniversity\\tof\\tNew\\tYork,\\non\\tbehalf\\tof\\tthe\\tCollege\\tof\\tNanoscale\\tScience\\tand\\nEngineering\\tof\\tthe\\tState\\tUniversity\\tof\\tNew\\tYork,\\nand\\tSilevo,\\tLLC.\\n10-K(1)001-3575810.16iFebruary\\t10,\\t2016\\n10.55Tenth\\tAmendment\\tto\\tAmended\\tand\\tRestated\\nAgreement\\tFor\\tResearch\\t&\\tDevelopment\\tAlliance\\non\\tTriex\\tModule\\tTechnology,\\teffective\\tas\\tof\\tMarch\\n31,\\t2017,\\tby\\tand\\tbetween\\tThe\\tResearch\\nFoundation\\tFor\\tThe\\tState\\tUniversity\\tof\\tNew\\tYork,\\non\\tbehalf\\tof\\tthe\\tColleges\\tof\\tNanoscale\\tScience\\nand\\tEngineering\\tof\\tthe\\tState\\tUniversity\\tof\\tNew\\nYork,\\tand\\tSilevo,\\tLLC.\\n10-Q001-3475610.8May\\t10,\\t2017\\n10.56Eleventh\\tAmendment\\tto\\tAmended\\tand\\tRestated\\nAgreement\\tfor\\tResearch\\t&\\tDevelopment\\tAlliance\\non\\tTriex\\tModule\\tTechnology,\\teffective\\tas\\tof\\tJuly\\n22,\\t2020,\\tamong\\tthe\\tResearch\\tFoundation\\tfor\\tthe\\nState\\tUniversity\\tof\\tNew\\tYork,\\tSilevo,\\tLLC\\tand\\nTesla\\tEnergy\\tOperations,\\tInc.\\n10-Q001-3475610.6July\\t28,\\t2020\\n10.57Twelfth\\tAmendment\\tto\\tAmended\\tand\\tRestated\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 111,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 49\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"10.57Twelfth\\tAmendment\\tto\\tAmended\\tand\\tRestated\\nAgreement\\tfor\\tResearch\\t&\\tDevelopment\\tAlliance\\non\\tTriex\\tModule\\tTechnology,\\teffective\\tas\\tof\\tMay\\n1,\\t2021,\\tamong\\tthe\\tResearch\\tFoundation\\tfor\\tthe\\nState\\tUniversity\\tof\\tNew\\tYork,\\tSilevo,\\tLLC\\tand\\nTesla\\tEnergy\\tOperations,\\tInc.\\n10-Q001-3475610.1October\\t25,\\t2021\\n109\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 111,\n        \"lines\": {\n          \"from\": 49,\n          \"to\": 56\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Exhibit\\nNumber\\nIncorporated\\tby\\tReference\\nFiled\\nHerewithExhibit\\tDescriptionFormFile\\tNo.ExhibitFiling\\tDate\\n10.58††Grant\\tContract\\tfor\\tState-Owned\\tConstruction\\tLand\\nUse\\tRight,\\tdated\\tas\\tof\\tOctober\\t17,\\t2018,\\tby\\tand\\nbetween\\tShanghai\\tPlanning\\tand\\tLand\\tResource\\nAdministration\\tBureau,\\tas\\tgrantor,\\tand\\tTesla\\n(Shanghai)\\tCo.,\\tLtd.,\\tas\\tgrantee\\t(English\\ntranslation).\\n10-Q001-3475610.2July\\t29,\\t2019\\n10.59Credit\\tAgreement,\\tdated\\tas\\tof\\tJanuary\\t20,\\t2023,\\namong\\tTesla,\\tInc.,\\tthe\\tLenders\\tand\\tIssuing\\tBanks\\nfrom\\ttime\\tto\\ttime\\tparty\\tthereto,\\tCitibank,\\tN.A.,\\tas\\nAdministrative\\tAgent\\tand\\tDeutsche\\tBank\\nSecurities,\\tInc.,\\tas\\tSyndication\\tAgent\\n10-K001-3475610.59January\\t31,\\t2023\\n21.1List\\tof\\tSubsidiaries\\tof\\tthe\\tRegistrant————X\\n23.1Consent\\tof\\tPricewaterhouseCoopers\\tLLP,\\nIndependent\\tRegistered\\tPublic\\tAccounting\\tFirm\\n————X\\n31.1Rule\\t13a-14(a)\\t/\\t15(d)-14(a)\\tCertification\\tof\\nPrincipal\\tExecutive\\tOfficer\\n————X\\n31.2Rule\\t13a-14(a)\\t/\\t15(d)-14(a)\\tCertification\\tof\\nPrincipal\\tFinancial\\tOfficer\\n————X\\n32.1*Section\\t1350\\tCertifications————X\\n97Tesla,\\tInc.\\tClawback\\tPolicy————X\\n101.INSInline\\tXBRL\\tInstance\\tDocument————X\\n101.SCHInline\\tXBRL\\tTaxonomy\\tExtension\\tSchema\\nDocument\\n————X\\n101.CALInline\\tXBRL\\tTaxonomy\\tExtension\\tCalculation\\nLinkbase\\tDocument.\\n————X\\n101.DEFInline\\tXBRL\\tTaxonomy\\tExtension\\tDefinition\\nLinkbase\\tDocument\\n————X\\n101.LABInline\\tXBRL\\tTaxonomy\\tExtension\\tLabel\\tLinkbase\\nDocument\\n————X\\n101.PREInline\\tXBRL\\tTaxonomy\\tExtension\\tPresentation\\nLinkbase\\tDocument\\n————X\\n104Cover\\tPage\\tInteractive\\tData\\tFile\\t(formatted\\tas\\ninline\\tXBRL\\twith\\tapplicable\\ttaxonomy\\textension\\ninformation\\tcontained\\tin\\tExhibits\\t101)\\n*Furnished\\therewith\\n**Indicates\\ta\\tmanagement\\tcontract\\tor\\tcompensatory\\tplan\\tor\\tarrangement\\n†Confidential\\ttreatment\\thas\\tbeen\\trequested\\tfor\\tportions\\tof\\tthis\\texhibit\\n††Portions\\tof\\tthis\\texhibit\\thave\\tbeen\\tredacted\\tin\\tcompliance\\twith\\tRegulation\\tS-K\\tItem\\t601(b)(10).\\n110\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 112,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 54\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"(1)Indicates\\ta\\tfiling\\tof\\tSolarCity\\n(2)Indicates\\ta\\tfiling\\tof\\tMaxwell\\tTechnologies,\\tInc.\\nITEM\\t16.\\tSUMMARY\\nNone.\\n111\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 113,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 5\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"SIGNATURES\\nPursuant\\tto\\tthe\\trequirements\\tof\\tSection\\t13\\tor\\t15(d)\\tthe\\tSecurities\\tExchange\\tAct\\tof\\t1934,\\tthe\\tregistrant\\thas\\tduly\\tcaused\\tthis\\treport\\tto\\tbe\\tsigned\\ton\\nits\\tbehalf\\tby\\tthe\\tundersigned,\\tthereunto\\tduly\\tauthorized.\\nTesla,\\tInc.\\n\\t\\nDate:\\tJanuary\\t26,\\t2024/s/\\tElon\\tMusk\\nElon\\tMusk\\nChief\\tExecutive\\tOfficer\\n(Principal\\tExecutive\\tOfficer)\\nPursuant\\tto\\tthe\\trequirements\\tof\\tthe\\tSecurities\\tExchange\\tAct\\tof\\t1934,\\tthis\\treport\\thas\\tbeen\\tsigned\\tbelow\\tby\\tthe\\tfollowing\\tpersons\\ton\\tbehalf\\tof\\tthe\\nregistrant\\tand\\tin\\tthe\\tcapacities\\tand\\ton\\tthe\\tdates\\tindicated.\\nSignatureTitleDate\\n\\t\\t\\t\\n/s/\\tElon\\tMuskChief\\tExecutive\\tOfficer\\tand\\tDirector\\t(Principal\\tExecutive\\tOfficer)January\\t26,\\t2024\\nElon\\tMusk\\n\\t\\n/s/\\tVaibhav\\tTaneja\\nChief\\tFinancial\\tOfficer\\t(Principal\\tFinancial\\tOfficer\\tand\\tPrincipal\\nAccounting\\tOfficer\\t)January\\t26,\\t2024\\nVaibhav\\tTaneja\\t\\t\\n\\t\\t\\t\\n/s/\\tRobyn\\tDenholmDirectorJanuary\\t26,\\t2024\\nRobyn\\tDenholm\\t\\t\\n\\t\\t\\t\\n/s/\\tIra\\tEhrenpreisDirectorJanuary\\t26,\\t2024\\nIra\\tEhrenpreis\\t\\t\\n\\t\\t\\t\\n/s/\\tJoseph\\tGebbiaDirectorJanuary\\t26,\\t2024\\nJoseph\\tGebbia\\t\\t\\n\\t\\t\\t\\n/s/\\tJames\\tMurdochDirectorJanuary\\t26,\\t2024\\nJames\\tMurdoch\\n/s/\\tKimbal\\tMuskDirectorJanuary\\t26,\\t2024\\nKimbal\\tMusk\\n\\t\\t\\t\\n/s/\\tJB\\tStraubelDirectorJanuary\\t26,\\t2024\\nJB\\tStraubel\\t\\t\\n\\t\\t\\t\\n/s/\\tKathleen\\tWilson-ThompsonDirectorJanuary\\t26,\\t2024\\nKathleen\\tWilson-Thompson\\t\\t\\nExhibit\\t21.1\\nSUBSIDIARIES\\tOF\\tTESLA,\\tINC.\\n112\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 114,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 43\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Name\\tof\\tSubsidiary\\nJurisdiction\\tof\\nIncorporation\\tor\\tOrganization\\nAlabama\\tService\\tLLCDelaware\\nAll\\tEV\\tHoldings,\\tLLCDelaware\\nAllegheny\\tSolar\\t1,\\tLLCDelaware\\nAllegheny\\tSolar\\tManager\\t1,\\tLLCDelaware\\nAlset\\tTransport\\tGmbHGermany\\nAlset\\tWarehouse\\tGmbHGermany\\nAncon\\tHoldings\\tII,\\tLLCDelaware\\nAncon\\tHoldings\\tIII,\\tLLCDelaware\\nAncon\\tHoldings,\\tLLCDelaware\\nAncon\\tSolar\\tCorporationDelaware\\nAncon\\tSolar\\tI,\\tLLCDelaware\\nAncon\\tSolar\\tII\\tLessee\\tManager,\\tLLCDelaware\\nAncon\\tSolar\\tII\\tLessee,\\tLLCDelaware\\nAncon\\tSolar\\tII\\tLessor,\\tLLCDelaware\\nAncon\\tSolar\\tIII\\tLessee\\tManager,\\tLLCDelaware\\nAncon\\tSolar\\tIII\\tLessee,\\tLLCDelaware\\nAncon\\tSolar\\tIII\\tLessor,\\tLLCDelaware\\nAncon\\tSolar\\tManaging\\tMember\\tI,\\tLLCDelaware\\nArpad\\tSolar\\tBorrower,\\tLLCDelaware\\nArpad\\tSolar\\tI,\\tLLCDelaware\\nArpad\\tSolar\\tManager\\tI,\\tLLCDelaware\\nAU\\tSolar\\t1,\\tLLCDelaware\\nAU\\tSolar\\t2,\\tLLCDelaware\\nBanyan\\tSolarCity\\tManager\\t2010,\\tLLCDelaware\\nBanyan\\tSolarCity\\tOwner\\t2010,\\tLLCDelaware\\nBasking\\tSolar\\tI,\\tLLCDelaware\\nBasking\\tSolar\\tII,\\tLLCDelaware\\nBasking\\tSolar\\tManager\\tII,\\tLLCDelaware\\nBeatrix\\tSolar\\tI,\\tLLCDelaware\\nBernese\\tSolar\\tManager\\tI,\\tLLCDelaware\\nBlue\\tSkies\\tSolar\\tI,\\tLLCDelaware\\nBlue\\tSkies\\tSolar\\tII,\\tLLCDelaware\\nBT\\tConnolly\\tStorage,\\tLLCTexas\\nCaballero\\tSolar\\tManaging\\tMember\\tI,\\tLLCDelaware\\nCaballero\\tSolar\\tManaging\\tMember\\tII,\\tLLCDelaware\\nCaballero\\tSolar\\tManaging\\tMember\\tIII,\\tLLCDelaware\\nCardinal\\tBlue\\tSolar,\\tLLCDelaware\\nCastello\\tSolar\\tI,\\tLLCDelaware\\nCastello\\tSolar\\tII,\\tLLCDelaware\\nCastello\\tSolar\\tIII,\\tLLCDelaware\\nChaparral\\tSREC\\tBorrower,\\tLLCDelaware\\nChaparral\\tSREC\\tHoldings,\\tLLCDelaware\\nChompie\\tSolar\\tI,\\tLLCDelaware\\nChompie\\tSolar\\tII,\\tLLCDelaware\\nChompie\\tSolar\\tManager\\tI,\\tLLCDelaware\\nChompie\\tSolar\\tManager\\tII,\\tLLCDelaware\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 115,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 49\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Clydesdale\\tSC\\tSolar\\tI,\\tLLCDelaware\\nColorado\\tRiver\\tProject,\\tLLCDelaware\\nCommunity\\tSolar\\tPartners,\\tLLCDelaware\\nConnecticut\\tAuto\\tRepair\\tand\\tService\\tLLCDelaware\\nCompass\\tAutomation\\tIncorporatedIllinois\\nDom\\tSolar\\tGeneral\\tPartner\\tI,\\tLLCDelaware\\nDom\\tSolar\\tLessor\\tI,\\tLPCayman\\tIslands\\nDomino\\tSolar\\tLtd.Cayman\\tIslands\\nDom\\tSolar\\tLimited\\tPartner\\tI,\\tLLCDelaware\\nEl\\tRey\\tEV,\\tLLCDelaware\\nFalconer\\tSolar\\tManager\\tI,\\tLLCDelaware\\nFirehorn\\tSolar\\tI,\\tLLCCayman\\tIslands\\nFirehorn\\tSolar\\tManager\\tI,\\tLLCDelaware\\nFocalPoint\\tSolar\\tBorrower,\\tLLCDelaware\\nFocalPoint\\tSolar\\tI,\\tLLCDelaware\\nFocalPoint\\tSolar\\tManager\\tI,\\tLLCDelaware\\nFontane\\tSolar\\tI,\\tLLCDelaware\\nFotovoltaica\\tGI\\t4,\\tS.\\tde\\tR.L.\\tde\\tC.V.Mexico\\nFotovoltaica\\tGI\\t5,\\tS.\\tde\\tR.L.\\tde\\tC.V.Mexico\\nFP\\tSystem\\tOwner,\\tLLCDelaware\\nGiga\\tInsurance\\tTexas,\\tInc.Texas\\nGiga\\tTexas\\tEnergy,\\tLLCDelaware\\nGrohmann\\tEngineering\\tTrading\\t(Shanghai)\\tCo.\\tLtd.China\\nGrohmann\\tUSA,\\tInc.Delaware\\nGuilder\\tSolar,\\tLLCDelaware\\nHamilton\\tSolar,\\tLLCDelaware\\nHarborfields\\tLLCDelaware\\nHangzhou\\tSilevo\\tElectric\\tPower\\tCo.,\\tLtd.China\\nHarpoon\\tSolar\\tI,\\tLLCDelaware\\nHarpoon\\tSolar\\tManager\\tI,\\tLLCDelaware\\nHaymarket\\tHoldings,\\tLLCDelaware\\nHaymarket\\tManager\\t1,\\tLLCDelaware\\nHaymarket\\tSolar\\t1,\\tLLCDelaware\\nHibar\\tSystems\\tEurope\\tGmbHGermany\\nHive\\tBattery\\tInc.Delaware\\nIkehu\\tManager\\tI,\\tLLCDelaware\\nIL\\tBuono\\tSolar\\tI,\\tLLCDelaware\\nIliosson,\\tS.A.\\tde\\tC.V.Mexico\\nIndustrial\\tMaintenance\\tTechnologies,\\tInc.California\\nKansas\\tRepair\\tLLCDelaware\\nKlamath\\tFalls\\tSolar\\t1,\\tLLCDelaware\\nKnight\\tSolar\\tManaging\\tMember\\tI,\\tLLCDelaware\\nKnight\\tSolar\\tManaging\\tMember\\tII,\\tLLCDelaware\\nKnight\\tSolar\\tManaging\\tMember\\tIII,\\tLLCDelaware\\nLandlord\\t2008-A,\\tLLCDelaware\\nLincoln\\tAuto\\tRepair\\tand\\tService\\tLLCDelaware\\nLouis\\tSolar\\tII,\\tLLCDelaware\\nLouis\\tSolar\\tIII,\\tLLCDelaware\\nLouis\\tSolar\\tManager\\tII,\\tLLCDelaware\\nLouis\\tSolar\\tManager\\tIII,\\tLLCDelaware\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 116,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 50\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Louis\\tSolar\\tMaster\\tTenant\\tI,\\tLLCDelaware\\nLouis\\tSolar\\tMT\\tManager\\tI,\\tLLCDelaware\\nLouis\\tSolar\\tOwner\\tI,\\tLLCDelaware\\nLouis\\tSolar\\tOwner\\tManager\\tI,\\tLLCDelaware\\nMaster\\tTenant\\t2008-A,\\tLLCDelaware\\nMatterhorn\\tSolar\\tI,\\tLLCDelaware\\nMaxwell\\tTechnologies,\\tInc.Delaware\\nMegalodon\\tSolar,\\tLLCDelaware\\nMonte\\tRosa\\tSolar\\tI,\\tLLCDelaware\\nMound\\tSolar\\tManager\\tV,\\tLLCDelaware\\nMound\\tSolar\\tManager\\tVI,\\tLLCDelaware\\nMound\\tSolar\\tManager\\tX,\\tLLCDelaware\\nMound\\tSolar\\tManager\\tXI,\\tLLCDelaware\\nMound\\tSolar\\tManager\\tXII,\\tLLCDelaware\\nMound\\tSolar\\tMaster\\tTenant\\tIX,\\tLLCDelaware\\nMound\\tSolar\\tMaster\\tTenant\\tV,\\tLLCCalifornia\\nMound\\tSolar\\tMaster\\tTenant\\tVI,\\tLLCDelaware\\nMound\\tSolar\\tMaster\\tTenant\\tVII,\\tLLCDelaware\\nMound\\tSolar\\tMaster\\tTenant\\tVIII,\\tLLCDelaware\\nMound\\tSolar\\tMT\\tManager\\tIX,\\tLLCDelaware\\nMound\\tSolar\\tMT\\tManager\\tVII,\\tLLCDelaware\\nMound\\tSolar\\tMT\\tManager\\tVIII,\\tLLCDelaware\\nMound\\tSolar\\tOwner\\tIX,\\tLLCDelaware\\nMound\\tSolar\\tOwner\\tManager\\tIX,\\tLLCDelaware\\nMound\\tSolar\\tOwner\\tManager\\tVII,\\tLLCDelaware\\nMound\\tSolar\\tOwner\\tManager\\tVIII,\\tLLCDelaware\\nMound\\tSolar\\tOwner\\tV,\\tLLCCalifornia\\nMound\\tSolar\\tOwner\\tVI,\\tLLCDelaware\\nMound\\tSolar\\tOwner\\tVII,\\tLLCDelaware\\nMound\\tSolar\\tOwner\\tVIII,\\tLLCDelaware\\nMound\\tSolar\\tPartnership\\tX,\\tLLCDelaware\\nMound\\tSolar\\tPartnership\\tXI,\\tLLCDelaware\\nMound\\tSolar\\tPartnership\\tXII,\\tLLCDelaware\\nMS\\tSolarCity\\t2008,\\tLLCDelaware\\nMS\\tSolarCity\\tCommercial\\t2008,\\tLLCDelaware\\nMS\\tSolarCity\\tResidential\\t2008,\\tLLCDelaware\\nNew\\tMexico\\tSales\\tand\\tVehicle\\tService\\tLLCDelaware\\nNBA\\tSolarCity\\tAFB,\\tLLCCalifornia\\nNBA\\tSolarCity\\tCommercial\\tI,\\tLLCCalifornia\\nNBA\\tSolarCity\\tSolar\\tPhoenix,\\tLLCCalifornia\\nNorthern\\tNevada\\tResearch\\tCo.,\\tLLCNevada\\nOranje\\tSolar\\tI,\\tLLCDelaware\\nOranje\\tSolar\\tManager\\tI,\\tLLCDelaware\\nPalmetto\\tAuto\\tRepair\\tand\\tService\\tLLCDelaware\\nParamount\\tEnergy\\tFund\\tI\\tLessee,\\tLLCDelaware\\nParamount\\tEnergy\\tFund\\tI\\tLessor,\\tLLCDelaware\\nPEF\\tI\\tMM,\\tLLCDelaware\\nPerbix\\tMachine\\tCompany,\\tInc.Minnesota\\nPresidio\\tSolar\\tI,\\tLLCDelaware\\nPresidio\\tSolar\\tII,\\tLLCDelaware\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 117,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 50\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Presidio\\tSolar\\tIII,\\tLLCDelaware\\nPukana\\tLa\\tSolar\\tI,\\tLLCDelaware\\nR9\\tSolar\\t1,\\tLLCDelaware\\nRoadster\\tAutomobile\\tSales\\tand\\tService\\t(Beijing)\\tCo.,\\tLtd.China\\nRoadster\\tFinland\\tOyFinland\\nSA\\tVPP\\tHolding\\tTrustAustralia\\nSA\\tVPP\\tProject\\tTrustAustralia\\nSequoia\\tPacific\\tHoldings,\\tLLCDelaware\\nSequoia\\tPacific\\tManager\\tI,\\tLLCDelaware\\nSequoia\\tPacific\\tSolar\\tI,\\tLLCDelaware\\nSequoia\\tSolarCity\\tOwner\\tI,\\tLLCDelaware\\nSierra\\tSolar\\tPower\\t(Hong\\tKong)\\tLimitedHong\\tKong\\nSiiLion,\\tInc.Delaware\\nSilevo,\\tLLCDelaware\\nSolar\\tAquarium\\tHoldings,\\tLLCDelaware\\nSolar\\tEnergy\\tof\\tAmerica\\t1,\\tLLCDelaware\\nSolar\\tEnergy\\tof\\tAmerica\\tManager\\t1,\\tLLCDelaware\\nSolar\\tExplorer,\\tLLCDelaware\\nSolar\\tGezellig\\tHoldings,\\tLLCDelaware\\nSolar\\tHouse\\tI,\\tLLCDelaware\\nSolar\\tHouse\\tII,\\tLLCDelaware\\nSolar\\tHouse\\tIII,\\tLLCDelaware\\nSolar\\tHouse\\tIV,\\tLLCDelaware\\nSolar\\tIntegrated\\tFund\\tI,\\tLLCDelaware\\nSolar\\tIntegrated\\tFund\\tII,\\tLLCDelaware\\nSolar\\tIntegrated\\tFund\\tIII,\\tLLCDelaware\\nSolar\\tIntegrated\\tFund\\tIV-A,\\tLLCDelaware\\nSolar\\tIntegrated\\tFund\\tV,\\tLLCDelaware\\nSolar\\tIntegrated\\tFund\\tVI,\\tLLCDelaware\\nSolar\\tIntegrated\\tManager\\tI,\\tLLCDelaware\\nSolar\\tIntegrated\\tManager\\tII,\\tLLCDelaware\\nSolar\\tIntegrated\\tManager\\tIII,\\tLLCDelaware\\nSolar\\tIntegrated\\tManager\\tIV-A,\\tLLCDelaware\\nSolar\\tIntegrated\\tManager\\tV,\\tLLCDelaware\\nSolar\\tIntegrated\\tManager\\tVI,\\tLLCDelaware\\nSolar\\tServices\\tCompany,\\tLLCDelaware\\nSolar\\tUlysses\\tManager\\tI,\\tLLCDelaware\\nSolar\\tUlysses\\tManager\\tII,\\tLLCDelaware\\nSolar\\tVoyager,\\tLLCDelaware\\nSolar\\tWarehouse\\tManager\\tI,\\tLLCDelaware\\nSolar\\tWarehouse\\tManager\\tII,\\tLLCDelaware\\nSolar\\tWarehouse\\tManager\\tIII,\\tLLCDelaware\\nSolar\\tWarehouse\\tManager\\tIV,\\tLLCDelaware\\nSolarCity\\tAlpine\\tHoldings,\\tLLCDelaware\\nSolarCity\\tAmphitheatre\\tHoldings,\\tLLCDelaware\\nSolarCity\\tArbor\\tHoldings,\\tLLCDelaware\\nSolarCity\\tArches\\tHoldings,\\tLLCDelaware\\nSolarCity\\tAU\\tHoldings,\\tLLCDelaware\\nSolarCity\\tCruyff\\tHoldings,\\tLLCDelaware\\nSolarCity\\tElectrical,\\tLLCDelaware\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 118,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 50\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"SolarCity\\tElectrical\\tNew\\tYork\\tCorporationDelaware\\nSolarCity\\tFinance\\tCompany,\\tLLCDelaware\\nSolarCity\\tFinance\\tHoldings,\\tLLCDelaware\\nSolarCity\\tFoxborough\\tHoldings,\\tLLCDelaware\\nSolarCity\\tFTE\\tSeries\\t1,\\tLLCDelaware\\nSolarCity\\tFTE\\tSeries\\t2,\\tLLCDelaware\\nSolarCity\\tFund\\tHoldings,\\tLLCDelaware\\nSolarCity\\tGrand\\tCanyon\\tHoldings,\\tLLCDelaware\\nSolarCity\\tHoldings\\t2008,\\tLLCDelaware\\nSolarCity\\tInternational,\\tInc.Delaware\\nSolarCity\\tLeviathan\\tHoldings,\\tLLCDelaware\\nSolarCity\\tLMC\\tSeries\\tI,\\tLLCDelaware\\nSolarCity\\tLMC\\tSeries\\tII,\\tLLCDelaware\\nSolarCity\\tLMC\\tSeries\\tIII,\\tLLCDelaware\\nSolarCity\\tLMC\\tSeries\\tIV,\\tLLCDelaware\\nSolarCity\\tLMC\\tSeries\\tV,\\tLLCDelaware\\nSolarCity\\tMid-Atlantic\\tHoldings,\\tLLCDelaware\\nSolarCity\\tNitro\\tHoldings,\\tLLCDelaware\\nSolarCity\\tOrange\\tHoldings,\\tLLCDelaware\\nSolarCity\\tSeries\\tHoldings\\tI,\\tLLCDelaware\\nSolarCity\\tSeries\\tHoldings\\tII,\\tLLCDelaware\\nSolarCity\\tSeries\\tHoldings\\tIV,\\tLLCDelaware\\nSolarCity\\tSteep\\tHoldings,\\tLLCDelaware\\nSolarCity\\tUlu\\tHoldings,\\tLLCDelaware\\nSolarCity\\tVillage\\tHoldings,\\tLLCDelaware\\nSolarRock,\\tLLCDelaware\\nSolarStrong,\\tLLCDelaware\\nSparrowhawk\\tSolar\\tI,\\tLLCDelaware\\nSREC\\tHoldings,\\tLLCDelaware\\nTALT\\tHoldings,\\tLLCDelaware\\nTALT\\tTBM\\tHoldings,\\tLLCDelaware\\nTBM\\tPartnership\\tII,\\tLLCDelaware\\nTEO\\tEngineering,\\tInc.California\\nTES\\t2017-1,\\tLLCDelaware\\nTES\\t2017-2,\\tLLCDelaware\\nTES\\tHoldings\\t2017-1,\\tLLCDelaware\\nTesla\\t2014\\tWarehouse\\tSPV\\tLLCDelaware\\nTesla\\tAuto\\tLease\\tTrust\\t2021-ADelaware\\nTesla\\tAuto\\tLease\\tTrust\\t2021-BDelaware\\nTesla\\tAuto\\tLease\\tTrust\\t2022-ADelaware\\nTesla\\tAuto\\tLease\\tTrust\\t2023-ADelaware\\nTesla\\tAuto\\tLease\\tTrust\\t2023-BDelaware\\nTesla\\tElectric\\tVehicle\\tTrust\\t2023-1Delaware\\nTesla\\tAutobidder\\tInternational\\tB.V.Netherlands\\nTesla\\tAutomation\\tGmbHGermany\\nTesla\\tAutomobile\\tInformation\\tService\\t(Dalian)\\tCo.,\\tLtd.China\\nTesla\\tAutomobile\\tManagement\\tand\\tService\\t(Haikou)\\tCo.,\\tLtd.China\\nTesla\\tAutomobile\\tSales\\tand\\tService\\t(Beijing)\\tCo.,\\tLtd.China\\nTesla\\tAutomobile\\tSales\\tand\\tService\\t(Changchun)\\tCo.,\\tLtd.China\\nTesla\\tAutomobile\\tSales\\tand\\tService\\t(Changsha)\\tCo.,\\tLtd.China\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 119,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 50\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Tesla\\tAutomobile\\tSales\\tand\\tService\\t(Chengdu)\\tCo.,\\tLtd.China\\nTesla\\tAutomobile\\tSales\\tand\\tService\\t(Chongqing)\\tCo.,\\tLtd.China\\nTesla\\tAutomobile\\tSales\\tand\\tService\\t(Dalian)\\tCo.,\\tLtd.China\\nTesla\\tAutomobile\\tSales\\tand\\tService\\t(Fuzhou)\\tCo.,\\tLtd.China\\nTesla\\tAutomobile\\tSales\\tand\\tService\\t(Guangzhou)\\tCo.,\\tLtd.China\\nTesla\\tAutomobile\\tSales\\tand\\tService\\t(Guiyang)\\tCo.,\\tLtd.China\\nTesla\\tAutomobile\\tSales\\tand\\tService\\t(Haerbin)\\tCo.,\\tLtd.China\\nTesla\\tAutomobile\\tSales\\tand\\tService\\t(Hangzhou)\\tCo.,\\tLtd.China\\nTesla\\tAutomobile\\tSales\\tand\\tService\\t(Hefei)\\tCo.,\\tLtd.China\\nTesla\\tAutomobile\\tSales\\tand\\tService\\t(Hohhot)\\tCo.,\\tLtd.China\\nTesla\\tAutomobile\\tSales\\tand\\tService\\t(Jinan)\\tCo.,\\tLtd.China\\nTesla\\tAutomobile\\tSales\\tand\\tService\\t(Kunming)\\tCo.,\\tLtd.China\\nTesla\\tAutomobile\\tSales\\tand\\tService\\t(Lanzhou)\\tCo.,\\tLtd.China\\nTesla\\tAutomobile\\tSales\\tand\\tService\\t(Nanchang)\\tCo.,\\tLtd.China\\nTesla\\tAutomobile\\tSales\\tand\\tService\\t(Nanjing)\\tCo.,\\tLtd.China\\nTesla\\tAutomobile\\tSales\\tand\\tService\\t(Nanning)\\tCo.,\\tLtd.China\\nTesla\\tAutomobile\\tSales\\tand\\tService\\t(Ningbo)\\tCo.,\\tLtd.China\\nTesla\\tAutomobile\\tSales\\tand\\tService\\t(Qingdao)\\tCo.,\\tLtd.China\\nTesla\\tAutomobile\\tSales\\tand\\tService\\t(Shanghai)\\tCo.,\\tLtd.China\\nTesla\\tAutomobile\\tSales\\tand\\tService\\t(Shenyang)\\tCo.,\\tLtd.China\\nTesla\\tAutomobile\\tSales\\tand\\tService\\t(Shijiazhuang)\\tCo.,\\tLtd.China\\nTesla\\tAutomobile\\tSales\\tand\\tService\\t(Suzhou)\\tCo.\\tLtd.China\\nTesla\\tAutomobile\\tSales\\tand\\tService\\t(Taiyuan)\\tCo.,\\tLtd.China\\nTesla\\tAutomobile\\tSales\\tand\\tService\\t(Tianjin)\\tCo.\\tLtd.China\\nTesla\\tAutomobile\\tSales\\tand\\tService\\t(Urumqi)\\tCo.\\tLtd.China\\nTesla\\tAutomobile\\tSales\\tand\\tService\\t(Wenzhou)\\tCo.,\\tLtd.China\\nTesla\\tAutomobile\\tSales\\tand\\tService\\t(Wuhan)\\tCo.,\\tLtd.China\\nTesla\\tAutomobile\\tSales\\tand\\tService\\t(Wuxi)\\tCo.,\\tLtd.China\\nTesla\\tAutomobile\\tSales\\tand\\tService\\t(Xi'an)\\tCo.,\\tLtd.China\\nTesla\\tAutomobile\\tSales\\tand\\tService\\t(Xiamen)\\tCo.,\\tLtd.China\\nTesla\\tAutomobile\\tSales\\tand\\tService\\t(Xining)\\tCo.,\\tLtd.China\\nTesla\\tAutomobile\\tSales\\tand\\tService\\t(Yinchuan)\\tCo.,\\tLtd.China\\nTesla\\tAutomobile\\tSales\\tand\\tService\\t(Zhengzhou)\\tCo.\\tLtd.China\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 120,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 33\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Tesla\\tAutomobiles\\tSales\\tand\\tService\\tMexico,\\tS.\\tde\\tR.L.\\tde\\tC.V.Mexico\\nTesla\\t(Beijing)\\tNew\\tEnergy\\tR&D\\tCo.,\\tLtd.China\\nTesla\\tBelgium\\tBVBelgium\\nTesla\\tCanada\\tFinance\\tULCCanada\\nTesla\\tCanada\\tGP\\tInc.Canada\\nTesla\\tCanada\\tLPCanada\\nTesla\\tCharging,\\tLLCDelaware\\nTesla\\tChile\\tSpAChile\\nTesla\\tConstruction\\t(Shanghai)\\tCo.,\\tLtd.China\\nTesla\\tCzech\\tRepublic\\ts.r.o.Czech\\tRepublic\\nTesla\\tEnergia\\tMacau\\tLimitadaMacau\\nTesla\\tEngineering\\tGermany\\tGmbHGermany\\nTesla\\tEnergy\\td.o.o.Slovenia\\nTesla\\tEnergy\\tManagement\\tLLCDelaware\\nTesla\\tEnergy\\tOperations,\\tInc.Delaware\\nTesla\\tEnergy\\tVentures\\tAustralia\\tPty\\tLtdAustralia\\nTesla\\tEnergy\\tVentures\\tLimitedUnited\\tKingdom\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 120,\n        \"lines\": {\n          \"from\": 34,\n          \"to\": 50\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Tesla\\tEnergy\\tVentures\\tHoldings\\tB.V.Netherlands\\nTesla\\tFinance\\tLLCDelaware\\nTesla\\tFinancial\\tLeasing\\t(China)\\tCo.,\\tLtd.China\\nTesla\\tFinancial\\tServices\\tGmbHGermany\\nTesla\\tFinancial\\tServices\\tHoldings\\tB.V.Netherlands\\nTesla\\tFinancial\\tServices\\tLimitedUnited\\tKingdom\\nTesla\\tFrance\\tS.à\\tr.l.France\\nTesla\\tGermany\\tGmbHGermany\\nTesla\\tGeneral\\tInsurance,\\tInc.Arizona\\nTesla\\tGreece\\tSingle\\tMember\\tP.C.Greece\\nTesla\\tHrvatska\\td.o.o.Croatia\\nTesla\\tHungary\\tKft.Hungary\\nTesla\\tIndia\\tMotors\\tand\\tEnergy\\tPrivate\\tLimitedIndia\\nTesla\\tInsurance\\tBrokers\\tCo.,\\tLtd.China\\nTesla\\tInsurance\\tHoldings,\\tLLCDelaware\\nTesla\\tInsurance,\\tInc.Delaware\\nTesla\\tInsurance\\tLtd.Malta\\nTesla\\tInsurance\\tCompanyCalifornia\\nTesla\\tInsurance\\tServices,\\tInc.California\\nTesla\\tInsurance\\tServices\\tof\\tTexas,\\tInc.Texas\\nTesla\\tInternational\\tB.V.Netherlands\\nTesla\\tInvestments\\tLLCDelaware\\nTesla\\tItaly\\tS.r.l.Italy\\nTesla\\tJordan\\tCar\\tTrading\\tLLCJordan\\nTesla\\tKorea\\tLimitedRepublic\\tof\\tKorea\\nTesla\\tLease\\tTrustDelaware\\nTesla\\tLLCDelaware\\nTesla\\tManufacturing\\tBrandenburg\\tSEGermany\\nTesla\\tManufacturing\\tMexico,\\tS.\\tde\\tR.L.\\tde\\tC.V.Mexico\\nTesla\\tManufacturing\\tMexico\\tHolding,\\tS.\\tde\\tR.L.\\tde\\tC.V.Mexico\\nTesla\\tMichigan,\\tInc.Michigan\\nTesla\\tMississippi\\tLLCDelaware\\nTesla\\tMotors\\tAustralia,\\tPty\\tLtdAustralia\\nTesla\\tMotors\\tAustria\\tGmbHAustria\\nTesla\\tMotors\\t(Beijing)\\tCo.,\\tLtd.China\\nTesla\\tMotors\\tCanada\\tULCCanada\\nTesla\\tMotors\\tColombia\\tS.A.SColombia\\nTesla\\tMotors\\tHolding\\tB.V.Netherlands\\nTesla\\tMotors\\tDenmark\\tApSDenmark\\nTesla\\tMotors\\tFL,\\tInc.Florida\\nTesla\\tMotors\\tHK\\tLimitedHong\\tKong\\nTesla\\tMotors\\tIceland\\tehf.Iceland\\nTesla\\tMotors\\tIreland\\tLimitedIreland\\nTesla\\tMotors\\tIsrael\\tLtd.Israel\\nTesla\\tMotors\\tJapan\\tGKJapan\\nTesla\\tMotors\\tLimitedUnited\\tKingdom\\nTesla\\tMotors\\tLuxembourg\\tS.à\\tr.l.Luxembourg\\nTesla\\tMotors\\tMA,\\tInc.Massachusetts\\nTesla\\tMotors\\tNetherlands\\tB.V.Netherlands\\nTesla\\tMotors\\tNew\\tYork\\tLLCNew\\tYork\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 121,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 50\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Tesla\\tMotors\\tNL\\tLLCDelaware\\nTesla\\tMotors\\tNV,\\tInc.Nevada\\nTesla\\tMotors\\tPA,\\tInc.Pennsylvania\\nTesla\\tMotors\\tRomania\\tS.R.L.Romania\\nTesla\\tMotors\\tSales\\tand\\tService\\tLLCTurkey\\nTesla\\tMotors\\tSingapore\\tHoldings\\tPte.\\tLtd.Singapore\\nTesla\\tMotors\\tSingapore\\tPrivate\\tLimitedSingapore\\nTesla\\tMotors\\tStichtingNetherlands\\nTesla\\tMotors\\tTaiwan\\tLimitedTaiwan\\nTesla\\tMotors\\tTN,\\tInc.Tennessee\\nTesla\\tMotors\\tTX,\\tInc.Texas\\nTesla\\tMotors\\tUT,\\tInc.Utah\\nTesla\\tNambe\\tLLCDelaware\\nTesla\\tNew\\tZealand\\tULCNew\\tZealand\\nTesla\\tNorway\\tASNorway\\nTesla\\tPoland\\tsp.\\tz\\to.o.Poland\\nTesla\\tProperty\\t&Casualty,\\tInc.California\\nTesla\\tPortugal,\\tSociedade\\tUnipessoal\\tLDAPortugal\\nTesla\\tPuerto\\tRico\\tLLCPuerto\\tRico\\nTesla\\tQatar\\tLLCQatar\\nTesla\\tSales,\\tInc.Delaware\\nTesla\\tSdn.\\tBhd.Malaysia\\nTesla\\tShanghai\\tCo.,\\tLtdChina\\nTesla\\t(Shanghai)\\tNew\\tEnergy\\tCo.,\\tLTD.China\\nTesla\\tSpain,\\tS.L.\\tUnipersonalSpain\\nTesla\\tSwitzerland\\tGmbHSwitzerland\\nTesla\\t(Thailand)\\tLtd.Thailand\\nTesla\\tTH1\\tLLCDelaware\\nTesla\\tTH2\\tLLCDelaware\\nTelsa\\tToronto\\tAutomation\\tULCCanada\\nTesla\\tToronto\\tInternational\\tHoldings\\tULCCanada\\nTesla\\tTransport\\tB.V.Netherlands\\nThe\\tBig\\tGreen\\tSolar\\tI,\\tLLCDelaware\\nThe\\tBig\\tGreen\\tSolar\\tManager\\tI,\\tLLCDelaware\\nThree\\tRivers\\tSolar\\t1,\\tLLCDelaware\\nThree\\tRivers\\tSolar\\t2,\\tLLCDelaware\\nThree\\tRivers\\tSolar\\t3,\\tLLCDelaware\\nThree\\tRivers\\tSolar\\tManager\\t1,\\tLLCDelaware\\nThree\\tRivers\\tSolar\\tManager\\t2,\\tLLCDelaware\\nThree\\tRivers\\tSolar\\tManager\\t3,\\tLLCDelaware\\nTM\\tInternational\\tC.V.Netherlands\\nTM\\tSweden\\tABSweden\\nUSB\\tSolarCity\\tManager\\tIV,\\tLLCDelaware\\nUSB\\tSolarCity\\tMaster\\tTenant\\tIV,\\tLLCCalifornia\\nUSB\\tSolarCity\\tOwner\\tIV,\\tLLCCalifornia\\nVisigoth\\tSolar\\t1,\\tLLCDelaware\\nVisigoth\\tSolar\\tHoldings,\\tLLCDelaware\\nVisigoth\\tSolar\\tManaging\\tMember\\t1,\\tLLCDelaware\\nVPP\\tProject\\t1\\t(SA)\\tPty\\tLtd.Australia\\nWeisshorn\\tSolar\\tI,\\tLLCCayman\\tIslands\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 122,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 50\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Weisshorn\\tSolar\\tManager\\tI,\\tLLCDelaware\\nZep\\tSolar\\tLLCCalifornia\\nExhibit\\t23.1\\nCONSENT\\tOF\\tINDEPENDENT\\tREGISTERED\\tPUBLIC\\tACCOUNTING\\tFIRM\\nWe\\thereby\\tconsent\\tto\\tthe\\tincorporation\\tby\\treference\\tin\\tthe\\tRegistration\\tStatements\\ton\\tForm\\tS-8\\t(Nos.\\t333-232079,\\t333-223169,\\t333-216376,\\t333-\\n209696,\\t333-198002,\\t333-187113,\\t333-183033,\\tand\\t333-167874)\\tof\\tTesla,\\tInc.\\tof\\tour\\treport\\tdated\\tJanuary\\t26,\\t2024\\trelating\\tto\\tthe\\tfinancial\\tstatements\\nand\\tthe\\teffectiveness\\tof\\tinternal\\tcontrol\\tover\\tfinancial\\treporting,\\twhich\\tappears\\tin\\tthis\\tForm\\t10-K.\\n/s/\\tPricewaterhouseCoopers\\tLLP\\nSan\\tJose,\\tCalifornia\\nJanuary\\t26,\\t2024\\nExhibit\\t31.1\\nCERTIFICATIONS\\nI,\\tElon\\tMusk,\\tcertify\\tthat:\\n1.I\\thave\\treviewed\\tthis\\tAnnual\\tReport\\ton\\tForm\\t10-K\\tof\\tTesla,\\tInc.;\\n2.Based\\ton\\tmy\\tknowledge,\\tthis\\treport\\tdoes\\tnot\\tcontain\\tany\\tuntrue\\tstatement\\tof\\ta\\tmaterial\\tfact\\tor\\tomit\\tto\\tstate\\ta\\tmaterial\\tfact\\tnecessary\\tto\\tmake\\tthe\\nstatements\\tmade,\\tin\\tlight\\tof\\tthe\\tcircumstances\\tunder\\twhich\\tsuch\\tstatements\\twere\\tmade,\\tnot\\tmisleading\\twith\\trespect\\tto\\tthe\\tperiod\\tcovered\\tby\\tthis\\nreport;\\n3.Based\\ton\\tmy\\tknowledge,\\tthe\\tfinancial\\tstatements,\\tand\\tother\\tfinancial\\tinformation\\tincluded\\tin\\tthis\\treport,\\tfairly\\tpresent\\tin\\tall\\tmaterial\\trespects\\tthe\\nfinancial\\tcondition,\\tresults\\tof\\toperations\\tand\\tcash\\tflows\\tof\\tthe\\tregistrant\\tas\\tof,\\tand\\tfor,\\tthe\\tperiods\\tpresented\\tin\\tthis\\treport;\\n4.The\\tregistrant’s\\tother\\tcertifying\\tofficer\\tand\\tI\\tare\\tresponsible\\tfor\\testablishing\\tand\\tmaintaining\\tdisclosure\\tcontrols\\tand\\tprocedures\\t(as\\tdefined\\tin\\nExchange\\tAct\\tRules\\t13a-15(e)\\tand\\t15d-15(e))\\tand\\tinternal\\tcontrol\\tover\\tfinancial\\treporting\\t(as\\tdefined\\tin\\tExchange\\tAct\\tRules\\t13a-15(f)\\tand\\t15d-\\n15(f))\\tfor\\tthe\\tregistrant\\tand\\thave:\\n(a)Designed\\tsuch\\tdisclosure\\tcontrols\\tand\\tprocedures,\\tor\\tcaused\\tsuch\\tdisclosure\\tcontrols\\tand\\tprocedures\\tto\\tbe\\tdesigned\\tunder\\tour\\nsupervision,\\tto\\tensure\\tthat\\tmaterial\\tinformation\\trelating\\tto\\tthe\\tregistrant,\\tincluding\\tits\\tconsolidated\\tsubsidiaries,\\tis\\tmade\\tknown\\tto\\tus\\nby\\tothers\\twithin\\tthose\\tentities,\\tparticularly\\tduring\\tthe\\tperiod\\tin\\twhich\\tthis\\treport\\tis\\tbeing\\tprepared;\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 123,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 25\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"(b)Designed\\tsuch\\tinternal\\tcontrol\\tover\\tfinancial\\treporting,\\tor\\tcaused\\tsuch\\tinternal\\tcontrol\\tover\\tfinancial\\treporting\\tto\\tbe\\tdesigned\\tunder\\nour\\tsupervision,\\tto\\tprovide\\treasonable\\tassurance\\tregarding\\tthe\\treliability\\tof\\tfinancial\\treporting\\tand\\tthe\\tpreparation\\tof\\tfinancial\\nstatements\\tfor\\texternal\\tpurposes\\tin\\taccordance\\twith\\tgenerally\\taccepted\\taccounting\\tprinciples;\\n(c)Evaluated\\tthe\\teffectiveness\\tof\\tthe\\tregistrant’s\\tdisclosure\\tcontrols\\tand\\tprocedures\\tand\\tpresented\\tin\\tthis\\treport\\tour\\tconclusions\\tabout\\nthe\\teffectiveness\\tof\\tthe\\tdisclosure\\tcontrols\\tand\\tprocedures,\\tas\\tof\\tthe\\tend\\tof\\tthe\\tperiod\\tcovered\\tby\\tthis\\treport\\tbased\\ton\\tsuch\\tevaluation;\\nand\\n(d)Disclosed\\tin\\tthis\\treport\\tany\\tchange\\tin\\tthe\\tregistrant’s\\tinternal\\tcontrol\\tover\\tfinancial\\treporting\\tthat\\toccurred\\tduring\\tthe\\tregistrant’s\\nmost\\trecent\\tfiscal\\tquarter\\t(the\\tregistrant’s\\tfourth\\tfiscal\\tquarter\\tin\\tthe\\tcase\\tof\\tan\\tannual\\treport)\\tthat\\thas\\tmaterially\\taffected,\\tor\\tis\\nreasonably\\tlikely\\tto\\tmaterially\\taffect,\\tthe\\tregistrant’s\\tinternal\\tcontrol\\tover\\tfinancial\\treporting;\\tand\\n5.The\\tregistrant’s\\tother\\tcertifying\\tofficer\\tand\\tI\\thave\\tdisclosed,\\tbased\\ton\\tour\\tmost\\trecent\\tevaluation\\tof\\tinternal\\tcontrol\\tover\\tfinancial\\treporting,\\tto\\tthe\\nregistrant’s\\tauditors\\tand\\tthe\\taudit\\tcommittee\\tof\\tthe\\tregistrant’s\\tBoard\\tof\\tDirectors\\t(or\\tpersons\\tperforming\\tthe\\tequivalent\\tfunctions):\\n(a)All\\tsignificant\\tdeficiencies\\tand\\tmaterial\\tweaknesses\\tin\\tthe\\tdesign\\tor\\toperation\\tof\\tinternal\\tcontrol\\tover\\tfinancial\\treporting\\twhich\\tare\\nreasonably\\tlikely\\tto\\tadversely\\taffect\\tthe\\tregistrant’s\\tability\\tto\\trecord,\\tprocess,\\tsummarize\\tand\\treport\\tfinancial\\tinformation;\\tand\\n(b)Any\\tfraud,\\twhether\\tor\\tnot\\tmaterial,\\tthat\\tinvolves\\tmanagement\\tor\\tother\\temployees\\twho\\thave\\ta\\tsignificant\\trole\\tin\\tthe\\tregistrant’s\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 123,\n        \"lines\": {\n          \"from\": 26,\n          \"to\": 39\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"internal\\tcontrol\\tover\\tfinancial\\treporting.\\nDate:\\tJanuary\\t26,\\t2024/s/\\tElon\\tMusk\\n\\t\\nElon\\tMusk\\n\\tChief\\tExecutive\\tOfficer\\n\\t(Principal\\tExecutive\\tOfficer)\\nExhibit\\t31.2\\nCERTIFICATIONS\\nI,\\tVaibhav\\tTaneja,\\tcertify\\tthat:\\n1.I\\thave\\treviewed\\tthis\\tAnnual\\tReport\\ton\\tForm\\t10-K\\tof\\tTesla,\\tInc.;\\n2.Based\\ton\\tmy\\tknowledge,\\tthis\\treport\\tdoes\\tnot\\tcontain\\tany\\tuntrue\\tstatement\\tof\\ta\\tmaterial\\tfact\\tor\\tomit\\tto\\tstate\\ta\\tmaterial\\tfact\\tnecessary\\tto\\tmake\\tthe\\nstatements\\tmade,\\tin\\tlight\\tof\\tthe\\tcircumstances\\tunder\\twhich\\tsuch\\tstatements\\twere\\tmade,\\tnot\\tmisleading\\twith\\trespect\\tto\\tthe\\tperiod\\tcovered\\tby\\tthis\\nreport;\\n3.Based\\ton\\tmy\\tknowledge,\\tthe\\tfinancial\\tstatements,\\tand\\tother\\tfinancial\\tinformation\\tincluded\\tin\\tthis\\treport,\\tfairly\\tpresent\\tin\\tall\\tmaterial\\trespects\\tthe\\nfinancial\\tcondition,\\tresults\\tof\\toperations\\tand\\tcash\\tflows\\tof\\tthe\\tregistrant\\tas\\tof,\\tand\\tfor,\\tthe\\tperiods\\tpresented\\tin\\tthis\\treport;\\n4.The\\tregistrant’s\\tother\\tcertifying\\tofficer\\tand\\tI\\tare\\tresponsible\\tfor\\testablishing\\tand\\tmaintaining\\tdisclosure\\tcontrols\\tand\\tprocedures\\t(as\\tdefined\\tin\\nExchange\\tAct\\tRules\\t13a-15(e)\\tand\\t15d-15(e))\\tand\\tinternal\\tcontrol\\tover\\tfinancial\\treporting\\t(as\\tdefined\\tin\\tExchange\\tAct\\tRules\\t13a-15(f)\\tand\\t15d-\\n15(f))\\tfor\\tthe\\tregistrant\\tand\\thave:\\n(a)Designed\\tsuch\\tdisclosure\\tcontrols\\tand\\tprocedures,\\tor\\tcaused\\tsuch\\tdisclosure\\tcontrols\\tand\\tprocedures\\tto\\tbe\\tdesigned\\tunder\\tour\\nsupervision,\\tto\\tensure\\tthat\\tmaterial\\tinformation\\trelating\\tto\\tthe\\tregistrant,\\tincluding\\tits\\tconsolidated\\tsubsidiaries,\\tis\\tmade\\tknown\\tto\\tus\\nby\\tothers\\twithin\\tthose\\tentities,\\tparticularly\\tduring\\tthe\\tperiod\\tin\\twhich\\tthis\\treport\\tis\\tbeing\\tprepared;\\n(b)Designed\\tsuch\\tinternal\\tcontrol\\tover\\tfinancial\\treporting,\\tor\\tcaused\\tsuch\\tinternal\\tcontrol\\tover\\tfinancial\\treporting\\tto\\tbe\\tdesigned\\tunder\\nour\\tsupervision,\\tto\\tprovide\\treasonable\\tassurance\\tregarding\\tthe\\treliability\\tof\\tfinancial\\treporting\\tand\\tthe\\tpreparation\\tof\\tfinancial\\nstatements\\tfor\\texternal\\tpurposes\\tin\\taccordance\\twith\\tgenerally\\taccepted\\taccounting\\tprinciples;\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 124,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 24\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"(c)Evaluated\\tthe\\teffectiveness\\tof\\tthe\\tregistrant’s\\tdisclosure\\tcontrols\\tand\\tprocedures\\tand\\tpresented\\tin\\tthis\\treport\\tour\\tconclusions\\tabout\\nthe\\teffectiveness\\tof\\tthe\\tdisclosure\\tcontrols\\tand\\tprocedures,\\tas\\tof\\tthe\\tend\\tof\\tthe\\tperiod\\tcovered\\tby\\tthis\\treport\\tbased\\ton\\tsuch\\tevaluation;\\nand\\n(d)Disclosed\\tin\\tthis\\treport\\tany\\tchange\\tin\\tthe\\tregistrant’s\\tinternal\\tcontrol\\tover\\tfinancial\\treporting\\tthat\\toccurred\\tduring\\tthe\\tregistrant’s\\nmost\\trecent\\tfiscal\\tquarter\\t(the\\tregistrant’s\\tfourth\\tfiscal\\tquarter\\tin\\tthe\\tcase\\tof\\tan\\tannual\\treport)\\tthat\\thas\\tmaterially\\taffected,\\tor\\tis\\nreasonably\\tlikely\\tto\\tmaterially\\taffect,\\tthe\\tregistrant’s\\tinternal\\tcontrol\\tover\\tfinancial\\treporting;\\tand\\n5.The\\tregistrant’s\\tother\\tcertifying\\tofficer\\tand\\tI\\thave\\tdisclosed,\\tbased\\ton\\tour\\tmost\\trecent\\tevaluation\\tof\\tinternal\\tcontrol\\tover\\tfinancial\\treporting,\\tto\\tthe\\nregistrant’s\\tauditors\\tand\\tthe\\taudit\\tcommittee\\tof\\tthe\\tregistrant’s\\tBoard\\tof\\tDirectors\\t(or\\tpersons\\tperforming\\tthe\\tequivalent\\tfunctions):\\n(a)All\\tsignificant\\tdeficiencies\\tand\\tmaterial\\tweaknesses\\tin\\tthe\\tdesign\\tor\\toperation\\tof\\tinternal\\tcontrol\\tover\\tfinancial\\treporting\\twhich\\tare\\nreasonably\\tlikely\\tto\\tadversely\\taffect\\tthe\\tregistrant’s\\tability\\tto\\trecord,\\tprocess,\\tsummarize\\tand\\treport\\tfinancial\\tinformation;\\tand\\n(b)Any\\tfraud,\\twhether\\tor\\tnot\\tmaterial,\\tthat\\tinvolves\\tmanagement\\tor\\tother\\temployees\\twho\\thave\\ta\\tsignificant\\trole\\tin\\tthe\\tregistrant’s\\ninternal\\tcontrol\\tover\\tfinancial\\treporting.\\nDate:\\tJanuary\\t26,\\t2024/s/\\tVaibhav\\tTaneja\\n\\t\\nVaibhav\\tTaneja\\n\\tChief\\tFinancial\\tOfficer\\n\\t(Principal\\tFinancial\\tOfficer\\tand\\t\\nPrincipal\\tAccounting\\tOfficer)\\nExhibit\\t32.1\\nSECTION\\t1350\\tCERTIFICATIONS\\nI,\\tElon\\tMusk,\\tcertify,\\tpursuant\\tto\\t18\\tU.S.C.\\tSection\\t1350,\\tthat,\\tto\\tmy\\tknowledge,\\tthe\\tAnnual\\tReport\\tof\\tTesla,\\tInc.\\ton\\tForm\\t10-K\\tfor\\tthe\\tannual\\tperiod\\tended\\nDecember\\t31,\\t2023,\\t(i)\\tfully\\tcomplies\\twith\\tthe\\trequirements\\tof\\tSection\\t13(a)\\tor\\t15(d)\\tof\\tthe\\tSecurities\\tExchange\\tAct\\tof\\t1934\\tand\\t(ii)\\tthat\\tthe\\tinformation\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 124,\n        \"lines\": {\n          \"from\": 25,\n          \"to\": 46\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"contained\\tin\\tsuch\\tForm\\t10-K\\tfairly\\tpresents,\\tin\\tall\\tmaterial\\trespects,\\tthe\\tfinancial\\tcondition\\tand\\tresults\\tof\\toperations\\tof\\tTesla,\\tInc.\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 124,\n        \"lines\": {\n          \"from\": 47,\n          \"to\": 47\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Date:\\tJanuary\\t26,\\t2024/s/\\tElon\\tMusk\\n\\t\\nElon\\tMusk\\n\\tChief\\tExecutive\\tOfficer\\n\\t(Principal\\tExecutive\\tOfficer)\\nI,\\tVaibhav\\tTaneja,\\tcertify,\\tpursuant\\tto\\t18\\tU.S.C.\\tSection\\t1350,\\tthat,\\tto\\tmy\\tknowledge,\\tthe\\tAnnual\\tReport\\tof\\tTesla,\\tInc.\\ton\\tForm\\t10-K\\tfor\\tthe\\tannual\\tperiod\\nended\\tDecember\\t31,\\t2023,\\t(i)\\tfully\\tcomplies\\twith\\tthe\\trequirements\\tof\\tSection\\t13(a)\\tor\\t15(d)\\tof\\tthe\\tSecurities\\tExchange\\tAct\\tof\\t1934\\tand\\t(ii)\\tthat\\tthe\\ninformation\\tcontained\\tin\\tsuch\\tForm\\t10-K\\tfairly\\tpresents,\\tin\\tall\\tmaterial\\trespects,\\tthe\\tfinancial\\tcondition\\tand\\tresults\\tof\\toperations\\tof\\tTesla,\\tInc.\\nDate:\\tJanuary\\t26,\\t2024/s/\\tVaibhav\\tTaneja\\n\\t\\nVaibhav\\tTaneja\\n\\tChief\\tFinancial\\tOfficer\\n\\t(Principal\\tFinancial\\tOfficer\\tand\\n\\tPrincipal\\tAccounting\\tOfficer)\\nExhibit\\t97\\nTesla,\\tInc.\\nCLAWBACK\\tPOLICY\\nThe\\tCompensation\\tCommittee\\t(the\\t“Committee”)\\tof\\tthe\\tBoard\\tof\\tDirectors\\t(the\\t“Board”)\\tof\\tTesla,\\tInc.\\t(the\\t“Company”)\\nbelieves\\tthat\\tit\\tis\\tappropriate\\tfor\\tthe\\tCompany\\tto\\tadopt\\tthis\\tClawback\\tPolicy\\t(this\\t“Policy”)\\tto\\tbe\\tapplied\\tto\\tthe\\tcertain\\nexecutive\\tofficers\\tof\\tthe\\tCompany\\tand\\tadopts\\tthis\\tPolicy\\tto\\tbe\\teffective\\tas\\tof\\tthe\\tEffective\\tDate.\\n1.Definitions\\nFor\\tpurposes\\tof\\tthis\\tPolicy,\\tthe\\tfollowing\\tdefinitions\\tshall\\tapply:\\na)“Company\\tGroup”\\tmeans\\tthe\\tCompany\\tand\\teach\\tof\\tits\\tSubsidiaries,\\tas\\tapplicable.\\nb)“Covered\\tCompensation”\\tmeans\\tany\\tIncentive-Based\\tCompensation\\tReceived\\tby\\ta\\tperson\\twho\\tserved\\tas\\tan\\nExecutive\\tOfficer\\tat\\tany\\ttime\\tduring\\tthe\\tperformance\\tperiod\\tfor\\tsuch\\tIncentive-Based\\tCompensation\\tand\\tthat\\twas\\nReceived\\t(i)\\ton\\tor\\tafter\\tOctober\\t2,\\t2023\\tand\\t(ii)\\tafter\\tthe\\tperson\\tbecame\\tan\\tExecutive\\tOfficer.\\nc)“Effective\\tDate”\\tmeans\\tNovember\\t15,\\t2023.\\nd)“Erroneously\\tAwarded\\tCompensation”\\tmeans\\tthe\\tamount\\tof\\tCovered\\tCompensation\\tReceived\\tby\\ta\\tperson\\tduring\\nthe\\tfiscal\\tperiod\\twhen\\tthe\\tapplicable\\tFinancial\\tReporting\\tMeasure\\trelating\\tto\\tsuch\\tCovered\\tCompensation\\twas\\nattained\\tthat\\texceeds\\tthe\\tamount\\tof\\tCovered\\tCompensation\\tthat\\totherwise\\twould\\thave\\tbeen\\tReceived\\tby\\tsuch\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 125,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 30\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"person\\thad\\tsuch\\tamount\\tbeen\\tdetermined\\tbased\\ton\\tthe\\tapplicable\\tRestatement,\\tcomputed\\twithout\\tregard\\tto\\tany\\ntaxes\\tpaid\\t(i.e.,\\ton\\ta\\tpre-tax\\tbasis).\\tFor\\tCovered\\tCompensation\\tbased\\ton\\tstock\\tprice\\tor\\ttotal\\tshareholder\\treturn,\\nwhere\\tthe\\tamount\\tof\\tErroneously\\tAwarded\\tCompensation\\tis\\tnot\\tsubject\\tto\\tmathematical\\trecalculation\\tdirectly\\nfrom\\tthe\\tinformation\\tin\\ta\\tRestatement,\\tthe\\tCommittee\\twill\\tdetermine\\tthe\\tamount\\tof\\tsuch\\tCovered\\tCompensation\\nthat\\tconstitutes\\tErroneously\\tAwarded\\tCompensation,\\tif\\tany,\\tbased\\ton\\ta\\treasonable\\testimate\\tof\\tthe\\teffect\\tof\\tthe\\nRestatement\\ton\\tthe\\tstock\\tprice\\tor\\ttotal\\tshareholder\\treturn\\tupon\\twhich\\tthe\\tCovered\\tCompensation\\twas\\tgranted,\\nvested\\tor\\tpaid\\tand\\tthe\\tCommittee\\tshall\\tmaintain\\tdocumentation\\tof\\tsuch\\tdetermination\\tand\\tprovide\\tsuch\\ndocumentation\\tto\\tNasdaq.\\ne)“Exchange\\tAct”\\tmeans\\tthe\\tU.S.\\tSecurities\\tExchange\\tAct\\tof\\t1934,\\tas\\tamended.\\nf)“Executive\\tOfficer”\\tmeans\\teach\\t“executive\\tofficer”\\tof\\tthe\\tCompany\\t(as\\tdefined\\tin\\tRule\\t10D-1(d)\\tunder\\tthe\\nExchange\\tAct),\\twhich\\tshall\\tbe\\tdeemed\\tto\\tinclude\\tany\\tindividuals\\tidentified\\tby\\tthe\\tCompany\\tas\\texecutive\\tofficers\\npursuant\\tto\\tItem\\t401(b)\\tof\\tRegulation\\tS-K\\tunder\\tthe\\tExchange\\tAct.\\tBoth\\tcurrent\\tand\\tformer\\tExecutive\\tOfficers\\nare\\tsubject\\tto\\tthe\\tPolicy\\tin\\taccordance\\twith\\tits\\tterms.\\n1\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 125,\n        \"lines\": {\n          \"from\": 31,\n          \"to\": 44\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"g)“Financial\\tReporting\\tMeasure”\\tmeans\\t(i)\\tany\\tmeasure\\tthat\\tis\\tdetermined\\tand\\tpresented\\tin\\taccordance\\twith\\tthe\\naccounting\\tprinciples\\tused\\tin\\tpreparing\\tthe\\tCompany’s\\tfinancial\\tstatements,\\tand\\tany\\tmeasures\\tderived\\twholly\\tor\\nin\\tpart\\tfrom\\tsuch\\tmeasures\\tand\\tmay\\tconsist\\tof\\tGAAP\\tor\\tnon-GAAP\\tfinancial\\tmeasures\\t(as\\tdefined\\tunder\\nRegulation\\tG\\tof\\tthe\\tExchange\\tAct\\tand\\tItem\\t10\\tof\\tRegulation\\tS-K\\tunder\\tthe\\tExchange\\tAct),\\t(ii)\\tstock\\tprice\\tor\\t(iii)\\ntotal\\tshareholder\\treturn.\\tFinancial\\tReporting\\tMeasures\\tmay\\tor\\tmay\\tnot\\tbe\\tfiled\\twith\\tthe\\tSEC\\tand\\tmay\\tbe\\npresented\\toutside\\tthe\\tCompany’s\\tfinancial\\tstatements,\\tsuch\\tas\\tin\\tManagements’\\tDiscussion\\tand\\tAnalysis\\tof\\nFinancial\\tConditions\\tand\\tResult\\tof\\tOperations\\tor\\tin\\tthe\\tperformance\\tgraph\\trequired\\tunder\\tItem\\t201(e)\\tof\\nRegulation\\tS-K\\tunder\\tthe\\tExchange\\tAct.\\nh)“Incentive-Based\\tCompensation”\\tmeans\\tany\\tcompensation\\tthat\\tis\\tgranted,\\tearned\\tor\\tvested\\tbased\\twholly\\tor\\tin\\npart\\tupon\\tthe\\tattainment\\tof\\ta\\tFinancial\\tReporting\\tMeasure.\\ni)“Lookback\\tPeriod”\\tmeans\\tthe\\tthree\\tcompleted\\tfiscal\\tyears\\t(plus\\tany\\ttransition\\tperiod\\tof\\tless\\tthan\\tnine\\tmonths\\nthat\\tis\\twithin\\tor\\timmediately\\tfollowing\\tthe\\tthree\\tcompleted\\tfiscal\\tyears\\tand\\tthat\\tresults\\tfrom\\ta\\tchange\\tin\\tthe\\nCompany’s\\tfiscal\\tyear)\\timmediately\\tpreceding\\tthe\\tdate\\ton\\twhich\\tthe\\tCompany\\tis\\trequired\\tto\\tprepare\\ta\\nRestatement\\tfor\\ta\\tgiven\\treporting\\tperiod,\\twith\\tsuch\\tdate\\tbeing\\tthe\\tearlier\\tof:\\t(i)\\tthe\\tdate\\tthe\\tBoard,\\ta\\tcommittee\\nof\\tthe\\tBoard,\\tor\\tthe\\tofficer\\tor\\tofficers\\tof\\tthe\\tCompany\\tauthorized\\tto\\ttake\\tsuch\\taction\\tif\\tBoard\\taction\\tis\\tnot\\nrequired,\\tconcludes,\\tor\\treasonably\\tshould\\thave\\tconcluded,\\tthat\\tthe\\tCompany\\tis\\trequired\\tto\\tprepare\\ta\\nRestatement,\\tor\\t(ii)\\tthe\\tdate\\ta\\tcourt,\\tregulator\\tor\\tother\\tlegally\\tauthorized\\tbody\\tdirects\\tthe\\tCompany\\tto\\tprepare\\ta\\nRestatement.\\tRecovery\\tof\\tany\\tErroneously\\tAwarded\\tCompensation\\tunder\\tthe\\tPolicy\\tis\\tnot\\tdependent\\ton\\tif\\tor\\nwhen\\tthe\\tRestatement\\tis\\tactually\\tfiled.\\nj)“Nasdaq”\\tmeans\\tthe\\tNasdaq\\tStock\\tMarket.\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 126,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 20\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"j)“Nasdaq”\\tmeans\\tthe\\tNasdaq\\tStock\\tMarket.\\nk)“Received”:\\tIncentive-Based\\tCompensation\\tis\\tdeemed\\t“Received”\\tin\\tthe\\tCompany’s\\tfiscal\\tperiod\\tduring\\twhich\\nthe\\tFinancial\\tReporting\\tMeasure\\tspecified\\tin\\tor\\totherwise\\trelating\\tto\\tthe\\tIncentive-Based\\tCompensation\\taward\\tis\\nattained,\\teven\\tif\\tthe\\tgrant,\\tcertification\\tof\\tachievement,\\tvesting\\tor\\tpayment\\tof\\tthe\\tIncentive-Based\\tCompensation\\noccurs\\tafter\\tthe\\tend\\tof\\tthat\\tperiod.\\nl)“Restatement”\\tmeans\\tan\\taccounting\\trestatement\\trequired\\tdue\\tto\\tthe\\tmaterial\\tnoncompliance\\tby\\tthe\\tCompany\\nwith\\tany\\tfinancial\\treporting\\trequirement\\tunder\\tthe\\tsecurities\\tlaws,\\tincluding\\t(i)\\tto\\tcorrect\\tan\\terror\\tin\\tpreviously\\nissued\\tfinancial\\tstatements\\tthat\\tis\\tmaterial\\tto\\tthe\\tpreviously\\tissued\\tfinancial\\tstatements\\t(commonly\\treferred\\tto\\nas\\ta\\t“Big\\tR”\\trestatement)\\tor\\t(ii)\\tto\\tcorrect\\tan\\terror\\tin\\tpreviously\\tissued\\tfinancial\\tstatements\\tthat\\tis\\tnot\\tmaterial\\nto\\tthe\\tpreviously\\tissued\\tfinancial\\tstatements\\tbut\\tthat\\twould\\tresult\\tin\\ta\\tmaterial\\tmisstatement\\tif\\tthe\\terror\\twere\\ncorrected\\tin\\tthe\\tcurrent\\tperiod\\tor\\tleft\\tuncorrected\\tin\\tthe\\tcurrent\\tperiod\\t(commonly\\treferred\\tto\\tas\\ta\\t“little\\tr”\\nrestatement).\\tChanges\\tto\\tthe\\tCompany’s\\tfinancial\\tstatements\\tthat\\tdo\\tnot\\trepresent\\terror\\tcorrections\\tunder\\tthe\\nthen-current\\trelevant\\taccounting\\tstandards\\twill\\tnot\\tconstitute\\tRestatements.\\n2\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 126,\n        \"lines\": {\n          \"from\": 20,\n          \"to\": 33\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"m)“SEC”\\tmeans\\tthe\\tU.S.\\tSecurities\\tand\\tExchange\\tCommission.\\nn)“Subsidiary”\\tmeans\\tany\\tdomestic\\tor\\tforeign\\tcorporation,\\tpartnership,\\tassociation,\\tjoint\\tstock\\tcompany,\\tjoint\\nventure,\\ttrust\\tor\\tunincorporated\\torganization\\t“affiliated”\\twith\\tthe\\tCompany,\\tthat\\tis,\\tdirectly\\tor\\tindirectly,\\tthrough\\none\\tor\\tmore\\tintermediaries,\\t“controlling”,\\t“controlled\\tby”\\tor\\t“under\\tcommon\\tcontrol\\twith”,\\tthe\\tCompany.\\n“Control”\\tfor\\tthis\\tpurpose\\tmeans\\tthe\\tpossession,\\tdirect\\tor\\tindirect,\\tof\\tthe\\tpower\\tto\\tdirect\\tor\\tcause\\tthe\\tdirection\\tof\\nthe\\tmanagement\\tand\\tpolicies\\tof\\tsuch\\tperson,\\twhether\\tthrough\\tthe\\townership\\tof\\tvoting\\tsecurities,\\tcontract\\tor\\notherwise.\\n2.Recoupment\\tof\\tErroneously\\tAwarded\\tCompensation\\nIn\\tthe\\tevent\\tof\\ta\\tRestatement,\\tany\\tErroneously\\tAwarded\\tCompensation\\tReceived\\tduring\\tthe\\tLookback\\tPeriod\\tthat\\t(a)\\tis\\nthen-outstanding\\tbut\\thas\\tnot\\tyet\\tbeen\\tpaid\\tshall\\tbe\\tautomatically\\tand\\timmediately\\tforfeited\\tor\\t(b)\\thas\\tbeen\\tpaid\\tto\\tany\\nperson\\tshall\\tbe\\tsubject\\tto\\treasonably\\tprompt\\trepayment\\tto\\tthe\\tCompany\\tGroup\\tin\\taccordance\\twith\\tSection\\t3\\tof\\tthis\\tPolicy.\\nThe\\tCommittee\\tmust\\tpursue\\t(and\\tshall\\tnot\\thave\\tthe\\tdiscretion\\tto\\twaive)\\tthe\\tforfeiture\\tand/or\\trepayment\\tof\\tsuch\\nErroneously\\tAwarded\\tCompensation\\tin\\taccordance\\twith\\tSection\\t3\\tof\\tthis\\tPolicy,\\texcept\\tas\\tprovided\\tbelow.\\tRecovery\\tof\\tany\\nErroneously\\tAwarded\\tCompensation\\tunder\\tthe\\tPolicy\\tis\\tnot\\tdependent\\ton\\tfraud\\tor\\tmisconduct\\tby\\tany\\tperson\\tin\\tconnection\\nwith\\tthe\\tRestatement.\\nNotwithstanding\\tthe\\tforegoing,\\tthe\\tCommittee\\t(or,\\tif\\tthe\\tCommittee\\tis\\tnot\\ta\\tcommittee\\tof\\tthe\\tBoard\\tresponsible\\tfor\\tthe\\nCompany’s\\texecutive\\tcompensation\\tdecisions\\tand\\tcomposed\\tentirely\\tof\\tindependent\\tdirectors,\\ta\\tmajority\\tof\\tthe\\nindependent\\tdirectors\\tserving\\ton\\tthe\\tBoard)\\tmay\\tdetermine\\tnot\\tto\\tpursue\\tthe\\tforfeiture\\tand/or\\trecovery\\tof\\tErroneously\\nAwarded\\tCompensation\\tfrom\\tany\\tperson\\tif\\tthe\\tCommittee\\tdetermines\\tthat\\tsuch\\tforfeiture\\tand/or\\trecovery\\twould\\tbe\\nimpracticable\\tdue\\tto\\tany\\tof\\tthe\\tfollowing\\tcircumstances:\\t(i)\\tthe\\tdirect\\texpense\\tpaid\\tto\\ta\\tthird\\tparty\\t(for\\texample,\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 127,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 20\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"reasonable\\tlegal\\texpenses\\tand\\tconsulting\\tfees)\\tto\\tassist\\tin\\tenforcing\\tthe\\tPolicy\\twould\\texceed\\tthe\\tamount\\tto\\tbe\\trecovered\\n(following\\treasonable\\tattempts\\tby\\tthe\\tCompany\\tGroup\\tto\\trecover\\tsuch\\tErroneously\\tAwarded\\tCompensation,\\tthe\\ndocumentation\\tof\\tsuch\\tattempts,\\tand\\tthe\\tprovision\\tof\\tsuch\\tdocumentation\\tto\\tthe\\tNasdaq)\\tor\\t(ii)\\trecovery\\twould\\tlikely\\ncause\\tany\\totherwise\\ttax-qualified\\tretirement\\tplan,\\tunder\\twhich\\tbenefits\\tare\\tbroadly\\tavailable\\tto\\temployees\\tof\\tCompany\\nGroup,\\tto\\tfail\\tto\\tmeet\\tthe\\trequirements\\tof\\t26\\tU.S.C.\\n401(a)(13)\\tor\\t26\\tU.S.C.\\t411(a)\\tand\\tregulations\\tthereunder.\\n3.Means\\tof\\tRepayment\\nIn\\tthe\\tevent\\tthat\\tthe\\tCommittee\\tdetermines\\tthat\\tany\\tperson\\tshall\\trepay\\tany\\tErroneously\\tAwarded\\tCompensation,\\tthe\\nCommittee\\tshall\\tprovide\\twritten\\tnotice\\tto\\tsuch\\tperson\\tby\\temail\\tor\\tcertified\\tmail\\tto\\tthe\\tphysical\\taddress\\ton\\tfile\\twith\\tthe\\nCompany\\tGroup\\tfor\\tsuch\\tperson,\\tand\\tthe\\tperson\\tshall\\tsatisfy\\tsuch\\trepayment\\tin\\ta\\tmanner\\tand\\ton\\tsuch\\tterms\\tas\\trequired\\nby\\tthe\\tCommittee,\\tand\\tthe\\tCompany\\tGroup\\tshall\\tbe\\tentitled\\tto\\tset\\toff\\tthe\\trepayment\\tamount\\tagainst\\tany\\tamount\\towed\\tto\\nthe\\tperson\\tby\\tthe\\tCompany\\tGroup,\\tto\\trequire\\tthe\\tforfeiture\\tof\\tany\\taward\\tgranted\\tby\\tthe\\tCompany\\tGroup\\tto\\tthe\\tperson,\\tor\\nto\\ttake\\tany\\tand\\tall\\tnecessary\\tactions\\tto\\treasonably\\tpromptly\\trecoup\\tthe\\trepayment\\tamount\\tfrom\\tthe\\tperson,\\tin\\teach\\tcase,\\nto\\tthe\\tfullest\\textent\\tpermitted\\tunder\\tapplicable\\tlaw,\\tincluding\\twithout\\tlimitation,\\tSection\\t409A\\tof\\tthe\\tU.S.\\n3\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 127,\n        \"lines\": {\n          \"from\": 21,\n          \"to\": 35\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Internal\\tRevenue\\tCode\\tand\\tthe\\tregulations\\tand\\tguidance\\tthereunder.\\tIf\\tthe\\tCommittee\\tdoes\\tnot\\tspecify\\ta\\trepayment\\ntiming\\tin\\tthe\\twritten\\tnotice\\tdescribed\\tabove,\\tthe\\tapplicable\\tperson\\tshall\\tbe\\trequired\\tto\\trepay\\tthe\\tErroneously\\tAwarded\\nCompensation\\tto\\tthe\\tCompany\\tGroup\\tby\\twire,\\tcash\\tor\\tcashier’s\\tcheck\\tno\\tlater\\tthan\\tthirty\\t(30)\\tdays\\tafter\\treceipt\\tof\\tsuch\\nnotice.\\n4.No\\tIndemnification\\nNo\\tperson\\tshall\\tbe\\tindemnified,\\tinsured\\tor\\treimbursed\\tby\\tthe\\tCompany\\tGroup\\tin\\trespect\\tof\\tany\\tloss\\tof\\tcompensation\\tby\\nsuch\\tperson\\tin\\taccordance\\twith\\tthis\\tPolicy,\\tnor\\tshall\\tany\\tperson\\treceive\\tany\\tadvancement\\tof\\texpenses\\tfor\\tdisputes\\trelated\\nto\\tany\\tloss\\tof\\tcompensation\\tby\\tsuch\\tperson\\tin\\taccordance\\twith\\tthis\\tPolicy,\\tand\\tno\\tperson\\tshall\\tbe\\tpaid\\tor\\treimbursed\\tby\\nthe\\tCompany\\tGroup\\tfor\\tany\\tpremiums\\tpaid\\tby\\tsuch\\tperson\\tfor\\tany\\tthird-party\\tinsurance\\tpolicy\\tcovering\\tpotential\\trecovery\\nobligations\\tunder\\tthis\\tPolicy.\\n5.Miscellaneous\\nThis\\tPolicy\\tgenerally\\twill\\tbe\\tadministered\\tand\\tinterpreted\\tby\\tthe\\tCommittee,\\tprovided\\tthat\\tthe\\tBoard\\tmay,\\tfrom\\ttime\\tto\\ntime,\\texercise\\tdiscretion\\tto\\tadminister\\tand\\tinterpret\\tthis\\tPolicy,\\tin\\twhich\\tcase,\\tall\\treferences\\therein\\tto\\t“Committee”\\tshall\\tbe\\ndeemed\\tto\\trefer\\tto\\tthe\\tBoard.\\tAny\\tdetermination\\tby\\tthe\\tCommittee\\twith\\trespect\\tto\\tthis\\tPolicy\\tshall\\tbe\\tfinal,\\tconclusive\\tand\\nbinding\\ton\\tall\\tinterested\\tparties.\\tAny\\tdiscretionary\\tdeterminations\\tof\\tthe\\tCommittee\\tunder\\tthis\\tPolicy,\\tif\\tany,\\tneed\\tnot\\tbe\\nuniform\\twith\\trespect\\tto\\tall\\tpersons,\\tand\\tmay\\tbe\\tmade\\tselectively\\tamongst\\tpersons,\\twhether\\tor\\tnot\\tsuch\\tpersons\\tare\\nsimilarly\\tsituated.\\nThis\\tPolicy\\tis\\tintended\\tto\\tsatisfy\\tthe\\trequirements\\tof\\tSection\\t954\\tof\\tthe\\tDodd-Frank\\tWall\\tStreet\\tReform\\tand\\tConsumer\\nProtection\\tAct,\\tas\\tit\\tmay\\tbe\\tamended\\tfrom\\ttime\\tto\\ttime,\\tRule\\t10D-\\t1\\tunder\\tthe\\tExchange\\tAct,\\tand\\tany\\trelated\\trules\\tor\\nregulations\\tpromulgated\\tby\\tthe\\tSEC\\tor\\tthe\\tNasdaq,\\tincluding\\tany\\tadditional\\tor\\tnew\\trequirements\\tthat\\tbecome\\teffective\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 128,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 20\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"after\\tthe\\tEffective\\tDate\\twhich\\tupon\\teffectiveness\\tshall\\tbe\\tdeemed\\tto\\tautomatically\\tamend\\tthis\\tPolicy\\tto\\tthe\\textent\\nnecessary\\tto\\tcomply\\twith\\tsuch\\tadditional\\tor\\tnew\\trequirements.\\nThe\\tprovisions\\tin\\tthis\\tPolicy\\tare\\tintended\\tto\\tbe\\tapplied\\tto\\tthe\\tfullest\\textent\\tof\\tthe\\tlaw.\\tTo\\tthe\\textent\\tthat\\tany\\tprovision\\nof\\tthis\\tPolicy\\tis\\tfound\\tto\\tbe\\tunenforceable\\tor\\tinvalid\\tunder\\tany\\tapplicable\\tlaw,\\tsuch\\tprovision\\twill\\tbe\\tapplied\\tto\\tthe\\nmaximum\\textent\\tpermitted\\tand\\tshall\\tautomatically\\tbe\\tdeemed\\tamended\\tin\\ta\\tmanner\\tconsistent\\twith\\tits\\tobjectives\\tto\\tthe\\nextent\\tnecessary\\tto\\tconform\\tto\\tapplicable\\tlaw.\\tThe\\tinvalidity\\tor\\tunenforceability\\tof\\tany\\tprovision\\tof\\tthis\\tPolicy\\tshall\\tnot\\naffect\\tthe\\tvalidity\\tor\\tenforceability\\tof\\tany\\tother\\tprovision\\tof\\tthis\\tPolicy.\\tRecoupment\\tof\\tErroneously\\tAwarded\\tCompensation\\nunder\\tthis\\tPolicy\\tis\\tnot\\tdependent\\tupon\\tthe\\tCompany\\tGroup\\tsatisfying\\tany\\tconditions\\tin\\tthis\\tPolicy,\\tincluding\\tany\\nrequirements\\tto\\tprovide\\tapplicable\\tdocumentation\\tto\\tthe\\tNasdaq.\\nThe\\trights\\tof\\tthe\\tCompany\\tGroup\\tunder\\tthis\\tPolicy\\tto\\tseek\\tforfeiture\\tor\\treimbursement\\tare\\tin\\taddition\\tto,\\tand\\tnot\\tin\\nlieu\\tof,\\tany\\trights\\tof\\trecoupment,\\tor\\tremedies\\tor\\trights\\tother\\tthan\\trecoupment,\\tthat\\tmay\\tbe\\tavailable\\tto\\tthe\\tCompany\\nGroup\\tpursuant\\tto\\tthe\\tterms\\tof\\tany\\tlaw,\\tgovernment\\tregulation\\tor\\tstock\\texchange\\tlisting\\trequirement\\tor\\tany\\tother\\tpolicy,\\ncode\\tof\\n4\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 128,\n        \"lines\": {\n          \"from\": 21,\n          \"to\": 34\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"conduct,\\temployee\\thandbook,\\temployment\\tagreement,\\tequity\\taward\\tagreement,\\tor\\tother\\tplan\\tor\\tagreement\\tof\\tthe\\nCompany\\tGroup.\\n6.Amendment\\tand\\tTermination\\nTo\\tthe\\textent\\tpermitted\\tby,\\tand\\tin\\ta\\tmanner\\tconsistent\\twith\\tapplicable\\tlaw,\\tincluding\\tSEC\\tand\\tNasdaq\\trules,\\tthe\\nCommittee\\tmay\\tterminate,\\tsuspend\\tor\\tamend\\tthis\\tPolicy\\tat\\tany\\ttime\\tin\\tits\\tdiscretion.\\n7.Successors\\nThis\\tPolicy\\tshall\\tbe\\tbinding\\tand\\tenforceable\\tagainst\\tall\\tpersons\\tand\\ttheir\\trespective\\tbeneficiaries,\\theirs,\\texecutors,\\nadministrators\\tor\\tother\\tlegal\\trepresentatives\\twith\\trespect\\tto\\tany\\tCovered\\tCompensation\\tgranted,\\tvested\\tor\\tpaid\\tto\\tor\\nadministered\\tby\\tsuch\\tpersons\\tor\\tentities.\\n8.Agreement\\tto\\tArbitrate;\\tGoverning\\tLaw;\\tVenue\\nThis\\tPolicy\\tand\\tall\\trights\\tand\\tobligations\\thereunder\\twill\\tbe\\tgoverned\\tby\\tand\\tinterpreted\\tin\\taccordance\\twith\\tTexas\\tlaw.\\t\\nAny\\tdispute\\tarising\\tfrom\\tor\\trelating\\tto\\tthis\\tPolicy\\tshall\\tbe\\tsubject\\tto\\tbinding\\tarbitration\\tin\\taccordance\\twith\\tthe\\tthen-current\\nStreamlined\\tArbitration\\tRules\\tof\\tthe\\tJudicial\\tArbitration\\tand\\tMediation\\tServices\\t(“JAMS”).\\t\\tThe\\texistence,\\tcontent\\tand\\tresult\\nof\\tthe\\tarbitration\\tshall\\tbe\\theld\\tin\\tconfidence\\tby\\tthe\\tparties,\\ttheir\\trepresentatives,\\tany\\tother\\tparticipants\\tand\\tthe\\tarbitrator.\\t\\nThe\\tarbitration\\twill\\tbe\\tconducted\\tby\\ta\\tsingle\\tarbitrator\\tselected\\tby\\tagreement\\tof\\tthe\\tparties\\tor,\\tfailing\\tsuch\\tagreement,\\nappointed\\tin\\taccordance\\twith\\tthe\\tJAMS\\trules.\\t\\tThe\\tarbitration\\tshall\\tbe\\tconducted\\tin\\tEnglish\\tand\\tin\\tAustin,\\tTexas.\\t\\tEach\\nparty\\twill\\tbear\\tits\\town\\texpenses\\tin\\tthe\\tarbitration\\tand\\twill\\tshare\\tequally\\tthe\\tcosts\\tof\\tthe\\tarbitration;\\tprovided,\\thowever,\\nthat\\tthe\\tarbitrator\\tmay,\\tin\\tits\\tdiscretion,\\taward\\treasonable\\tcosts\\tand\\tfees\\tto\\tthe\\tprevailing\\tparty.\\t\\tJudgment\\tupon\\tthe\\naward\\trendered\\tin\\tthe\\tarbitration\\tmay\\tbe\\tentered\\tin\\tany\\tcourt\\tof\\tcompetent\\tjurisdiction.\\t\\tIf\\tany\\tdispute\\tin\\tarbitration\\tunder\\nthis\\tPolicy\\tis\\tsubstantially\\tthe\\tsame\\tor\\tinvolves\\tcommon\\tissues\\tof\\tlaw\\tor\\tfact,\\teither\\tparty\\tshall\\tbe\\tentitled\\tto\\trequire\\tthat\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 129,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 20\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"any\\tsuch\\tdispute\\tbe\\tconsolidated\\twith\\tthe\\trelevant\\tarbitration\\tpursuant\\thereto,\\tand\\tthe\\tother\\tparty\\tshall\\tpermit,\\tand\\tco-\\noperate\\tin,\\tsuch\\tconsolidation.\\t\\t\\n5\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 129,\n        \"lines\": {\n          \"from\": 21,\n          \"to\": 23\n        }\n      }\n    }\n  },\n  {\n    \"pageContent\": \"Tesla,\\tInc.\\nCLAWBACK\\tPOLICY\\nACKNOWLEDGMENT,\\tCONSENT\\tAND\\tAGREEMENT\\nI\\tacknowledge\\tthat\\tI\\thave\\treceived\\tand\\treviewed\\ta\\tcopy\\tof\\tthe\\tTesla,\\tInc.\\tClawback\\tPolicy\\t(as\\tmay\\tbe\\tamended\\tfrom\\ntime\\tto\\ttime,\\tthe\\t“Policy”)\\tand\\tI\\thave\\tbeen\\tgiven\\tan\\topportunity\\tto\\task\\tquestions\\tabout\\tthe\\tPolicy\\tand\\treview\\tit\\twith\\tmy\\ncounsel.\\tI\\tknowingly,\\tvoluntarily\\tand\\tirrevocably\\tconsent\\tto\\tand\\tagree\\tto\\tbe\\tbound\\tby\\tand\\tsubject\\tto\\tthe\\tPolicy’s\\tterms\\tand\\nconditions,\\tincluding\\tthat\\tI\\twill\\treturn\\tany\\tErroneously\\tAwarded\\tCompensation\\tthat\\tis\\trequired\\tto\\tbe\\trepaid\\tin\\taccordance\\nwith\\tthe\\tPolicy.\\tI\\tfurther\\tacknowledge,\\tunderstand\\tand\\tagree\\tthat\\t(i)\\tthe\\tcompensation\\tthat\\tI\\treceive,\\thave\\treceived\\tor\\tmay\\nbecome\\tentitled\\tto\\treceive\\tfrom\\tthe\\tCompany\\tGroup\\tis\\tsubject\\tto\\tthe\\tPolicy,\\tand\\tthe\\tPolicy\\tmay\\taffect\\tsuch\\tcompensation\\nand\\t(ii)\\tI\\thave\\tno\\tright\\tto\\tindemnification,\\tinsurance\\tpayments\\tor\\tother\\treimbursement\\tby\\tor\\tfrom\\tthe\\tCompany\\tGroup\\tfor\\nany\\tcompensation\\tthat\\tis\\tsubject\\tto\\trecoupment\\tand/or\\tforfeiture\\tunder\\tthe\\tPolicy.\\nCapitalized\\tterms\\tused\\tbut\\tnot\\tdefined\\therein\\thave\\tthe\\tmeanings\\tset\\tforth\\tin\\tthe\\tPolicy.\\nSigned:\\nPrint\\tName:\\nDate:\",\n    \"metadata\": {\n      \"source\": \"./test_docs/test-tsla-10k-2023.pdf\",\n      \"pdf\": {\n        \"version\": \"1.10.100\",\n        \"info\": {\n          \"PDFFormatVersion\": \"1.4\",\n          \"IsAcroFormPresent\": false,\n          \"IsXFAPresent\": false,\n          \"Title\": \"\",\n          \"Creator\": \"wkhtmltopdf 0.12.6\",\n          \"Producer\": \"Qt 5.15.2\",\n          \"CreationDate\": \"D:20240129111114Z\"\n        },\n        \"metadata\": null,\n        \"totalPages\": 130\n      },\n      \"loc\": {\n        \"pageNumber\": 130,\n        \"lines\": {\n          \"from\": 1,\n          \"to\": 15\n        }\n      }\n    }\n  }\n]"
  },
  {
    "path": "ch9/py/src/ingestion_graph/__init__.py",
    "content": ""
  },
  {
    "path": "ch9/py/src/ingestion_graph/configuration.py",
    "content": "\"\"\"Define the configurable parameters for the index graph.\"\"\"\r\n\r\nfrom __future__ import annotations\r\n\r\nfrom dataclasses import dataclass, field, fields\r\nfrom typing import Annotated, Literal, Optional, Type, TypeVar, Any\r\nfrom langchain_core.runnables import RunnableConfig, ensure_config\r\n\r\n\r\nDEFAULT_DOCS_FILE = \"src/docSplits.json\"\r\n\r\n\r\n@dataclass(kw_only=True)\r\nclass IndexConfiguration:\r\n    \"\"\"Configuration class for indexing and retrieval operations.\r\n\r\n    This class defines the parameters needed for configuring the indexing and\r\n    retrieval processes, including embedding model selection, retriever provider choice, and search parameters.\r\n    \"\"\"\r\n\r\n    docs_file: str = field(\r\n        default=DEFAULT_DOCS_FILE,\r\n        metadata={\r\n            \"description\": \"Path to a JSON file containing default documents to index.\"\r\n        },\r\n    )\r\n\r\n    embedding_model: Annotated[\r\n        str,\r\n        {\"__template_metadata__\": {\"kind\": \"embeddings\"}},\r\n    ] = field(\r\n        default=\"openai/text-embedding-3-small\",\r\n        metadata={\r\n            \"description\": \"Name of the embedding model to use. Must be a valid embedding model name.\"\r\n        },\r\n    )\r\n\r\n    retriever_provider: Annotated[\r\n        Literal[\"supabase\", \"chroma\"],\r\n        {\"__template_metadata__\": {\"kind\": \"retriever\"}},\r\n    ] = field(\r\n        default=\"chroma\",\r\n        metadata={\r\n            \"description\": \"The vector store provider to use for retrieval. Options are 'supabase', or 'chroma'.\"\r\n        },\r\n    )\r\n\r\n    search_kwargs: dict[str, Any] = field(\r\n        default_factory=dict,\r\n        metadata={\r\n            \"description\": \"Additional keyword arguments to pass to the search function of the retriever.\"\r\n        },\r\n    )\r\n\r\n    @classmethod\r\n    def from_runnable_config(\r\n        cls: Type[T], config: Optional[RunnableConfig] = None\r\n    ) -> T:\r\n        \"\"\"Create an IndexConfiguration instance from a RunnableConfig object.\r\n\r\n        Args:\r\n            cls (Type[T]): The class itself.\r\n            config (Optional[RunnableConfig]): The configuration object to use.\r\n\r\n        Returns:\r\n            T: An instance of IndexConfiguration with the specified configuration.\r\n        \"\"\"\r\n        config = ensure_config(config)\r\n        configurable = config.get(\"configurable\") or {}\r\n        _fields = {f.name for f in fields(cls) if f.init}\r\n        return cls(**{k: v for k, v in configurable.items() if k in _fields})\r\n\r\n\r\nT = TypeVar(\"T\", bound=IndexConfiguration)\r\n"
  },
  {
    "path": "ch9/py/src/ingestion_graph/graph.py",
    "content": "import json\r\nfrom typing import Optional\r\nfrom langchain_core.runnables import RunnableConfig\r\nfrom langgraph.graph import StateGraph, START, END\r\n\r\nfrom ingestion_graph.configuration import IndexConfiguration\r\nfrom ingestion_graph.state import IndexState, reduce_docs\r\n\r\nfrom shared.retrieval import make_retriever\r\n\r\n\r\nasync def ingest_docs(state: IndexState, config: Optional[RunnableConfig] = None) -> dict[str, str]:\r\n    if not config:\r\n        raise ValueError(\"Configuration required to run index_docs.\")\r\n\r\n    configuration = IndexConfiguration.from_runnable_config(config)\r\n    docs = state[\"docs\"]\r\n    if not docs:\r\n        with open(configuration.docs_file, encoding=\"utf-8\") as file_content:\r\n            serialized_docs = json.loads(file_content.read())\r\n            docs = reduce_docs([], serialized_docs)\r\n    else:\r\n        docs = reduce_docs([], docs)\r\n\r\n    with make_retriever(configuration) as retriever:\r\n        await retriever.aadd_documents(docs)\r\n\r\n    return {\"docs\": \"delete\"}\r\n\r\n# Define the graph\r\nbuilder = StateGraph(IndexState, config_schema=IndexConfiguration)\r\nbuilder.add_node(ingest_docs)\r\nbuilder.add_edge(START, \"ingest_docs\")\r\nbuilder.add_edge(\"ingest_docs\", END)\r\n\r\n# Compile into a graph object that you can invoke and deploy.\r\ngraph = builder.compile()\r\ngraph.name = \"IngestionGraph\"\r\n"
  },
  {
    "path": "ch9/py/src/ingestion_graph/state.py",
    "content": "\"\"\"State management for the index graph.\"\"\"\r\n\r\nfrom dataclasses import dataclass, field\r\nfrom typing import Annotated\r\n\r\nfrom langchain_core.documents import Document\r\n\r\nfrom shared.state import reduce_docs\r\n\r\n\r\n# The index state defines the simple IO for the single-node index graph\r\n@dataclass(kw_only=True)\r\nclass IndexState:\r\n    \"\"\"Represents the state for document indexing and retrieval.\r\n\r\n    This class defines the structure of the index state, which includes\r\n    the documents to be indexed and the retriever used for searching\r\n    these documents.\r\n    \"\"\"\r\n\r\n    docs: Annotated[list[Document], reduce_docs] = field(\r\n        default_factory=list,\r\n        metadata={\r\n            \"description\": \"A list of documents that the agent can index.\"\r\n        },\r\n    )\r\n"
  },
  {
    "path": "ch9/py/src/retrieval_graph/__init__.py",
    "content": ""
  },
  {
    "path": "ch9/py/src/retrieval_graph/configuration.py",
    "content": "\"\"\"Define the configurable parameters for the agent.\"\"\"\n\nfrom __future__ import annotations\n\nfrom dataclasses import dataclass, field, fields\nfrom typing import Annotated, Any, Literal, Optional, Type, TypeVar\n\nfrom langchain_core.runnables import RunnableConfig, ensure_config\nfrom shared.configuration import BaseConfiguration\n\n\n@dataclass(kw_only=True)\nclass Configuration(BaseConfiguration):\n    \"\"\"The configuration for the agent.\"\"\"\n\n    query_model: Annotated[str, {\"__template_metadata__\": {\"kind\": \"llm\"}}] = field(\n        default=\"openai/gpt-4o\",\n        metadata={\n            \"description\": \"The language model used for processing and refining queries. Should be in the form: provider/model-name.\"\n        },\n    )\n"
  },
  {
    "path": "ch9/py/src/retrieval_graph/graph.py",
    "content": "from typing import Literal\r\nfrom langchain.hub import pull\r\nfrom langchain_core.prompts import ChatPromptTemplate\r\nfrom langchain_core.messages import HumanMessage\r\nfrom langchain_openai import ChatOpenAI\r\nfrom langgraph.graph import END, START, StateGraph\r\nfrom pydantic import BaseModel\r\n\r\nfrom retrieval_graph.utils import format_docs, load_chat_model\r\nfrom retrieval_graph.configuration import Configuration\r\nfrom shared.retrieval import make_retriever\r\nfrom langchain_core.runnables import RunnableConfig\r\n\r\nfrom retrieval_graph.state import AgentState\r\n\r\n\r\nclass Schema(BaseModel):\r\n    route: str = Literal['retrieve', 'direct']\r\n    direct_answer: str\r\n\r\n\r\nasync def check_query_type(state: AgentState, *, config: RunnableConfig):\r\n    configuration = Configuration.from_runnable_config(config)\r\n    structured_llm = load_chat_model(\r\n        configuration.query_model).with_structured_output(Schema)\r\n    routing_prompt = ChatPromptTemplate.from_messages([\r\n        (\"system\", \"You are a routing assistant. Your job is to determine if a question needs document retrieval or can be answered directly.\\n\\nRespond with either:\\n'retrieve' - if the question requires retrieving documents\\n'direct' - if the question can be answered directly AND your direct answer\"),\r\n        (\"human\", \"{query}\")\r\n    ])\r\n\r\n    formatted_prompt = routing_prompt.invoke({\"query\": state[\"query\"]})\r\n    response = structured_llm.invoke(formatted_prompt)\r\n\r\n    route = response.route\r\n\r\n    if route == \"retrieve\":\r\n        return {\"route\": \"retrieve_documents\"}\r\n    else:\r\n        direct_answer = response.direct_answer\r\n        return {\"route\": END, \"messages\": [HumanMessage(content=direct_answer)]}\r\n\r\n\r\nasync def route_query(state: AgentState, *, config: RunnableConfig):\r\n    route = state[\"route\"]\r\n    if not route:\r\n        raise ValueError(\"Route is not set\")\r\n\r\n    if route == \"retrieve_documents\":\r\n        return \"retrieve_documents\"\r\n    else:\r\n        return END\r\n\r\n\r\nasync def retrieve_documents(state: AgentState, *, config: RunnableConfig):\r\n    configuration = Configuration.from_runnable_config(config)\r\n    retriever = make_retriever(configuration)\r\n    response = retriever.invoke(state[\"query\"])\r\n    return {\"documents\": response}\r\n\r\n\r\nasync def generate_response(state: AgentState, *, config: RunnableConfig):\r\n    configuration = Configuration.from_runnable_config(config)\r\n    context = format_docs(state[\"documents\"])\r\n    prompt_template = pull(\"rlm/rag-prompt\")\r\n    formatted_prompt = prompt_template.invoke(\r\n        {\"context\": context, \"question\": state[\"query\"]})\r\n    messages = formatted_prompt.messages + state[\"messages\"]\r\n    response = load_chat_model(configuration.query_model).invoke(messages)\r\n    return {\"messages\": response}\r\n\r\n\r\nbuilder = StateGraph(AgentState, config_schema=Configuration)\r\nbuilder.add_node(\"check_query_type\", check_query_type)\r\nbuilder.add_node(\"retrieve_documents\", retrieve_documents)\r\nbuilder.add_node(\"generate_response\", generate_response)\r\nbuilder.add_edge(START, \"check_query_type\")\r\nbuilder.add_conditional_edges(\"check_query_type\", route_query)\r\nbuilder.add_edge(\"retrieve_documents\", \"generate_response\")\r\nbuilder.add_edge(\"generate_response\", END)\r\n\r\n# Compile into a graph object that you can invoke and deploy.\r\ngraph = builder.compile()\r\ngraph.name = \"RetrievalGraph\"\r\n"
  },
  {
    "path": "ch9/py/src/retrieval_graph/state.py",
    "content": "from typing import Annotated\r\nfrom langgraph.graph import MessagesState\r\nfrom langchain_core.documents import Document\r\n\r\nfrom shared.state import reduce_docs\r\n\r\n\r\nclass AgentState(MessagesState):\r\n    query: str\r\n    route: str\r\n    documents: Annotated[list[Document], reduce_docs]\r\n\r\n"
  },
  {
    "path": "ch9/py/src/retrieval_graph/utils.py",
    "content": "from typing import Optional\r\nfrom langchain_core.documents import Document\r\nfrom langchain_core.language_models import BaseChatModel\r\nfrom langchain.chat_models import init_chat_model\r\n\r\n\r\ndef _format_doc(doc: Document) -> str:\r\n    \"\"\"Format a single document as XML.\r\n\r\n    Args:\r\n        doc (Document): The document to format.\r\n\r\n    Returns:\r\n        str: The formatted document as an XML string.\r\n    \"\"\"\r\n    metadata = doc.metadata or {}\r\n    meta = \"\".join(f\" {k}={v!r}\" for k, v in metadata.items())\r\n    if meta:\r\n        meta = f\" {meta}\"\r\n\r\n    return f\"<document{meta}>\\n{doc.page_content}\\n</document>\"\r\n\r\n\r\ndef format_docs(docs: Optional[list[Document]]) -> str:\r\n    \"\"\"Format a list of documents as XML.\r\n\r\n    This function takes a list of Document objects and formats them into a single XML string.\r\n\r\n    Args:\r\n        docs (Optional[list[Document]]): A list of Document objects to format, or None.\r\n\r\n    Returns:\r\n        str: A string containing the formatted documents in XML format.\r\n\r\n    Examples:\r\n        >>> docs = [Document(page_content=\"Hello\"), Document(page_content=\"World\")]\r\n        >>> print(format_docs(docs))\r\n        <documents>\r\n        <document>\r\n        Hello\r\n        </document>\r\n        <document>\r\n        World\r\n        </document>\r\n        </documents>\r\n\r\n        >>> print(format_docs(None))\r\n        <documents></documents>\r\n    \"\"\"\r\n    if not docs:\r\n        return \"<documents></documents>\"\r\n    formatted = \"\\n\".join(_format_doc(doc) for doc in docs)\r\n    return f\"\"\"<documents>\r\n{formatted}\r\n</documents>\"\"\"\r\n\r\n\r\ndef load_chat_model(fully_specified_name: str) -> BaseChatModel:\r\n    \"\"\"Load a chat model from a fully specified name.\r\n\r\n    Args:\r\n        fully_specified_name (str): String in the format 'provider/model'.\r\n    \"\"\"\r\n    if \"/\" in fully_specified_name:\r\n        provider, model = fully_specified_name.split(\"/\", maxsplit=1)\r\n    else:\r\n        provider = \"\"\r\n        model = fully_specified_name\r\n    return init_chat_model(model, model_provider=provider)\r\n"
  },
  {
    "path": "ch9/py/src/shared/__init__.py",
    "content": ""
  },
  {
    "path": "ch9/py/src/shared/configuration.py",
    "content": "\"\"\"Define the configurable parameters for the agent.\"\"\"\n\nfrom __future__ import annotations\n\nfrom dataclasses import dataclass, field, fields\nfrom typing import Annotated, Any, Literal, Optional, Type, TypeVar\n\nfrom langchain_core.runnables import RunnableConfig, ensure_config\n\n\n@dataclass(kw_only=True)\nclass BaseConfiguration:\n    \"\"\"Configuration class for indexing and retrieval operations.\n\n    This class defines the parameters needed for configuring the indexing and\n    retrieval processes, including user identification, embedding model selection,\n    retriever provider choice, and search parameters.\n    \"\"\"\n    embedding_model: Annotated[\n        str,\n        {\"__template_metadata__\": {\"kind\": \"embeddings\"}},\n    ] = field(\n        default=\"openai/text-embedding-3-small\",\n        metadata={\n            \"description\": \"Name of the embedding model to use. Must be a valid embedding model name.\"\n        },\n    )\n\n    retriever_provider: Annotated[\n        Literal[\"supabase\", \"chroma\"],\n        {\"__template_metadata__\": {\"kind\": \"retriever\"}},\n    ] = field(\n        default=\"chroma\",\n        metadata={\n            \"description\": \"The vector store provider to use for retrieval. Options are 'supabase' or 'chroma'.\"\n        },\n    )\n\n    search_kwargs: dict[str, Any] = field(\n        default_factory=dict,\n        metadata={\n            \"description\": \"Additional keyword arguments to pass to the search function of the retriever.\"\n        },\n    )\n\n    @classmethod\n    def from_runnable_config(\n        cls: Type[T], config: Optional[RunnableConfig] = None\n    ) -> T:\n        \"\"\"Create an BaseConfiguration instance from a RunnableConfig object.\n\n        Args:\n            cls (Type[T]): The class itself.\n            config (Optional[RunnableConfig]): The configuration object to use.\n\n        Returns:\n            T: An instance of BaseConfiguration with the specified configuration.\n        \"\"\"\n        config = ensure_config(config)\n        configurable = config.get(\"configurable\") or {}\n        _fields = {f.name for f in fields(cls) if f.init}\n        return cls(**{k: v for k, v in configurable.items() if k in _fields})\n\n\nT = TypeVar(\"T\", bound=BaseConfiguration)\n"
  },
  {
    "path": "ch9/py/src/shared/retrieval.py",
    "content": "from contextlib import contextmanager\r\nimport os\r\nfrom langchain_chroma import Chroma\r\nfrom langchain_core.embeddings import Embeddings\r\nfrom langchain_core.runnables import RunnableConfig\r\nfrom langchain_openai import OpenAIEmbeddings\r\nfrom langchain_community.vectorstores import SupabaseVectorStore\r\nfrom langchain_chroma import Chroma\r\nfrom supabase import create_client\r\nimport chromadb\r\n\r\n\r\nfrom ingestion_graph.configuration import IndexConfiguration\r\n\r\n\r\ndef make_text_encoder(model: str) -> Embeddings:\r\n    \"\"\"Connect to the configured text encoder.\"\"\"\r\n    provider, model = model.split(\"/\", maxsplit=1)\r\n    if provider == \"openai\":\r\n        from langchain_openai import OpenAIEmbeddings\r\n        return OpenAIEmbeddings(model=model)\r\n    else:\r\n        raise ValueError(f\"Unsupported embedding provider: {provider}\")\r\n\r\n\r\n@contextmanager\r\ndef make_supabase_retriever(configuration: RunnableConfig, embedding_model: Embeddings):\r\n    supabase_url = os.environ.get(\"SUPABASE_URL\")\r\n    supabase_key = os.environ.get(\"SUPABASE_SERVICE_ROLE_KEY\")\r\n\r\n    if not supabase_url or not supabase_key:\r\n        raise ValueError(\r\n            \"Please set SUPABASE_URL and SUPABASE_SERVICE_ROLE_KEY env variables\")\r\n\r\n    client = create_client(supabase_url, supabase_key)\r\n    vectorstore = SupabaseVectorStore(\r\n        client=client, embedding=embedding_model, table_name=\"documents\", query_name=\"match_documents\")\r\n    search_kwargs = configuration.search_kwargs\r\n    yield vectorstore.as_retriever(search_kwargs=search_kwargs)\r\n\r\n\r\n@contextmanager\r\ndef make_chroma_retriever(configuration: IndexConfiguration, embedding_model: Embeddings):\r\n    client = chromadb.HttpClient(host='localhost', port=8000)\r\n\r\n    vectorstore = Chroma(\r\n        collection_name=\"documents\",\r\n        embedding_function=embedding_model,\r\n        client=client\r\n    )\r\n    search_kwargs = configuration.search_kwargs\r\n    search_filter = search_kwargs.setdefault(\"filter\", {})\r\n    yield vectorstore.as_retriever(search_kwargs=search_kwargs)\r\n\r\n\r\n@contextmanager\r\ndef make_retriever(\r\n    config: RunnableConfig,\r\n):\r\n    \"\"\"Create a retriever for the agent, based on the current configuration.\"\"\"\r\n    configuration = IndexConfiguration.from_runnable_config(config)\r\n    embedding_model = make_text_encoder(configuration.embedding_model)\r\n    if configuration.retriever_provider == \"supabase\":\r\n        with make_supabase_retriever(configuration, embedding_model) as retriever:\r\n            yield retriever\r\n    elif configuration.retriever_provider == \"chroma\":\r\n        with make_chroma_retriever(configuration, embedding_model) as retriever:\r\n            yield retriever\r\n    else:\r\n        raise ValueError(\r\n            \"Unrecognized retriever_provider in configuration. \"\r\n            f\"Expected one of: {', '.join(Configuration.__annotations__['retriever_provider'].__args__)}\\n\"\r\n            f\"Got: {configuration.retriever_provider}\"\r\n        )\r\n"
  },
  {
    "path": "ch9/py/src/shared/state.py",
    "content": "\"\"\"Shared functions for state management.\"\"\"\r\n\r\nimport hashlib\r\nimport uuid\r\nfrom typing import Any, Literal, Optional, Union\r\n\r\nfrom langchain_core.documents import Document\r\n\r\nfrom typing import Any, Literal, Optional\r\n\r\n\r\n\r\ndef _generate_uuid(page_content: str) -> str:\r\n    \"\"\"Generate a UUID for a document based on page content.\"\"\"\r\n    md5_hash = hashlib.md5(page_content.encode()).hexdigest()\r\n    return str(uuid.UUID(md5_hash))\r\n\r\n\r\ndef reduce_docs(\r\n    existing: Optional[list[Document]],\r\n    new: Union[\r\n        list[Document],\r\n        list[dict[str, Any]],\r\n        list[str],\r\n        str,\r\n        Literal[\"delete\"],\r\n    ],\r\n) -> list[Document]:\r\n    \"\"\"Reduce and process documents based on the input type.\r\n\r\n    This function handles various input types and converts them into a sequence of Document objects.\r\n    It can delete existing documents, create new ones from strings or dictionaries, or return the existing documents.\r\n    It also combines existing documents with the new one based on the document ID.\r\n\r\n    Args:\r\n        existing (Optional[Sequence[Document]]): The existing docs in the state, if any.\r\n        new (Union[Sequence[Document], Sequence[dict[str, Any]], Sequence[str], str, Literal[\"delete\"]]):\r\n            The new input to process. Can be a sequence of Documents, dictionaries, strings, a single string,\r\n            or the literal \"delete\".\r\n    \"\"\"\r\n    if new == \"delete\":\r\n        return []\r\n\r\n    existing_list = list(existing) if existing else []\r\n    if isinstance(new, str):\r\n        return existing_list + [\r\n            Document(page_content=new, metadata={\"uuid\": _generate_uuid(new)})\r\n        ]\r\n\r\n    new_list = []\r\n    if isinstance(new, list):\r\n        existing_ids = set(doc.metadata.get(\"uuid\") for doc in existing_list)\r\n        for item in new:\r\n            if isinstance(item, str):\r\n                item_id = _generate_uuid(item)\r\n                new_list.append(Document(page_content=item, metadata={\"uuid\": item_id}))\r\n                existing_ids.add(item_id)\r\n\r\n            elif isinstance(item, dict):\r\n                metadata = item.get(\"metadata\", {})\r\n                item_id = metadata.get(\"uuid\") or _generate_uuid(\r\n                    item.get(\"page_content\", \"\")\r\n                )\r\n\r\n                if item_id not in existing_ids:\r\n                    new_list.append(\r\n                        Document(**{**item, \"metadata\": {**metadata, \"uuid\": item_id}})\r\n                    )\r\n                    existing_ids.add(item_id)\r\n\r\n            elif isinstance(item, Document):\r\n                item_id = item.metadata.get(\"uuid\", \"\")\r\n                if not item_id:\r\n                    item_id = _generate_uuid(item.page_content)\r\n                    new_item = item.copy(deep=True)\r\n                    new_item.metadata[\"uuid\"] = item_id\r\n                else:\r\n                    new_item = item\r\n\r\n                if item_id not in existing_ids:\r\n                    new_list.append(new_item)\r\n                    existing_ids.add(item_id)\r\n\r\n    return existing_list + new_list\r\n"
  },
  {
    "path": "package.json",
    "content": "{\n\t\"name\": \"learning-langchain-repo\",\n\t\"description\": \"Learning LangChain O'Reilly book code examples\",\n\t\"type\": \"module\",\n\t\"author\": \"Nuno Campos and Mayo Oshin\",\n\t\"scripts\": {\n\t\t\"langgraph:dev\": \"npx @langchain/langgraph-cli dev -c ch9/js/langgraph.json --verbose\"\n\t},\n\t\"dependencies\": {\n\t\t\"@langchain/community\": \"^0.3.26\",\n\t\t\"@langchain/core\": \"^0.3.33\",\n\t\t\"@langchain/langgraph\": \"^0.2.41\",\n\t\t\"@langchain/langgraph-cli\": \"^0.0.1\",\n\t\t\"@langchain/langgraph-sdk\": \"^0.0.36\",\n\t\t\"@langchain/openai\": \"^0.3.17\",\n\t\t\"@supabase/supabase-js\": \"^2.44.0\",\n\t\t\"duck-duck-scrape\": \"^2.2.7\",\n\t\t\"expr-eval\": \"^2.0.2\",\n\t\t\"langchain\": \"^0.3.15\",\n\t\t\"pdf-parse\": \"^1.1.1\",\n\t\t\"pg\": \"^8.13.1\",\n\t\t\"sqlite3\": \"^5.1.7\",\n\t\t\"typeorm\": \"^0.3.20\"\n\t},\n\t\"devDependencies\": {\n\t\t\"@types/pdf-parse\": \"^1.1.4\"\n\t}\n}\n"
  },
  {
    "path": "pyproject.toml",
    "content": "[project]\nname = \"learning-langchain\"\nversion = \"0.0.1\"\ndescription = \"Code blocks for the book Learning LangChain.\"\nauthors = []\nlicense = { text = \"MIT\" }\nreadme = \"README.md\"\nrequires-python = \">=3.9\"\ndependencies = [\n    \"langgraph>=0.2.6\",\n    \"langchain-openai>=0.1.22\",\n    \"langchain>=0.2.14\",\n    \"python-dotenv>=1.0.1\",\n    \"langchain-community>=0.3.15\",\n    \"langchain-postgres>=0.0.12\",\n    \"langchain-chroma>=0.2.0\",\n    \"beautifulsoup4>=4.12.2\",\n    \"pypdf>=5.1.0\",\n    \"psycopg[binary]>=3.2.4\",  # Updated to include [binary] extra\n    \"setuptools>=75.8.0\",\n    \"langsmith>=0.3.2\",\n    \"langgraph-checkpoint-sqlite>=2.0.3\",\n    \"duckduckgo-search>=7.3.0\",\n    \"langgraph-cli>=0.1.73\"\n]\n\n[build-system]\nrequires = [\"setuptools>=73.0.0\", \"wheel\"]\nbuild-backend = \"setuptools.build_meta\"\n\n[tool.setuptools]\npackages = []\n\n[tool.setuptools.package-data]\n\"*\" = [\"py.typed\"]\n\n[project.scripts]\nlanggraph-dev = \"langgraph.cli:dev_command --config ch9/py/langgraph.json --verbose\"\n"
  },
  {
    "path": "test.txt",
    "content": "Chapter 1: Life in Ancient Greece\nLife in ancient Greece was a tapestry woven with rich cultural, social, and political threads that have left an enduring legacy on Western civilization. Centered around the polis, or city-state, ancient Greek society fostered a unique blend of communal living, intellectual pursuit, and artistic innovation. This chapter delves into the multifaceted aspects of daily life in ancient Greece, exploring the social structure, education, religion, economy, and contributions to art and architecture that defined this remarkable civilization.\nThe Polis: Heart of Greek Society\nAt the core of ancient Greek life was the polis, a city-state that served as the primary political and social unit. Each polis was an independent entity with its own government, laws, and customs, fostering a strong sense of community and civic responsibility among its citizens. The most famous of these city-states—Athens, Sparta, Corinth, and Thebes—each had distinct characteristics and governance structures, contributing to a diverse and dynamic Greek landscape.\nAthens: Cradle of Democracy\nAthens is renowned as the birthplace of democracy, where citizens participated directly in decision-making processes. Assemblies were held regularly, allowing male citizens to voice their opinions and vote on legislation, military actions, and other crucial matters. This participatory governance encouraged active civic engagement and laid the foundation for modern democratic systems.\nSparta: Military Prowess and Discipline\nIn contrast, Sparta was a militaristic society focused on discipline, strength, and obedience. Governed by a dual monarchy and a council of elders, Sparta's social structure emphasized rigorous training and military service. From a young age, Spartan males underwent the agoge, a state-sponsored education and training regimen designed to produce elite soldiers loyal to the state.\nDaily Life and Social Structure\nCitizens and Their Roles\nGreek society was highly stratified, with clear distinctions between citizens, metics (resident foreigners), and slaves. Citizens were typically free-born males who had completed their military training and participated in the political life of the polis. Metics contributed to the economy through trade and craftsmanship but lacked political rights. Slaves performed various labor roles, from domestic service to skilled craftsmanship, under the ownership of private individuals or the state.\nGender Roles and Family Life\nWhile male citizens engaged in public life, women primarily managed household affairs and took care of children. However, the roles and freedoms of women varied significantly between city-states. In Athens, women's public presence was limited, whereas in Sparta, women enjoyed greater autonomy and could own property, reflecting the militaristic and pragmatic nature of Spartan society.\nEducation and Intellectual Pursuits\nEducation was a cornerstone of Greek society, especially in Athens, where citizens were encouraged to pursue knowledge and develop critical thinking skills. Young boys attended schools to study subjects such as reading, writing, mathematics, music, and physical education. The gymnasium played a central role, serving not only as a place for athletic training but also as a hub for intellectual discussions and philosophical debates.\nThe Gymnasium: A Nexus of Body and Mind\nThe gymnasium epitomized the Greek ideal of a balanced development of body and mind. Athletes trained rigorously, preparing for competitions like the Olympic Games, while philosophers and scholars engaged in discourse on topics ranging from ethics to natural sciences. This integration of physical and intellectual pursuits fostered a well-rounded citizenry capable of contributing to various facets of society.\nReligion and Mythology\nReligion was deeply ingrained in everyday life, influencing social practices, politics, and personal behavior. The Greeks practiced a polytheistic belief system, worshipping a pantheon of gods and goddesses who embodied various aspects of nature and human experience.\nTemples and Worship\nMajestic temples dedicated to deities like Zeus, Athena, and Apollo dotted the landscape of Greek cities. These structures showcased architectural prowess with their impressive columns and intricate sculptures. Religious festivals and ceremonies were central to community life, featuring processions, sacrifices, athletic competitions, and theatrical performances that honored the gods and reinforced social cohesion.\nSacred Rituals and Oracles\nPriests and priestesses served as intermediaries between the divine and the mortal realms, conducting rituals and offering guidance through oracles. The Oracle of Delphi was one of the most renowned, providing prophetic insights that influenced political decisions and personal endeavors alike.\nEconomy and Trade\nAncient Greece's economy was vibrant and diverse, driven by agriculture, craftsmanship, and extensive trade networks. The fertile plains supported the cultivation of olives, grapes, and grains, which were staples of the Greek diet and essential for trade.\nThe Agora: Marketplace and Social Hub\nThe agora was the bustling marketplace and central meeting place in each polis. Here, merchants sold goods ranging from fresh produce and seafood to handcrafted pottery and textiles. The agora was not only a center for economic activity but also a venue for social interaction, political discussion, and the exchange of ideas.\nMaritime Trade and Colonization\nGreece's geographical location fostered a strong maritime tradition, with numerous islands and a rugged coastline facilitating trade across the Mediterranean and Black Seas. Greek traders established colonies in regions such as Sicily, Asia Minor, and North Africa, spreading Greek culture and goods while benefiting from the exchange of resources and ideas.\nArt, Architecture, and Engineering\nThe Greeks were exceptional innovators, leaving an indelible mark on art, architecture, and engineering. Their contributions continue to influence modern aesthetics and structural design.\nSculpture and Pottery\nGreek sculptors excelled in creating lifelike statues that captured the human form with remarkable realism and beauty. Works such as the Venus de Milo and the Discobolus exemplify the Greek pursuit of idealized proportions and expressive detail. Pottery was another significant art form, featuring intricate designs and scenes from mythology and everyday life that provide valuable insights into Greek culture.\nArchitectural Marvels\nGreek architecture is celebrated for its grandeur and precision. The use of the three classical orders—Doric, Ionic, and Corinthian—defined the aesthetic of temples and public buildings. The Parthenon in Athens, dedicated to the goddess Athena, stands as a testament to Greek architectural ingenuity, with its harmonious proportions and elaborate sculptures.\nEngineering Feats\nGreek engineers developed advanced infrastructure to support urban living. Aqueducts and public fountains were engineered to manage water resources efficiently, improving sanitation and public health. The construction of roads, bridges, and ports facilitated trade and communication, contributing to the prosperity of the polis.\nLegacy of Ancient Greece\nThe legacy of ancient Greece is profound, laying the groundwork for numerous aspects of modern society. Democratic governance, philosophical inquiry, artistic expression, and architectural principles all trace their origins to this remarkable civilization. By examining the daily life, social structures, and cultural achievements of ancient Greeks, we gain a deeper appreciation for the foundations upon which contemporary Western society is built.\n---\nThis chapter provides a comprehensive overview of life in ancient Greece, setting the stage for a detailed exploration of its enduring contributions to the world. Through understanding the intricate dynamics of the polis, the pursuit of education and intellectual growth, the depth of religious practices, and the brilliance in art and engineering, we can better appreciate the sophistication and resilience of ancient Greek civilization.\n\nChapter 2: Politics and Governance in Ancient Greece\nThe political landscape of ancient Greece was as diverse as its geography, with each city-state, or polis, developing its own unique system of governance. From the birthplace of democracy in Athens to the oligarchic and militaristic structures of Sparta, Greek political systems have profoundly influenced modern governance. This chapter explores the various forms of government, the roles of citizens, political institutions, and the interplay between different city-states in shaping the political dynamics of ancient Greece.\nForms of Government\nDemocracy in Athens\nAthens is celebrated as the cradle of democracy, introducing a system where citizens actively participated in decision-making. This direct democracy allowed male citizens to:\nAttend the Assembly (Ekklesia): The principal legislative body where laws were proposed, debated, and voted upon.\nServe in Public Offices: Positions such as strategos (military generals) and archons (magistrates) were filled by lot, ensuring broad participation.\nParticipate in the Council of 500 (Boule): A representative body responsible for setting the agenda for the Assembly.\nThis inclusive approach fostered a sense of civic duty and accountability, laying the groundwork for democratic principles that endure to this day.\nOligarchy in Sparta\nContrasting sharply with Athenian democracy, Sparta operated under an oligarchic system characterized by a rigid military hierarchy and limited political participation. Key features included:\nDual Kingship: Sparta was ruled by two kings from separate royal families, ensuring a balance of power.\nGerousia (Council of Elders): Comprising 28 elders over the age of 60 and the two kings, this council held significant legislative and judicial authority.\nEphors: Five elected officials who oversaw daily governance, enforced laws, and acted as a check on the kings’ power.\nLimited Citizenship: Political rights were restricted to a small group of full citizens, known as Spartiates, who were professional soldiers committed to the state.\nSpartan governance emphasized stability, discipline, and military excellence, reflecting the society’s martial values.\nTyranny and Other Forms\nBeyond Athens and Sparta, other city-states experienced different forms of governance, including tyranny, where a single ruler seized power, often with popular support to address social inequalities or external threats. Additionally, some poleis practiced monarchies or variations of constitutional government, each adapting to their unique social and political contexts.\nPolitical Institutions and Processes\nThe Assembly (Ekklesia)\nIn democratic Athens, the Ekklesia was the central institution where citizens gathered to:\nPropose and Debate Laws: Legislators and citizens could introduce new laws or amendments.\nDecide on Military Campaigns: Strategic decisions regarding warfare and alliances were made collectively.\nElect Officials: Key positions were filled through direct voting.\nRegular meetings of the Assembly ensured that citizens remained engaged in the governance process, promoting transparency and collective responsibility.\nThe Council of 500 (Boule)\nThe Boule played a crucial role in preparing legislative agendas and managing day-to-day affairs. Members were selected by lot, ensuring a diverse representation from across the populace. The council coordinated various government departments and supervised public projects, acting as a bridge between the populace and the broader legislative body.\nThe Areopagus\nThe Areopagus was a prestigious council composed of former archons, serving as guardians of the constitution and overseeing moral and legal matters. Although its power waned over time, it remained an influential body in maintaining political stability and addressing serious crimes.\nCitizenship and Political Participation\nCriteria for Citizenship\nCitizenship in ancient Greece was a coveted status, primarily restricted to free-born males who met specific criteria:\nBirthright: Typically, citizens had both parents from the same polis.\nExemplary Conduct: Participation in military service and public affairs was expected.\nProperty Ownership: In some city-states, owning property was a prerequisite for full citizenship.\nRoles and Responsibilities\nCitizens were expected to:\nEngage in Civic Duties: Attend assemblies, vote on laws, and serve in public offices.\nMilitary Service: Especially in Athens, where the citizenry was responsible for defending the polis.\nContribute to Public Finances: Through taxes and participation in economic activities.\nThis active participation reinforced the democratic ethos in places like Athens and the militaristic discipline in Sparta.\nInteractions Between City-States\nConfederations and Alliances\nAncient Greece was not a unified nation but a collection of independent city-states that often formed alliances for mutual protection and economic benefit. Notable alliances included:\nThe Delian League: Led by Athens, this alliance aimed to defend against Persian aggression and eventually became the basis for Athenian imperial power.\nThe Peloponnesian League: Dominated by Sparta, this coalition served as a counterbalance to Athenian influence, leading to the protracted Peloponnesian War.\nConflicts and Wars\nRivalries and competition for resources, influence, and power frequently led to conflicts such as:\nThe Persian Wars: A series of conflicts where Greek city-states united against the invading Persian Empire.\nThe Peloponnesian War: A devastating conflict between Athens and Sparta that reshaped the Greek political landscape.\nLocal Skirmishes: Smaller-scale wars and disputes often erupted between neighboring poleis over territory and alliances.\nThese conflicts underscored the fragile balance of power and the constant struggle for supremacy among the Greek city-states.\nPolitical Philosophy and Thought\nFoundations of Political Theory\nAncient Greece was not only a cradle of political practice but also of political thought. Thinkers like Plato, Aristotle, and Socrates explored ideas about governance, justice, and the ideal state.\nPlato's \"Republic\": Proposed a philosopher-king ruling an ideal state based on justice and rationality.\nAristotle's \"Politics\": Analyzed various forms of government, advocating for a constitutional polity as the most stable and just system.\nInfluence on Modern Governance\nGreek political philosophy has had a lasting impact on modern political systems, particularly in the development of democratic ideals, republicanism, and the separation of powers. Concepts such as civic participation, rule of law, and checks and balances trace their origins to ancient Greek political thought.\nConclusion\nThe politics and governance of ancient Greece were multifaceted and dynamic, reflecting the diversity and complexity of its city-states. From the democratic experiments of Athens to the disciplined oligarchy of Sparta, Greek political systems offered a range of models that have shaped the evolution of governance throughout history. Understanding these ancient political structures provides valuable insights into the foundations of modern political institutions and the enduring legacy of Greek political innovation.\n---\nChapter 3: Military and Warfare in Ancient Greece\nWarfare was a central aspect of life in ancient Greece, influencing political power, societal structures, and cultural values. The frequent conflicts between city-states and against external threats necessitated highly organized military systems and innovative strategies. This chapter examines the structure of Greek armies, the role of prominent military leaders, key battles and wars, military tactics and technologies, as well as the societal impact of warfare on ancient Greek civilization.\nMilitary Structure and Organization\nThe Hoplite and Phalanx Formation\nThe backbone of Greek armies was the hoplite, a heavily armored infantry soldier equipped with spear and shield. Hoplites fought in tight, rectangular formations known as phalanxes, which were highly effective against enemy forces.\nArmor and Weapons: Hoplites wore bronze helmets, breastplates, greaves, and carried large round shields (aspis) and spears (doru).\nPhalanx Tactics: The phalanx emphasized unity and discipline, with soldiers overlapping their shields to create an impenetrable front and advancing in unison to maximize offensive and defensive capabilities.\nThe Spartan Military\nSparta was renowned for its exceptional military system, which was the foundation of its society. Key aspects included:\nAgoge: A rigorous state-sponsored education and training program for male citizens, instilling discipline, endurance, and martial prowess from a young age.\nSpartiates: The elite warrior class, full citizens of Sparta, who dedicated their lives to military service.\nDual Kingship: Sparta’s two kings often led military campaigns, ensuring strategic leadership and continuity in wartime.\nNaval Forces\nWhile land battles were predominant, naval power was also crucial, particularly for city-states like Athens.\nTriremes: Fast, agile warships with three rows of oarsmen, equipped with a bronze ram for attacking enemy vessels.\nAthenian Navy: Athens developed a powerful navy that played a pivotal role in conflicts such as the Persian Wars and the Peloponnesian War, enabling the projection of power across the Aegean Sea.\nProminent Military Leaders\nLeonidas I of Sparta\nKing Leonidas I is celebrated for his leadership during the Battle of Thermopylae in 480 BCE, where he led a small Spartan force against the vast Persian army, exemplifying courage and sacrifice.\nThemistocles of Athens\nThemistocles was instrumental in developing the Athenian navy, securing Greek victories against the Persians, notably at the Battle of Salamis, and advancing Athens' maritime dominance.\nEpaminondas of Thebes\nEpaminondas revolutionized Greek warfare with his innovative tactics, most notably at the Battle of Leuctra in 371 BCE, where he defeated Sparta and shifted the balance of power in Greece.\nKey Battles and Wars\nThe Persian Wars (499-449 BCE)\nA series of conflicts between Greek city-states and the Persian Empire, including:\nBattle of Marathon (490 BCE): A decisive Greek victory that halted Persian expansion into mainland Greece.\nBattle of Thermopylae (480 BCE): Despite a heroic stand by Leonidas and his Spartans, the Persians eventually overcame Greek forces.\nBattle of Salamis (480 BCE): A naval triumph for Athens, crippling the Persian fleet and securing Greek independence.\nThe Peloponnesian War (431-404 BCE)\nA protracted and destructive conflict between Athens and its empire against the Peloponnesian League led by Sparta, resulting in:\nAthenian Plague: Devastated Athens, weakening its military and morale.\nSicilian Expedition: A failed Athenian military campaign that further strained resources.\nSpartan Victory: Ultimately, Sparta's resilience and support from Persia led to the downfall of Athenian power.\nThe Corinthian War (395-387 BCE)\nFought between Sparta and an alliance of Athens, Thebes, Corinth, and Persia, this war highlighted shifting alliances and the complexities of Greek politics following the Peloponnesian War.\nThe Battle of Leuctra (371 BCE)\nA watershed moment where Theban forces under Epaminondas defeated Sparta decisively, leading to the decline of Spartan dominance and the rise of Thebes as a major power.\nMilitary Tactics and Technologies\nPhalanx Formation\nThe phalanx remained the dominant infantry tactic throughout much of Greek warfare, emphasizing cohesion and brute strength. Innovations included:\nDepth and Flexibility: Adjusting the number of ranks to respond to different threats.\nCombined Arms: Integrating infantry with cavalry and archers for versatile combat strategies.\nNaval Innovations\nGreek naval warfare saw advancements in ship design and tactics, such as:\nRamming Techniques: Utilizing the bronze ram to breach enemy ships.\nBoarding Maneuvers: Engaging enemy crews directly through close combat.\nSiege Warfare\nCity-states developed techniques for besieging fortified cities, including:\nSiege Engines: Construction of battering rams, towers, and other devices to breach walls.\nBlockades: Cutting off supplies to weaken and starve out besieged populations.\nSocietal Impact of Warfare\nMilitary Service and Citizenship\nIn many Greek city-states, military service was closely tied to citizenship and social status. For instance:\nSparta: Full citizenship was reserved for those who completed the agoge and served in the army.\nAthens: Military service was part of the duties of citizenship, fostering civic responsibility.\nEconomic Consequences\nProlonged warfare strained the economies of Greek city-states, leading to:\nResource Allocation: Significant portions of resources were directed towards military expenditures.\nSlavery and Labor: Increased reliance on slave labor to maintain agricultural and urban productivity during wartime.\nCultural Reflections\nWarfare permeated Greek culture, inspiring:\nLiterature and Drama: Epic tales like those of Achilles and heroic plays celebrating military valor.\nArt and Monuments: Sculptures and monuments commemorating victorious battles and fallen heroes.\nThe Legacy of Greek Warfare\nAncient Greek military strategies and innovations have left a lasting legacy on the art of war. Concepts such as the phalanx formation influenced military tactics for centuries, while the emphasis on discipline and training set standards for military professionalism. Additionally, the political and philosophical reflections on warfare by Greek thinkers have contributed to enduring discussions on the ethics and purposes of war.\nConclusion\nMilitary prowess and warfare were integral to the fabric of ancient Greek society, shaping its political landscape, economic structures, and cultural expressions. The strategic innovations, heroic narratives, and enduring legacies of Greek military endeavors continue to inform modern military thought and commemorate the valor of those who served. Understanding the complexities of ancient Greek warfare provides a deeper appreciation for the resilience and ingenuity that characterized one of history’s most influential civilizations.\n---\nChapter 4: Arts and Culture in Ancient Greece\nThe arts and culture of ancient Greece represent a pinnacle of human creativity and intellectual achievement. From sculpture and pottery to theater and music, Greek artistic endeavors have left an indelible mark on Western civilization. This chapter explores the various forms of Greek art, the societal role of artists, the development of literature and drama, architectural advancements, and the enduring influence of Greek culture on subsequent generations.\nVisual Arts\nSculpture\nGreek sculpture is renowned for its realism, idealism, and expression of human emotion. Key developments include:\nArchaic Period (700-480 BCE): Characterized by rigid and formalized figures, exemplified by the kouros and kore statues.\nClassical Period (480-323 BCE): Transition to naturalism and dynamic poses, as seen in works by sculptors like Phidias, Polykleitos, and Myron.\nPhidias: Creator of the statue of Zeus at Olympia and the Parthenon sculptures.\nPolykleitos: Developed the Canon, a set of proportions for the ideal male body.\nMyron: Best known for the Discobolus (Discus Thrower), capturing motion and athleticism.\nPottery\nGreek pottery serves both functional and artistic purposes, often decorated with intricate designs and narrative scenes.\nTypes of Pottery: Includes amphorae (storage vessels), kraters (mixing wine and water), and kylixes (drinking cups).\nDecorative Styles:\nGeometric Style (900-700 BCE): Features abstract patterns and motifs.\nBlack-Figure Technique (700-500 BCE): Figures are painted in black silhouette against the natural red clay.\nRed-Figure Technique (530-300 BCE): The reverse of black-figure, allowing for greater detail and expression.\nPainting\nWhile few examples survive, Greek painting was highly esteemed, with influences seen in vase paintings and frescoes.\nTechniques: Included fresco, encaustic, and tempera.\nThemes: Mythological narratives, daily life, and natural landscapes.\nArchitecture\nGreek architecture is celebrated for its harmony, proportion, and grandeur, with enduring influences on Western architectural styles.\nThe Three Orders: Doric, Ionic, and Corinthian, each with distinct column designs and decorative elements.\nDoric Order: Simple, sturdy columns with plain capitals.\nIonic Order: Slender columns with scroll-like capitals.\nCorinthian Order: Elaborate capitals adorned with acanthus leaves.\nNotable Structures\nThe Parthenon: A masterpiece of Doric architecture, dedicated to the goddess Athena, featuring intricate sculptures and a harmonious facade.\nThe Temple of Artemis at Ephesus: Exemplifies the grandeur of Greek temple design.\nThe Theater of Epidaurus: Renowned for its exceptional acoustics and elegant design.\nLiterature and Drama\nGreek literature laid the foundation for Western literary traditions, encompassing epic poetry, lyric poetry, history, and drama.\nEpic and Lyric Poetry\nHomer's \"Iliad\" and \"Odyssey\": Epic poems that recount heroic tales of the Trojan War and the adventures of Odysseus.\nHesiod's \"Theogony\" and \"Works and Days\": Explores the origins of the gods and provides agricultural and moral guidance.\nLyric Poets: Composers like Sappho and Pindar created expressive and personal poetry, often performed with musical accompaniment.\nDrama\nGreek theater was a significant cultural institution, featuring tragedies and comedies that explored complex themes.\nTragedy: Focused on human suffering and moral dilemmas, with playwrights like Aeschylus, Sophocles, and Euripides.\nSophocles: Authored masterpieces such as \"Oedipus Rex\" and \"Antigone.\"\nComedy: Addressed social and political satire, with playwrights like Aristophanes.\nAristophanes: Known for plays like \"Lysistrata\" and \"The Birds,\" blending humor with social commentary.\nLiterary Themes\nHeroism and Fate: Explored the struggles of individuals against destiny and the gods.\nEthics and Morality: Delved into questions of justice, virtue, and the human condition.\nPolitical Critique: Used satire and drama to comment on societal norms and governance.\nMusic and Dance\nMusic and dance were integral to Greek cultural and religious life, performed in various contexts from religious ceremonies to public festivals.\nInstruments: Included the lyre, aulos (reed instrument), and various percussion instruments.\nDance Styles: Varied from solemn processional dances to lively, communal performances.\nRole in Society: Accompanied storytelling, worship, and were integral to theatrical performances.\nPhilosophy and Intellectual Life\nGreek philosophy represents a cornerstone of Western intellectual tradition, emphasizing reason, inquiry, and the pursuit of knowledge.\nPre-Socratic Philosophers: Focused on natural phenomena and the origins of the cosmos, including Thales, Anaximander, and Heraclitus.\nSocratic Philosophy: Centered on ethical inquiries and the Socratic method of dialogue, pioneered by Socrates.\nPlatonic and Aristotelian Thought: Plato founded the Academy, exploring ideal forms and political philosophy, while Aristotle established the Lyceum, contributing to logic, biology, ethics, and aesthetics.\nThe Role of Artists and Intellectuals\nArtists and intellectuals held esteemed positions in Greek society, often patronized by wealthy elites and city-states.\nPatronage: Wealthy citizens and temples funded artistic and intellectual endeavors, fostering an environment of creativity and innovation.\nPublic Commissions: Artists were commissioned to create works for public spaces, religious institutions, and civic celebrations.\nIntellectual Societies: Philosophers and scholars engaged in debates and taught students, contributing to the collective knowledge and cultural advancements.\nLegacy of Greek Arts and Culture\nThe influence of Greek arts and culture extends far beyond antiquity, shaping subsequent artistic movements and intellectual developments.\nRenaissance Revival: Greek artistic principles inspired the Renaissance’s emphasis on classical beauty and harmony.\nNeoclassical Architecture: Revived Greek architectural styles in modern public buildings and monuments.\nLiterary Influence: Greek literature and drama have been continuously studied, adapted, and emulated in Western literary traditions.\nPhilosophical Foundations: Greek philosophical concepts underpin many modern ethical, political, and scientific frameworks.\nConclusion\nThe arts and culture of ancient Greece represent a vibrant and dynamic facet of its civilization, showcasing unparalleled creativity and intellectual rigor. From the timeless sculptures that capture the human form and spirit to the profound philosophical inquiries into existence and morality, Greek cultural achievements continue to inspire and inform contemporary society. Understanding the depth and breadth of Greek artistic and cultural contributions provides valuable insights into the enduring legacy of one of history’s most influential civilizations.\n---\nChapter 5: Philosophy and Science in Ancient Greece\nAncient Greece was a fertile ground for philosophical thought and scientific inquiry, laying the foundational principles that have shaped Western intellectual traditions. Greek philosophers and scientists pursued knowledge across diverse fields, seeking to understand the nature of reality, ethics, politics, and the natural world. This chapter delves into the major philosophical schools, key scientific advancements, influential thinkers, and the enduring impact of Greek intellectual pursuits on subsequent generations.\nPhilosophical Schools and Movements\nPre-Socratic Philosophers\nBefore Socrates, Greek philosophers known as Pre-Socratics focused primarily on cosmology, metaphysics, and the nature of the universe.\nThales of Miletus: Proposed that water was the fundamental substance (arche) underlying all matter.\nAnaximander: Introduced the concept of the apeiron (infinite) as the origin of all things.\nHeraclitus: Emphasized constant change, famously asserting that \"you cannot step into the same river twice.\"\nParmenides: Argued for the concept of Being as unchanging and eternal, challenging notions of change and plurality.\nSocratic Philosophy\nSocrates shifted Greek philosophy towards ethical and epistemological inquiries, focusing on human behavior, morality, and the pursuit of virtue.\nSocratic Method: A form of cooperative argumentative dialogue that stimulates critical thinking and illuminates ideas.\nEthical Focus: Examined the nature of justice, courage, and other virtues, asserting that knowledge and virtue are interconnected.\nInfluence: Socrates’ ideas were recorded by his students, notably Plato, as Socrates himself left no written records.\nPlatonic Philosophy\nPlato, a student of Socrates, founded the Academy and developed a comprehensive philosophical system.\nTheory of Forms: Proposed that non-material abstract forms represent the most accurate reality, with the physical world being a shadow of these perfect forms.\nPolitical Philosophy: In \"The Republic,\" outlined an ideal state governed by philosopher-kings.\nDialectic Method: Engaged in dialogues that explored philosophical concepts through reasoned argumentation.\nAristotelian Philosophy\nAristotle, a student of Plato, established the Lyceum and made significant contributions across multiple disciplines.\nEmpirical Observation: Emphasized the importance of observation and experience in acquiring knowledge.\nLogic and Syllogism: Developed formal logic systems, including the syllogism, a foundational tool in deductive reasoning.\nEthics: In \"Nicomachean Ethics,\" introduced the concept of the Golden Mean, advocating for moderation and balance in moral behavior.\nNatural Philosophy: Studied biology, physics, and metaphysics, laying the groundwork for scientific inquiry.\nHellenistic Philosophies\nFollowing Aristotle, several philosophical schools emerged during the Hellenistic period, addressing issues of human existence and the cosmos.\nStoicism: Founded by Zeno of Citium, emphasized rationality, self-control, and acceptance of fate, advocating for living in harmony with nature.\nEpicureanism: Founded by Epicurus, taught that the pursuit of pleasure and avoidance of pain were the highest goods, with an emphasis on simple living and friendship.\nSkepticism: Advocated by Pyrrho and others, promoted the suspension of judgment and the recognition of the limits of human knowledge.\nScientific Advancements\nMathematics\nGreek mathematicians made groundbreaking contributions that remain fundamental to modern mathematics.\nEuclid: Authored \"Elements,\" a comprehensive compilation of the knowledge of geometry of his time, establishing axiomatic methods still in use.\nArchimedes: Made significant discoveries in geometry, calculus, and mechanics, including the principle of buoyancy and the Archimedean screw.\nPythagoras: Best known for the Pythagorean theorem, contributed to number theory and the understanding of mathematical relationships.\nAstronomy\nGreek astronomers developed sophisticated models to explain celestial phenomena.\nThales and Anaximander: Proposed early models of the solar system and celestial mechanics.\nEudoxus and Aristarchus: Developed geocentric and heliocentric models, respectively, anticipating later astronomical theories.\nHipparchus: Created detailed celestial maps and developed the first known star catalog, contributing to the study of trigonometry in astronomy.\nMedicine\nGreek advancements in medicine laid the foundations for modern medical practices.\nHippocrates: Often called the \"Father of Medicine,\" emphasized empirical observation, diagnosis, and the ethical practice of medicine, encapsulated in the Hippocratic Oath.\nGalen: Expanded medical knowledge through anatomical studies and outlined theories of physiology and pathology that influenced medicine for centuries.\nPhysics and Engineering\nGreek scientists explored the principles of physics and developed innovative engineering solutions.\nArchimedes: Investigated principles of leverage, buoyancy, and the properties of materials, applying them to practical inventions like war machines and mechanical devices.\nHero of Alexandria: Developed early steam engines (aeolipile) and automated mechanical devices, contributing to the field of pneumatics.\nInfluential Thinkers\nSocrates\nThough primarily known for his ethical inquiries, Socrates laid the groundwork for critical philosophical inquiry through his emphasis on questioning and dialogue.\nPlato\nPlato's extensive body of work spans numerous philosophical topics, including metaphysics, ethics, politics, and epistemology, providing a comprehensive framework for understanding the world and human society.\nAristotle\nAristotle's contributions are vast, covering logic, metaphysics, ethics, politics, biology, and more. His systematic approach to knowledge and emphasis on empirical observation have had a lasting impact on various fields of study.\nEpicurus\nEpicurus' teachings on pleasure, happiness, and the nature of the universe influenced subsequent philosophical thought, promoting a life of moderation and intellectual inquiry.\nZeno of Citium\nAs the founder of Stoicism, Zeno introduced ideas about rationality, emotional resilience, and living in accordance with nature, shaping ethical discussions for centuries.\nThe Legacy of Greek Philosophy and Science\nFoundation of Western Philosophy\nGreek philosophical concepts form the bedrock of Western philosophical traditions, influencing thinkers from the Roman era through the Renaissance to contemporary philosophy.\nScientific Inquiry\nThe empirical and systematic approaches developed by Greek scientists pioneered the scientific method, emphasizing observation, hypothesis, and logical reasoning as tools for understanding the natural world.\nEducational Institutions\nThe establishment of institutions like Plato’s Academy and Aristotle’s Lyceum set models for higher education and scholarly research, promoting lifelong learning and intellectual exploration.\nEthical and Political Thought\nGreek ideas about ethics, governance, and the role of individuals in society continue to inform modern ethical theories, political systems, and educational curricula.\nConclusion\nThe philosophical and scientific endeavors of ancient Greece represent a monumental chapter in human intellectual history. Greek philosophers and scientists laid the essential groundwork for diverse fields of study, promoting a culture of inquiry, reason, and intellectual rigor. Their contributions not only advanced contemporary understanding but also provided enduring frameworks that continue to influence modern thought and practice. By exploring the rich legacy of Greek philosophy and science, we gain insight into the enduring quest for knowledge and the pursuit of wisdom that characterizes human civilization.\n---\nChapter 6: Economy and Trade in Ancient Greece\nThe economy of ancient Greece was a complex system intricately linked to its social structures, political institutions, and geographic landscape. Featuring diverse economic activities such as agriculture, craftsmanship, maritime trade, and the use of slave labor, the Greek economy facilitated prosperity and cultural exchange across the Mediterranean. This chapter examines the foundational sectors of the Greek economy, the mechanisms of trade and commerce, the role of currency and markets, labor systems, and the economic interactions that contributed to the vibrancy of ancient Greek civilization.\nAgricultural Foundations\nFarming Practices\nAgriculture was the cornerstone of the Greek economy, providing sustenance and raw materials.\nStaple Crops: Included wheat, barley, olives, grapes, and various fruits and vegetables.\nOlive Cultivation: Olive oil was a vital commodity used for cooking, lighting, religious offerings, and as a trade good.\nViticulture: Grape cultivation for wine production was widespread, with regions like Attica and the Peloponnese renowned for their vineyards.\nLand Ownership and Use\nSmallholdings: Many farmers owned small plots of land, farming primarily for subsistence.\nLarge Estates (Latifundia): Owned by wealthy elites, often worked by tenant farmers or slaves, focusing on cash crops for trade.\nCrop Rotation and Irrigation: Techniques to maintain soil fertility and improve yields, though limited by the region's predominantly Mediterranean climate.\nCraftsmanship and Industry\nPottery and Ceramics\nGreek pottery was both a functional and artistic industry, vital for daily life and trade.\nProduction Centers: Cities like Athens, Corinth, and Sparta were renowned for their distinctive pottery styles.\nExports: Pottery was a significant export product, valued both for its utility and its aesthetic appeal.\nMetalworking\nSkilled metalworkers produced tools, weapons, and luxury items.\nBronze and Iron: Used extensively for creating household goods, military equipment, and decorative objects.\nJewelry and Ornamental Metalwork: Crafted from gold, silver, and bronze, often adorned with intricate designs and gemstone inlays.\nTextiles and Clothing\nThe production of textiles, particularly wool and linen, was a key industry.\nWeaving Techniques: Advanced skills in loom operation and dyeing techniques allowed for the creation of complex patterns and durable fabrics.\nGarments: Produced for both daily use and ceremonial purposes, reflecting social status and cultural identity.\nMaritime Trade and Commerce\nThe Athenian Empire\nAthens leveraged its powerful navy to establish and maintain a vast trade network.\nDelian League: Originally formed as an alliance against Persia, it evolved into an Athenian empire that controlled trade routes and secured economic dominance.\nExports and Imports: Athens exported pottery, textiles, and metal goods while importing grain, timber, and other essential resources.\nTrade Routes and Navigation\nGreek merchants navigated the Mediterranean and Black Seas, establishing trade links with diverse regions.\nPhoenicia, Egypt, and Carthage: Key trading partners providing goods such as glassware, papyrus, and purple dye.\nBlack Sea Colonies: Facilitated the export of grain and other resources to support Greek cities.\nCommercial Centers\nThe Agora: Served as the bustling marketplace in each polis, where merchants conducted trade, negotiations, and transactions.\nPort Cities: Harbors in cities like Piraeus (Athens) and Corinth were vital hubs for shipping, trade, and economic activity.\nCurrency and Economic Systems\nStandardized Currency\nThe introduction of standardized coins revolutionized Greek trade and economy.\nMinting Practices: Each city-state minted its own coins, often bearing symbols or deities significant to their identity.\nFacilitating Trade: Coins provided a reliable medium of exchange, reducing the limitations of barter systems and enabling more extensive trade networks.\nBanking and Credit\nMoneylenders: Operated as early forms of banks, offering loans secured by collateral, often land or slaves.\nMetics: Resident foreigners played a significant role in commerce and banking, contributing to economic diversity and expertise.\nLabor Systems\nSlavery in the Greek Economy\nSlaves were integral to various economic sectors, performing labor-intensive tasks and skilled work.\nSources of Slaves: Acquired through war, piracy, trade, and as debts.\nRoles: Included domestic service, agricultural labor, craftsmanship, mining, and public works.\nEconomic Dependence: The reliance on slave labor allowed Greek citizens to engage in politics, commerce, and intellectual pursuits.\nFree Labor and Citizenship\nCitizen Labor: Free male citizens often engaged in farming, artisanal trades, and commerce, contributing to the economic self-sufficiency of the polis.\nPublic Works: Citizens participated in constructing temples, theaters, and infrastructure projects, enhancing the urban landscape and economic capacity.\nEconomic Interactions and Expansion\nColonization and Trade Zones\nEstablishing Colonies: Greek city-states founded colonies across the Mediterranean and Black Seas to access resources, reduce population pressure, and expand trade networks.\nEconomic Zones: Colonies served as trade outposts, facilitating the exchange of goods, culture, and ideas between Greeks and indigenous populations.\nPiracy and Privateering\nPirate Threats: Throughout the Mediterranean, piracy posed significant challenges to trade routes, prompting city-states to invest in naval protection.\nPrivateering: Some maritime expeditions blurred the lines between commerce and piracy, seizing valuable goods for profit.\nEconomic Challenges and Solutions\nResource Scarcity\nLack of Arable Land: Particularly in regions like Greece proper, limited fertile land necessitated efficient agricultural practices and reliance on imports.\nMaritime Dependence: The economy's reliance on sea trade made it vulnerable to naval blockades and maritime conflicts.\nEconomic Inequality\nWealth Concentration: The prosperity derived from trade and industry led to significant wealth disparities between elites and common citizens.\nSocial Tensions: Economic inequality sometimes fueled political conflicts and social unrest within city-states.\nAdaptations and Innovations\nTechnological Advances: Innovations in shipbuilding, agriculture, and craftsmanship improved productivity and trade efficiency.\nEconomic Policies: City-states implemented various economic policies, such as tariffs, trade regulations, and public investments, to manage growth and address challenges.\nThe Economic Legacy of Ancient Greece\nInfluence on Modern Economies\nGreek economic principles, such as the use of standardized currency, banking practices, and trade conventions, have influenced modern economic systems and international trade practices.\nCultural Exchange and Economic Growth\nThe extensive trade networks of ancient Greece facilitated cultural exchanges, technological innovations, and economic prosperity, contributing to the flourishing of Greek civilization and its lasting legacy.\nLessons for Contemporary Economies\nThe economic strategies and challenges of ancient Greece offer valuable lessons on resource management, the impact of trade on societal development, and the complexities of economic inequality.\nConclusion\nThe economy of ancient Greece was a dynamic and multifaceted system that underpinned the prosperity and cultural achievements of its city-states. Through agriculture, craftsmanship, maritime trade, and the strategic use of labor, the Greeks built a robust economy that sustained their civilization and enabled extensive cultural and intellectual advancements. The economic interactions and innovations of ancient Greece not only fostered internal growth but also facilitated connections with distant regions, spreading Greek culture and ideas across the Mediterranean. Understanding the economic foundations and complexities of ancient Greece provides essential insights into the factors that contributed to its enduring legacy and offers timeless lessons for economic development and sustainability.\n\n\nCHAPTER I.\n\nEARLY GREEK THOUGHT    pages 1-52\n\nI. Strength and universality of the Greek intellect, 1—Specialisation\nof individual genius, 2—Pervading sense of harmony and union,\n3—Circumstances by which the intellectual character of the Greeks\nwas determined, 3—Philosophy a natural product of the Greek mind,\n4—Speculation at first limited to the external world, 4—Important\nresults achieved by the early Greek thinkers, 5—Their conception of\na cosmos first made science possible, 6—The alleged influence of\nOriental ideas disproved, 6.\n\nII. Thales was the first to offer a purely physical explanation of the\nworld, 7—Why he fixed on water as the origin of all things, 8—Great\nadvance made by Anaximander, 9—His conception of the Infinite,\n9-Anaximenes mediates between the theories of his two predecessors,\n10—The Pythagoreans: their love of antithesis and the importance\nattributed to number in their system, 11—Connexion between their\nethical teaching and the general religious movement of the age,\n13—Analogy with the mediaeval spirit, 13.\n\nIII. Xenophanes: his attacks on the popular religion, 14—Absence of\nintolerance among the Greeks, 15—Primitive character of the monotheism\ntaught by Xenophanes, 16—Elimination of the religious element from\nphilosophy by Parmenides, 16—His speculative innovations, 17—He\ndiscovers the indestructibility of matter, 17—but confuses matter\nwith existence in general, 18—and more particularly with extension,\n19—In what sense he can be called a materialist, 19—New arguments\nbrought forward by Zeno in defence of the Eleatic system, 20—The\nanalytical or mediatorial moment of Greek thought, 21—Influence of\nParmenides on subsequent systems of philosophy, 22—Diametrically\nopposite method pursued by Heracleitus, 22—His contempt for the\nmass of mankind, 22—Doctrine of universal relativity, 23—Fire as\nthe primordial element, 24—The idea of Law first introduced by\nHeracleitus, 25—Extremes to which his principles were afterwards\ncarried, 25—Polarisation of Greek thought, 26.\n\nIV. Historical order of the systems which succeeded and mediated\nbetween Parmenides and Heracleitus, 26—Empedocles: poetic and\nreligious character of his philosophy, 27—His inferiority to previous\nthinkers, 28—Eclectic tendency of his system, 29—In what respects it\nmarks an advance on that of Parmenides, 29—His alleged anticipation\nof the Darwinian theory, 30—The fixity of species a doctrine held\nby every ancient philosopher except Anaximander, 31—The theory of\nknowledge put forward by Empedocles: its objective and materialistic\ncharacter, 32—How it suggested the Atomic theory, 33—The possibility\nof a vacuum denied by Parmenides and asserted by Leucippus, 34—The\nAtomic theory developed and applied by Democritus: encyclopaedic range\nof his studies, 35—His complete rejection of the supernatural, 36.\n\nV. Anaxagoras at Athens, 36—He is accused of impiety and compelled to\nfly, 37—Analysis of his system, 38—Its mechanical and materialistic\ntendency, 39—Separation of Nous from the rest of Nature, 40—In\ndenying the divinity of the heavenly bodies, Anaxagoras opposed himself\nto the universal faith of antiquity, 40—The exceptional intolerance\nof the Athenians and its explanation, 42—Transition from physical to\ndialectical and ethical philosophy, 43.\n\nVI. Early Greek thought as manifested in literature and art, 45—The\ngenealogical method of Hesiod and Herodotus, 47—The search for first\ncauses in Pindar and Aeschylus, 48—Analogous tendencies of sculpture\nand architecture, 49—Combination of geographical with genealogical\nstudies, 50—The evolution of order from chaos suggested by the\nnegative or antithetical moment of Greek thought, 50—Verifiable and\nfruitful character of early Greek thought, 52.\n\n\nCHAPTER II.\n\nTHE GREEK HUMANISTS: NATURE AND LAW    pages 53-107\n\nI. The reaction of speculation on life, 53—Moral superiority of the\nGreeks to the Hebrews and Romans, 54—Illustrations of humanity from\nthe Greek poets, 55—Temporary corruption of moral sentiment and its\nexplanation, 56—Subsequent reformation effected by philosophy, 57—The\nGreek worship of beauty not incompatible with a high moral standard,\n58—Preference of the solid to the showy virtues shown by public\nopinion in Greece, 59—Opinion of Plato, 60.\n\nII. Virtues inculcated in the aphorisms of the Seven Sages,\n62—Sôphrosynê as a combination of moderation and self-knowledge,\n62—Illustrations from Homer, 62—Transition from self-regarding to\nother-regarding virtue, 63—How morality acquired a religious sanction\n(i.) by the use of oaths, 64—(ii.) by the ascription of a divine\norigin to law, 65—(iii.) by the practice of consulting oracles on\nquestions of right and wrong, 65—Difference between the Olympian and\nChthonian religions, 66—The latter was closely connected with the\nideas of law and of retribution after death, 67—Beneficent results due\nto the interaction of the two religions, 68.\n\nIII. The religious standpoint of Aeschylus, 69—Incipient dissociation\nof religion from morality in Sophocles, 70—Their complete separation\nin Euripides, 71—Contrast between the Eteocles of Aeschylus and the\nEteocles of Euripides, 72—Analogous difference between Herodotus\nand Thucydides, 73—Evidence of moral deterioration supplied by\nAristophanes and Plato, 74—Probability of an association between\nintellectual growth and moral decline, 75.\n\nIV. The Sophists, 76—Prodicus and Hippias, 77—Their theory of Nature\nas a moral guide, 79—Illustration from Euripides, 80—Probable\nconnexion of the Cynic school with Prodicus, 81—Antithesis between\nNature and Law, 81—Opposition to slavery, 82—The versatility of\nHippias connected with his advocacy of Nature, 83—The right of the\nstronger as a law of Nature, 84.\n\nV. Rise of idealism and accompanying tendency to set convention above\nNature, 85—Agnosticism of Protagoras, 87—In what sense he made man\nthe measure of all things, 88—His defence of civilisation, 89—Similar\nviews expressed by Thucydides, 90—Contrast between the naturalism of\nAeschylus and the humanism of Sophocles, 91—The flexible character\nof Nomos favourable to education, 92—Greek youths and modern women,\n93—The teaching of rhetoric, 93—It is subsequently developed into\neristicism, 94.\n\nVI. The nihilism of Gorgias, 95—His arguments really directed against\nthe worship of Nature, 96—The power of rhetoric in ancient Athens and\nmodern England, 97—The doctrines of Protagoras as developed by the\nCyrenaic school, 99—and by the Megaric school, 100—Subsequent history\nof the antithesis between Nature and Law, 100.\n\nVII. Variety of tendencies represented by the Sophists, 102—Their\nposition in Greek society, 103—The different views taken of their\nprofession in ancient and modern times, 104—Their place in the\ndevelopment of Greek philosophy, 107.\n\n\nCHAPTER III.\n\nTHE PLACE OF SOCRATES IN GREEK PHILOSOPHY    pages 108-170\n\nI. Universal celebrity of Socrates, 108—Our intimate knowledge of his\nappearance and character, 109—Conflicting views of his philosophy,\n110—Untrustworthiness of the Platonic _Apologia_, 111—Plato’s account\ncontradicted by Xenophon, 113—Consistency of the _Apologia_ with the\ngeneral standpoint of Plato’s Dialogues, 114—The Platonic idea of\nscience, 115-— How Plato can help us to understand Socrates, 116.\n\nII. Zeller’s theory of the Socratic philosophy, 117—Socrates did\nnot offer any definition of knowledge, 119—Nor did he correct the\ndeficiencies of Greek physical speculation, 120—His attitude towards\nphysics resembled that of Protagoras, 121—Positive theories of\nmorality and religion which he entertained, 123.\n\nIII. True meaning and originality of the Socratic teaching,\n125—Circumstances by which the Athenian character was formed, 126—Its\nprosaic, rationalistic, and utilitarian tendencies, 127—Effect\nproduced by the possession of empire, 128—The study of mind in art\nand philosophy, 128—How the Athenian character was represented by\nSocrates, 129—His sympathy with its practical and religious side,\n130—His relation to the Humanists, 131—His identification of virtue\nwith knowledge, 132—The search for a unifying principle in ethics,\n133—Importance of knowledge as a factor in conduct and civilisation,\n133—Fundamental identity of all the mental processes, 136.\n\nIV. Harmony of theory and practice in the life of Socrates, 137—Mind\nas a principle (i.) of self-control, (ii.) of co-operation, and\n(iii.) of spontaneous energy, 137—Derivation and function of the\ncross-examining elenchus, 138—How it illustrates the negative moment\nof Greek thought, 139—Conversations with Glauco and Euthydemus,\n139—The erotetic method as an aid to self-discipline, 141—Survival of\ncontradictory debate in the speeches of Thucydides, 142.\n\nV. Why Socrates insisted on the necessity of defining abstract terms,\n142—Subsequent influence of his method on the development of Roman\nlaw, 144—Substitution of arrangement by resemblance and difference\nfor arrangement by contiguity, 145—The One in the Many, and the Many\nin the One: conversation with Charmides, 146—Illustration of ideas\nby their contradictory opposites, 147—The Socratic induction, (i.)\nan interpretation of the unknown by the known, 148—Misapplication of\nthis method in the theory of final causes, 149—(ii.) A process of\ncomparison and abstraction, 150—Appropriateness of this method to the\nstudy of mental phenomena, 151—Why it is inapplicable to the physical\nsciences, 151—Wide range of studies included in a complete philosophy\nof mind, 151—The dialectical elimination of inconsistency, 152.\n\nVI. Consistency the great principle represented by Socrates,\n152—Parallelism of ethics and logic, 154—The ethical dialectic of\nSocrates and Homer, 154—Personal and historical verifications of\nthe Socratic method, 155—Its influence on the development of art\nand literature, 156—and on the relations between men and women,\n158—Meaning of the Daemonium, 160.\n\nVII. Accusation and trial of Socrates, 161—Futility of the charges\nbrought against him, 162—Misconceptions of modern critics, 164—His\ndefence and condemnation, 165—Worthlessness of Grote’s apology for\nthe Dicastery, 166—Refusal of Socrates to save himself by flight,\n168—Comparison with Giordano Bruno and Spinoza, 169—The monuments\nraised to Socrates by Plato and Xenophon, 169.\n\n\nCHAPTER IV.\n\nPLATO; HIS TEACHERS AND HIS TIMES    pages 171-213\n\nI. New meaning given to systems of philosophy by the method of\nevolution, 171—Extravagances of which Plato’s philosophy seems to be\nmade up, 172—The high reputation which it, nevertheless, continues\nto enjoy, 174—Distinction between speculative tendencies and the\nsystematic form under which they are transmitted, 174—Genuineness\nof the Platonic Dialogues, 175—Their chronological order, 177—They\nembody the substance of Plato’s philosophical teaching, 177.\n\nII. Wider application given to the dialectic method by Plato, 179—He\ngoes back to the initial doubt of Socrates, 180—To what extent\nhe shared in the religious reaction of his time, 181—He places\ndemonstrative reasoning above divine inspiration, 182—His criticism\nof the Socratic ethics, 183—Exceptional character of the _Crito_\naccounted for, 184—Traces of Sophistic influence, 185—General\nrelation of Plato to the Sophists, 186—Egoistic hedonism of the\n_Protagoras_, 188.\n\nIII. Plato as an individual: his high descent, personal beauty, and\nartistic endowment, 189—His style is neither poetry nor eloquence\nnor conversation, but the expression of spontaneous thought, 190—The\nPlatonic Socrates, 191—Plato carries the spirit of the Athenian\naristocracy into philosophy, 192—Severity with which great reformers\nhabitually view their own age, 192—Plato’s scornful opinion of\nthe many, 194—His loss of faith in his own order, 195—Horror of\ndespotism inspired by his intercourse with Dionysius, 195—His\ndissatisfaction with the constitution of Sparta, 196—His theory\nof political degeneration verified by the history of the Roman\nrepublic, 196—His exclusively Hellenic and aristocratic sympathies,\n197—Invectives against the corrupting influence of the multitude and\nof their flatterers, 198—Denunciation of the popular law-courts,\n199—Character of the successful pleader, 200—Importance to which he\nhad risen in Plato’s time, 200—The professional teacher of rhetoric,\n201.\n\nIV. Value and comprehensiveness of Plato’s philosophy, 202—Combination\nof Sicilian and Italiote with Attic modes of thought, 203—Transition\nfrom the _Protagoras_ to the _Theaetêtus_, 205—‘Man is the measure\nof all things’: opinion and sensation, 206—Extension of the\ndialectic method to all existence, 207—The Heracleitean system true\nof phenomena, 208—Heracleitus and Parmenides in the _Cratylus_,\n209—Tendency to fix on Identity and Difference as the ultimate\nelements of knowledge, 210—Combination of the mathematical method\nwith the dialectic of Socrates, 210—Doctrine of _à priori_ cognition,\n211—The idea of Sameness derived from introspection, 212—Tendency\ntowards monism, 213.\n\n\nCHAPTER V.\n\nPLATO AS A REFORMER    pages 214-274\n\nI. Recapitulation, 214—Plato’s identification of the human with\nthe divine, 215—The Athanasian creed of philosophy, 216—Attempts\nto mediate between appearance and reality, 216—Meaning of Platonic\nlove, 217—Its subsequent development in the philosophy of Aristotle,\n218—And in the poetry of Dante, 219—Connexion between religious\nmysticism and the passion of love, 219—Successive stages of Greek\nthought represented in the _Symposium_, 220—Analysis of Plato’s\ndialectical method, 221—Exaggerated importance attributed to\nclassification, 222—Plato’s influence on modern philosophy, 223.\n\nII. Mediatoral character of Plato’s psychology, 223—Empirical\nknowledge as a link between demonstration and sense perception,\n224—Pride as a link between reason and appetite, 224—Transition from\nmetaphysics to ethics: knowledge and pleasure, 225—Anti-hedonistic\narguments of the _Philébus_, 226—Attempt to base ethics on the\ndistinction between soul and body, 227—What is meant by the Idea of\nGood? 228—It is probably the abstract notion of Identity, 229.\n\nIII. How the practical teaching of Plato differed from that of\nSocrates, 229—Identification of justice with self-interest,\n230—Confusion of social with individual happiness, 231—Resolution of\nthe soul into a multitude of conflicting impulses, 232—Impossibility\nof arguing men into goodness, 233.\n\nIV. Union of religion with morality, 234—Cautious handling of\nthe popular theology, 234—The immortality of the soul, 235—The\nPythagorean reformation arrested by the progress of physical\nphilosophy, 237—Immortality denied by some of the Pythagoreans\nthemselves, 237—Scepticism as a transition from materialism to\nspiritualism, 238—The arguments of Plato, 239—Pantheism the natural\noutcome of his system, 240.\n\nV. Plato’s condemnation of art, 241—Exception in favour of religious\nhymns and edifying fiction, 241—Mathematics to be made the basis of\neducation, 242—Application of science to the improvement of the race,\n242—Inconsistency of Plato’s belief in heredity with the doctrine\nof metempsychosis, 243—Scheme for the reorganisation of society,\n244—Practical dialectic of the _Republic_, 245.\n\nVI. Hegel’s theory of the _Republic_, 246—Several distinct tendencies\nconfounded under the name of subjectivity, 247—Greek philosophy not\nan element of political disintegration, 250—Plato borrowed more from\nEgypt than from Sparta, 253.\n\nVII. The consequences of a radical revolution, 254—Plato constructed\nhis new republic out of the elementary and subordinate forms of social\nunion, 254—Inconsistencies into which he was led by this method,\n254—The position which he assigns to women, 256—The Platonic State\nhalf school-board and half marriage-board, 258—Partial realisation of\nPlato’s polity in the Middle Ages, 259—Contrast between Plato and the\nmodern Communists, 259—His real affinities are with Comte and Herbert\nSpencer, 261.\n\nVIII. Reaction of Plato’s social studies on his metaphysics, 262—The\nideas resolved into different aspects of the relation between soul and\nbody, 263—Dialectic dissolution of the four fundamental contrasts\nbetween reality and appearance, 263—Mind as an intermediary between\nthe Ideas and the external world, 265—Cosmogony of the _Timaeus_,\n265—Philosophy and theology, 267.\n\nIX. Plato’s hopes from a beneficent despotism, 268—The _Laws_,\n269—Concessions to current modes of thought, 270—Religious\nintolerance, 271—Recapitulation of Plato’s achievements,\n272—Fertility of his method, 273.\n\n\nCHAPTER VI.\n\nCHARACTERISTICS OF ARISTOTLE    pages 275-329\n\nI. Recent Aristotelian literature, 275—Reaction in favour of\nAristotle’s philosophy, 277—and accompanying misinterpretation of its\nmeaning, 278—Zeller’s partiality for Aristotle, 280.\n\nII. Life of Aristotle, 280—His relation to Plato, 281-Aristotle and\nHermeias; 284—Aristotle and Alexander, 285—Aristotle’s residence\nin Athens, flight, and death, 288—His choice of a successor,\n288—Provisions of his will, 289—Personal appearance, 289—Anecdotes\nillustrating his character, 290—Want of self-reliance and originality,\n291.\n\nIII. Prevalent misconception of the difference between Aristotle\nand Plato, 291—Plato a practical, Aristotle a theoretical genius,\n293—Contrast offered by their views of theology, ethics, and politics,\n294—Aristotle’s ideal of a State, 296—His want of political insight\nand prevision, 297—Worthlessness of his theories at the present day,\n298.\n\nIV. Strength and weakness of Aristotle’s _Rhetoric_, 299—Erroneous\ntheory of aesthetic enjoyment put forward in his _Poetics_, 300—The\ntrue nature of tragic emotion, 303—Importance of female characters\nin tragedy, 303—Necessity of poetic injustice, 305—Theory of the\nCatharsis, 306—Aristotle’s rules for reasoning compiled from Plato,\n307—The _Organon_ in Ceylon, 307.\n\nV. Aristotle’s unequalled intellectual enthusiasm, 308—Illustrations\nfrom his writings, 309—His total failure in every physical science\nexcept zoology and anatomy, 311—His repeated rejection of the just\nviews put forward by other philosophers, 312—Complete antithesis\nbetween his theory of Nature and ours, 316.\n\nVI. Supreme mastery shown by Aristotle in dealing with the surface of\nthings, 318—His inability to go below the surface, 319—In what points\nhe was inferior to his predecessors, 320—His standpoint necessarily\ndetermined by the development of Greek thought, 321—Analogous\ndevelopment of the Attic drama, 323.\n\nVII. Periodical return to the Aristotelian method, 325—The\nsystematising power of Aristotle exemplified in all his writings,\n326—but chiefly in those relating to the descriptive sciences,\n327—His biological generalisations, 328—How they are explained and\ncorrected by the theory of evolution, 329.\n\n\nCHAPTER VII.\n\nTHE SYSTEMATIC PHILOSOPHY OF ARISTOTLE    pages 330-402\n\nI. Homogeneity of Aristotle’s writings, 330—The _Metaphysics_,\n331—What are the causes and principles of things? 331—Objections\nto the Ionian materialism, 332—Aristotle’s teleology a study of\nfunctions, 332—Illegitimate generalisation to the inorganic world,\n333—Aristotle’s Four Causes, 334—Derivation of his substantial Forms\nfrom the Platonic Ideas, 335—His criticism of the Ideal theory,\n336—Its applicability to every kind of transcendental realism,\n338—Survival of the Platonic theory in Aristotle’s system, 338.\n\nII. Specific forms assumed by the fundamental dualism of Greek\nthought, 339—Stress laid by Aristotle on the antithesis between Being\nand not Being, 339—Its formulation in the highest laws of logic,\n340—Intermediate character ascribed to accidents, 340—Distinction\nbetween truth and real existence, 341—The Categories: their import\nand derivation, 341—Analysis of the idea of Substance, 343—Analysis\nof individuality, 345—Substitution of Possibility and Actuality for\nMatter and Form, 346—Purely verbal significance of this doctrine,\n347—Motion as the transformation of Power into Act, 347.\n\nIII. Aristotle’s theology founded on a dynamical misconception,\n348—Necessity of a Prime Mover, 349—Aristotle not a pantheist\nbut a theist, 350—Mistaken interpretation of Sir A. Grant,\n351—Inconsistency of Aristotle’s metaphysics with Catholic theology,\n352—and with the modern arguments for the existence of a God, 353—as\nwell as with the conclusions of modern science, 353—Self-contradictory\ncharacter of his system, 354—Motives by which it may be explained,\n354—The Greek star-worship and the Christian heaven, 356—Higher\nposition given to the earth by Copernicus, 356—Aristotle’s\nglorification of the heavens, 357—How his astronomy illustrates the\nGreek ideas of circumscription and mediation, 358.\n\nIV. Aristotle’s general principle of systematisation, 359—Deduction\nof the Four Elements, 360—Connexion of the Peripatetic physics with\nastrology and alchemy, 361—Revolution effected by modern science,\n361—Systematisation of biology, 362—Aristotle on the Generation of\nAnimals, 363—His success in comparative anatomy, 364.\n\nV. Antithetical framework of Aristotle’s psychology, 365—His theory\nof sensation contrasted with that of the Atomists, 365—His successful\ntreatment of imagination and memory, 366—How general ideas are\nformed, 366—The active Nous is a self-conscious idea, 367—The train\nof thought which led to this theory, 368—Meaning of the passage in\nthe _Generation of Animals_, 369—Supposed refutation of materialism,\n370—Aristotle not an adherent of Ferrier, 371—Form and matter not\ndistinguished as subject and object, 373—Aristotle rejects the\ndoctrine of personal immortality, 374.\n\nVI. Aristotle’s logic, 375—Subordination of judgments to concepts,\n376—Science as a process of definition and classification,\n377—Aristotle’s theory of propositions, 378—His conceptual analysis\nof the syllogism, 379—Influence of Aristotle’s metaphysics on his\nlogic, 380—Disjunction the primordial form of all reasoning, 381—How\nit gives rise to hypothetical and categorical reasoning, 382.\n\nVII. Theory of applied reasoning: distinction between demonstration and\ndialectic, 383—Aristotle places abstractions above reasoned truth,\n384—Neglect of axioms in comparison with definitions, 384—‘Laws\nof nature’ not recognised by Aristotle, 385—He failed to perceive\nthe value of deductive reasoning, 387—Derivation of generals from\nparticulars: Aristotle and Mill, 387—In what sense Aristotle was\nan empiricist, 390—Examination of Zeller’s view, 391—Induction as\nthe analysis of the middle term into the extremes, 393—Theory of\nexperimental reasoning contained in the _Topics_, 394.\n\nVIII. Systematic treatment of the antithesis between Reason and\nPassion, 395—Relation between the _Rhetoric_ and the _Ethics_,\n395—Artificial treatment of the virtues, 396—Fallacious opposition\nof Wisdom to Temperance, 397—Central idea of the _Politics_: the\ndistinction between the intellectual state and the material state,\n398—Consistency of the _Poetics_ with Aristotle’s system as a whole,\n399.\n\nIX. Aristotle’s philosophy a valuable corrective to the modern\nglorification of material industry, 399—Leisure a necessary condition\nof intellectual progress, 400—How Aristotle would view the results of\nmodern civilisation, 401.\n\nFOOTNOTES:\n\n[1] _Die Philosophie der Griechen_, III., a, pp. 5 f.\n\n[2] If I remember rightly, Polybius makes the same observation, but I\ncannot recall the exact reference.\n\n[3] _Sophist_, 243, A.\n\n[4] See especially the interesting note on the subject in his recent\nwork, _Die wirkliche und die scheinbare Welt_, Vorrede, pp x. ff.\n\n\n\n\nADDITIONAL REFERENCES.\n\n Transcriber’s Note: These have been marked up as footnotes in the\n text, using alphabetic coding. This identifies the page and line number\n rather than any precise text.\n\n[A] Page 9, line 18. Plutarch (_ut fertur_), _Plac. Phil._, I., iii., 4.\n\n[B] Page 15, line 26. Xenophanes, _Fragm._ 19 and 21, ed. Mullach.\n\n[C] Page 41, line 25. Diogenes Laert., IX., 34. The words ‘in the\nEastern countries where he had travelled,’ are a conjectural addition,\nbut they seem justified by the context.\n\n[D] Page 43, line 11. Plutarch, _Pericles_, iv.\n\n[E] Page 65. For the story of Glaucus, see Herodotus VI., lxxxvi.\n\n[F] Page 77, line 21. Plato, _Protag._, 315, D.\n\n[G] Page 78, line 1. _Ibid._, 341, A.\n\n[H] Page 103. For the opinion of Socrates respecting the Sophists, see\nXenophon, _Mem._, I., vi., 11 ff.\n\n[I] Page 114, line 4. Xenophon, _Mem._, I., iv., 1.\n\n[J] Page 194, line 28. _Repub._, 493, A; _ibid._, line 33. Gorgias,\n521, E.\n\n[K] Page 195, line 23. _Theaetêt._, 175, A and 174, E. Jowett’s\nTransl., IV., p. 325.\n\n[L] Page 233, last line. _Sophist._, 246, D.\n\n[M] Page 294, line 7. For Plato’s preference of practice to\ncontemplation, see _Repub._, 496, E.\n\n\n\n\nTHE GREEK PHILOSOPHERS.\n\n\n\n\nCHAPTER I.\n\nEARLY GREEK THOUGHT.\n\n\nI.\n\nDuring the two centuries that ended with the close of the Peloponnesian\nwar, a single race, weak numerically, and weakened still further\nby political disunion, simultaneously developed all the highest\nhuman faculties to an extent possibly rivalled but certainly not\nsurpassed by the collective efforts of that vastly greater population\nwhich now wields the accumulated resources of modern Europe. This\nrace, while maintaining a precarious foothold on the shores of the\nMediterranean by repeated prodigies of courage and genius, contributed\na new element to civilisation which has been the mainspring of all\nsubsequent progress, but which, as it expanded into wider circles and\nencountered an increasing resistance from without, unavoidably lost\nsome of the enormous elasticity that characterised its earliest and\nmost concentrated reaction. It was the just boast of the Greek that\nto Asiatic refinement and Thracian valour he joined a disinterested\nthirst for knowledge unshared by his neighbours on either side.[5] And\nif a contemporary of Pericles could have foreseen all that would be\nthought, and said, and done during the next twenty-three centuries\nof this world’s existence, at no period during that long lapse of\nages, not even among the kindred Italian race, could he have found\na competitor to contest with Hellas the olive crown of a nobler\nOlympia, the guerdon due to a unique combination of supreme excellence\nin every variety of intellectual exercise, in strategy, diplomacy,\nstatesmanship; in mathematical science, architecture, plastic art, and\npoetry; in the severe fidelity of the historian whose paramount object\nis to relate facts as they have occurred, and the dexterous windings\nof the advocate whose interest leads him to evade or to disguise\nthem; in the far-reaching meditations of the lonely thinker grappling\nwith the enigmas of his own soul, and the fervid eloquence by which a\nmultitude on whose decision hang great issues is inspired, directed,\nor controlled. He would not, it is true, have found any single Greek\nto pit against the athletes of the Renaissance; there were none who\ndisplayed that universal genius so characteristic of the greatest\nTuscan artists such as Lionardo and Michael Angelo; nor, to take a much\nnarrower range, did a single Greek writer whose compositions have come\ndown to us excel, or even attempt to excel, in poetry and prose alike.\nBut our imaginary prophet might have observed that such versatility\nbetter befitted a sophist like Hippias or an adventurer like Critias\nthan an earnest master of the Pheidian type. He might have quoted\nPindar’s sarcasm about highly educated persons who have an infinity\nof tastes and bring none of them to perfection;[6] holding, as Plato\ndid in the next generation, that one man can only do one thing well,\nhe might have added that the heroes of modern art would have done much\nnobler work had they concentrated their powers on a single task instead\nof attempting half a dozen and leaving most of them incomplete.\n\nThis careful restriction of individual effort to a single province\ninvolved no dispersion or incoherence in the results achieved. The\nhighest workers were all animated by a common spirit. Each represented\nsome one aspect of the glory and greatness participated in by all. Nor\nwas the collective consciousness, the uniting sympathy, limited to a\nsingle sphere. It rose, by a graduated series, from the city community,\nthrough the Dorian or Ionian stock with which they claimed more\nimmediate kinship, to the Panhellenic race, the whole of humanity, and\nthe divine fatherhood of Zeus, until it rested in that all-embracing\nnature which Pindar knew as the one mother of gods and men.[7]\n\nWe may, perhaps, find some suggestion of this combined distinctness and\ncomprehensiveness in the aspect and configuration of Greece itself;\nin its manifold varieties of soil, and climate, and scenery, and\nproductions; in the exquisite clearness with which the features of its\nlandscape are defined; and the admirable development of coast-line by\nwhich all parts of its territory, while preserving their political\nindependence, were brought into safe and speedy communication with\none another. The industrial and commercial habits of the people,\nnecessitating a well-marked division of labour and a regulated\ndistribution of commodities, gave a further impulse in the same\ndirection.\n\nBut what afforded the most valuable education in this sense was their\nsystem of free government, involving, as it did, the supremacy of an\nimpersonal law, the subdivision of public authority among a number of\nmagistrates, and the assignment to each of certain carefully defined\nfunctions which he was forbidden to exceed; together with the living\ninterest felt by each citizen in the welfare of the whole state, and\nthat conception of it as a whole composed of various parts, which is\nimpossible where all the public powers are collected in a single hand.\n\nA people so endowed were the natural creators of philosophy. There\ncame a time when the harmonious universality of the Hellenic genius\nsought for its counterpart and completion in a theory of the external\nworld. And there came a time, also, when the decay of political\ninterests left a large fund of intellectual energy, accustomed to work\nunder certain conditions, with the desire to realise those conditions\nin an ideal sphere. Such is the most general significance we can\nattach to that memorable series of speculations on the nature of\nthings which, beginning in Ionia, was carried by the Greek colonists\nto Italy and Sicily, whence, after receiving important additions and\nmodifications, the stream of thought flowed back into the old country,\nwhere it was directed into an entirely new channel by the practical\ngenius of Athens. Thales and his successors down to Democritus were\nnot exactly what we should call philosophers, in any sense of the\nword that would include a Locke or a Hume, and exclude a Boyle or a\nBlack; for their speculations never went beyond the confines of the\nmaterial universe; they did not even suspect the existence of those\nethical and dialectical problems which long constituted the sole\nobject of philosophical discussion, and have continued since the\ntime when they were first mooted to be regarded as its most peculiar\nprovince. Nor yet can we look on them altogether or chiefly as men of\nscience, for their paramount purpose was to gather up the whole of\nknowledge under a single principle; and they sought to realise this\npurpose, not by observation and experiment, but by the power of thought\nalone. It would, perhaps, be truest to say that from their point of\nview philosophy and science were still undifferentiated, and that\nknowledge as a universal synthesis was not yet divorced from special\ninvestigations into particular orders of phenomena. Here, as elsewhere,\nadvancing reason tends to reunite studies which have been provisionally\nseparated, and we must look to our own contemporaries—to our Tyndalls\nand Thomsons, our Helmholtzes and Zöllners—as furnishing the fittest\nparallel to Anaximander and Empedocles, Leucippus and Diogenes of\nApollonia.\n\nIt has been the fashion in certain quarters to look down on these\nearly thinkers—to depreciate the value of their speculations because\nthey were thinkers, because, as we have already noticed, they reached\ntheir most important conclusions by thinking, the means of truly\nscientific observation not being within their reach. Nevertheless,\nthey performed services to humanity comparable for value with the\nlegislation of Solon and Cleisthenes, or the victories of Marathon\nand Salamis; while their creative imagination was not inferior to\nthat of the great lyric and dramatic poets, the great architects and\nsculptors, whose contemporaries they were. They first taught men to\ndistinguish between the realities of nature and the illusions of sense;\nthey discovered or divined the indestructibility of matter and its\natomic constitution; they taught that space is infinite, a conception\nso far from being self-evident that it transcended the capacity of\nAristotle to grasp; they held that the seemingly eternal universe was\nbrought into its present form by the operation of mechanical forces\nwhich will also effect its dissolution; confronted by the seeming\npermanence and solidity of our planet, with the innumerable varieties\nof life to be found on its surface, they declared that all things had\narisen by differentiation[8] from a homogeneous attenuated vapour;\nwhile one of them went so far as to surmise that man is descended from\nan aquatic animal. But higher still than these fragmentary glimpses\nand anticipations of a theory which still awaits confirmation from\nexperience, we must place their central doctrine, that the universe\nis a cosmos, an ordered whole governed by number and law, not a blind\nconflict of semi-conscious agents, or a theatre for the arbitrary\ninterference of partial, jealous, and vindictive gods; that its\nchanges are determined, if at all, by an immanent unchanging reason;\nand that those celestial luminaries which had drawn to themselves in\nevery age the unquestioning worship of all mankind were, in truth,\nnothing more than fiery masses of inanimate matter. Thus, even if the\nearly Greek thinkers were not scientific, they first made science\npossible by substituting for a theory of the universe which is its\ndirect negation, one that methodised observation has increasingly\ntended to confirm. The garland of poetic praise woven by Lucretius\nfor his adored master should have been dedicated to them, and to them\nalone. His noble enthusiasm was really inspired by their lessons, not\nby the wearisome trifling of a moralist who knew little and cared less\nabout those studies in which the whole soul of his Roman disciple was\nabsorbed.\n\nWhen the power and value of these primitive speculations can no longer\nbe denied, their originality is sometimes questioned by the systematic\ndetractors of everything Hellenic. Thales and the rest, we are told,\nsimply borrowed their theories without acknowledgment from a storehouse\nof Oriental wisdom on which the Greeks are supposed to have drawn as\nfreely as Coleridge drew on German philosophy. Sometimes each system is\naffiliated to one of the great Asiatic religions; sometimes they are\nall traced back to the schools of Hindostan. It is natural that no two\ncritics should agree, when the rival explanations are based on nothing\nstronger than superficial analogies and accidental coincidences. Dr.\nZeller in his wonderfully learned, clear, and sagacious work on Greek\nphilosophy, has carefully sifted some of the hypotheses referred to,\nand shown how destitute they are of internal or external evidence,\nand how utterly they fail to account for the facts. The oldest and\nbest authorities, Plato and Aristotle, knew nothing about such a\nderivation of Greek thought from Eastern sources. Isocrates does,\nindeed, mention that Pythagoras borrowed his philosophy from Egypt,\nbut Isocrates did not even pretend to be a truthful narrator. No Greek\nof the early period except those regularly domiciled in Susa seems to\nhave been acquainted with any language but his own. Few travelled very\nfar into Asia, and of those few, only one or two were philosophers.\nDemocritus, who visited more foreign countries than any man of his\ntime, speaks only of having discussed mathematical problems with the\nwise men whom he encountered; and even in mathematics he was at least\ntheir equal.[9] It was precisely at the greatest distance from Asia,\nin Italy and Sicily, that the systems arose which seem to have most\nanalogy with Asiatic modes of thought. Can we suppose that the traders\nof those times were in any way qualified to transport the speculations\nof Confucius and the Vedas to such a distance from their native homes?\nWith far better reason might one expect a German merchant to carry a\nknowledge of Kant’s philosophy from Königsberg to Canton. But a more\nconvincing argument than any is to show that Greek philosophy in its\nhistorical evolution exhibits a perfectly natural and spontaneous\nprogress from simpler to more complex forms, and that system grew out\nof system by a strictly logical process of extension, analysis, and\ncombination. This is what, chiefly under the guidance of Zeller, we\nshall now attempt to do.\n\n\nII.\n\nThales, of Miletus, an Ionian geometrician and astronomer, about whose\nage considerable uncertainty prevails, but who seems to have flourished\ntowards the close of the seventh century before our era, is by general\nconsent regarded as the father of Greek physical philosophy. Others\nbefore him had attempted to account for the world’s origin, but none\nlike him had traced it back to a purely natural beginning. According\nto Thales all things have come from water. That the earth is entirely\nenclosed by water above and below as well as all round was perhaps a\ncommon notion among the Western Asiatics. It was certainly believed\nby the Hebrews, as we learn from the accounts of the creation and the\nflood contained in Genesis. The Milesian thinker showed his originality\nby generalising still further and declaring that not only did water\nsurround all things, but that all things were derived from it as their\nfirst cause and substance, that water was, so to speak, the material\nabsolute. Never have more pregnant words been spoken; they acted like\na ferment on the Greek mind; they were the grain whence grew a tree\nthat has overshadowed the whole earth. At one stroke they substituted\na comparatively scientific, because a verifiable principle for the\nconfused fancies of mythologising poets. Not that Thales was an\natheist, or an agnostic, or anything of that sort. On the contrary, he\nis reported to have said that all things were full of gods; and the\nreport sounds credible enough. Most probably the saying was a protest\nagainst the popular limitation of divine agencies to certain special\noccasions and favoured localities. A true thinker seeks above all for\nconsistency and continuity. He will more readily accept a perpetual\nstream of creative energy than a series of arbitrary and isolated\ninterferences with the course of Nature. For the rest, Thales made\nno attempt to explain how water came to be transformed into other\nsubstances, nor is it likely that the necessity of such an explanation\nhad ever occurred to him. We may suspect that he and others after him\nwere not capable of distinguishing very clearly between such notions\nas space, time, cause, substance, and limit. It is almost as difficult\nfor us to enter into the thoughts of these primitive philosophers as it\nwould have been for them to comprehend processes of reasoning already\nfamiliar to Plato and Aristotle. Possibly the forms under which we\narrange our conceptions may become equally obsolete at a more advanced\nstage of intellectual evolution, and our sharp distinctions may prove\nto be not less artificial than the confused identifications which they\nhave superseded.\n\nThe next great forward step in speculation was taken by Anaximander,\nanother Milesian, also of distinguished attainments in mathematics\nand astronomy. We have seen that to Thales water, the all-embracing\nelement, became, as such, the first cause of all things, the absolute\nprinciple of existence. His successor adopted the same general point\nof view, but looked out from it with a more penetrating gaze. Beyond\nwater lay something else which he called the Infinite. He did not mean\nthe empty abstraction which has stalked about in modern times under\nthat ill-omened name, nor yet did he mean infinite space, but something\nricher and more concrete than either; a storehouse of materials whence\nthe waste of existence could be perpetually made good. The growth\nand decay of individual forms involve a ceaseless drain on Nature,\nand the deficiency must be supplied by a corresponding influx from\nwithout.[A] For, be it observed that, although the Greek thinkers were\nat this period well aware that nothing can come from nothing, they had\nnot yet grasped the complementary truth inalienably wedded to it by\nLucretius in one immortal couplet, that nothing can return to nothing;\nand Kant is quite mistaken when he treats the two as historically\ninseparable. Common experience forces the one on our attention much\nsooner than the other. Our incomings are very strictly measured out and\naccounted for without difficulty, while it is hard to tell what becomes\nof all our expenditure, physical and economical. Yet, although the\nindestructibility of matter was a conception which had not yet dawned\non Anaximander, he seems to have been feeling his way towards the\nrecognition of a circulatory movement pervading all Nature. Everything,\nhe says, must at last be reabsorbed in the Infinite as a punishment for\nthe sin of its separate existence.[10] Some may find in this sentiment\na note of Oriental mysticism. Rather does its very sadness illustrate\nthe healthy vitality of Greek feeling, to which absorption seemed like\nthe punishment of a crime against the absolute, and not, as to so many\nAsiatics, the crown and consummation of spiritual perfection. Be this\nas it may, a doctrine which identified the death of the whole world\nwith its reabsorption into a higher reality would soon suggest the idea\nthat its component parts vanish only to reappear in new combinations.\n\nAnaximander’s system was succeeded by a number of others which cannot\nbe arranged according to any order of linear progression. Such\narrangements are, indeed, false in principle. Intellectual life, like\nevery other life, is a product of manifold conditions, and their varied\ncombinations are certain to issue in a corresponding multiplicity of\neffects. Anaximenes, a fellow-townsman of Anaximander, followed most\nclosely in the footsteps of the master. Attempting, as it would appear,\nto mediate between his two predecessors, he chose air for a primal\nelement. Air is more omnipresent than water, which, as well as earth,\nis enclosed within its plastic sphere. On the other hand, it is more\ntangible and concrete than the Infinite, or may even be substituted for\nthat conception by supposing it to extend as far as thought can reach.\nAs before, cosmogony grows out of cosmography; the enclosing element is\nthe parent of those embraced within it.\n\nSpeculation now leaves its Asiatic cradle and travels with the Greek\ncolonists to new homes in Italy and Sicily, where new modes of thought\nwere fostered by a new environment. A name, round which mythical\naccretions have gathered so thickly that the original nucleus of fact\nalmost defies definition, first claims our attention. Aristotle, as\nis well known, avoids mentioning Pythagoras, and always speaks of the\nPythagoreans when he is discussing the opinions held by a certain\nItalian school. Their doctrine, whoever originated it, was that all\nthings are made out of number. Brandis regards Pythagoreanism as an\nentirely original effort of speculation, standing apart from the main\ncurrent of Hellenic thought, and to be studied without reference to\nIonian philosophy. Zeller, with more plausibility, treats it as an\noutgrowth of Anaximander’s system. In that system the finite and the\ninfinite remained opposed to one another as unreconciled moments of\nthought. Number, according to the Greek arithmeticians, was a synthesis\nof the two, and therefore superior to either. To a Pythagorean the\nfinite and the infinite were only one among several antithetical\ncouples, such as odd and even, light and darkness, male and female,\nand, above all, the one and the many whence every number after unity\nis formed. The tendency to search for antitheses everywhere, and to\nmanufacture them where they do not exist, became ere long an actual\ndisease of the Greek mind. A Thucydides could no more have dispensed\nwith this cumbrous mechanism than a rope-dancer could get on without\nhis balancing pole; and many a schoolboy has been sorely puzzled by the\nfantastic contortions which Italiote reflection imposed for a time on\nAthenian oratory.\n\nReturning to our more immediate subject, we must observe that the\nPythagoreans did not maintain, in anticipation of modern quantitative\nscience, that all things are determined by number, but that all\nthings are numbers, or are made out of numbers, two propositions not\neasily distinguished by unpractised thinkers. Numbers, in a word,\nwere to them precisely what water had been to Thales, what air was to\nAnaximenes, the absolute principle of existence; only with them the\nidea of a limit, the leading inspiration of Greek thought, had reached\na higher degree of abstraction. Number was, as it were, the exterior\nlimit of the finite, and the interior limit of the infinite. Add to\nthis that mathematical studies, cultivated in Egypt and Phoenicia\nfor their practical utility alone, were being pursued in Hellas with\never-increasing ardour for the sake of their own delightfulness, for\nthe intellectual discipline that they supplied—a discipline even\nmore valuable then than now, and for the insight which they bestowed,\nor were believed to bestow, into the secret constitution of Nature;\nand that the more complicated arithmetical operations were habitually\nconducted with the aid of geometrical diagrams, thus suggesting\nthe possibility of applying a similar treatment to every order of\nrelations. Consider the lively emotions excited among an intelligent\npeople at a time when multiplication and division, squaring and cubing,\nthe rule of three, the construction and equivalence of figures, with\nall their manifold applications to industry, commerce, fine art, and\ntactics, were just as strange and wonderful as electrical phenomena are\nto us; consider also the magical influence still commonly attributed to\nparticular numbers, and the intense eagerness to obtain exact numerical\nstatements, even when they are of no practical value, exhibited by all\nwho are thrown back on primitive ways of living, as, for example, in\nAlpine travelling, or on board an Atlantic steamer, and we shall cease\nto wonder that a mere form of thought, a lifeless abstraction, should\nonce have been regarded as the solution of every problem, the cause of\nall existence; or that these speculations were more than once revived\nin after ages, and perished only with Greek philosophy itself.\n\nWe have not here to examine the scientific achievements of Pythagoras\nand his school; they belong to the history of science, not to that\nof pure thought, and therefore lie outside the present discussion.\nSomething, however, must be said of Pythagoreanism as a scheme of\nmoral, religious, and social reform. Alone among the pre-Socratic\nsystems, it undertook to furnish a rule of conduct as well as a theory\nof being. Yet, as Zeller has pointed out,[11] it was only an apparent\nanomaly, for the ethical teaching of the Pythagoreans was not based\non their physical theories, except in so far as a deep reverence for\nlaw and order was common to both. Perhaps, also, the separation of\nsoul and body, with the ascription of a higher dignity to the former,\nwhich was a distinctive tenet of the school, may be paralleled with\nthe position given to number as a kind of spiritual power creating\nand controlling the world of sense. So also political power was to be\nentrusted to an aristocracy trained in every noble accomplishment,\nand fitted for exercising authority over others by self-discipline,\nby mutual fidelity, and by habitual obedience to a rule of right.\nNevertheless, we must look, with Zeller, for the true source of\nPythagoreanism as a moral movement in that great wave of religious\nenthusiasm which swept over Hellas during the sixth century before\nChrist, intimately associated with the importation of Apollo-worship\nfrom Lycia, with the concentration of spiritual authority in the\noracular shrine of Delphi, and the political predominance of the\nDorian race, those Normans of the ancient world. Legend has thrown\nthis connexion into a poetical form by making Pythagoras the son of\nApollo; and the Samian sage, although himself an Ionian, chose the\nDorian cities of Southern Italy as a favourable field for his new\nteaching, just as Calvinism found a readier acceptance in the advanced\nposts of the Teutonic race than among the people whence its founder\nsprang. Perhaps the nearest parallel, although on a far more extensive\nscale, for the religious movement of which we are speaking, is the\nspectacle offered by mediaeval Europe during the twelfth and thirteenth\ncenturies of our era, when a series of great Popes had concentrated\nall spiritual power in their own hands, and were sending forth army\nafter army of Crusaders to the East; when all Western Europe had\nawakened to the consciousness of its common Christianity, and each\nindividual was thrilled by a sense of the tremendous alternatives\ncommitted to his choice; when the Dominican and Franciscan orders\nwere founded; when Gothic architecture and Florentine painting arose;\nwhen the Troubadours and Minnesängers were pouring out their notes\nof scornful or tender passion, and the love of the sexes had become a\nsentiment as lofty and enduring as the devotion of friend to friend\nhad been in Greece of old. The bloom of Greek religious enthusiasm\nwas more exquisite and evanescent than that of feudal Catholicism;\ninferior in pure spirituality and of more restricted significance as\na factor in the evolution of humanity, it at least remained free from\nthe ecclesiastical tyranny, the murderous fanaticism, and the unlovely\nsuperstitions of mediaeval faith. But polytheism under any form was\nfatally incapable of coping with the new spirit of enquiry awakened by\nphilosophy, and the old myths, with their naturalistic crudities, could\nnot long satisfy the reason and conscience of thinkers who had learned\nin another school to seek everywhere for a central unity of control,\nand to bow their imaginations before the passionless perfection of\neternal law.\n\n\nIII.\n\nSuch a thinker was Xenophanes, of Colophon. Driven, like Pythagoras,\nfrom his native city by civil discords, he spent the greater part of\nan unusually protracted life wandering through the Greek colonies of\nSicily and Southern Italy, and reciting his own verses, not always,\nas it would appear, to a very attentive audience. Elea, an Italiote\ncity, seems to have been his favourite resort, and the school of\nphilosophy which he founded there has immortalised the name of this\notherwise obscure Phocaean settlement. Enough remains of his verses to\nshow with what terrible strength of sarcasm he assailed the popular\nreligion of Hellas. ‘Homer and Hesiod,’ he exclaims, ‘have attributed\nto the gods everything that is a shame and reproach among men—theft,\nadultery, and mutual deception.’[12] Nor is Xenophanes content with\nattacking these unedifying stories, he strikes at the anthropomorphic\nconceptions which lay at their root. ‘Mortals think that the gods have\nsenses, and a voice and a body like their own. The negroes fancy that\ntheir deities are black-skinned and snub-nosed, the Thracians give\ntheirs fair hair and blue eyes; if horses or lions had hands and could\npaint, they too would make gods in their own image.’[13] It was, he\ndeclared, as impious to believe in the birth of a god as to believe\nin the possibility of his death. The current polytheism was equally\nfalse. ‘There is one Supreme God among gods and men, unlike mortals\nboth in mind and body.’[14] There can be only one God, for God is\nOmnipotent, so that there must be none to dispute his will. He must\nalso be perfectly homogeneous, shaped like a sphere, seeing, hearing,\nand thinking with every part alike, never moving from place to place,\nbut governing all things by an effortless exercise of thought. Had such\ndaring heresies been promulgated in democratic Athens, their author\nwould probably have soon found himself and his works handed over to the\ntender mercies of the Eleven. Happily at Elea, and in most other Greek\nstates, the gods were left to take care of themselves.\n\nXenophanes does not seem to have been ever molested on account of\nhis religious opinions. He complains bitterly enough that people\npreferred fiction to philosophy, that uneducated athletes engrossed\nfar too much popular admiration, that he, Xenophanes, was not\nsufficiently appreciated;[B] but of theological intolerance, so\nfar as our information goes, he says not one single word. It will\neasily be conceived that the rapid progress of Greek speculation\nwas singularly favoured by such unbounded freedom of thought and\nspeech. The views just set forth have often been regarded as a step\ntowards spiritualistic monotheism, and so, considered in the light of\nsubsequent developments, they unquestionably were. Still, looking at\nthe matter from another aspect, we may say that Xenophanes, when he\nshattered the idols of popular religion, was returning to the past\nrather than anticipating the future; feeling his way back to the\ndeeper, more primordial faith of the old Aryan race, or even of that\nstill older stock whence Aryan and Turanian alike diverged. He turns\nfrom the brilliant, passionate, fickle Dyaus, to Zên, or Ten, the\never-present, all-seeing, all-embracing, immovable vault of heaven.\nAristotle, with a sympathetic insight unfortunately too rare in his\ncriticisms on earlier systems, observes that Xenophanes did not make\nit clear whether the absolute unity he taught was material or ideal,\nbut simply looked up at the whole heaven and declared that the One\nwas God.[15] Aristotle was himself the real creator of philosophic\nmonotheism, just because the idea of living, self-conscious personality\nhad a greater value, a profounder meaning for him than for any other\nthinker of antiquity, one may almost say than for any other thinker\nwhatever. It is, therefore, a noteworthy circumstance that, while\nwarmly acknowledging the anticipations of Anaxagoras, he nowhere speaks\nof Xenophanes as a predecessor in the same line of enquiry. The latter\nmight be called a pantheist were it not that pantheism belongs to a\nmuch later stage of speculation, one, in fact, not reached by the Greek\nmind at any period of its development. His leading conception was\nobscured by a confusion of mythological with purely physical ideas, and\ncould only bear full fruit when the religious element had been entirely\neliminated from its composition. This elimination was accomplished\nby a far greater thinker, one who combined poetic inspiration with\nphilosophic depth; who was penetrating enough to discern the logical\nconsequences involved in a fundamental principle of thought, and bold\nenough to push them to their legitimate conclusions without caring for\nthe shock to sense and common opinion that his merciless dialectic\nmight inflict.\n\nParmenides, of Elea, flourished towards the beginning of the fifth\ncentury B.C. We know very little about his personal history.\nAccording to Plato, he visited Athens late in life, and there made\nthe acquaintance of Socrates, at that time a very young man. But an\nunsupported statement of Plato’s must always be received with extreme\ncaution; and this particular story is probably not less fictitious than\nthe dialogue which it serves to introduce. Parmenides embodied his\ntheory of the world in a poem, the most important passages of which\nhave been preserved. They show that, while continuing the physical\nstudies of his predecessors, he proceeded on an entirely different\nmethod. Their object was to deduce every variety of natural phenomena\nfrom a fundamental unity of substance. He declared that all variety and\nchange were a delusion, and that nothing existed but one indivisible,\nunalterable, absolute reality; just as Descartes’ antithesis of thought\nand extension disappeared in the infinite substance of Spinoza, or as\nthe Kantian dualism of object and subject was eliminated in Hegel’s\nabsolute idealism. Again, Parmenides does not dogmatise to the same\nextent as his predecessors; he attempts to demonstrate his theory by\nthe inevitable necessities of being and thought. Existence, he tells\nus over and over again, _is_, and non-existence is not, cannot even\nbe imagined or thought of as existing, for thought is the same as\nbeing. This is not an anticipation of Hegel’s identification of being\nwith thought; it only amounts to the very innocent proposition that\na thought is something and about something—enters, therefore, into\nthe general undiscriminated mass of being. He next proceeds to prove\nthat what is can neither come into being nor pass out of it again.\nIt cannot come out of the non-existent, for that is inconceivable;\nnor out of the existent, for nothing exists but being itself; and the\nsame argument proves that it cannot cease to exist. Here we find the\nindestructibility of matter, a truth which Anaximander had not yet\ngrasped, virtually affirmed for the first time in history. We find\nalso that our philosopher is carried away by the enthusiasm of a new\ndiscovery, and covers more ground than he can defend in maintaining\nthe permanence of all existence whatever. The reason is that to him,\nas to every other thinker of the pre-Socratic period, all existence\nwas material, or, rather, all reality was confounded under one vague\nconception, of which visible resisting extension supplied the most\nfamiliar type. To proceed: Being cannot be divided from being, nor is\nit capable of condensation or expansion (as the Ionians had taught);\nthere is nothing by which it can be separated or held apart; nor is it\never more or less existent, but all is full of being. Parmenides goes\non in his grand style:—\n\n    ‘Therefore the whole extends continuously,\n    Being by Being set; immovable,\n    Subject to the constraint of mighty laws;\n    Both increate and indestructible,\n    Since birth and death have wandered far away\n    By true conviction into exile driven;\n    The same, in self-same place, and by itself\n    Abiding, doth abide most firmly fixed,\n    And bounded round by strong Necessity.\n    Wherefore a holy law forbids that Being\n    Should be without an end, else want were there,\n    And want of that would be a want of all.’[16]\n\nThus does the everlasting Greek love of order, definition, limitation,\nreassert its supremacy over the intelligence of this noble thinker,\njust as his almost mystical enthusiasm has reached its highest pitch\nof exaltation, giving him back a world which thought can measure,\ncircumscribe, and control.\n\nBeing, then, is finite in extent, and, as a consequence of its absolute\nhomogeneity, spherical in form. There is good reason for believing that\nthe earth’s true figure was first discovered in the fifth century B.C.,\nbut whether it was suggested by the _à priori_ theories of Parmenides,\nor was generalised by him into a law of the whole universe, or whether\nthere was more than an accidental connexion between the two hypotheses,\nwe cannot tell. Aristotle, at any rate, was probably as much indebted\nto the Eleatic system as to contemporary astronomy for his theory\nof a finite spherical universe. It will easily be observed that the\ndistinction between space and matter, so obvious to us, and even to\nGreek thinkers of a later date, had not yet dawned upon Parmenides.\nAs applied to the former conception, most of his affirmations are\nperfectly correct, but his belief in the finiteness of Being can only\nbe justified on the supposition that Being is identified with matter.\nFor it must be clearly understood (and Zeller has the great merit of\nhaving proved this fact by incontrovertible arguments)[17] that the\nEleatic Being was not a transcendental conception, nor an abstract\nunity, as Aristotle erroneously supposed, nor a Kantian noumenon, nor\na spiritual essence of any kind, but a phenomenal reality of the most\nconcrete description. We can only not call Parmenides a materialist,\nbecause materialism implies a negation of spiritualism, which in his\ntime had not yet come into existence. He tells us plainly that a man’s\nthoughts result from the conformation of his body, and are determined\nby the preponderating element in its composition. Not much, however,\ncan be made of this rudimentary essay in psychology, connected as it\nseems to be with an appendix to the teaching of our philosopher, in\nwhich he accepts the popular dualism, although still convinced of its\nfalsity, and uses it, under protest, as an explanation of that very\ngenesis which he had rejected as impossible.\n\nAs might be expected, the Parmenidean paradoxes provoked a considerable\namount of contradiction and ridicule. The Reids and Beatties of that\ntime drew sundry absurd consequences from the new doctrine, and offered\nthem as a sufficient refutation of its truth. Zeno, a young friend and\nfavourite of Parmenides, took up arms in his master’s defence, and\nsought to prove with brilliant dialectical ability that consequences\nstill more absurd might be deduced from the opposite belief. He\noriginated a series of famous puzzles respecting the infinite\ndivisibility of matter and the possibility of motion, subsequently\nemployed as a disproof of all certainty by the Sophists and Sceptics,\nand occasionally made to serve as arguments on behalf of agnosticism\nby writers of our own time. Stated generally, they may be reduced to\ntwo. A whole composed of parts and divisible _ad infinitum_ must be\neither infinitely great or infinitely little; infinitely great if its\nparts have magnitude, infinitely little if they have not. A moving body\ncan never come to the end of a given line, for it must first traverse\nhalf the line, then half the remainder, and so on for ever. Aristotle\nthought that the difficulty about motion could be solved by taking the\ninfinite divisibility of time into account; and Coleridge, according to\nhis custom, repeated the explanation without acknowledgment. But Zeno\nwould have refused to admit that any infinite series could come to an\nend, whether it was composed of successive or of co-existent parts. So\nlong as the abstractions of our understanding are treated as separate\nentities, these and similar puzzles will continue to exercise the\ningenuity of metaphysicians. Our present business, however, is not to\nsolve Zeno’s difficulties, but to show how they illustrate a leading\ncharacteristic of Greek thought, its tendency to perpetual analysis,\na tendency not limited to the philosophy of the Greeks, but pervading\nthe whole of their literature and even of their art. Homer carefully\ndistinguishes the successive steps of every action, and leads up to\nevery catastrophe by a series of finely graduated transitions. Like\nZeno, again, he pursues a system of dichotomy, passing rapidly over the\nfirst half of his subject, and relaxes the speed of his narrative by\ngoing into ever-closer detail until the consummation is reached. Such\na poem as the ‘Achilleis’ of modern critics would have been perfectly\nintolerable to a Greek, from the too rapid and uniform march of its\naction. Herodotus proceeds after a precisely similar fashion, advancing\nfrom a broad and free treatment of history to elaborate minuteness of\ndetail. So, too, a Greek temple divides itself into parts so distinct,\nyet so closely connected, that the eye, after separating, as easily\nrecombines them into a whole. The evolution of Greek music tells the\nsame tale of progressive subdivision, which is also illustrated by the\npassage from long speeches to single lines, and from these again to\nhalf lines in the dialogue of a Greek drama. No other people could have\ncreated mathematical demonstration, for no other would have had skill\nand patience enough to discover the successive identities interposed\nbetween and connecting the sides of an equation. The dialectic of\nSocrates and Plato, the somewhat wearisome distinctions of Aristotle,\nand, last of all, the fine-spun series of triads inserted by Proclus\nbetween the superessential One and the fleeting world of sense,—were\nall products of the same fundamental tendency, alternately most\nfruitful and most barren in its results. It may be objected that Zeno,\nso far from obeying this tendency, followed a diametrically opposite\nprinciple, that of absolutely unbroken continuity. True; but the\n‘Eleatic Palamedes’ fought his adversaries with a weapon wrested out\nof their own hands; rejecting analysis as a law of real existence, he\ncontinued to employ it as a logical artifice with greater subtlety than\nhad ever yet been displayed in pure speculation.[18]\n\nBesides Zeno, Parmenides seems to have had only one disciple of\nnote, Melissus, the Samian statesman and general; but under various\nmodifications and combined with other elements, the Eleatic absolute\nentered as a permanent factor into Greek speculation. From it were\nlineally descended the Sphairos of Empedocles, the eternal atoms of\nLeucippus, the Nous of Anaxagoras, the Megaric Good, the supreme\nsolar idea of Plato, the self-thinking thought of Aristotle, the\nimperturbable tranquillity attributed to their model sage by Stoics\nand Epicureans alike, the sovereign indifference of the Sceptics, and\nfinally, the Neo-platonic One. Modern philosophers have sought for\ntheir supreme ideal in power, movement, activity, life, rather than in\nany stationary substance; yet even among them we find Herbart partially\nreviving the Eleatic theory, and confronting Hegel’s fluent categories\nwith his own inflexible monads.\n\nWe have now to study an analogous, though far less complicated,\nantagonism in ancient Greece, and to show how her most brilliant period\nof physical philosophy arose from the combination of two seemingly\nirreconcilable systems. Parmenides, in an address supposed to be\ndelivered by Wisdom to her disciple, warns us against the method\npursued by ‘ignorant mortals, the blind, deaf, stupid, confused\ntribes, who hold that to be and not to be are the same, and that all\nthings move round by an inverted path.’[19] What Parmenides denounced\nas arrant nonsense was deliberately proclaimed to be the highest\ntruth by his illustrious contemporary, Heracleitus, of Ephesus. This\nwonderful thinker is popularly known as the weeping philosopher,\nbecause, according to a very silly tradition, he never went abroad\nwithout shedding tears over the follies of mankind. No such mawkish\nsentimentality, but bitter scorn and indignation, marked the attitude\nof Heracleitus towards his fellows. A self-taught sage, he had no\nrespect for the accredited instructors of Hellas. ‘Much learning,’\nhe says, ‘does not teach reason, else it would have taught Hesiod\nand Pythagoras, Xenophanes and Hecataeus.’[20] Homer, he declares,\nought to be flogged out of the public assemblages, and Archilochus\nlikewise. When the highest reputations met with so little mercy,\nit will readily be imagined what contempt he poured on the vulgar\nherd. The feelings of a high-born aristocrat combine with those of a\nlofty genius to point and wing his words. ‘The many are bad and few\nare the good. The best choose one thing instead of all, a perpetual\nwell-spring of fame, while the many glut their appetites like beasts.\nOne man is equal to ten thousand if he is the best.’ This contempt\nwas still further intensified by the very excusable incapacity of the\npublic to understand profound thought conveyed in a style proverbial\nfor its obscurity. ‘Men cannot comprehend the eternal law; when I\nhave explained the order of Nature they are no wiser than before.’\nWhat, then, was this eternal law, a knowledge of which Heracleitus\nfound so difficult to popularise? Let us look back for a moment at\nthe earlier Ionian systems. They had taught that the universe arose\neither by differentiation or by condensation and expansion from a\nsingle primordial substance, into which, as Anaximander, at least,\nheld, everything, at last returned. Now, Heracleitus taught that this\ntransformation is a universal, never-ending, never-resting process;\nthat all things are moving; that Nature is like a stream in which no\nman can bathe twice; that rest and stability are the law, not of life,\nbut of death. Again, the Pythagorean school, as we have seen, divided\nall things into a series of sharply distinguished antithetical pairs.\nHeracleitus either directly identified the terms of every opposition,\nor regarded them as necessarily combined, or as continually passing\ninto one another. Perhaps we shall express his meaning most thoroughly\nby saying that he would have looked on all three propositions as\nequivalent statements of a single fact. In accordance with this\nprinciple he calls war the father and king and lord of all, and\ndenounces Homer’s prayer for the abolition of strife as an unconscious\nblasphemy against the universe itself. Yet, even his powerful\nintellect could not grasp the conception of a shifting relativity\nas the law and life of things without embodying it in a particular\nmaterial substratum. Following the Ionian tradition, he sought for a\nworld-element, and found it in that cosmic fire which enveloped the\nterrestrial atmosphere, and of which the heavenly luminaries were\nsupposed to be formed. ‘Fire,’ says the Ephesian philosopher, no doubt\nadapting his language to the comprehension of a great commercial\ncommunity, ‘is the general medium of exchange, as gold is given for\neverything, and everything for gold.’ ‘The world was not created by any\ngod or any man, but always was, and is, and shall be, an ever-living\nfire, periodically kindled and quenched.‘ By cooling and condensation,\nwater is formed from fire, and earth from water; then, by a converse\nprocess called the way up as the other was the way down, earth again\npasses into water and water into fire. At the end of certain stated\nperiods the whole world is to be reconverted into fire, but only to\nenter on a new cycle in the series of its endless revolutions—a\nconception, so far, remarkably confirmed by modern science. The whole\ntheory, including a future world conflagration, was afterwards adopted\nby the Stoics, and probably exercised a considerable influence on the\neschatology of the early Christian Church. Imagination is obliged to\nwork under forms which thought has already superseded; and Heracleitus\nas a philosopher had forestalled the dazzling consummation to which as\na prophet he might look forward in wonder and hope. For, his elemental\nfire was only a picturesque presentation indispensable to him, but\nnot to us, of the sovereign law wherein all things live and move and\nhave their being. To have introduced such an idea into speculation\nwas his distinctive and inestimable achievement, although it may have\nbeen suggested by the εἱμαρμένη or destiny of the theological poets,\na term occasionally employed in his writings. It had a moral as well\nas a physical meaning, or rather it hovers ambiguously between the\ntwo. ‘The sun shall not transgress his bounds, or the Erinyes who help\njustice will find him out.’ It is the source of human laws, the common\nreason which binds men together, therefore they should hold by it even\nmore firmly than by the laws of the State. It is not only all-wise but\nall-good, even where it seems to be the reverse; for our distinctions\nbetween good and evil, just and unjust, vanish in the divine harmony of\nNature, the concurrent energies and identifying transformations of her\nuniversal life.\n\nAccording to Aristotle, the Heracleitean flux was inconsistent with\nthe highest law of thought, and made all predication impossible. It\nhas been shown that the master himself recognised a fixed recurring\norder of change which could be affirmed if nothing else could. But the\nprinciple of change, once admitted, seemed to act like a corrosive\nsolvent, too powerful for any vessel to contain. Disciples were\nsoon found who pushed it to extreme consequences with the effect of\nabolishing all certainty whatever. In Plato’s time it was impossible\nto argue with a Heracleitean; he could never be tied down to a\ndefinite statement. Every proposition became false as soon as it was\nuttered, or rather before it was out of the speaker’s mouth. At last,\na distinguished teacher of the school declined to commit himself\nby using words, and disputed exclusively in dumb show. A dangerous\nspeculative crisis had set in. At either extremity of the Hellenic\nworld the path of scientific inquiry was barred; on the one hand by\na theory eliminating non-existence from thought, and on the other\nhand by a theory identifying it with existence. The luminous beam\nof reflection had been polarised into two divergent rays, each light\nwhere the other was dark and dark where the other was light, each\ndenying what the other asserted and asserting what the other denied.\nFor a century physical speculation had taught that the universe was\nformed by the modification of a single eternal substance, whatever\nthat substance might be. By the end of that period, all becoming was\nabsorbed into being at Elea, and all being into becoming at Ephesus.\nEach view contained a portion of the truth, and one which perhaps\nwould never have been clearly perceived if it had not been brought\ninto exclusive prominence. But further progress was impossible until\nthe two half-truths had been recombined. We may compare Parmenides and\nHeracleitus to two lofty and precipitous peaks on either side of an\nAlpine pass. Each commands a wide prospect, interrupted only on the\nside of its opposite neighbour. And the fertilising stream of European\nthought originates with neither of them singly, but has its source\nmidway between.\n\n\nIV.\n\nWe now enter on the last period of purely objective philosophy, an\nage of mediating and reconciling, but still profoundly original\nspeculation. Its principal representatives, with whom alone we have\nto deal, are Empedocles, the Atomists, Leucippus and Democritus, and\nAnaxagoras. There is considerable doubt and difficulty respecting the\norder in which they should be placed. Anaxagoras was unquestionably the\noldest and Democritus the youngest of the four, the difference between\ntheir ages being forty years. It is also nearly certain that the\nAtomists came after Empedocles. But if we take a celebrated expression\nof Aristotle’s[21] literally (as there is no reason why it should not\nbe taken), Anaxagoras, although born before Empedocles, published\nhis views at a later period. Was he also anticipated by Leucippus? We\ncannot tell with certainty, but it seems likely from a comparison of\ntheir doctrines that he was; and in all cases the man who naturalised\nphilosophy in Athens, and who by his theory of a creative reason\nfurnishes a transition to the age of subjective speculation, will be\nmost conveniently placed at the close of the pre-Socratic period.\n\nA splendid tribute has been paid to the fame of Empedocles by\nLucretius, the greatest didactic poet of all time, and by a great\ndidactic poet of our own time, Mr. Matthew Arnold. But the still more\nrapturous panegyric pronounced by the Roman enthusiast on Epicurus\nmakes his testimony a little suspicious, and the lofty chant of\nour own contemporary must be taken rather as an expression of his\nown youthful opinions respecting man’s place in Nature, than as a\nfaithful exposition of the Sicilian thinker’s creed. Many another\nname from the history of philosophy might with better reason have\nbeen prefixed to that confession of resigned and scornful scepticism\nentitled _Empedocles on Etna_. The real doctrines of an essentially\nreligious teacher would hardly have been so cordially endorsed by\nMr. Swinburne. But perhaps no other character could have excited the\ndeep sympathy felt by one poetic genius for another, when with both\nof them thought is habitually steeped in emotion. Empedocles was the\nlast Greek of any note who threw his philosophy into a metrical form.\nNeither Xenophanes nor Parmenides had done this with so much success.\nNo less a critic than Aristotle extols the Homeric splendour of his\nverses, and Lucretius, in this respect an authority, speaks of them\nas almost divine. But, judging from the fragments still extant, their\nspeculative content exhibits a distinct decline from the height reached\nby his immediate predecessors. Empedocles betrays a distrust in man’s\npower of discovering truth, almost, although not quite, unknown to\nthem. Too much certainty would be impious. He calls on the ‘much-wooed\nwhite-armed virgin muse’ to—\n\n    ‘Guide from the seat of Reverence thy bright car,\n    And bring to us the creatures of a day,\n    What without sin we may aspire to know.’[22]\n\nWe also miss in him their single-minded devotion to philosophy and\ntheir rigorous unity of doctrine. The Acragantine sage was a party\nleader (in which capacity, to his great credit, he victoriously upheld\nthe popular cause), a rhetorician, an engineer, a physician, and a\nthaumaturgist. The well-known legend relating to his death may be\ntaken as a not undeserved satire on the colossal self-conceit of the\nman who claimed divine honours during his lifetime. Half-mystic and\nhalf-rationalist, he made no attempt to reconcile the two inconsistent\nsides of his intellectual character. It may be compared to one of\nthose grotesque combinations in which, according to his morphology,\nthe heads and bodies of widely different animals were united during\nthe beginnings of life before they had learned to fall into their\nproper places. He believed in metempsychosis, and professed to remember\nthe somewhat miscellaneous series of forms through which his own\npersonality had already run. He had been a boy, a girl, a bush, a\nbird, and a fish. Nevertheless, as we shall presently see, his theory\nof Nature altogether excluded such a notion as the soul’s separate\nexistence. We have now to consider what that theory actually was. It\nwill be remembered that Parmenides had affirmed the perpetuity and\neternal self-identity of being, but that he had deprived this profound\ndivination of all practical value by interpreting it in a sense which\nexcluded diversity and change. Empedocles also declares creation and\ndestruction to be impossible, but explains that the appearances so\ndenominated arise from the union and separation of four everlasting\nsubstances—earth, air, fire, and water. This is the famous doctrine\nof the four elements, which, adopted by Plato and Aristotle, was\nlong regarded as the last word of chemistry, and still survives in\npopular phraseology. Its author may have been guided by an unconscious\nreflection on the character of his own philosophical method, for was\nnot he, too, constructing a new system out of the elements supplied\nby his predecessors? They had successively fixed on water, air, and\nfire as the primordial form of existence; he added a fourth, earth,\nand effected a sort of reconciliation by placing them all on an equal\nfooting. Curiously enough, the earlier monistic system had a relative\njustification which his crude eclecticism lacked. All matter may exist\neither in a solid, a liquid, or a gaseous form; and all solid matter\nhas reached its present condition after passing through the two other\ndegrees of consistency. That the three modifications should be found\ncoexisting in our own experience is a mere accident of the present\nrégime, and to enumerate them is to substitute a description for an\nexplanation, the usual fault of eclectic systems. Empedocles, however,\nbesides his happy improvement on Parmenides, made a real contribution\nto thought when, as Aristotle puts it, he sought for a moving as well\nas for a material cause; in other words, when he asked not only of\nwhat elements the world is composed, but also by what forces were they\nbrought together. He tells us of two such causes, Love and Strife,\nthe one a combining, the other a dissociating power. If for these\nhalf-mythological names we read attractive and repulsive forces, the\nresult will not be very different from our own current cosmologies.\nSuch terms, when so used as to assume the existence of occult qualities\nin matter, driving its parts asunder or drawing them close together,\nare, in truth, as completely mythological as any figments of Hellenic\nfancy. Unlike their modern antitypes, the Empedoclean goddesses did\nnot reign together, but succeeded one another in alternate dominion\nduring protracted periods of time. The victory of Love was complete\nwhen all things had been drawn into a perfect sphere, evidently the\nabsolute Eleatic Being subjected to a Heracleitean law of vicissitude\nand contradiction. For Strife lays hold on the consolidated orb, and\nby her disintegrating action gradually reduces it to a formless chaos,\ntill, at the close of another world-period, the work of creation begins\nagain. Yet growth and decay are so inextricably intertwined that\nEmpedocles failed to keep up this ideal separation, and was compelled\nto admit the simultaneous activity of both powers in our everyday\nexperience, so that Nature turns out to be composed of six elements\ninstead of four, the mind which perceives it being constituted in a\nprecisely similar manner. But Love, although on the whole victorious,\ncan only gradually get the better of her retreating enemy, and Nature,\nas we know it, is the result of their continued conflict. Empedocles\ndescribed the process of evolution, as he conceived it, in somewhat\nminute detail. Two points only are of much interest to us, his alleged\nanticipation of the Darwinian theory and his psychology. The former,\nsuch as it was, has occasionally been attributed to Lucretius, but\nthe Roman poet most probably copied Epicurus, although the very brief\nsummary of that philosopher’s physical system preserved by Diogenes\nLaertius contains no allusion to such a topic. We know, however, that\nin Aristotle’s time a theory identical with that of Lucretius was\nheld by those who rejected teleological explanations of the world in\ngeneral and of living organisms in particular. All sorts of animals\nwere produced by spontaneous generation; only those survived which\nwere accidentally furnished with appliances for procuring nourishment\nand for propagating their kind. The notion itself originated with\nEmpedocles, whose fanciful suppositions have already been mentioned\nin a different connexion. Most assuredly he did not offer it as a\nsolution of problems which in his time had not yet been mooted, but as\nan illustration of the confusion which prevailed when Love had only\nadvanced a little way in her ordering, harmonising, unifying task.\nPrantl, writing a few years before the appearance of Mr. Darwin’s\nbook on the Origin of Species, and therefore without any prejudice\non the subject, observes with truth that this theory of Empedocles\nwas deeply rooted in the mythological conceptions of the time.[23]\nPerhaps he was seeking for a rationalistic explanation of the centaurs,\nminotaurs, hundred-handed giants, and so forth, in whose existence he\nhad not, like Lucretius, learned completely to disbelieve. His strange\nsupposition was afterwards freed from its worst extravagances; but\neven as stated in the _De Rerum Naturâ_, it has no claim whatever\nto rank as a serious hypothesis. Anything more unlike the Darwinian\ndoctrine, according to which all existing species have been evolved\nfrom less highly-organized ancestors by the gradual accumulation of\nminute differences, it would be difficult to conceive. Every thinker of\nantiquity, with one exception, believed in the immutability of natural\nspecies. They had existed unchanged from all eternity, or had sprung\nup by spontaneous generation from the earth’s bosom in their present\nform. The solitary dissentient was Anaximander, who conjectured that\nman was descended from an aquatic animal.[24] Strange to say, this\nlucky guess has not yet been quoted as an argument against the Ascidian\npedigree. It is chiefly the enemies of Darwinism who are eager to find\nit anticipated in Empedocles or Lucretius. By a curious inversion of\ntraditionalism, it is fancied that a modern discovery can be upset\nby showing that somebody said something of the kind more than two\nthousand years ago. Unfortunately authority has not the negative value\nof disproving the principles which it supports. We must be content\nto accept the truths brought to light by observation and reasoning,\neven at the risk of finding ourselves in humiliating agreement with a\nphilosopher of antiquity.[25]\n\nPassing from life to mind, we find Empedocles teaching an even more\npronounced materialism than Parmenides, inasmuch as it is stated in\nlanguage of superior precision. Our souls are, according to him,\nmade up of elements like those which constitute the external world,\neach of these being perceived by a corresponding portion of the same\nsubstances within ourselves—fire by fire, water by water, and so on\nwith the rest. It is a mistake to suppose that speculation begins from\na subjective standpoint, that men start with a clear consciousness of\ntheir own personality, and proceed to construct an objective universe\nafter the same pattern. Doubtless they are too prone to personify the\nblind forces of Nature, and Empedocles himself has just supplied us\nwith an example of this tendency, but they err still more by reading\noutward experience into their own souls, by materialising the processes\nof consciousness, and resolving human personality into a loose\nconfederacy of inorganic units. Even Plato, who did more than anyone\nelse towards distinguishing between mind and body, ended by laying down\nhis psychology on the lines of an astronomical system. Meanwhile, to\nhave separated the perception of an object from the object itself, in\never so slight a degree, was an important gain to thought. We must not\nomit to notice a hypothesis by which Empedocles sought to elucidate\nthe mechanism of sensation, and which was subsequently adopted by the\natomic school; indeed, as will presently be shown, we have reason to\nbelieve that the whole atomic theory was developed out of it. He held\nthat emanations were being continually thrown off from the surfaces of\nbodies, and that they penetrated into the organs of sense through fine\npassages or pores. This may seem a crude guess, but it is at any rate\nmuch more scientific than Aristotle’s explanation. According to the\nlatter, possibilities of feeling are converted into actualities by the\npresence of an object. In other words, we feel when and because we do;\na safe assertion, but hardly an addition to our positive knowledge of\nthe subject.\n\nWe have seen how Greek thought had arrived at a perfectly just\nconception of the process by which all physical transformations are\neffected. The whole extended universe is an aggregate of bodies, while\neach single body is formed by a combination of everlasting elements,\nand is destroyed by their separation. But if Empedocles was right, if\nthese primary substances were no other than the fire, air, water, and\nearth of everyday experience, what became of the Heracleitean law,\nconfirmed by common observation, that, so far from remaining unaltered,\nthey were continually passing into one another? To this question the\natomic theory gave an answer so conclusive, that, although ignored or\ncontemned by later schools, it was revived with the great revival of\nscience in the sixteenth century, was successfully employed in the\nexplanation of every order of phenomena, and still remains the basis\nof all physical enquiry. The undulatory theory of light, the law\nof universal gravitation, and the laws of chemical combination can\nonly be expressed in terms implying the existence of atoms; the laws\nof gaseous diffusion, and of thermodynamics generally, can only be\nunderstood with their help; and the latest developments of chemistry\nhave tended still further to establish their reality, as well as to\nelucidate their remarkable properties. In the absence of sufficient\ninformation, it is difficult to determine by what steps this admirable\nhypothesis was evolved. Yet, even without external evidence, we may\nfairly conjecture that, sooner or later, some philosopher, possessed of\na high generalising faculty, would infer that if bodies are continually\nthrowing off a flux of infinitesimal particles from their surfaces,\nthey must be similarly subdivided all through; and that if the organs\nof sense are honeycombed with imperceptible pores, such may also be\nthe universal constitution of matter.[26] Now, according to Aristotle,\nLeucippus, the founder of atomism, did actually use the second of these\narguments, and employed it in particular to prove the existence of\nindivisible solids.[27] Other considerations equally obvious suggested\nthemselves from another quarter. If all change was expressible in\nterms of matter and motion, then gradual change implied interstitial\nmotion, which again involved the necessity of fine pores to serve as\nchannels for the incoming and outgoing molecular streams. Nor, as was\nsupposed, could motion of any kind be conceived without a vacuum,\nthe second great postulate of the atomic theory. Here its advocates\ndirectly joined issue with Parmenides. The chief of the Eleatic school\nhad, as we have seen, presented being under the form of a homogeneous\nsphere, absolutely continuous but limited in extent. Space dissociated\nfrom matter was to him, as afterwards to Aristotle, non-existent and\nimpossible. It was, he exclaimed, inconceivable, nonsensical. Unhappily\ninconceivability is about the worst negative criterion of truth ever\nyet invented. His challenge was now taken up by the Atomists, who\nboldly affirmed that if non-being meant empty space, it was just as\nconceivable and just as necessary as being. A further stimulus may have\nbeen received from the Pythagorean school, whose doctrines had, just\nat this time, been systematised and committed to writing by Philolaus,\nits most eminent disciple. The hard saying that all things were made\nout of number might be explained and confirmed if the integers were\ninterpreted as material atoms.\n\nIt will have been observed that, so far, the merit of originating\natomism has been attributed to Leucippus, instead of to the more\ncelebrated Democritus, with whose name it is usually associated. The\ntwo were fast friends, and seem always to have worked together in\nperfect harmony. But Leucippus, although next to nothing is known of\nhis life, was apparently the older man, and from him, so far as we\ncan make out, emanated the great idea, which his brilliant coadjutor\ncarried into every department of enquiry, and set forth in works\nwhich are a loss to literature as well as to science, for the poetic\nsplendour of their style was not less remarkable than the encyclopaedic\nrange of their contents. Democritus was born at Abdêra, a Thracian\ncity, 470 B.C., a year before Socrates, and lived to a very advanced\nage—more than a hundred, according to some accounts. However this\nmay be, he was probably, like most of his great countrymen, possessed\nof immense vitality. His early manhood was spent in Eastern travel,\nand he was not a little proud of the numerous countries which he had\nvisited, and the learned men with whom he had conversed. His time was\nmostly occupied in observing Nature, and in studying mathematics;\nthe sages of Asia and Egypt may have acquainted him with many useful\nscientific facts, but we have seen that his philosophy was derived from\npurely Hellenic sources. A few fragments of his numerous writings still\nsurvive—the relics of an intellectual Ozymandias. In them are briefly\nshadowed forth the conceptions which Lucretius, or at least his modern\nEnglish interpreters, have made familiar to all educated men and women.\nEverything is the result of mechanical causation. Infinite worlds are\nformed by the collision of infinite atoms falling for ever downward\nthrough infinite space. No place is left for supernatural agency;\nnor are the unaided operations of Nature disguised under Olympian\nappellations. Democritus goes even further than Epicurus in his\nrejection of the popular mythology. His system provides no interstellar\nrefuge for abdicated gods. He attributed a kind of objective existence\nto the apparitions seen in sleep, and even a considerable influence for\ngood or for evil, but denied that they were immortal. The old belief in\na Divine Power had arisen from their activity and from meteorological\nphenomena of an alarming kind, but was destitute of any stronger\nfoundation. For his own part, he looked on the fiery spherical atoms as\na universal reason or soul of the world, without, however, assigning\nto them the distinct and commanding position occupied by a somewhat\nanalogous principle in the system which we now proceed to examine, and\nwith which our survey of early Greek thought will most fitly terminate.\n\n\nV.\n\nReasons have already been suggested for placing Anaxagoras last in\norder among the physical philosophers, notwithstanding his priority in\npoint of age to more than one of them. He was born, according to the\nmost credible accounts, 500 B.C., at Clazomenae, an Ionian city, and\nsettled in Athens when twenty years of age. There he spent much the\ngreater part of a long life, illustrating the type of character which\nEuripides—expressly referring, as is supposed, to the Ionian sage—has\ndescribed in the following choric lines:\n\n    ‘Happy is he who has learned\n    To search out the secret of things,\n    Not to the townsmen’s bane,\n    Neither for aught that brings\n    An unrighteous gain.\n    But the ageless order he sees\n    Of nature that cannot die,\n    And the causes whence it springs,\n    And the how and the why.\n    Never have thoughts like these\n    To a deed of dishonour been turned.’[28]\n\nThe dishonour was for the townsmen who, in an outbreak of insane\nfanaticism, drove the blameless truthseeker from his adopted home.\nAnaxagoras was the intimate companion of Pericles, and Pericles had\nmade many enemies by his domestic as well as by his foreign policy.\nA coalition of harassed interests and offended prejudices was formed\nagainst him. A cry arose that religion and the constitution were in\ndanger. The Athenians had too much good sense to dismiss their great\ndemocratic Minister, but they permitted the illustrious statesman’s\npolitical opponents to strike at him through his friends.[29] Aspasia\nwas saved only by the tears of her lover. Pheidias, the grandest,\nmost spiritual-minded artist of all time, was arrested on a charge\nof impiety, and died in a prison of the city whose temples were\nadorned with the imperishable monuments of his religious inspiration.\nA decree against ‘astronomers and atheists’ was so evidently aimed\nat Anaxagoras that the philosopher retired to Lampsacus, where he\ndied at the age of seventy-two, universally admired and revered.\nAltars dedicated to Reason and Truth were erected in his honour, and\nfor centuries his memory continued to be celebrated by an annual\nfeast.[30] His whole existence had been devoted to science. When\nasked what made life worth living, he answered, ‘The contemplation of\nthe heavens and of the universal cosmic order.’ The reply was like a\ntitle-page to his works. We can see that specialisation was beginning,\nthat the positive sciences were separating themselves from general\ntheories about Nature, and could be cultivated independently of them.\nA single individual might, indeed, combine philosophy of the most\ncomprehensive kind with a detailed enquiry into some particular order\nof phenomena, but he could do this without bringing the two studies\ninto any immediate connexion with each other. Such seems to have been\nthe case with Anaxagoras. He was a professional astronomer and also\nthe author of a modified atomic hypothesis. This, from its greater\ncomplexity, seems more likely to have been suggested by the purely\nquantitative conception of Leucippus than to have preceded it in the\norder of evolution. Democritus, and probably his teacher also, drew a\nvery sharp distinction between what were afterwards called the primary\nand secondary qualities of matter. Extension and resistance alone\nhad a real existence in Nature, while the attributes corresponding\nto our special sensations, such as temperature, taste, and colour,\nwere only subjectively, or, as he expressed it, conventionally true.\nAnaxagoras affirmed no less strongly than his younger contemporaries\nthat the sum of being can neither be increased nor diminished, that\nall things arise and perish by combination and division, and that\nbodies are formed out of indestructible elements; like the Atomists,\nagain, he regarded these elementary substances as infinite in number\nand inconceivably minute; only he considered them as qualitatively\ndistinct, and as resembling on an infinitesimal scale the highest\ncompounds that they build up. Not only were gold, iron, and the other\nmetals formed of homogeneous particles, but such substances as flesh,\nbone, and blood were, according to him, equally simple, equally\ndecomposable, into molecules of like nature with themselves. Thus, as\nAristotle well observes, he reversed the method of Empedocles, and\ntaught that earth, air, fire, and water were really the most complex\nof all bodies, since they supplied nourishment to the living tissues,\nand therefore must contain within themselves the multitudinous variety\nof units by whose aggregation individualised organic substance is\nmade up.[31] Furthermore, our philosopher held that originally this\nintermixture had been still more thoroughgoing, all possible qualities\nbeing simultaneously present in the smallest particles of matter. The\nresulting state of chaotic confusion lasted until Nous, or Reason, came\nand segregated the heterogeneous elements by a process of continuous\ndifferentiation leading up to the present arrangement of things. Both\nPlato and Aristotle have commended Anaxagoras for introducing into\nspeculation the conception of Reason as a cosmic world-ordering power;\nboth have censured him for making so little use of his own great\nthought, for attributing almost everything to secondary, material,\nmechanical causes; for not everywhere applying the teleological method;\nin fact, for not anticipating the Bridgewater Treatises and proving\nthat the world is constructed on a plan of perfect wisdom and goodness.\nLess fortunate than the Athenians, we cannot purchase the work of\nAnaxagoras on Nature at an orchestral book-stall for the moderate price\nof a drachma; but we know enough about its contents to correct the\nsomewhat petulant and superficial criticism of a school perhaps less in\nsympathy than we are with its author’s method of research. Evidently\nthe Clazomenian philosopher did not mean by Reason an ethical force, a\npower which makes for human happiness or virtue, nor yet a reflecting\nintelligence, a designer adapting means to ends. To all appearances the\nNous was not a spirit in the sense which we attach, or which Aristotle\nattached to the term. It was, according to Anaxagoras, the subtlest\nand purest of all things, totally unmixed with other substances, and\ntherefore able to control and bring them into order. This is not how\nmen speak of an immaterial inextended consciousness. The truth is that\nno amount of physical science could create, although it might lead\ntowards a spiritualistic philosophy. Spiritualism first arose from\nthe sophistic negation of an external world, from the exclusive study\nof man, from the Socratic search after general definitions. Yet, if\nNous originally meant intelligence, how could it lose this primary\nsignification and become identified with a mere mode of matter? The\nanswer is, that Anaxagoras, whose whole life was spent in tracing out\nthe order of Nature, would instinctively think of his own intelligence\nas a discriminating, identifying faculty; would, consequently, conceive\nits objective counterpart under the form of a differentiating and\nintegrating power. All preceding thinkers had represented their supreme\nbeing under material conditions, either as one element singly or as a\nsum total where elemental differences were merged. Anaxagoras differed\nfrom them chiefly by the very sharp distinction drawn between his\ninforming principle and the rest of Nature. The absolute intermixture\nof qualities which he presupposes bears a very strong resemblance\nboth to the Sphairos of Empedocles and to the fiery consummation of\nHeracleitus, it may even have been suggested by them. Only, what with\nthem was the highest form of existence becomes with him the lowest;\nthought is asserting itself more and more, and interpreting the law of\nevolution in accordance with its own imperious demands.\n\nA world where ordering reason was not only raised to supreme power,\nbut also jealously secluded from all communion with lower forms of\nexistence, meant to popular imagination a world from which divinity\nhad been withdrawn. The astronomical teaching of Anaxagoras was well\ncalculated to increase a not unfounded alarm. Underlying the local\ntribal mythology of Athens and of Greece generally, was an older,\ndeeper Nature-worship, chiefly directed towards those heavenly\nluminaries which shone so graciously on all men, and to which all\nmen yielded, or were supposed to yield, grateful homage in return.\n_Securus judicat orbis terrarum._ Every Athenian citizen from Nicias to\nStrepsiades would feel his own belief strengthened by such a universal\nconcurrence of authority. Two generations later, Plato held fast to\nthe same conviction, severely denouncing its impugners, whom he would,\nif possible, have silenced with the heaviest penalties. To Aristotle,\nalso, the heavenly bodies were something far more precious and perfect\nthan anything in our sublunary sphere, something to be spoken of\nonly in language of enthusiastic and passionate love. At a far later\nperiod Marcus Aurelius could refer to them as visible gods;[32] and\njust before the final extinction of Paganism highly-educated men still\noffered up their orisons in silence and secresy to the moon.[33]\nJudge, then, with what horror an orthodox public received Anaxagoras’s\nannouncement that the moon shone only by reflected light, that she was\nan earthy body, and that her surface was intersected with mountains and\nravines, besides being partially built over. The bright Selênê, the\nQueen of Heaven, the most interesting and sympathetic of goddesses,\nwhose phases so vividly recalled the course of human life, who was\nfirmly believed to bring fine weather at her return and to take it away\nat her departure, was degraded into a cold, dark, senseless clod.[34]\nDemocritus observed that all this had been known a long time in the\nEastern countries where he had travelled.[C] Possibly; but fathers of\nfamilies could not have been more disturbed if it had been a brand-new\ndiscovery. The sun, too, they were told, was a red-hot stone larger\nthan Peloponnesus—a somewhat unwieldy size even for a Homeric god.\nSocrates, little as he cared about physical investigations generally,\ntook this theory very seriously to heart, and attempted to show by a\nseries of distinctions that sun-heat and fire-heat were essentially\ndifferent from each other. A duller people than the Athenians would\nprobably have shown far less suspicion of scientific innovations. Men\nwho were accustomed to anticipate the arguments of an orator before\nthey were half out of his mouth, with whom the extraction of reluctant\nadmissions by cross-examination was habitually used as a weapon of\nattack and defence in the public law courts and practised as a game in\nprivate circles—who were perpetually on their guard against insidious\nattacks from foreign and domestic foes—had minds ready trained to\nthe work of an inquisitorial priesthood. An Athenian, moreover, had\nmythology at his fingers’ ends; he was accustomed to see its leading\nincidents placed before him on the stage not only with intense realism,\nbut with a systematic adaptation to the demands of common experience\nand a careful concatenation of cause and effect, which gave his belief\nin them all the force of a rational conviction while retaining all the\ncharm of a supernatural creed. Then, again, the constitution of Athens,\nless than that of any other Greek State, could be worked without the\ndevoted, self-denying co-operation of her citizens, and in their\nminds sense of duty was inseparably associated with religious belief,\nbased in its turn on mythological traditions. A great poet has said,\nand said truly, that Athens was ‘on the will of man as on a mount of\ndiamond set,’ but the crystallising force which gave that collective\nhuman will such clearness and keenness and tenacity was faith in the\nprotecting presence of a diviner Will at whose withdrawal it would have\ncrumbled into dust. Lastly, the Athenians had no genius for natural\nscience; none of them were ever distinguished as savants. They looked\non the new knowledge much as Swift looked on it two thousand years\nafterwards. It was, they thought, a miserable trifling waste of time,\nnot productive of any practical good, breeding conceit in young men,\nand quite unworthy of receiving any attention from orators, soldiers,\nand statesmen. Pericles, indeed, thought differently, but Pericles was\nas much beyond his age when he talked about Nature with Anaxagoras as\nwhen he charged Aspasia with the government of his household and the\nentertainment of his guests.\n\nThese reflections are offered, not in excuse but in explanation of\nAthenian intolerance, a phenomenon for the rest unparalleled in ancient\nGreece. We cannot say that men were then, or ever have been, logically\nobliged to choose between atheism and superstition. If instead of using\nNous as a half-contemptuous nickname for the Clazomenian stranger,[D]\nhis contemporaries had taken the trouble to understand what Nous really\nmeant, they might have found in it the possibility of a deep religious\nsignificance; they might have identified it with all that was best\nand purest in their own guardian goddess Athênê; have recognised it\nas the very foundation of their own most characteristic excellences.\nBut vast spiritual revolutions are not so easily accomplished; and\nwhen, before the lapse of many years, Nous was again presented to the\nAthenian people, this time actually personified as an Athenian citizen,\nit was again misunderstood, again rejected, and became the occasion for\na display of the same persecuting spirit, unhappily pushed to a more\nfatal extreme.\n\nUnder such unfavourable auspices did philosophy find a home in Athens.\nThe great maritime capital had drawn to itself every other species\nof intellectual eminence, and this could not fail to follow with the\nrest. But philosophy, although hitherto identified with mathematical\nand physical science, held unexhausted possibilities of development in\nreserve. According to a well-known legend, Thales once fell into a tank\nwhile absorbed in gazing at the stars. An old woman advised him to look\nat the tank in future, for there he would see the water and the stars\nas well. Others after him had got into similar difficulties, and might\nseek to evade them by a similar artifice. While busied with the study\nof cosmic evolution, they had stumbled unawares on some perplexing\nmental problems. Why do the senses suggest beliefs so much at variance\nwith those arrived at by abstract reasoning? Why should reason be more\ntrustworthy than sense? Why are the foremost Hellenic thinkers so\nhopelessly disagreed? What is the criterion of truth? Of what use are\nconclusions which cannot command universal assent? Or, granting that\ntruth is discoverable, how can it be communicated to others? Such were\nsome of the questions now beginning urgently to press for a solution.\n‘I sought for myself,’ said Heracleitus in his oracular style. His\nsuccessors had to do even more—to seek not only for themselves but for\nothers; to study the beliefs, habits, and aptitudes of their hearers\nwith profound sagacity, in order to win admission for the lessons they\nwere striving to impart. And when a systematic investigation of human\nnature had once begun, it could not stop short with a mere analysis\nof the intellectual faculties; what a man did was after all so very\nmuch more important than what he knew, was, in truth, that which alone\ngave his knowledge any practical value whatever. Moral distinctions,\ntoo, were beginning to grow uncertain. When every other traditional\nbelief had been shaken to its foundations, when men were taught to\ndoubt the evidence of their own senses, it was not to be expected that\nthe conventional laws of conduct, at no time very exact or consistent,\nwould continue to be accepted on the authority of ancient usage.\nThus, every kind of determining influences, internal and external,\nconspired to divert philosophy from the path which it had hitherto\npursued, and to change it from an objective, theoretical study into an\nintrospective, dialectic, practical discipline.\n\n\nVI.\n\nAnd now, looking back at the whole course of early Greek thought,\npresenting as it does a gradual development and an organic unity\nwhich prove it to be truly a native growth, a spontaneous product\nof the Greek mind, let us take one step further and enquire whether\nbefore the birth of pure speculation, or parallel with but apart from\nits rudimentary efforts, there were not certain tendencies displayed\nin the other great departments of intellectual activity, fixed forms\nas it were in which the Hellenic genius was compelled to work, which\nreproduce themselves in philosophy and determine its distinguishing\ncharacteristics. Although the materials for a complete Greek ethology\nare no longer extant, it can be shown that such tendencies did actually\nexist.\n\nIt is a familiar fact, first brought to light by Lessing, and\ngeneralised by him into a law of all good literary composition, that\nHomer always throws his descriptions into a narrative form. We are not\ntold what a hero wore, but how he put on his armour; when attention is\ndrawn to a particular object we are made acquainted with its origin\nand past history; even the reliefs on a shield are invested with life\nand movement. Homer was not impelled to adopt this method either by\nconscious reflection or by a profound poetic instinct. At a certain\nstage of intellectual development, every Greek would find it far easier\nto arrange the data of experience in successive than in contemporaneous\norder; the one is fixed, the other admits of indefinite variation.\nPictorial and plastic art also begin with serial presentations, and\nonly arrive at the construction of large centralised groups much later\non. We have next to observe that, while Greek reflection at first\nfollowed the order of time, it turned by preference not to present or\nfuture, but to past time. Nothing in Hellenic literature reminds us of\nHebrew prophecy. To a Greek all distinct prevision was merged in the\ngloom of coming death or the glory of anticipated fame. Of course, at\nevery great crisis of the national fortunes much curiosity prevailed\namong the vulgar as to what course events would take; but it was\nsedulously discouraged by the noblest minds. Herodotus and Sophocles\nlook on even divine predictions as purposely ambiguous and misleading.\nPindar often dwells on the hopeless uncertainty of life.[35] Thucydides\ntreats all vaticination as utterly delusive. So, when a belief in\nthe soul’s separate existence first obtained acceptance among the\nGreeks, it interested them far less as a pledge of never-ending life\nand progress hereafter, than as involving a possible revelation of\npast history, of the wondrous adventures which each individual had\npassed through before assuming his present form. Hence the peculiar\nforce of Pindar’s congratulation to the partaker in the Eleusinian\nmysteries; after death he knows not only ‘the end of life,’ but also\n‘its god-given beginning.’[36] Even the present was not intelligible\nuntil it had been projected back into the past, or interpreted by the\nlight of some ancient tale. Sappho, in her famous ode to Aphroditê,\nrecalls the incidents of a former passion precisely similar to the\nunrequited love which now agitates her heart, and describes at length\nhow the goddess then came to her relief as she is now implored to come\nagain. Modern critics have spoken of this curious literary artifice as\na sign of delicacy and reserve. We may be sure that Sappho was an utter\nstranger to such feelings; she ran her thoughts into a predetermined\nmould just as a bee builds its wax into hexagonal cells. Curtius,\nthe German historian, has surmised with much plausibility that the\nentire legend of Troy owes its origin to this habit of throwing back\ncontemporary events into a distant past. According to his view, the\ncharacters and scenes recorded by Homer, although unhistorical as\nthey now stand, had really a place in the Achaean colonisation of\nAsia Minor.[37] But, apart from any disguised allusions, old stories\nhad an inexhaustible charm for the Greek imagination. Even during the\nstirring events of the Peloponnesian war, elderly Athenian citizens\nin their hours of relaxation talked of nothing but mythology.[38] When\na knowledge of reading became universally diffused, and books could\nbe had at a moderate price, ancient legends seem to have been the\nfavourite literature of the lower classes, just as among ourselves in\nCaxton’s time. Still more must the same taste have prevailed a century\nearlier. A student who opens Pindar’s epinician odes for the first\ntime is surprised to find so little about the victorious combatants\nand the struggles in which they took part, so much about mythical\nadventures seemingly unconnected with the ostensible subject of the\npoem. Furthermore, we find that genealogies were the framework by which\nthese distant recollections were held together. Most noble families\ntraced their descent back to a god or to a god-like hero. The entire\ninterval separating the historical period from the heroic age was\nfilled up with more or less fictitious pedigrees. A man’s ancestry\nwas much the most important part of his biography. It is likely that\nHerodotus had just as enthusiastic an admiration as we can have for\nLeonidas. Yet one fancies that a historian of later date would have\nshown his appreciation of the Spartan king in a rather different\nfashion. We should have been told something about the hero’s personal\nappearance, and perhaps some characteristic incidents from his earlier\ncareer would have been related. Not so with Herodotus. He pauses in\nthe story of Thermopylae to give us the genealogy of Leonidas up to\nHeraclês; no more and no less. That was the highest compliment he could\npay, and it is repeated for Pausanias, the victor of Plataea.[39] The\ngenealogical method was capable of wide extension, and could be applied\nto other than human or animal relationships. Hesiod’s Theogony is a\ngenealogy of heaven and earth, and all that in them is. According to\nAeschylus, gain is bred from gain, slaughter from slaughter, woe from\nwoe. Insolence bears a child like unto herself, and this in turn gives\nbirth to a still more fatal progeny.[40] The same poet terminates his\nenumeration of the flaming signals that sped the message of victory\nfrom Troy to Argos, by describing the last beacon as ‘not ungrandsired\nby the Idaean fire.’[41] Now, when the Greek genius had begun to move\nin any direction, it rushed forward without pausing until arrested by\nan impassable limit, and then turned back to retraverse at leisure\nthe whole interval separating that limit from its point of departure.\nThus, the ascending lines of ancestry were followed up until they led\nto a common father of all; every series of outrages was traced through\nsuccessive reprisals back to an initial crime; and more generally every\nevent was affiliated to a preceding event, until the whole chain had\nbeen attached to an ultimate self-existing cause. Hence the records\nof origination, invention, spontaneity were long sought after with\nan eagerness which threw almost every other interest into the shade.\n‘Glory be to the inventor,’ sings Pindar, in his address to victorious\nCorinth; ‘whence came the graces of the dithyrambic hymn, who first\nset the double eagle on the temples of the gods?’[42] The _Prometheus_\nof Aeschylus tells how civilisation began, and the trilogy to which it\nbelongs was probably intended to show how the supremacy of Zeus was\nfirst established and secured. A great part of the _Agamemnon_ deals\nwith events long anterior to the opening of the drama, but connected\nas ultimate causes with the terrible catastrophe which it represents.\nIn the _Eumenides_ we see how the family, as it now exists, was first\nconstituted by the substitution of paternal for maternal headship, and\nalso how the worship of the Avenging Goddesses was first introduced\ninto Athens, as well as how the Areopagite tribunal was founded. It\nis very probable that Sophocles’s earliest work, the _Triptolemus_,\nrepresented the origin of agriculture under a dramatic form; and if\nthe same poet’s later pieces, as well as all those of Euripides,\nstand on quite different ground, occupied as they are with subjects of\ncontemporaneous, or rather of eternal interest, we must regard this\nas a proof that the whole current of Greek thought had taken a new\ndirection, corresponding to that simultaneously impressed on philosophy\nby Socrates and the Sophists. We may note further that the Aeginetan\nsculptures, executed soon after Salamis, though evidently intended to\ncommemorate that victory, represent a conflict waged long before by\nthe tutelary heroes of Aegina against an Asiatic foe. We may also see\nin our own British Museum how the birth of Athênê was recorded in a\nmarble group on one pediment of the Parthenon, and the foundation of\nher chosen city on the other. The very temple which these majestic\nsculptures once adorned was a petrified memorial of antiquity, and,\nby the mere form of its architecture, must have carried back men’s\nthoughts to the earliest Hellenic habitation, the simple structure in\nwhich a gabled roof was supported by cross-beams on a row of upright\nwooden posts.\n\nTurning back once more from art and literature to philosophy, is\nit not abundantly clear that if the Greeks speculated at all, they\nmust at first have speculated according to some such method as that\nwhich history proves them to have actually followed? They must have\nbegun by fixing their thoughts, as Thales and his successors did, on\nthe world’s remotest past; they must have sought for a first cause\nof things, and conceived it, not as any spiritual power, but as a\nkind of natural ancestor homogeneous with the forms which issued\nfrom it, although greater and more comprehensive than they were; in\nshort, as an elemental body—water, air, fire, or, more vaguely, as\nan infinite substance. Did not the steady concatenation of cause and\neffect resemble the unrolling of a heroic genealogy? And did not the\nreabsorption of every individual existence in a larger whole translate\ninto more general terms that subordination of personal to family and\ncivic glory which is the diapason of Pindar’s music?\n\nNor was this all. Before philosophising, the Greeks did not think only\nin the order of time; they learned at a very early period to think\nalso in the order of space, their favourite idea of a limit being\nmade especially prominent here. Homer’s geographical notions, however\nerroneous, are, for his age, singularly well defined. Aeschylus has a\nwide knowledge of the earth’s surface, and exhibits it with perhaps\nunnecessary readiness. Pindar delights to follow his mythological\nheroes about on their travels. The same tendency found still freer\nscope when prose literature began. Hecataeus, one of the earliest\nprose-writers, was great both as a genealogist and as a geographer;\nand in this respect also Herodotus carried out on a great scale the\nenquiries most habitually pursued by his countrymen. Now, it will be\nremembered that we have had occasion to characterise early Ionian\nspeculation as being, to a great extent, cosmography. The element from\nwhich it deduced all things was, in fact, that which was supposed to\nlie outside and embrace the rest. The geographical limit was conceived\nas a genealogical ancestor. Thus, the studies which men like Hecataeus\ncarried on separately, were combined, or rather confused, in a single\nbold generalisation by Anaximenes and Heracleitus.\n\nYet, however much may be accounted for by these considerations, they\nstill leave something unexplained. Why should one thinker after\nanother so unhesitatingly assume that the order of Nature as we know\nit has issued not merely from a different but from an exactly opposite\ncondition, from universal confusion and chaos? Their experience was\nfar too limited to tell them anything about those vast cosmic changes\nwhich we know by incontrovertible evidence to have already occurred,\nand to be again in course of preparation. We can only answer this\nquestion by bringing into view what may be called the negative moment\nof Greek thought. The science of contraries is one, says Aristotle, and\nit certainly was so to his countrymen. Not only did they delight to\nbring together the extremes of weal and woe, of pride and abasement,\nof security and disaster, but whatever they most loved and clung to in\nreality seemed to interest their imagination most powerfully by its\nremoval, its reversal, or its overthrow. The Athenians were peculiarly\nintolerant of regal government and of feminine interference in\npolitics. In Athenian tragedy the principal actors are kings and royal\nladies. The Athenian matrons occupied a position of exceptional dignity\nand seclusion. They are brought upon the comic stage to be covered with\nthe coarsest ridicule, and also to interfere decisively in the conduct\nof public affairs. Aristophanes was profoundly religious himself, and\nwrote for a people whose religion, as we have seen, was pushed to\nthe extreme of bigotry. Yet he shows as little respect for the gods\nas for the wives and sisters of his audience. To take a more general\nexample still, the whole Greek tragic drama is based on the idea of\nfamily kinship, and that institution was made most interesting to Greek\nspectators by the violation of its eternal sanctities, by unnatural\nhatred, and still more unnatural love; or by a fatal misconception\nwhich causes the hands of innocent persons, more especially of tender\nwomen, to be armed against their nearest and dearest relatives in\nutter unconsciousness of the awful guilt about to be incurred. By an\nextension of the same psychological law to abstract speculation we are\nenabled to understand how an early Greek philosopher who had come to\nlook on Nature as a cosmos, an orderly whole, consisting of diverse but\nconnected and interdependent parts, could not properly grasp such a\nconception until he had substituted for it one of a precisely opposite\ncharacter, out of which he reconstructed it by a process of gradual\nevolution. And if it is asked how in the first place did he come by the\nidea of a cosmos, our answer must be that he found it in Greek life,\nin societies distinguished by a many-sided but harmonious development\nof concurrent functions, and by voluntary obedience to an impersonal\nlaw. Thus, then, the circle is complete; we have returned to our point\nof departure, and again recognise in Greek philosophy a systematised\nexpression of the Greek national genius.\n\nWe must now bring this long and complicated, but it is hoped not\nuninteresting, study to a close. We have accompanied philosophy to a\npoint where it enters on a new field, and embraces themes sufficiently\nimportant to form the subject of a separate chapter. The contributions\nmade by its first cultivators to our positive knowledge have already\nbeen summarised. It remains to mention that there was nothing of a\ntruly transcendental character about their speculations. Whatever\nextension we may give to that terrible bugbear, the Unknowable, they\ndid not trespass on its domain. Heracleitus and his compeers, while\npenetrating far beyond the horizon of their age and country, kept very\nnearly within the limits of a possible experience. They confused some\nconceptions which we have learned to distinguish, and separated others\nwhich we have learned to combine; but they were the lineal progenitors\nof our highest scientific thought; and they first broke ground on a\npath where we must continue to advance, if the cosmos which they won\nfor us is not to be let lapse into chaos and darkness again.\n\nFOOTNOTES:\n\n[5] Plato, _Rep._ IV., 435, E; Aristotle, _Pol._ VII., 1327, b., 29.\n\n[6] _Nem._ III. 40-42. (Donaldson.)\n\n[7] _Nem._ VI. _sub in._\n\n[8] The word differentiation (ἑτεροίωσις) seems to have been first used\nby Diogenes Apolloniates. Simpl. _Phys._ fol. 326 ff., quoted by Ritter\nand Preller, _Hist. Phil._, p. 126 (6th ed.)\n\n[9] Ritter and Preller, p. 112.\n\n[10] Ritter and Preller p. 8.\n\n[11] _Die Philosophie der Griechen_, I. p. 401 (3rd ed.)\n\n[12] Ritter and Preller, p. 54.\n\n[13] Ritter and Preller, p. 54.\n\n[14] _Ib._\n\n[15] _Metaph._ I. v.\n\n[16] Ritter and Preller, p. 63.\n\n[17] _Op. cit._ p. 475.\n\n[18] The tendency which it has been attempted to characterise as a\nfundamental moment of Greek thought can only be called analytical in\ndefault of a better word. It is a process by which two related terms\nare at once parted and joined together by the insertion of one or\nmore intermediary links; as, for instance, when a capital is inserted\nbetween column and architrave, or when a proposition is demonstrated by\nthe interposition of a middle term between its subject and predicate.\nThe German words Vermitteln and Vermittelung express what is meant with\nsufficient exactitude. They play a great part in Hegel’s philosophy,\nand it will be remembered that Hegel was the most Hellenic of modern\nthinkers. So understood, there will cease to be any contradiction\nbetween the Eleates and Greek thought generally, at least from one\npoint of view, as their object was to fill up the vacant spaces\nsupposed to separate one mode of existence from another.\n\n[19] Ritter and Preller, p. 62.\n\n[20] For the originals of this and the succeeding quotations from\nHeracleitus, see Ritter and Preller, pp. 14-23.\n\n[21] Τῇ μὲν ἡλικίᾳ πρότερος ὢν, τοῖς δ’ ἔργοις ὕστερος. _Metaph._ I.\niii.\n\n[22] Ritter and Preller, p. 90.\n\n[23] Prantl, _Aristoteles’ Physik_, p. 484.\n\n[24] Ritter and Preller, p. 11.\n\n[25] Since the above remarks were first published, Mr. Wallace, in\nhis work on Epicureanism, has stated that, according to Epicurus,\n‘the very animals which are found upon the earth have been made what\nthey are by slow processes of selection and adaptation through the\nexperience of life;’ and he proceeds to call the theory in question,\n‘ultra-Darwinian’ (_Epicureanism_, p. 114). Lucretius—the authority\nquoted—says nothing about ‘slow processes of adaptation,’ nor yet does\nhe say that the animals were ‘made what they are’ by ‘selection,’ but\nby the procreative power of the earth herself. Picking out a ready-made\npair of boots from among a number which do not fit is a very different\nprocess from manufacturing the same pair by measure, or wearing it into\nshape. To call the Empedoclean theory ultra-Darwinian, is like calling\nthe Democritean or Epicurean theory of gravitation ultra-Newtonian. And\nMr. Wallace seems to admit as much, when he proceeds to say on the very\nsame page, ‘Of course in this there is no implication of the peculiarly\nDarwinian doctrine of descent or development of kind from kind with\nstructure modified and complicated to meet changing circumstances.’\n(By the way, this is _not_ a peculiarly Darwinian doctrine, for it\noriginated with Lamarck, spontaneous variation and selection being the\nadditions made by the English naturalists). But what becomes then of\nthe ‘slow processes of adaptation’ and the ‘ultra-Darwinian theory’\nspoken of just before?\n\n[26] By a curious coincidence, the atomic constitution of matter still\nfinds its strongest proof in optical phenomena. Light is propagated by\ntransverse waves, and such waves are only possible in a discontinuous\nmedium. But if the luminiferous ether is composed of discrete\nparticles, so also must be the matter which it penetrates in all\ndirections.\n\n[27] Ar. _De Gen. et Corr._, I., viii., 325, b, 5.\n\n[28] Eurip. _Frag. Incert. Fab._, CXXXVI. Didot, p. 850. [I am indebted\nfor this version to Miss A. M. F. Robinson, the translator of the\n_Crowned Hippolytus_.]\n\n[29] Curtius, _Griechische Geschichte_, 342-5 (3rd ed.).\n\n[30] Zeller, _op. cit._, p. 791.\n\n[31] Ar. _De Coelo_, III., iii., 302, a, 28.\n\n[32] M. Antoninus, XII., 28.\n\n[33] Zeller, _Ph. d. Gr._, III., b, p. 669.\n\n[34] Even regulating the calendar by the sun instead of by the moon\nseems to have been regarded as a dangerous and impious innovation by\nthe more conservative Athenians—at least judging from the half-serious\npleasantry of Aristophanes, _Nub._, 608-26. (Dindorf.)\n\n[35] σύμβολον δ’ οὔ πώ τις ἐπιχθονίων\n     πιστὸν ἀμφὶ πράξιος ἐσσομένας εὗρεν θεόθεν.—_Ol._, XII., 8-9.\n\n[36] _Frag._, 102.\n\n[37] _Griechische Geschichte_, ii., 112-3 (3rd ed.).\n\n[38] Aristophanes, _Vesp._, 1176.\n\n[39] Herod., VII., 204; IX., 64.\n\n[40] _Agam._, 750-71.\n\n[41] _Ib._, 311.\n\n[42] _Ol._, XIII., 17 (Donaldson).\n\n\n\n\nCHAPTER II.\n\nTHE GREEK HUMANISTS: NATURE AND LAW.\n\n\nI.\n\nIn the preceding chapter we traced the rise and progress of physical\nphilosophy among the ancient Greeks. We showed how a few great\nthinkers, borne on by an unparalleled development of intellectual\nactivity, worked out ideas respecting the order of nature and the\nconstitution of matter which, after more than two thousand years, still\nremain as fresh and fruitful as ever; and we found that, in achieving\nthese results, Greek thought was itself determined by ascertainable\nlaws. Whether controlling artistic imagination or penetrating to the\nobjective truth of things, it remained always essentially homogeneous,\nand worked under the same forms of circumscription, analysis, and\nopposition. It began with external nature, and with a far distant past;\nnor could it begin otherwise, for only so could the subjects of its\nlater meditations be reached. Only after less sacred beliefs have been\nshaken can ethical dogmas be questioned. Only when discrepancies of\nopinion obtrude themselves on man’s notice is the need of an organising\nlogic experienced. And the mind’s eye, originally focussed for distant\nobjects alone, has to be gradually restricted in its range by the\npressure of accumulated experience before it can turn from past to\npresent, from successive to contemporaneous phenomena. We have now to\nundertake the not less interesting task of showing how the new culture,\nthe new conceptions, the new power to think obtained through those\nearliest speculations, reacted on the life from which they sprang,\ntransforming the moral, religious, and political creeds of Hellas, and\npreparing, as nothing else could prepare, the vaster revolution which\nhas given a new dignity to existence, and substituted, in however\nimperfect a form, for the adoration of animalisms which lie below man,\nthe adoration of an ideal which rises above him, but only personifies\nthe best elements of his own nature, and therefore is possible for a\nperfected humanity to realise.\n\nWhile most educated persons will admit that the Greeks are our masters\nin science and literature, in politics and art, some even among those\nwho are free from theological prejudices will not be prepared to grant\nthat the principles which claim to guide our conduct are only a wider\nextension or a more specific application of Greek ethical teaching.\nHebraism has been opposed to Hellenism as the educating power whence\nour love of righteousness is derived, and which alone prevents the\nfoul orgies of a primitive nature-worship from being still celebrated\nin the midst of our modern civilisation. And many look on old Roman\nreligion as embodying a sense of duty higher than any bequeathed\nto us by Greece. The Greeks have, indeed, suffered seriously from\ntheir own sincerity. Their literature is a perfect image of their\nlife, reflecting every blot and every flaw, unveiled, uncoloured,\nundisguised. It was, most fortunately, never subjected to the revision\nof a jealous priesthood, bent on removing every symptom inconsistent\nwith the hypothesis of a domination exercised by themselves through\nall the past. Nor yet has their history been systematically falsified\nto prove that they never wrongfully attacked a neighbour, and were\ninvariably obliged to conquer in self-defence. Still, even taking\nthe records as they stand, it is to Greek rather than to Hebrew or\nRoman annals that we must look for examples of true virtue; and in\nGreek literature, earlier than in any other, occur precepts like\nthose which are now held to be most distinctively characteristic of\nChristian ethics. Let us never forget that only by Stoical teaching\nwas the narrow and cruel formalism of ancient Roman law elevated into\nthe ‘written reason’ of the imperial jurists; only after receiving\nsuccessive infiltrations of Greek thought was the ethnic monotheism of\nJudaea expanded into a cosmopolitan religion. Our popular theologians\nare ready enough to admit that Hellenism was providentially the means\nof giving Christianity a world-wide diffusion; they ignore the fact\nthat it gave the new faith not only wings to fly, but also eyes to\nsee and a soul to love. From very early times there was an intuition\nof humanity in Hellas which only needed dialectical development to\nbecome an all-sufficient law of life. Homer sympathises ardently with\nhis own countrymen, but he never vilifies their enemies. He did not,\nnor did any Greek, invent impure legends to account for the origin of\nhostile tribes whose kinship could not be disowned; unlike Samuel, he\nregards the sacrifice of prisoners with unmixed abhorrence. What would\nhe, whose Odysseus will not allow a shout of triumph to be raised\nover the fallen, have said to Deborah’s exultation at the murder of a\nsuppliant fugitive? Courage was, indeed, with him the highest virtue,\nand Greek literature abounds in martial spirit-stirring tones, but\nit is nearly always by the necessities of self-defence that this\nenthusiasm is invoked; with Pindar and Simonides, with Aeschylus and\nSophocles, it is resistance to an invader that we find so proudly\ncommemorated; and the victories which make Greek history so glorious\nwere won in fighting to repel an unjust aggression perpetrated either\nby the barbarians or by a tyrant state among the Greeks themselves.\nThere was, as will be shown hereafter, an unhappy period when right was\neither denied, or, what comes to the same thing, identified with might;\nbut this offensive paradox only served to waken true morality into a\nmore vivid self-consciousness, and into the felt need of discovering\nfor itself a stronger foundation than usage and tradition, a loftier\nsanction than mere worldly success could afford. The most universal\nprinciple of justice, to treat others as we should wish to be treated\nourselves, seems before the Rabbi Hillel’s time to have become almost\na common-place of Greek ethics;[43] difficulties left unsolved by the\nBook of Job were raised to a higher level by Greek philosophy; and long\nbefore St. Paul, a Plato reasoned of righteousness, temperance, and\njudgment to come.\n\nNo one will deny that the life of the Greeks was stained with foul\nvices, and that their theory sometimes fell to the level of their\npractice. No one who believes that moral truth, like all truth, has\nbeen gradually discovered, will wonder at this phenomenon. If moral\nconduct is a function of social life, then, like other functions, it\nwill be subject, not only to growth, but also to disease and decay. An\nintense and rapid intellectual development may have for its condition\na totally abnormal state of society, where certain vices, unknown to\nruder ages, spring up and flourish with rank luxuriance. When men have\nto take women along with them on every new path of enquiry, progress\nwill be considerably retarded, although its benefits will ultimately\nbe shared among a greater number, and will be better insured against\nthe danger of a violent reaction. But the work that Hellas was\ncommissioned to perform could not wait; it had to be accomplished in\na few generations, or not at all. The barbarians were forcing their\nway in on every side, not merely with the weight of invading armies,\nbut with the deadlier pressure of a benumbing superstition, with the\nbrute-worship of Egypt and the devil-worship of Phoenicia, with their\ndelirious orgies, their mutilations, their crucifixions, and their\ngladiatorial contests. Already in the later dramas of Euripides and\nin the Rhodian school of sculpture, we see the awful shadow coming\nnearer, and feel the poisonous breath of Asia on our faces. Reason,\nthe reason by which these terrors have been for ever exorcised, could\nonly arrive at maturity under the influence of free and uninterrupted\ndiscussion carried on by men among themselves in the gymnasium, the\nagora, the ecclêsia, and the dicastery. The resulting and inevitable\nseparation of the sexes bred frightful disorders, which through all\nchanges of creed have clung like a moral pestilence to the shores of\nthe Aegean, and have helped to complicate political problems by joining\nto religious hatred the fiercer animosity of physical disgust. But\nwhatever were the corruptions of Greek sentiment, Greek philosophy had\nthe power to purge them away. ‘Follow nature’ became the watchword\nof one school after another; and a precept which at first may have\nmeant only that man should not fall below the brutes, was finally\nso interpreted as to imply an absolute control of sense by reason.\nNo loftier standard of sexual purity has ever been inculcated than\nthat fixed by Plato in his latest work, the _Laws_. Isocrates bids\nhusbands set an example of conjugal fidelity to their wives. Socrates\nhad already declared that virtue was the same for both sexes. Xenophon\ninterests himself in the education of women. Plato would give them the\nsame training, and everywhere associate them in the same functions with\nmen. Equally decisive evidence of a theoretical opposition to slavery\nis not forthcoming, and we know that it was unfortunately sanctioned by\nPlato and Aristotle, in this respect no better inspired than the early\nChristians; nevertheless, the germ of such an opposition existed, and\nwill hereafter be pointed out.\n\nIt has been said that the Greeks only worshipped beauty; that they\ncultivated morality from the aesthetic side; that virtue was with\nthem a question, not of duty, but of taste. Some very strong texts\nmight be quoted in support of this judgment. For example, we find\nIsocrates saying, in his encomium on Helen, that ‘Beauty is the first\nof all things in majesty, and honour, and divineness. It is easy to\nsee its power: there are many things which have no share of courage,\nor wisdom, or justice, which yet will be found honoured above things\nwhich have each of these, but nothing which is devoid of beauty is\nprized; all things are scorned which have not been given their part of\nthat attribute; the admiration for virtue itself comes to this, that\nof all manifestations of life virtue is the most _beautiful_.’[44] And\nAristotle distinguishes the highest courage as willingness to die for\nthe καλόν. So also Plato describes philosophy as a love ‘that leads\none from fair forms to fair practices, and from fair practices to fair\nnotions, until from fair notions he arrives at the notion of absolute\nbeauty, and at last knows what the essence of beauty is. And this is\nthat life beyond all others which man should live in the contemplation\nof beauty absolute.’[45] Now, first of all, we must observe that, while\nloveliness has been worshipped by many others, none have conceived\nit under a form so worthy of worship as the Greeks. Beauty with them\nwas neither little, nor fragile, nor voluptuous; the soul’s energies\nwere not relaxed but exalted by its contemplation; there was in it an\nelement of austere and commanding dignity. The Argive Hêrê, though\nrevealed to us only through a softened Italian copy, has more divinity\nin her countenance than any Madonna of them all; and the Melian\nAphroditê is distinguished by majesty of form not less than by purity\nand sweetness of expression. This beauty was the unreserved information\nof matter by mind, the visible rendering of absolute power, wisdom,\nand goodness. Therefore, what a Greek worshipped was the perpetual\nand ever-present energising of mind; but he forgot that beauty can\nonly exist as a combination of spirit with sense; and, after detaching\nthe higher element, he continued to call it by names and clothe it\nin attributes proper to its earthly manifestations alone. Yet such\nan extension of the aesthetic sentiment involved no weakening of the\nmoral fibre. A service comprehending all idealisms in one demanded the\nself-effacement of a laborious preparation and the self-restraint of\na gradual achievement. They who pitched the goal of their aspiration\nso high, knew that the paths leading up to it were rough, and steep,\nand long; they felt that perfect workmanship and perfect taste, being\nsupremely precious, must be supremely difficult as well; χαλεπὰ τὰ\nκαλά they said, the beautiful is hard—hard to judge, hard to win,\nand hard to keep. He who has passed through that stern discipline\nneed tremble at no other task; nor has duty anything to fear from a\ncompanionship whose ultimate requirements are coincident with her own,\nand the abandonment of which for a joyless asceticism can only lead to\nthe reappearance as an invading army of forces that should have been\ncherished as indispensable allies.\n\nIt may be urged that beauty, however difficult of attainment or severe\nin form, is, after all, essentially superficial; and that a morality\nelaborated on the same principles will be equally superficial—will,\nin fact, be little more than the art of keeping up appearances, of\ndisplaying fine sentiments, of avoiding those actions the consequences\nof which are immediately felt to be disagreeable, and, above all, of\nnot needlessly wounding anyone’s sensibilities. Such an imitation of\nmorality—which it would be a mistake to call hypocrisy—has no doubt\nbeen common enough among all civilised nations; but there is no reason\nto believe that it was in any way favoured by the circumstances of\nGreek life. There is even evidence of a contrary tendency, as, indeed,\nmight be expected among a people whose most important states were saved\nfrom the corrupting influences of a court. Where the sympathetic\nadmiration of shallow and excitable spectators is the effect chiefly\nsought after, the showy virtues will be preferred to the solid, and the\nappearance to the reality of all virtue; while brilliant and popular\nqualities will be allowed to atone for the most atrocious crimes.\nBut, among the Greeks of the best period, courage and generosity rank\ndistinctly lower than temperance and justice; their poets and moralists\nalike inculcate the preference of substance to show; and in no single\ninstance, so far as we can judge, did they, as modern nations often do,\nfor the sake of great achievements condone great wrongs. It was said of\na Greek and by a Greek that he did not wish to seem but to be just.[46]\nWe follow the judgment of the Greeks themselves in preferring Leonidas\nto Pausanias, Aristeides to Themistocles, and Socrates to Alcibiades.\nAnd we need only compare Epameinondas with David or Pericles with\nSolomon as national heroes, to perceive at once how much nearer the two\nGreeks come to our own standard of perfection, and how futile are the\ncharges sometimes brought against those from whose traditions we have\ninherited their august and stainless fame.\n\nMoreover, we have not here to consider what was the average level\nof sentiment and practice among the Greeks; we have to study what\nalone was of importance for the races which came under their tuition,\nand that is the highest moral judgment to which they rose. Now, the\ndeliberate verdict of their philosophy on the relation between beauty\nand virtue is contained in the following passage from Plato’s _Laws_:—\n\n ‘When anyone prefers beauty to virtue, what is this but the real and\n utter dishonour of the soul? For such a preference implies that the\n body is more honourable than the soul; and this is false, for there is\n nothing of earthly birth which is more honourable than the heavenly,\n and he who thinks otherwise of the soul has no idea how greatly he\n undervalues this wonderful possession.’[47]\n\n\nII.\n\nThus much for the current prejudices which seemed likely to interfere\nwith a favourable consideration of our subject. We have next to study\nthe conditions by which the form of Greek ethical philosophy was\noriginally determined. Foremost among these must be placed the moral\nconceptions already current long before systematic reflection could\nbegin. What they were may be partly gathered from some wise saws\nattributed by the Greeks themselves to their Seven Sages, but probably\ncurrent at a much earlier period. The pith of these maxims, taken\ncollectively, is to recommend the qualities attributed by our own\nphilosophic poet to his perfect woman:—\n\n    ‘The reason firm, the temperate will,\n    Endurance, foresight, strength, and skill.’\n\nWe may say almost as briefly that they inculcate complete independence\nboth of our own passions and of external circumstances, with a\ncorresponding respect for the independence of others, to be shown by\nusing persuasion instead of force. Their tone will perhaps be best\nunderstood by contrast with that collection of Hebrew proverbs which\nhas come down to us under the name of Solomon, but which Biblical\ncritics now attribute to a later period and a divided authorship. While\nthese regularly put forward material prosperity as the chief motive to\ngood conduct, Hellenic wisdom teaches indifference to the variations of\nfortune. To a Greek, ‘the power that makes for righteousness,’ so far\nfrom being, ‘not ourselves,’ was our own truest self, the far-seeing\nreason which should guard us from elation and from depression, from\npassion and from surprise. Instead of being offered old age as a\nreward, we are told to be equally prepared for a long and for a short\nlife.\n\nTwo precepts stand out before all others, which, trivial as they\nmay seem, are uttered from the very soul of Greek experience, ‘Be\nmoderate,’ and, ‘Know thyself.’ Their joint observance constitutes the\ncharacteristic virtue of Sôphrosynê, which means all that we understand\nby temperance, and a great deal more besides; so much, in fact, that\nvery clever Greeks were hard set to define it, and very wise Greeks\ncould pray for it as the fairest gift of the gods.[48] Let us suppose\nthat each individual has a sphere of activity marked out for him by\nhis own nature and his special environment; then to discern clearly\nthe limits of that sphere and to keep within them would be Sôphrosynê,\nwhile the discernment, taken alone, would be wisdom. The same\nself-restraint operating as a check on interference with other spheres\nwould be justice; while the expansive force by which a man fills up\nhis entire sphere and guards it against aggressions may be called\ncourage. Thus we are enabled to comprehend the many-sided significance\nof Sôphrosynê, to see how it could stand both for a particular virtue\nand for all virtuousness whatever. We need only glance at Homer’s\npoems, and in particular at the _Iliad_—a much deeper as well as a\nmore brilliant work than the _Odyssey_—to perceive how very early this\ndemand for moderation combined with self-knowledge had embodied itself\nin Greek thought. Agamemnon violates the rights of Achilles under the\ninfluence of immoderate passion, and through ignorance of how little\nwe can accomplish without the hero’s assistance. Achilles, again,\ncarries his vindictiveness too far, and suffers in consequence. But\nhis self-knowledge is absolutely perfect; conscious that he is first\nin the field while others are better in council, he never undertakes\na task to which his powers are not fully adequate; nor does he enter\non his final work of vengeance without a clear consciousness of the\nspeedy death which its completion will entail on himself. Hector,\ntoo, notwithstanding ominous forebodings, knows his duty and does it,\nbut with much less just an estimate of his own powers, leading him to\npursue his success too far, and then, when the tide has turned, not\npermitting him to make a timely retreat within the walls of Troy. So\nwith the secondary characters. Patroclus also oversteps the limits\nof moderation, and pays the penalty with his life. Diomed silently\nbears the unmerited rebuke of Agamemnon, but afterwards recalls it at\na most effective moment, when rising to oppose the craven counsels\nof the great king. This the Greeks called observing opportunity,\nand opportunism was with them, as with French politicians, a form\nof moderation.[49] Down at the very bottom of the scale Thersites\nand Dolon are signal examples of men who do not know their sphere\nand suffer for their folly. In the _Odyssey_, Odysseus is a nearly\nperfect type of wisdom joined with self-control, erring, if we remember\nrightly, only once, when he insults Polyphemus before the ship is out\nof danger; while his comrades perish from want of these same gifts.\n\nSo far, virtue was with the Greeks what it must inevitably be with\nall men at first, chiefly self-regarding, a refined form of prudence.\nMoreover, other-regarding virtues gave less scope for reflection, being\noriginally comprehended under obedience to the law. But there were\ntwo circumstances which could not long escape their notice; first,\nthat fraud and violence are often, at least apparently, profitable to\nthose who perpetrate them, a fact bitterly remarked by Hesiod;[50]\nand secondly, that society cannot hold together without justice.\nIt was long before Governments grew up willing and able to protect\ntheir subjects from mutual aggressions, nor does positive law create\nmorality, but implies it, and could not be worked without it. Nor could\ninternational obligations be enforced by a superior tribunal; hence\nthey have remained down to the present day a fertile theme for ethical\ndiscussion. It is at this point that morality forms a junction with\nreligion, the history of which is highly interesting, but which can\nhere be only briefly traced. The Olympian divinities, as placed before\nus by Homer, are anything but moral. Their conduct towards each other\nis that of a dissolute nobility; towards men it is that of unscrupulous\npartisans and patrons. A loyal adherence to friends and gratitude for\nsacrificial offerings are their most respectable characteristics,\nraising them already a little above the nature-powers whence they were\nderived. Now, mark how they first become moralised. It is by being made\nwitnesses to an oath. Any one who is called in to testify to a promise\nfeels aggrieved if it is broken, looking on the breach as an insult\nto his own dignity. As the Third Commandment well puts it, his name\nhas been taken in vain. Thus it happened that the same gods who left\nevery other crime unpunished, visited perjury with severe and speedy\nretribution, continued even after the offender’s death.[51] Respect for\na contract is the primary form of moral obligation, and still seems to\npossess a peculiar hold over uneducated minds. We see every day how\nmany persons will abstain from actions which they know to be immoral\nbecause they have given their word to that effect, not because the\nactions themselves are wrong. And for that reason law courts would be\nmore willing to enforce contracts than to redress injuries. If, then,\none person inflicted damage on another, he might afterwards, in order\nto escape retaliation from the injured party, or from his family,\nengage to give satisfaction, and the court would compel him to redeem\nhis promise.[52] Thus contract, by procuring redress for every species\nof wrong, would gradually extend its own obligatory character to\nabstinence from injury in general, and the divine sanctions primarily\ninvoked on behalf of oaths would be extended, with them, over the whole\ndomain of moral conduct.\n\nNor was this all. Laws and justice once established would require\nto have their origin accounted for, and, according to the usual\ngenealogical method of the early Greeks, would be described as children\nof the gods, who would thus be interested in their welfare, and would\navenge their violation—a stage of reflection already reached in the\n_Works and Days_ of Hesiod.\n\nAgain, when oracles like that at Delphi had obtained wide-spread\nrenown and authority, they would be consulted, not only on ceremonial\nquestions and matters of policy, but also on debateable points of\nmorality. The divine responses, being unbiassed by personal interest,\nwould necessarily be given in accordance with received rules of\nrectitude, and would be backed by all the terrors of a supernatural\nsanction. It might even be dangerous to assume that the god could\npossibly give his support to wrong-doing. A story told by Herodotus\nproves that such actually was the case.[E] There lived once at Sparta a\ncertain man named Glaucus, who had acquired so great a reputation for\nprobity that, during the troublous times of the Persian conquest, a\nwealthy Milesian thought it advisable to deposit a large sum of money\nwith him for safe keeping. After a considerable time the money was\nclaimed by his children, but the honesty of Glaucus was not proof\nagainst temptation. He pretended to have forgotten the whole affair,\nand required a delay of three months before making up his mind with\nregard to the validity of their demand. During that interval he\nconsulted the Delphic oracle to know whether he might possess himself\nof the money by a false oath. The answer was that it would be for\nhis immediate advantage to do so; all must die, the faithful and the\nperjured alike; but Horcus (oath) had a nameless son swift to pursue\nwithout feet, strong to grasp without hands, who would destroy the\nwhole race of the sinner. Glaucus craved forgiveness, but was informed\nthat to tempt the god was equivalent to committing the crime. He went\nhome and restored the deposit, but his whole family perished utterly\nfrom the land before three generations had passed by.\n\nYet another step remained to take. Punishment must be transferred from\na man’s innocent children to the man himself in a future life. But the\nOlympian theology was, originally at least, powerless to effect this\nrevolution. Its gods, being personifications of celestial phenomena,\nhad nothing to do with the dark underworld whither men descended\nafter death. There existed, however, side by side with the brilliant\nreligion of courts and camps which Greek poetry has made so familiar\nto us, another religion more popular with simple country-folk,[53] to\nwhom war meant ruin, courts of justice a means invented by kings for\nexacting bribes, sea-voyages a senseless imprudence, chariot-racing a\nsinful waste of money, and beautiful women drones in the human hive,\ndemons of extravagance invented by Zeus for the purpose of venting his\nspite against mankind. What interest could these poor people take in\nthe resplendent guardians of their hereditary oppressors, in Hêrê and\nAthênê, Apollo and Poseidôn, Artemis and Aphroditê? But they had other\ngods peculiar to themselves, whose worship was wrapped in mystery,\npartly that its objects need not be lured away by the attraction of\nricher offerings elsewhere, partly because the activity of these\nChthonian deities, as they were called, was naturally associated with\ndarkness and secresy. Presiding over birth and death, over seed-time\nand harvest and vintage, they personified the frost-bound sleep of\nvegetation in winter and its return from a dark underworld in spring.\nOut of their worship grew stories which told how Persephonê, the\nfair daughter of Dêmêtêr, or Mother Earth, was carried away by Pluto\nto reign with him over the shades below, but after long searching\nwas restored to her mother for eight months in every year; and how\nDionysus, the wine-god, was twice born, first from the earth burned up\nand fainting under the intolerable fire of a summer sky, respectively\npersonified as Semelê and her lover Zeus, then from the protecting\nmist wrapped round him by his divine father, of whom it formed a part.\nDionysus, too, was subject to alternations of depression and triumph,\nfrom the recital of which Attic drama was developed, and gained a\nfooting in the infernal regions, whither we accompany him in the\n_Frogs_ of Aristophanes. Another country god was Hermês, who seems to\nhave been associated with planting and possession as well as with the\ndemarcation and exchange of property, and who was also a conductor of\nsouls to Hades. Finally, there were the Erinyes, children of night and\ndwellers in subterranean darkness; they could breed pestilence and\ndiscord, but could also avert them; they could blast the produce of the\nsoil or increase its luxuriance and fertility; when blood was spilt on\nthe ground, they made it blossom up again in a harvest of retributive\nhatred; they pursued the guilty during life, and did not relax their\ngrasp after death; all law, whether physical or moral, was under their\nprotection; the same Erinyes who, in the _Odyssey_, avenge on Oedipus\nthe suicide of his mother, in the _Iliad_ will not allow the miraculous\nspeaking of a horse to continue; and we have seen in the last chapter\nhow, according to Heracleitus, it is they who also prevent the sun\nfrom transgressing his appointed limits.[54] Dêmêtêr and Persephonê,\ntoo, seem to have been law-giving goddesses, as their great festival,\ncelebrated by women alone, was called the Thesmophoria, while eternal\nhappiness was promised to those who had been initiated into their\nmysteries at Eleusis; and we also find that moral maxims were graven on\nthe marble busts of Hermês placed along every thoroughfare in Athens.\nWe can thus understand why the mutilation of these Hermae caused\nsuch rage and terror, accompanied, as it was rumoured to be, by a\nprofanation of the Eleusinian mysteries; for any attack on the deities\nin question would seem to prefigure an attack on the settled order of\nthings, the popular rights which they both symbolised and protected.\n\nHere, then, we find, chiefly among the rustic population, a religion\nintimately associated with morality, and including the doctrine of\nretribution after death. But this simple faith, though well adapted\nto the few wants of its original votaries, could not be raised to\nthe utmost expansion and purity of which it was susceptible without\nbeing brought into vivifying contact with that other Olympian\nreligion which, as we have seen, belonged more peculiarly to the\nruling aristocracy. The poor may be more moral than the rich, and the\ncountry than the town; nevertheless it is from dwellers in cities, and\nfrom the higher classes, including as they do a large percentage of\neducated, open-minded individuals, that the impulses to moral progress\nalways proceed. If the narrowness and hardness of primitive social\narrangements were overcome; if justice was disengaged from the ties\nof blood-relationship, and tempered with consideration for inevitable\nerror; if deadly feuds were terminated by a habitual appeal to\narbitration; if the worship of one supreme ideal was substituted for a\nblind sympathy with the ebb and flow of life on earth; if the numerical\nstrength of states was increased by giving shelter to fugitives; if a\nHellenic nation was created and held together by a common literature\nand a common civilisation, by oracles accessible to all, and by\nperiodical games in which every free-born Greek could take part; and,\nlastly, if a brighter abode than the slumberous garden of Persephonê\nwas assigned after death to the godlike heroes who had come forth\nfrom a thrice repeated ordeal with souls unstained by sin;[55]—all\nthis was due to the military rather than to the industrial classes,\nto the spirit that breathes through Homer rather than to the tamer\ninspiration of Hesiod’s muse. But if justice was raised to an Olympian\nthrone; if righteous providence, no less than creative power, became\nan inalienable attribute of Zeus; if lyric poetry, from Archilochus to\nSimonides and Pindar, is one long hymn of prayer and praise ever turned\nupward in adoring love to the Divine; we must remember that Themis\nwas a synonyme for Earth, and that Prometheus, the original friend\nof humanity, for whose benefit he invented every useful art, augury\nincluded, was her son. The seeds of immortal hope were first planted\nin the fructifying bosom of Dêmêtêr, and life, a forsaken Ariadnê,\ntook refuge in the mystical embraces of Dionysus from the memory of a\npromise that had allured her to betray. Thus, we may conjecture that\nbetween hall and farm-house, between the Olympian and the Chthonian\nreligions, there was a constant reaction going on, during which ethical\nideas were continually expanding, and extricating themselves from the\nsuperstitious elements associated with their earliest theological\nexpression.\n\n\nIII.\n\nThis process was conceived by Aeschylus as a conflict between two\ngenerations of gods, ending with their complete reconciliation. In the\n_Prometheus Bound_ we have the commencement of the conflict, in the\n_Eumenides_ its close. Our sympathies are apparently at first intended\nto be enlisted on behalf of the older divinities, but at last are\nclaimed exclusively by the younger. As opposed to Prometheus, Zeus is\nevidently in the wrong, and seeks to make up for his deficiencies by\narbitrary violence. In the _Oresteia_ he is the champion of justice\nagainst iniquity, and through his interpreter, Apollo, he enforces a\nrevised moral code against the antiquated claims of the Erinyes; these\nlatter, however, ultimately consenting to become guardians of the new\nsocial order. The Aeschylean drama shows us Greek religion at the\nhighest level it could reach, unaided by philosophical reflection.\nWith Sophocles a perceptible decline has already begun. We are loth to\nsay anything that may sound like disparagement of so noble a poet. We\nyield to none in admiration for one who has combined the two highest\nqualities of art—sweetness and strength—more completely than any\nother singer, Homer alone excepted, and who has given the primordial\naffections their definitive expression for all time. But we cannot\nhelp perceiving an element of superstition in his dramas, which,\nso far, distinguishes them unfavourably from those of his Titanic\npredecessor. With Sophocles, when the gods interfere, it is to punish\ndisrespect towards themselves, not to enforce justice between man and\nman. Ajax perishes by his own hand because he has neglected to ask\nfor divine assistance in battle. Laius and Jocastê come to a tragic\nend through disobedience to a perfectly arbitrary oracle; and as a\npart of the same divine purpose Oedipus encounters the most frightful\ncalamities by no fault of his own. The gods are, moreover, exclusively\nobjects of fear; their sole business is to enforce the fulfilment of\nenigmatic prophecies; they give no assistance to the pious and virtuous\ncharacters. Antigonê is allowed to perish for having performed the last\nduties to her brother’s corpse. Neoptolemus receives no aid in that\nstruggle between ambition on the one hand with truthfulness and pity\non the other which makes his character one of the most interesting in\nall imaginative literature. When Athênê bids Odysseus exult over the\ndegradation of Ajax, the generous Ithacan refuses to her face, and\nfalls back on the consciousness of a common humanity uniting him in\nsympathy with his prostrate foe.\n\nThe rift within the lute went on widening till all its music was turned\nto jarring discord. With the third great Attic dramatist we arrive at\na period of complete dissolution. Morality is not only separated from\nmythological tradition, but is openly at war with it. Religious belief,\nafter becoming almost monotheistic, has relapsed into polytheism. With\nEuripides the gods do not, as with his predecessors, form a common\ncouncil. They lead an independent existence, not interfering with each\nother, and pursuing private ends of their own—often very disreputable\nones. Aphrodite inspires Phaedra with an incestuous passion for her\nstepson. Artemis is propitiated by human sacrifices. Hêrê causes\nHeraclês to kill his children in a fit of delirium. Zeus and Poseidôn\nare charged with breaking their own laws, and setting a bad example to\nmortals. Apollo, once so venerated, fares the worst of any. He outrages\na noble maiden, and succeeds in palming off her child on the man whom\nshe subsequently marries. He instigates the murder of a repentant enemy\nwho has come to seek forgiveness at his shrine. He fails to protect\nOrestes from the consequences of matricide, committed at his own\nunwise suggestion. Political animosity may have had something to do\nwith these attacks on a god who was believed to side with the Dorian\nconfederacy against Athens. Doubtless, also, Euripides disbelieved many\nof the scandalous stories which he selected as appropriate materials\nfor dramatic representation. But a satire on immoral beliefs would\nhave been unnecessary had they not been generally accepted. Nor was\nthe poet himself altogether a freethinker. One of his latest and most\nsplendid works, the _Bacchae_, is a formal submission to the orthodox\ncreed. Under the stimulus of an insane delusion, Pentheus is torn\nto pieces by his mother Agavê and her attendant Maenads, for having\npresumed to oppose the introduction of Dionysus-worship into Thebes.\nThe antecedents of the new divinity are questionable, and the nature of\nhis influence on the female population extremely suspicious. Yet much\nstress is laid on the impiety of Pentheus, and we are clearly intended\nto consider his fate as well-deserved.\n\nEuripides is not a true thinker, and for that very reason fitly\ntypifies a period when religion had been shaken to its very foundation,\nbut still retained a strong hold on men’s minds, and might at any time\nreassert its ancient authority with unexpected vigour. We gather, also,\nfrom his writings, that ethical sentiment had undergone a parallel\ntransformation. He introduces characters and actions which the elder\ndramatists would have rejected as unworthy of tragedy, and not only\nintroduces them, but composes elaborate speeches in their defence. Side\nby side with examples of devoted heroism we find such observations as\nthat everyone loves himself best, and that those are most prosperous\nwho attend most exclusively to their own interests. It so happens that\nin one instance where Euripides has chosen a subject already handled\nby Aeschylus, the difference of treatment shows how great a moral\nrevolution had occurred in the interim. The conflict waged between\nEteoclês and Polyneicês for their father’s throne is the theme both\nof the _Seven against Thebes_ and of the _Phoenician Women_. In both,\nPolyneicês bases his claim on grounds of right. It had been agreed that\nhe and his brother should alternately hold sway over Thebes. His turn\nhas arrived, and Eteoclês refuses to give way. Polyneicês endeavours\nto enforce his pretensions by bringing a foreign army against Thebes.\nAeschylus makes him appear before the walls with an allegorical figure\nof Justice on his shield, promising to restore him to his father’s\nseat. On hearing this, Eteoclês exclaims:—\n\n    ‘Aye, if Jove’s virgin daughter Justice shared\n    In deed or thought of his, then it might be.\n    But neither when he left the darkling womb,\n    Nor in his childhood, nor in youth, nor when\n    The clustering hair first gathered round his chin,\n    Hath Justice turned approving eyes on him;\n    Nor deem I that she comes as his ally,\n    Now that he wastes his native land with war,\n    Or Justice most unjustly were she called\n    If ruthless hearts could claim her fellowship.’[56]\n\nEuripides, with greater dramatic skill, brings the two brothers\ntogether in presence of their mother, Jocastê. When Polyneicês has\nspoken, Eteoclês replies:—\n\n    ‘Honour and wisdom are but empty names\n    That mortals use, each with a different meaning,\n    Agreeing in the sound, not in the sense.\n    Hear, mother, undisguised my whole resolve!\n    Were Sovereignty, chief goddess among gods,\n    Far set as is the rising of a star,\n    Or buried deep in subterranean gloom,\n    There I would seek and win her for mine own.\n\n           *       *       *       *       *\n\n    Come fire, come sword, yoke horses to the car,\n    And fill the plain with armed men, for I\n    Will not give up my royalty to him!\n    Let all my life be guiltless save in this:\n    I dare do any wrong for sovereign power—\n    The splendid guerdon of a splendid sin.’[57]\n\nThe contrast is not only direct, but designed, for Euripides had the\nwork of his predecessor before him, and no doubt imagined that he was\nimproving on it.\n\nWe perceive a precisely similar change of tone on comparing the two\ngreat historians who have respectively recorded the struggle of Greece\nagainst Persia, and the struggle of imperial Athens against Sparta\nand her allies. Though born within fifteen years of one another,\nHerodotus and Thucydides are virtually separated by an interval of two\ngenerations, for while the latter represents the most advanced thought\nof his time, the former lived among traditions inherited from the\nage preceding his own. Now, Herodotus is not more remarkable for the\nearnest piety than for the clear sense of justice which runs through\nhis entire work. He draws no distinction between public and private\nmorality. Whoever makes war on his neighbours without provocation, or\nrules without the consent of the governed, is, according to him, in\nthe wrong, although he is well aware that such wrongs are constantly\ncommitted. Thucydides knows nothing of supernatural interference in\nhuman affairs. After relating the tragical end of Nicias, he observes,\nnot without a sceptical tendency, that of all the Greeks then living,\nthis unfortunate general least deserved such a fate, so far as piety\nand respectability of character went. If there are gods they hold\ntheir position by superior strength. That the strong should enslave\nthe weak is a universal and necessary law of Nature. The Spartans,\nwho among themselves are most scrupulous in observing traditional\nobligations, in their dealings with others most openly identify gain\nwith honour, and expediency with right. Even if the historian himself\ndid not share these opinions, it is evident that they were widely\nentertained by his contemporaries, and he expressly informs us that\nGreek political morality had deteriorated to a frightful extent in\nconsequence of the civil discords fomented by the conflict between\nAthens and Sparta; while, in Athens at least, a similar corruption of\nprivate morality had begun with the great plague of 430, its chief\nsymptom being a mad desire to extract the utmost possible enjoyment\nfrom life, for which purpose every means was considered legitimate. On\nthis point Thucydides is confirmed and supplemented by the evidence of\nanother contemporary authority. According to Aristophanes, the ancient\ndiscipline had in his time become very much relaxed. The rich were idle\nand extravagant; the poor mutinous; young men were growing more and\nmore insolent to their elders; religion was derided; all classes were\nanimated by a common desire to make money and to spend it on sensual\nenjoyment. Only, instead of tracing back this profound demoralisation\nto a change in the social environment, Aristophanes attributes it to\ndemagogues, harassing informers, and popular poets, but above all to\nthe new culture then coming into vogue. Physical science had brought\nin atheism; dialectic training had destroyed the sanctity of ethical\nrestraints. When, however, the religious and virtuous Socrates is put\nforward as a type of both tendencies, our confidence in the comic\npoet’s accuracy, if not in his good faith, becomes seriously shaken;\nand his whole tone so vividly recalls the analogous invectives now\nhurled from press and pulpit against every philosophic theory, every\nscientific discovery, every social reform at variance with traditional\nbeliefs or threatening the sinister interests which have gathered round\niniquitous institutions, that at first we feel tempted to follow Grote\nin rejecting his testimony altogether. So far, however, as the actual\nphenomena themselves are concerned, and apart from their generating\nantecedents, Aristophanes does but bring into more picturesque\nprominence what graver observers are content to indicate, and what\nPlato, writing a generation later, treats as an unquestionable reality.\nNor is the fact of a lowered moral tone going along with accelerated\nmental activity either incredible or unparalleled. Modern history\nknows of at least two periods remarkable for such a conjunction,\nthe Renaissance and the eighteenth century, the former stained with\nevery imaginable crime, the latter impure throughout, and lapsing\ninto blood-thirsty violence at its close. Moral progress, like every\nother mode of motion, has its appropriate rhythm—its epochs of severe\nrestraint followed by epochs of rebellious license. And when, as an\naggravation of the reaction from which they periodically suffer,\nethical principles have become associated with a mythology whose decay,\nat first retarded, is finally hastened by their activity, it is still\neasier to understand how they may share in its discredit, and only\nregain their ascendency by allying themselves with a purified form of\nthe old religion, until they can be disentangled from the compromising\nsupport of all unverified theories whatever. We have every reason to\nbelieve that Greek life and thought did pass through such a crisis\nduring the second half of the fifth century B.C., and we have now to\ndeal with the speculative aspects of that crisis, so far as they are\nrepresented by the Sophists.\n\n\nIV.\n\nThe word Sophist in modern languages means one who purposely uses\nfallacious arguments. Our definition was probably derived from that\ngiven by Aristotle in his _Topics_, but does not entirely reproduce\nit. What we call sophistry was with him eristic, or the art of unfair\ndisputation; and by Sophist he means one who practises the eristic\nart for gain. He also defines sophistry as the appearance without the\nreality of wisdom. A very similar account of the Sophists and their\nart is given by Plato in what seems to be one of his later dialogues;\nand another dialogue, probably composed some time previously, shows\nus how eristic was actually practised by two Sophists, Euthydêmus and\nDionysodôrus, who had learned the art, which is represented as a very\neasy accomplishment, when already old men. Their performance is not\nedifying; and one only wonders how any Greek could have been induced to\npay for the privilege of witnessing such an exhibition. But the word\nSophist, in its original signification, was an entirely honourable\nname. It meant a sage, a wise and learned man, like Solon, or, for that\nmatter, like Plato and Aristotle themselves. The interval between these\nwidely-different connotations is filled up and explained by a number\nof individuals as to whom our information is principally, though by\nno means entirely, derived from Plato. All of them were professional\nteachers, receiving payment for their services; all made a particular\nstudy of language, some aiming more particularly at accuracy, others\nat beauty of expression. While no common doctrine can be attributed\nto them as a class, as individuals they are connected by a series of\ngraduated transitions, the final outcome of which will enable us to\nunderstand how, from a title of respect, their name could be turned\ninto a byword of reproach. The Sophists, concerning whom some details\nhave been transmitted to us, are Protagoras, Gorgias, Prodicus,\nHippias, Pôlus, Thrasymachus, and the Eristics already mentioned.\nWe have placed them, so far as their ages can be determined, in\nchronological order, but their logical order is somewhat different.\nThe first two on the list were born about 480 B.C., and the second\npair possibly twenty years later. But neither Protagoras nor Gorgias\nseems to have published his most characteristic theories until a\nrather advanced time of life, for they are nowhere alluded to by the\nXenophontic Socrates, who, on the other hand, is well acquainted with\nboth Prodicus and Hippias, while, conversely, Plato is most interested\nin the former pair. We shall also presently see that the scepticism\nof the elder Sophists can best be explained by reference to the more\ndogmatic theories of their younger contemporaries, which again easily\nfit on to the physical speculations of earlier thinkers.\n\nProdicus was born in Ceos, a little island belonging to the Athenian\nconfederacy, and seems to have habitually resided at Athens. His\nhealth was delicate, and he wrapped up a good deal, as we learn from\nthe ridicule of Plato, always pitiless to a valetudinarian.[F] Judging\nfrom two allusions in Aristophanes, he taught natural science in\nsuch a manner as to conciliate even that unsparing enemy of the\nnew learning.[58] He also gave moral instruction grounded on the\ntraditional ideas of his country, a pleasing specimen of which\nhas been preserved. It is conveyed under the form of an apologue,\nentitled the Choice of Heraclês, and was taken down in its present\nform by Xenophon from the lips of Socrates, who quoted it, with full\napproval, for the benefit of his own disciples. Prodicus also lectured\non the use of words, laying especial emphasis on the distinction of\nsynonyms. We hear, not without sympathy, that he tried to check the\nindiscriminate employment of ‘awful’ (δεινός), which was even more rife\nat Athens than among ourselves.[G] Finally, we are told that, like many\nmoderns, he considered the popular divinities to be personifications\nof natural phenomena. Hippias, who was a native of Elis, seems to\nhave taught on very much the same system. It would appear that he\nlectured principally on astronomy and physics, but did not neglect\nlanguage, and is said to have invented an art of memory. His restless\ninquisitiveness was also exercised on ancient history, and his\nerudition in that subject was taxed to the utmost during a visit to\nSparta, where the unlettered people still delighted in old stories,\nwhich among the more enlightened Greeks had been superseded by topics\nof livelier and fresher interest. At Sparta, too, he recited, with\ngreat applause, an ethical discourse under the form of advice given\nby Nestor to Neoptolemus after the capture of Troy. We know, on good\nauthority, that Hippias habitually distinguished between natural and\ncustomary law, the former being, according to him, everywhere the\nsame, while the latter varied from state to state, and in the same\nstate at different times. Natural law he held to be alone binding and\nalone salutary. On this subject the following expressions, evidently\nintended to be characteristic, are put into his mouth by Plato:—‘All\nof you who are here present I reckon to be kinsmen and friends and\nfellow-citizens, by nature and not by law; for by nature like is akin\nto like, whereas law is the tyrant of mankind, and often compels us to\ndo many things which are against Nature.’[59] Here two distinct ideas\nare implied, the idea that Nature is a moral guide, and, further,\nthe idea that she is opposed to convention. The habit of looking for\nexamples and lessons to some simpler life than their own prevailed\namong the Greeks from a very early period, and is, indeed, very common\nin primitive societies. Homer’s similes are a case in point; while all\nthat we are told about the innocence and felicity of the Aethiopians\nand Hyperboreans seems to indicate a deep-rooted belief in the moral\nsuperiority of savage to civilised nations; and Hesiod’s fiction of\nthe Four Ages, beginning with a golden age, arises from a kindred\nnotion that intellectual progress is accompanied by moral corruption.\nSimonides of Amorgus illustrates the various types of womankind by\nexamples from the animal world; and Aesop’s fables, dating from the\nfirst half of the sixth century, give ethical instruction under the\nsame disguise. We have already pointed out how Greek rural religion\nestablished a thorough-going connexion between physical and moral\nphenomena, and how Heracleitus followed in the same track. Now, one\ngreat result of early Greek thought, as described in our first chapter,\nwas to combine all these scattered fugitive incoherent ideas under a\nsingle conception, thus enabling them to elucidate and support one\nanother. This was the conception of Nature as a universal all-creative\neternal power, first superior to the gods, then altogether superseding\nthem. When Homer called Zeus the father of gods and men; when Pindar\nsaid that both races, the divine and the human, are sprung from one\nmother (Earth);[60] when, again, he spoke of law as an absolute king;\nor when Aeschylus set destiny above Zeus himself;[61] they were but\nforeshadowing a more despotic authority, whose dominion is even now not\nextinct, is perhaps being renewed under the title of Evolution. The\nword Nature was used by most philosophers, and the thing was implied\nby all. They did not, indeed, commit the mistake of personifying a\nconvenient abstraction; but a conception which they substituted for the\ngods would soon inherit every attribute of divine agency. Moreover,\nthe Nature of philosophy had three fundamental attributes admitting of\nready application as ethical standards. She was everywhere the same;\nfire burned in Greece and Persia alike. She tended towards an orderly\nsystem where every agent or element is limited to its appropriate\nsphere. And she proceeded on a principle of universal compensation,\nall gains in one direction being paid for by losses in another, and\nevery disturbance being eventually rectified by a restoration of\nequilibrium. It was, indeed, by no means surprising that truths which\nwere generalised from the experience of Greek social life should now\nreturn to confirm the orderliness of that life with the sanction of an\nall-pervading law.\n\nEuripides gives us an interesting example of the style in which this\nethical application of physical science could be practised. We have\nseen how Eteoclês expresses his determination to do and dare all for\nthe sake of sovereign power. His mother, Jocastê, gently rebukes him as\nfollows:—\n\n    ‘Honour Equality who binds together\n    Both friends and cities and confederates,\n    For equity is law, law equity;\n    The lesser is the greater’s enemy,\n    And disadvantaged aye begins the strife.\n    From her our measures, weights, and numbers come,\n    Defined and ordered by Equality;\n    So do the night’s blind eye and sun’s bright orb\n    Walk equal courses in their yearly round,\n    And neither is embittered by defeat;\n    And while both light and darkness serve mankind\n    Wilt thou not bear an equal in thy house?’[62]\n\nOn examining the apologue of Prodicus, we find it characterised by\na somewhat similar style of reasoning. There is, it is true, no\nreference to physical phenomena, but Virtue dwells strongly on the\ntruth that nothing can be had for nothing, and that pleasure must\neither be purchased by toil or atoned for by languor, satiety, and\npremature decay. We know also that the Cynical school, as represented\nby Antisthenês, rejected all pleasure on the ground that it was always\npaid for by an equal amount of pain; and Heraclês, the Prodicean type\nof a youth who follows virtue in preference to vice disguised as\nhappiness, was also the favourite hero of the Cynics. Again, Plato\nalludes, in the _Philêbus_, to certain thinkers, reputed to be ‘great\non the subject of physics,’ who deny the very existence of pleasure.\nCritics have been at a loss to identify these persons, and rather\nreluctantly put up with the explanation that Antisthenês and his school\nare referred to. Antisthenês was a friend of Prodicus, and may at one\ntime have shared in his scientific studies, thus giving occasion to\nthe association touched on by Plato. But is it not equally possible\nthat Prodicus left behind disciples who, like him, combined moral with\nphysical teaching; and, going a little further, may we not conjecture\nthat their opposition to Hedonism was inherited from the master\nhimself, who, like the Stoics afterwards, may have based it on an\napplication of physical reasoning to ethics?\n\nStill more important was the antithesis between Nature and convention,\nwhich, so far as we know, originated exclusively with Hippias. We\nhave already observed that universality and necessity were, with\nthe Greeks, standing marks of naturalness. The customs of different\ncountries were, on the other hand, distinguished by extreme variety,\namounting sometimes to diametrical opposition. Herodotus was fond\nof calling attention to such contrasts; only, he drew from them the\nconclusion that law, to be so arbitrary, must needs possess supreme\nand sacred authority. According to the more plausible interpretation\nof Hippias, the variety, and at least in Greek democracies, the\nchangeability of law proved that it was neither sacred nor binding.\nHe also looked on artificial social institutions as the sole cause of\ndivision and discord among mankind. Here we already see the dawn of a\ncosmopolitanism afterwards preached by Cynic and Stoic philosophers.\nFurthermore, to discover the natural rule of right, he compared the\nlaws of different nations, and selected those which were held by\nall in common as the basis of an ethical system.[63] Now, this is\nprecisely what was done by the Roman jurists long afterwards under\nthe inspiration of Stoical teaching. We have it on the high authority\nof Sir Henry Maine that they identified the _Jus Gentium_, that is,\nthe laws supposed to be observed by all nations alike, with the _Jus\nNaturale_, that is, the code by which men were governed in their\nprimitive condition of innocence. It was by a gradual application of\nthis ideal standard that the numerous inequalities between different\nclasses of persons, enforced by ancient Roman law, were removed, and\nthat contract was substituted for status. Above all, the abolition of\nslavery was, if not directly caused, at any rate powerfully aided,\nby the belief that it was against Nature. At the beginning of the\nfourteenth century we find Louis Hutin, King of France, assigning\nas a reason for the enfranchisement of his serfs, that, ‘according\nto natural law, everybody ought to be born free,’ and although Sir\nH. Maine holds this to have been a mistaken interpretation of the\njuridical axiom ‘omnes homines naturâ aequales sunt,’ which means\nnot an ideal to be attained, but a primitive condition from which we\nhave departed: nevertheless it very faithfully reproduces the theory\nof those Greek philosophers from whom the idea of a natural law was\nderived. That, in Aristotle’s time at least, a party existed who were\nopposed to slavery on theoretical grounds of right is perfectly evident\nfrom the language of the _Politics_. ‘Some persons,’ says Aristotle,\n‘think that slave-holding is against nature, for that one man is a\nslave and another free by law, while by nature there is no difference\nbetween them, for which reason it is unjust as being the result of\nforce.’[64] And he proceeds to prove the contrary at length. The same\ndoctrine of natural equality led to important political consequences,\nhaving, again according to Sir H. Maine, contributed both to the\nAmerican Declaration of Independence and to the French Revolution.\n\nThere is one more aspect deserving our attention, under which the\ntheory of Nature has been presented both in ancient and modern times.\nA dialogue which, whether rightly or wrongly attributed to Plato, may\nbe taken as good evidence on the subject it relates to,[65] exhibits\nHippias in the character of a universal genius, who can not only\nteach every science and practise every kind of literary composition,\nbut has also manufactured all the clothes and other articles about\nhis person. Here we have precisely the sort of versatility which\ncharacterises uncivilised society, and which believers in a state of\nnature love to encourage at all times. The division of labour, while\nit carries us ever farther from barbarism, makes us more dependent on\neach other. An Odysseus is master of many arts, a Themistocles of two,\na Demosthenes of only one. A Norwegian peasant can do more for himself\nthan an English countryman, and therefore makes a better colonist. If\nwe must return to Nature, our first step should be to learn a number\nof trades, and so be better able to shift for ourselves. Such was the\nideal of Hippias, and it was also the ideal of the eighteenth century.\nIts literature begins with _Robinson Crusoe_, the story of a man who\nis accidentally compelled to provide himself, during many years, with\nall the necessaries of life. Its educational manuals are, in France,\nRousseau’s _Émile_; in England, Day’s _Sandford and Merton_, both\nteaching that the young should be thrown as much as possible on their\nown resources. One of its types is Diderot, who learns handicrafts that\nhe may describe them in the _Encyclopédie_. Its two great spokesmen\nare Voltaire and Goethe, who, after cultivating every department\nof literature, take in statesmanship as well. And its last word is\nSchiller’s _Letters on Aesthetic Culture_, holding up totality of\nexistence as the supreme ideal to be sought after.\n\nThere is no reason to believe that Hippias used his distinction between\nNature and convention as an argument for despotism. It would rather\nappear that, if anything, he and his school desired to establish a more\ncomplete equality among men. Others, however, both rhetoricians and\npractical statesmen, were not slow to draw an opposite conclusion. They\nsaw that where no law was recognised, as between different nations,\nnothing but violence and the right of the stronger prevailed. It was\nonce believed that aggressions which human law could not reach found\nno favour with the gods, and dread of the divine displeasure may have\ndone something towards restraining them. But religion had partly been\ndestroyed by the new culture, partly perverted into a sanction for\nwrong-doing. By what right, it was asked, did Zeus himself reign? Had\nhe not unlawfully dethroned his father, Cronos, and did he not now hold\npower simply by virtue of superior strength? Similar reasonings were\nsoon applied to the internal government of each state. It was alleged\nthat the ablest citizens could lay claim to uncontrolled supremacy by\na title older than any social fiction. Rules of right meant nothing\nbut a permanent conspiracy of the weak to withdraw themselves from the\nlegitimate dominion of their born master, and to bamboozle him into\na voluntary surrender of his natural privileges. Sentiments bearing\na superficial resemblance to these have occasionally found utterance\namong ourselves. Nevertheless, it would be most unjust to compare\nCarlyle and Mr. Froude with Critias and Calliclês. We believe that\ntheir preference of despotism to representative government is an entire\nmistake. But we know that with them as with us the good of the governed\nis the sole end desired. The gentlemen of Athens sought after supreme\npower only as a means for gratifying their worst passions without let\nor hindrance; and for that purpose they were ready to ally themselves\nwith every foreign enemy in turn, or to flatter the caprices of the\nDêmos, if that policy promised to answer equally well. The antisocial\ntheories of these ‘young lions,’ as they were called by their enemies\nand sometimes by themselves also, do not seem to have been supported\nby any public teacher. If we are to believe Plato, Pôlus, a Sicilian\nrhetor, did indeed regard Archelaus, the abler Louis Napoleon of his\ntime, with sympathy and envious admiration, but without attempting\nto justify the crimes of his hero by an appeal to natural law. The\ncorruption of theoretical morality among the paid teachers took a more\nsubtle form. Instead of opposing one principle to another, they held\nthat all law had the same source, being an emanation from the will\nof the stronger, and exclusively designed to promote his interest.\nJustice, according to Thrasymachus in the _Republic_, is another’s\ngood, which is true enough, and to practise it except under compulsion\nis foolish, which, whatever Grote may say, is a grossly immoral\ndoctrine.\n\n\nV.\n\nWe have seen how the idea of Nature, first evolved by physical\nphilosophy, was taken by some, at least, among the Sophists as a\nbasis for their ethical teaching; then how an interpretation utterly\nopposed to theirs was put on it by practical men, and how this second\ninterpretation was so generalised by the younger rhetoricians as to\ninvolve the denial of all morality whatever. Meanwhile, another equally\nimportant conception, destined to come into speedy and prolonged\nantagonism with the idea of Nature, and like it to exercise a powerful\ninfluence on ethical reflection, had almost contemporaneously been\nelaborated out of the materials which earlier speculation supplied.\nFrom Parmenides and Heracleitus down, every philosopher who had\npropounded a theory of the world, had also more or less peremptorily\ninsisted on the fact that his theory differed widely from common\nbelief. Those who held that change is impossible, and those who\ntaught that everything is incessantly changing; those who asserted the\nindestructibility of matter, and those who denied its continuity; those\nwho took away objective reality from every quality except extension\nand resistance, and those who affirmed that the smallest molecules\npartook more or less of every attribute that is revealed to sense—all\nthese, however much they might disagree among themselves, agreed in\ndeclaring that the received opinions of mankind were an utter delusion.\nThus, a sharp distinction came to be drawn between the misleading\nsense-impressions and the objective reality to which thought alone\ncould penetrate. It was by combining these two elements, sensation\nand thought, that the idea of mind was originally constituted. And\nmind when so understood could not well be accounted for by any of the\nmaterialistic hypotheses at first proposed. The senses must differ\nprofoundly from that of which they give such an unfaithful report;\nwhile reason, which Anaxagoras had so carefully differentiated from\nevery other form of existence, carried back its distinction to the\nsubjective sphere, and became clothed with a new spirituality when\nreintegrated in the consciousness of man.\n\nThe first result of this separation between man and the world was a\ncomplete breach with the old physical philosophy, shown, on the one\nhand, by an abandonment of speculative studies, on the other, by a\nsubstitution of convention for Nature as the recognised standard of\nright. Both consequences were drawn by Protagoras, the most eminent\nof the Sophists. We have now to consider more particularly what was\nhis part in the great drama of which we are attempting to give an\nintelligible account.\n\nProtagoras was born about 480 B.C. He was a fellow-townsman of\nDemocritus, and has been represented, though not on good authority,\nas a disciple of that illustrious thinker. It was rather by a study\nof Heracleitus that his philosophical opinions, so far as they were\nborrowed from others, seem to have been most decisively determined.\nIn any case, practice, not theory, was the principal occupation of\nhis life. He gave instruction for payment in the higher branches of a\nliberal education, and adopted the name of Sophist, which before had\nsimply meant a wise man, as an honourable title for his new calling.\nProtagoras was a very popular teacher. The news of his arrival in a\nstrange city excited immense enthusiasm, and he was followed from place\nto place by a band of eager disciples. At Athens he was honoured by\nthe friendship of such men as Pericles and Euripides. It was at the\nhouse of the great tragic poet that he read out a work beginning with\nthe ominous declaration, ‘I cannot tell whether the gods exist or not;\nlife is too short for such difficult investigations.’[66] Athenian\nbigotry took alarm directly. The book containing this frank confession\nof agnosticism was publicly burned, all purchasers being compelled to\ngive up the copies in their possession. The author himself was either\nbanished or took flight, and perished by shipwreck on the way to Sicily\nbefore completing his seventieth year.\n\nThe scepticism of Protagoras went beyond theology and extended to all\nscience whatever. Such, at least, seems to have been the force of his\ncelebrated declaration that ‘man is the measure of all things, both\nas regards their existence and their non-existence.’[67] According to\nPlato, this doctrine followed from the identification of knowledge\nwith sensible perception, which in its turn was based on a modified\nform of the Heracleitean theory of a perpetual flux. The series of\nexternal changes which constitutes Nature, acting on the series of\ninternal changes which constitutes each man’s personality, produces\nparticular sensations, and these alone are the true reality. They vary\nwith every variation in the factors, and therefore are not the same\nfor separate individuals. Each man’s perceptions are true for himself,\nbut for himself alone. Plato easily shows that such a theory of truth\nis at variance with ordinary opinion, and that if all opinions are\ntrue, it must necessarily stand self-condemned. We may also observe\nthat if nothing can be known but sensation, nothing can be known of\nits conditions. It would, however, be unfair to convict Protagoras of\ntalking nonsense on the unsupported authority of the _Theaetêtus_.\nPlato himself suggests that a better case might have been made out\nfor the incriminated doctrine could its author have been heard in\nself-defence. We may conjecture that Protagoras did not distinguish\nvery accurately between existence, knowledge, and applicability to\npractice. If we assume, what there seems good reason to believe, that\nin the great controversy of Nature _versus_ Law, Protagoras sided with\nthe latter, his position will at once become clear. When the champions\nof Nature credited her with a stability and an authority greater than\ncould be claimed for merely human arrangements, it was a judicious step\nto carry the war into their territory, and ask, on what foundation then\ndoes Nature herself stand? Is not she, too, perpetually changing, and\ndo we not become acquainted with her entirely through our own feelings?\nOught not those feelings to be taken as the ultimate standard in all\nquestions of right and wrong? Individual opinion is a fact which must\nbe reckoned with, but which can be changed by persuasion, not by\nappeals to something that we none of us know anything about. _Man_ is\nthe measure of all things, not the will of gods whose very existence\nis uncertain, nor yet a purely hypothetical state of Nature. Human\ninterests must take precedence of every other consideration. Hector\nmeant nothing else when he preferred the obvious dictates of patriotism\nto inferences drawn from the flight of birds.\n\nWe now understand why Protagoras, in the Platonic dialogue bearing his\nname, should glance scornfully at the method of instruction pursued by\nHippias, with his lectures on astronomy, and why he prefers to discuss\nobscure passages in the poets. The quarrel between a classical and a\nscientific education was just then beginning, and Protagoras, as a\nHumanist, sided with the classics. Again, he does not think much of\nthe ‘great and sane and noble race of brutes.’ He would not, like the\nCynics, take them as examples of conduct. Man, he says, is naturally\nworse provided for than any animal; even the divine gift of wisdom\nwould not save him from extinction without the priceless social virtues\nof justice and reverence, that is, the regard for public opinion\nwhich Mr. Darwin, too, has represented as the strongest moralising\npower in primitive society. And, as the possession of these qualities\nconstituted the fundamental distinction between men and brutes, so also\ndid the advantage of civilisation over barbarism rest on their superior\ndevelopment, a development due to the ethical instruction received by\nevery citizen from his earliest infancy, reinforced through after-life\nby the sterner correction of legal punishments, and completed by the\nelimination of all individuals demonstrably unfitted for the social\nstate. Protagoras had no sympathy with those who affect to prefer the\nsimplicity of savages to the fancied corruption of civilisation. Hear\nhow he answers the Rousseaus and Diderots of his time:—\n\n ‘I would have you consider that he who appears to you to be the worst\n of those who have been brought up in laws and humanities would appear\n to be a just man and a master of justice if he were to be compared\n with men who had no education, or courts of justice, or laws, or any\n restraints upon them which compelled them to practise virtue—with\n the savages, for example, whom the poet Pherecrates exhibited on the\n stage at the last year’s Lenaean festival. If you were living among\n men such as the man-haters in his chorus, you would be only too glad\n to meet with Eurybates and Phrynondas, and you would sorrowfully long\n to revisit the rascality of this part of the world.’[68]\n\nWe find the same theory reproduced and enforced with weighty\nillustrations by the great historian of that age. It is not known\nwhether Thucydides owed any part of his culture to Protagoras, but\nthe introduction to his history breathes the same spirit as the\nobservations which we have just transcribed. He, too, characterises\nantiquity as a scene of barbarism, isolation, and lawless violence,\nparticularly remarking that piracy was not then counted a dishonourable\nprofession. He points to the tribes outside Greece, together with the\nmost backward among the Greeks themselves, as representing the low\ncondition from which Athens and her sister states had only emerged\nwithin a comparatively recent period. And in the funeral oration which\nhe puts into the mouth of Pericles, the legendary glories of Athens\nare passed over without the slightest allusion,[69] while exclusive\nprominence is given to her proud position as the intellectual centre of\nGreece. Evidently a radical change had taken place in men’s conceptions\nsince Herodotus wrote. They were learning to despise the mythical\nglories of their ancestors, to exalt the present at the expense of the\npast, to fix their attention exclusively on immediate human interests,\nand, possibly, to anticipate the coming of a loftier civilisation than\nhad as yet been seen.\n\nThe evolution of Greek tragic poetry bears witness to the same\ntransformation of taste. On comparing Sophocles with Aeschylus, we\nare struck by a change of tone analogous to that which distinguishes\nThucydides from Herodotus. It has been shown in our first chapter how\nthe elder dramatist delights in tracing events and institutions back to\ntheir first origin, and in following derivations through the steps of\na genealogical sequence. Sophocles, on the other hand, limits himself\nto a close analysis of the action immediately represented, the motives\nby which his characters are influenced, and the arguments by which\ntheir conduct is justified or condemned. We have already touched on the\nvery different attitude assumed towards religion by these two great\npoets. Here we have only to add that while Aeschylus fills his dramas\nwith supernatural beings, and frequently restricts his mortal actors\nto the interpretation or execution of a divine mandate, Sophocles,\nrepresenting the spirit of Greek Humanism, only once brings a god on\nthe stage, and dwells exclusively on the emotions of pride, ambition,\nrevenge, terror, pity, and affection, by which men and women of a lofty\ntype are actuated. Again (and this is one of his poetic superiorities),\nAeschylus has an open sense for the external world; his imagination\nranges far and wide from land to land; his pages are filled with the\nfire and light, the music and movement of Nature in a Southern country.\nHe leads before us in splendid procession the starry-kirtled night;\nthe bright rulers that bring round winter and summer; the dazzling\nsunshine; the forked flashes of lightning; the roaring thunder; the\nwhite-winged snow-flakes; the rain descending on thirsty flowers; the\nsea now rippling with infinite laughter, now moaning on the shingle,\ngrowing hoary under rough blasts, with its eastern waves dashing\nagainst the new-risen sun, or, again, lulled to waveless, windless,\nnoonday sleep; the volcano with its volleys of fire-breathing spray\nand fierce jaws of devouring lava; the eddying whorls of dust; the\nresistless mountain-torrent; the meadow-dews; the flowers of spring\nand fruits of summer; the evergreen olive, and trees that give leafy\nshelter from dogstar heat. For all this world of wonder and beauty\nSophocles offers only a few meagre allusions to the phenomena presented\nby sunshine and storm. No poet has ever so entirely concentrated\nhis attention on human deeds and human passions. Only the grove of\nColônus, interwoven with his own earliest recollections, had power\nto draw from him, in extreme old age, a song such as the nightingale\nmight have warbled amid those inviolable recesses where the ivy and\nlaurel, the vine and olive gave a never-failing shelter against sun and\nwind alike. Yet even this leafy covert is but an image of the poet’s\nown imagination, undisturbed by outward influences, self-involved,\nself-protected, and self-sustained. Of course, we are only restating\nin different language what has long been known, that the epic element\nof poetry, before so prominent, was with Sophocles entirely displaced\nby the dramatic; but if Sophocles became the greatest dramatist of\nantiquity, it was precisely because no other writer could, like him,\nwork out a catastrophe solely through the action of mind on mind,\nwithout any intervention of physical force; and if he possessed this\nfaculty, it was because Greek thought as a whole had been turned\ninward; because he shared in the devotion to psychological studies\nequally exemplified by his younger contemporaries, Protagoras,\nThucydides, and Socrates, all of whom might have taken for their motto\nthe noble lines—\n\n    ‘On earth there is nothing great but man,\n    In man there is nothing great but mind.’\n\nWe have said that Protagoras was a partisan of Nomos, or convention,\nagainst Nature. That was the conservative side of his character.\nStill, Nomos was not with him what it had been with the older Greeks,\nan immutable tradition indistinguishable from physical law. It was a\nhuman creation, and represented the outcome of inherited experience,\nadmitting always of change for the better. Hence the vast importance\nwhich he attributed to education. This, no doubt, was magnifying\nhis own office, for the training of youth was his profession. But,\nunquestionably, the feelings of his more liberal contemporaries\nwent with him. A generation before, Pindar had spoken scornfully of\nintellectual culture as a vain attempt to make up for the absence of\ngenius which the gods alone could give. Yet Pindar himself was always\ncareful to dwell on the services rendered by professional trainers to\nthe victorious athletes whose praises he sang, and there was really\nno reason why genius and culture should be permanently dissociated. A\nThemistocles might decide offhand on the questions brought before him;\na Pericles, dealing with much more complex interests, already needed a\nmore careful preparation.\n\nOn the other hand, conservatives like Aristophanes continued to oppose\nthe spread of education with acrimonious zeal. Some of their arguments\nhave a curiously familiar ring. Intellectual pursuits, they said, were\nbad for the health, led to irreligion and immorality, made young people\nquite unlike their grandfathers, and were somehow or other connected\nwith loose company and a fast life. This last insinuation was in one\nrespect the very reverse of true. So far as personal morality went,\nnothing could be better for it than the change introduced by Protagoras\nfrom amateur to paid teaching. Before this time, a Greek youth who\nwished for something better than the very elementary instruction given\nat school, could only attach himself to some older and wiser friend,\nwhose conversation might be very improving, but who was pretty sure\nto introduce a sentimental element into their relationship equally\ndiscreditable to both.[70] A similar danger has always existed with\nregard to highly intelligent women, although it may have threatened\na smaller number of individuals; and the efforts now being made to\nprovide them with a systematic education under official superintendence\nwill incidentally have the effect of saving our future Héloises and\nJulies from the tuition of an Abélard or a Saint-Preux.\n\nIt was their habit of teaching rhetoric as an art which raised the\nfiercest storm of indignation against Protagoras and his colleagues.\nThe endeavour to discover rules for addressing a tribunal or a popular\nassembly in the manner best calculated to win their assent had\noriginated quite independently of any philosophical theory. On the\nre-establishment of order, that is to say of popular government, in\nSicily, many lawsuits arose out of events which had happened years\nbefore; and, owing to the lapse of time, demonstrative evidence was not\navailable. Accordingly, recourse was had on both sides to arguments\npossessing a greater or less degree of probability. The art of putting\nsuch probable inferences so as to produce persuasion demanded great\ntechnical skill; and two Sicilians, Corax and Tisias by name, composed\ntreatises on the subject. It would appear that the new-born art was\ntaken up by Protagoras and developed in the direction of increased\ndialectical subtlety. We are informed that he undertook to make the\nworse appear the better reason; and this very soon came to be popularly\nconsidered as an accomplishment taught by all philosophers, Socrates\namong the rest. But if Protagoras merely meant that he would teach the\nart of reasoning, one hardly sees how he could have expressed himself\notherwise, consistently with the antithetical style of his age. We\nshould say more simply that a case is strengthened by the ability to\nargue it properly. It has not been shown that the Protagorean dialectic\noffered exceptional facilities for maintaining unjust pretensions.\nTaken, however, in connexion with the humanistic teaching, it had an\nunsettling and sceptical tendency. All belief and all practice rested\non law, and law was the result of a convention made among men and\nultimately produced by individual conviction. What one man had done\nanother could undo. Religious tradition and natural right, the sole\nexternal standards, had already disappeared. There remained the test\nof self-consistency, and against this all the subtlety of the new\ndialectic was turned. The triumph of Eristic was to show that a speaker\nhad contradicted himself, no matter how his statements might be worded.\nMoreover, now that reference to an objective reality was disallowed,\nwords were put in the place of things and treated like concrete\nrealities. The next step was to tear them out of the grammatical\nconstruction, where alone they possessed any truth or meaning, each\nbeing simultaneously credited with all the uses which at any time it\nmight be made to fulfil. For example, if a man knew one thing he knew\nall, for he had knowledge, and knowledge is of everything knowable.\nMuch that seems to us tedious or superfluous in Aristotle’s expositions\nwas intended as a safeguard against this endless cavilling. Finally,\nnegation itself was eliminated along with the possibility of falsehood\nand contradiction. For it was argued that ‘nothing’ had no existence\nand could not be an object of thought.[71]\n\n\nVI.\n\nFrom utter confusion to extreme nihilism there was but a single step.\nThis step was taken by Gorgias, the Sicilian rhetorician, who held\nthe same relation towards western Hellas and the Eleatic school as\nthat which Protagoras held towards eastern Hellas and the philosophy\nof Heracleitus. He, like his eminent contemporary, was opposed to the\nthinkers whom, borrowing a useful term from the nomenclature of the\nlast century, we may call the Greek physiocrats. To confute them,\nhe wrote a book with the significant title, _On Nature or Nothing_:\nmaintaining, first, that nothing exists; secondly, that if anything\nexists, we cannot know it; thirdly, that if we know it, there is no\npossibility of communicating our knowledge to others. The first thesis\nwas established by pushing the Eleatic arguments against movement\nand change a little further; the second by showing that thought and\nexistence are different, or else everything that is thought of would\nexist; the third by establishing a similar incommensurability between\nwords and sensations. Grote has attempted to show that Gorgias was\nonly arguing against the existence of a noumenon underlying phenomena,\nsuch as all idealists deny. Zeller has, however, convincingly proved\nthat Gorgias, in common with every other thinker before Plato, was\nignorant of this distinction;[72] and we may add that it would leave\nthe second and third theses absolutely unimpaired. We must take the\nwhole together as constituting a declaration of war against science,\nan assertion, in still stronger language, of the agnosticism taught\nby Protagoras. The truth is, that a Greek controversialist generally\noverproved his case, and in order to overwhelm an adversary pulled\ndown the whole house, even at the risk of being buried among the ruins\nhimself. A modern reasoner, taking his cue from Gorgias, without\npushing the matter to such an extreme, might carry on his attack on\nlines running parallel with those laid down by the Sicilian Sophist. He\nwould begin by denying the existence of a ‘state of Nature’; for such a\nstate must be either variable or constant. If it is constant, how could\ncivilisation ever have arisen? If it is variable, what becomes of the\nfixed standard appealed to? Then, again, supposing such a state ever\nto have existed, how could authentic information about it have come\ndown to us through the ages of corruption which are supposed to have\nintervened? And, lastly, granting that a state of Nature accessible to\nenquiry has ever existed, how can we reorganise society on the basis of\nsuch discordant data as are presented to us by the physiocrats, no two\nof whom agree with regard to the first principles of natural order; one\nsaying that it is equality, another aristocracy, and a third despotism?\nWe do not say that these arguments are conclusive, we only mean that\nin relation to modern thought they very fairly represent the dialectic\nartillery brought to bear by Greek humanism against its naturalistic\nopponents.\n\nWe have seen how Prodicus and Hippias professed to teach all science,\nall literature, and all virtuous accomplishments. We have seen how\nProtagoras rejected every kind of knowledge unconnected with social\nculture. We now find Gorgias going a step further. In his later years,\nat least, he professes to teach nothing but rhetoric or the art of\npersuasion. We say in his later years, for at one time he seems to have\ntaught ethics and psychology as well.[73] But the Gorgias of Plato’s\nfamous dialogue limits himself to the power of producing persuasion\nby words on all possible subjects, even those of whose details he is\nignorant. Wherever the rhetorician comes into competition with the\nprofessional he will beat him on his own ground, and will be preferred\nto him for every public office. The type is by no means extinct, and\nflourishes like a green bay-tree among ourselves. Like Pendennis, a\nwriter of this kind will review any book from the height of superior\nknowledge acquired by two hours’ reading in the British Museum; or,\nif he is adroit enough, will dispense with even that slender amount\nof preparation. He need not even trouble himself to read the book\nwhich he criticises. A superficial acquaintance with magazine articles\nwill qualify him to pass judgment on all life, all religion, and all\nphilosophy. But it is in politics that the finest career lies before\nhim. He rises to power by attacking the measures of real statesmen, and\nremains there by adopting them. He becomes Chancellor of the Exchequer\nby gross economical blundering, and Prime Minister by a happy mixture\nof epigram and adulation.\n\nRhetoric conferred even greater power in old Athens than in modern\nEngland. Not only did mastery of expression lead to public employment;\nbut also, as every citizen was permitted by law to address his\nassembled fellow-countrymen and propose measures for their acceptance,\nit became a direct passport to supreme political authority. Nor was\nthis all. At Athens the employment of professional advocates was\nnot allowed, and it was easy to prosecute an enemy on the most\nfrivolous pretexts. If the defendant happened to be wealthy, and\nif condemnation involved a loss of property, there was a prejudice\nagainst him in the minds of the jury, confiscation being regarded as\na convenient resource for replenishing the national exchequer. Thus\nthe possession of rhetorical ability became a formidable weapon in\nthe hands of unscrupulous citizens, who were enabled to extort large\nsums by the mere threat of putting rich men on their trial for some\nreal or pretended offence. This systematic employment of rhetoric for\npurposes of self-aggrandisement bore much the same relation to the\nteaching of Protagoras and Gorgias as the open and violent seizure of\nsupreme power on the plea of natural superiority bore to the theories\nof their rivals, being the way in which practical men applied the\nprinciple that truth is determined by persuasion. It was also attended\nby considerably less danger than a frank appeal to the right of the\nstronger, so far at least as the aristocratic party were concerned.\nFor they had been taught a lesson not easily forgotten by the downfall\nof the oligarchies established in 411 and 404; and the second\ncatastrophe especially proved that nothing but a popular government\nwas possible in Athens. Accordingly, the nobles set themselves to\nstudy new methods for obtaining their ultimate end, which was always\nthe possession of uncontrolled power over the lives and fortunes of\ntheir fellow-citizens. With wealth to purchase instruction from the\nSophists, with leisure to practise oratory, and with the ability often\naccompanying high birth, there was no reason why the successors of\nCharmides and Critias should not enjoy all the pleasures of tyranny\nunaccompanied by any of its drawbacks. Here, again, a parallel suggests\nitself between ancient Greece and modern Europe. On the Continent,\nwhere theories of natural law are far more prevalent than with us, it\nis by brute force that justice is trampled down: the one great object\nof every ambitious intriguer is to possess himself of the military\nmachine, his one great terror, that a stronger man may succeed in\nwresting it from him; in England the political adventurer looks to\nrhetoric as his only resource, and at the pinnacle of power has to\ndread the hailstorm of epigrammatic invective directed against him by\nabler or younger rivals.[74]\n\nBesides its influence on the formation and direction of political\neloquence, the doctrine professed by Protagoras had a far-reaching\neffect on the subsequent development of thought. Just as Cynicism was\nevolved from the theory of Hippias, so also did the teaching which\ndenied Nature and concentrated all study on subjective phenomena, with\na tendency towards individualistic isolation, lead on to the system of\nAristippus. The founder of the Cyrenaic school is called a Sophist by\nAristotle, nor can the justice of the appellation be doubted. He was,\nit is true, a friend and companion of Socrates, but intellectually\nhe is more nearly related to Protagoras. Aristippus rejected\nphysical studies, reduced all knowledge to the consciousness of our\nown sensations, and made immediate gratification the end of life.\nProtagoras would have objected to the last principle, but it was only\nan extension of his own views, for all history proves that Hedonism is\nconstantly associated with sensationalism. The theory that knowledge is\nbuilt up out of feelings has an elective affinity for the theory that\naction is, or ought to be, determined in the last resort by the most\nprominent feelings, which are pleasure and pain. Both theories have\nsince been strengthened by the introduction of a new and more ideal\nelement into each. We have come to see that knowledge is constituted\nnot by sensations alone, but by sensations grouped according to\ncertain laws which seem to be inseparable from the existence of any\nconsciousness whatever. And, similarly, we have learned to take into\naccount, not merely the momentary enjoyments of an individual, but his\nwhole life’s happiness as well, and not his happiness only, but also\nthat of the whole community to which he belongs. Nevertheless, in both\ncases it is rightly held that the element of feeling preponderates, and\nthe doctrines of such thinkers as J. S. Mill are legitimately traceable\nthrough Epicurus and Aristippus to Protagoras as their first originator.\n\nNotwithstanding the importance of this impulse, it does not represent\nthe whole effect produced by Protagoras on philosophy. His eristic\nmethod was taken up by the Megaric school, and at first combined with\nother elements borrowed from Parmenides and Socrates, but ultimately\nextricated from them and used as a critical solvent of all dogmatism\nby the later Sceptics. From their writings, after a long interval of\nenforced silence, it passed over to Montaigne, Bayle, Hume, and Kant,\nwith what redoubtable consequences to received opinions need not here\nbe specified. Our object is simply to illustrate the continuity of\nthought, and the powerful influence exercised by ancient Greece on its\nsubsequent development.\n\nEvery variety of opinion current among the Sophists reduces itself,\nin the last analysis, to their fundamental antithesis between Nature\nand Law, the latter being somewhat ambiguously conceived by its\nsupporters as either human reason or human will, or more generally\nas both together, combining to assert their self-dependence and\nemancipation from external authority. This antithesis was prefigured in\nthe distinction between Chthonian and Olympian divinities. Continuing\nafterwards to inspire the rivalry of opposing schools, Cynic against\nCyrenaic, Stoic against Epicurean, Sceptic against Dogmatist, it was\nbut partially overcome by the mediatorial schemes of Socrates and his\nsuccessors. Then came Catholicism, equally adverse to the pretensions\nof either party, and held them down under its suffocating pressure for\nmore than a thousand years.\n\n    ‘Natur und Geist, so spricht man nicht zu Christen,\n    Darum verbrennt man Atheisten;\n    Natur ist Sünde, Geist ist Teufel.’\n\nBoth slowly struggled back into consciousness in the fitful dreams\nof mediaeval sleep. Nature was represented by astrology with its\nfatalistic predetermination of events; idealism by the alchemical\nlore which was to give its possessor eternal youth and inexhaustible\nwealth. With the complete revival of classic literature and the\ntemporary neutralisation of theology by internal discord, both sprang\nup again in glorious life, and produced the great art of the sixteenth\ncentury, the great science and philosophy of the seventeenth. Later\non, becoming self-conscious, they divide, and their partisans draw off\ninto two opposing armies, Rousseau against Voltaire, Herder against\nKant, Goethe against Schiller, Hume against himself. Together they\nbring about the Revolution; but after marching hand in hand to the\ndestruction of all existing institutions they again part company, and,\nputting on the frippery of a dead faith, confront one another, each\nwith its own ritual, its own acolytes, its own intolerance, with feasts\nof Nature and goddesses of Reason, in mutual and murderous hostility.\nWhen the storm subsided, new lines of demarcation were laid down, and\nthe cause of political liberty was dissociated from what seemed to be\nthoroughly discredited figments. Nevertheless, imaginative literature\nstill preserves traces of the old conflict, and on examining the four\ngreatest English novelists of the last fifty years we shall find that\nDickens and Charlotte Bronté, though personally most unlike, agree\nin representing the arbitrary, subjective, ideal side of life, the\nsubjugation of things to self, not of self to things; he transfiguring\nthem in the light of humour, fancy, sentiment; she transforming\nthem by the alchemy of inward passion; while Thackeray and George\nEliot represent the triumph of natural forces over rebellious\nindividualities; the one writer depicting an often crude reality at\nodds with convention and conceit; while the other, possessing, if\nnot an intrinsically greater genius, at least a higher philosophical\nculture, discloses to us the primordial necessities of existence, the\npitiless conformations of circumstance, before which egoism, ignorance,\nillusion, and indecision must bow, or be crushed to pieces if they\nresist.\n\n\nVII.\n\nOur readers have now before them everything of importance that is\nknown about the Sophists, and something more that is not known for\ncertain, but may, we think, be reasonably conjectured. Taking the\nwhole class together, they represent a combination of three distinct\ntendencies, the endeavour to supply an encyclopaedic training for\nyouth, the cultivation of political rhetoric as a special art, and\nthe search after a scientific foundation for ethics derived from the\nresults of previous philosophy. With regard to the last point, they\nagree in drawing a fundamental distinction between Nature and Law,\nbut some take one and some the other for their guide. The partisans\nof Nature lean to the side of a more comprehensive education, while\ntheir opponents tend more and more to lay an exclusive stress on\noratorical proficiency. Both schools are at last infected by the\nmoral corruption of the day, natural right becoming identified with\nthe interest of the stronger, and humanism leading to the denial of\nobjective reality, the substitution of illusion for knowledge, and the\nconfusion of momentary gratification with moral good. The dialectical\nhabit of considering every question under contradictory aspects\ndegenerates into eristic prize-fighting and deliberate disregard\nof the conditions which alone make argument possible. Finally, the\ncomponent elements of Sophisticism are dissociated from one another,\nand are either separately developed or pass over into new combinations.\nRhetoric, apart from speculation, absorbs the whole time and talent\nof an Isocrates; general culture is imparted by a professorial class\nwithout originality, but without reproach; naturalism and sensuous\nidealism are worked up into systematic completion for the sake of their\nphilosophical interest alone; and the name of sophistry is unhappily\nfastened by Aristotle on paid exhibitions of verbal wrangling which the\ngreat Sophists would have regarded with indignation and disgust.\n\nIt remains for us to glance at the controversy which has long been\ncarried on respecting the true position of the Sophists in Greek life\nand thought. We have already alluded to the by no means favourable\njudgment passed on them by some among their contemporaries. Socrates\ncondemned them severely,[H] but only because they received payment for\ntheir lessons; and the sentiment was probably echoed by many who had\nneither his disinterestedness nor his frugality. To make profit by\nintellectual work was not unusual in Greece. Pheidias sold his statues;\nPindar spent his life writing for money; Simonides and Sophocles were\ncharged with showing too great eagerness in the pursuit of gain.[75]\nBut a man’s conversation with his friends had always been gratuitous,\nand the novel idea of charging a high fee for it excited considerable\noffence. Socrates called it prostitution—the sale of that which should\nbe the free gift of love—without perhaps sufficiently considering\nthat the same privilege had formerly been purchased with a more\ndishonourable price. He also considered that a freeman was degraded\nby placing himself at the beck and call of another, although it would\nappear that the Sophists chose their own time for lecturing, and were\ncertainly not more slaves than a sculptor or poet who had received an\norder to execute. It was also argued that any one who really succeeded\nin improving the community benefited so much by the result that it\nwas unfair on his part to demand any additional remuneration. Suppose\na popular preacher were to come over from New York to England, star\nabout among the principal cities, charging a high price for admission\nto his sermons, and finally return home in possession of a handsome\nfortune, we can well imagine that sarcasms at the expense of such\nprofitable piety would not be wanting. This hypothetical case will help\nus to understand how many an honest Athenian must have felt towards the\nshowy colonial strangers who were making such a lucrative business of\nteaching moderation and justice. Plato, speaking for his master but not\nfrom his master’s standpoint, raised an entirely different objection.\nHe saw no reason why the Sophists should not sell their wisdom if\nthey had any wisdom to sell. But this was precisely what he denied.\nHe submitted their pretensions to a searching cross-examination,\nand, as he considered, convicted them of being worthless pretenders.\nThere was a certain unfairness about this method, for neither his\nown positive teaching nor that of Socrates could have stood before\na similar test, as Aristotle speedily demonstrated in the next\ngeneration. He was, in fact, only doing for Protagoras and Gorgias\nwhat they had done for early Greek speculation, and what every school\nhabitually does for its predecessors. It had yet to be learned that\nthis dissolving dialectic constitutes the very law of philosophical\nprogress. The discovery was made by Hegel, and it is to him that the\nSophists owe their rehabilitation in modern times. His lectures on\nthe History of Philosophy contain much that was afterwards urged by\nGrote on the same side. Five years before the appearance of Grote’s\nfamous sixty-seventh chapter, Lewes had also published a vindication\nof the Sophists, possibly suggested by Hegel’s work, which he had\ncertainly consulted when preparing his own History. There is, however,\nthis great difference, that while the two English critics endeavour\nto minimise the sceptical, innovating tendency of the Sophists, it\nis, contrariwise, brought into exaggerated prominence by the German\nphilosopher. We have just remarked that the final dissolution of\nSophisticism was brought about by the separate development given to\neach of the various tendencies which it temporarily combined. Now,\neach of our three apologists has taken up one of these tendencies, and\ntreated it as constituting the whole movement under discussion. To\nHegel, the Sophists are chiefly subjective idealists. To Lewes, they\nare rhetoricians like Isocrates. To Grote, they are, what in truth the\nSophists of the Roman empire were, teachers representing the standard\nopinions of their age. Lewes and Grote are both particularly anxious\nto prove that the original Sophists did not corrupt Greek morality.\nThus much has been conceded by contemporary German criticism, and is\nno more than was observed by Plato long ago. Grote further asserts\nthat the implied corruption of morality is an illusion, and that at\nthe end of the Peloponnesian war the Athenians were no worse than\ntheir forefathers who fought at Marathon. His opinion is shared by\nso accomplished a scholar as Prof. Jowett;[76] but here he has the\ncombined authority of Thucydides, Aristophanes, and Plato against him.\nWe have, however, examined this question already, and need not return\nto it. Whether any of the Sophists themselves can be proved to have\ntaught immoral doctrines is another moot point. Grote defends them\nall, Polus and Thrasymachus included. Here, also, we have expressed\nour dissent from the eminent historian, whom we can only suppose to\nhave missed the whole point of Plato’s argument. Lewes takes different\nground when he accuses Plato of misrepresenting his opponents. It is\ntrue that the Sophists cannot be heard in self-defence, but there is\nno internal improbability about the charges brought against them. The\nGreek rhetoricians are not accused of saying anything that has not been\nsaid again and again by their modern representatives. Whether the odium\nof such sentiments should attach itself to the whole class of Sophists\nis quite another question. Grote denies that they held any doctrine in\ncommon. The German critics, on the other hand, insist on treating them\nas a school with common principles and tendencies. Brandis calls them\n‘a number of men, gifted indeed, but not seekers after knowledge for\nits own sake, who made a trade of giving instruction as a means for\nthe attainment of external and selfish ends, and of substituting mere\ntechnical proficiency for real science.’[77] If our account be the true\none, this would apply to Gorgias and the younger rhetoricians alone.\nOne does not precisely see what external or selfish ends were subserved\nby the physical philosophy which Prodicus and Hippias taught, nor\nwhy the comprehensive enquiries of Protagoras into the conditions of\ncivilisation and the limits of human knowledge should be contemptuously\nflung aside because he made them the basis of an honourable profession.\nZeller, in much the same strain, defines a Sophist as one who professes\nto be a teacher of wisdom, while his object is individual culture (die\nformelle und praktische Bildung des Subjekts) and not the scientific\ninvestigation of truth.[78] We do not know whether Grote was content\nwith an explanation which would only have required an unimportant\nmodification of his own statements to agree precisely with them. It\nought amply to have satisfied Lewes. For ourselves, we must confess to\ncaring very little whether the Sophists investigated truth for its own\nsake or as a means to self-culture. We believe, and in the next chapter\nwe hope to show, that Socrates, at any rate, did not treat knowledge\napart from practice as an end in itself. But the history of philosophy\nis not concerned with such subtleties as these. Our contention is that\nthe Stoic, Epicurean, and Sceptical schools may be traced back through\nAntisthenes and Aristippus to Hippias and Protagoras much more directly\nthan to Socrates. If Zeller will grant this, then he can no longer\ntreat Sophisticism as a mere solvent of the old physical philosophy.\nIf he denies it, we can only appeal to his own history, which here, as\nwell as in our discussions of early Greek thought, we have found more\nuseful than any other work on the subject. Our obligations to Grote\nare of a more general character. We have learned from him to look at\nthe Sophists without prejudice. But we think that he, too, underrates\ntheir far-reaching intellectual significance, while his defence of\ntheir moral orthodoxy seems, so far as certain members of the class are\nconcerned, inconsistent with any belief in Plato’s historical fidelity.\nThat the most eminent Sophists did nothing to corrupt Greek morality\nis now almost universally admitted. If we have succeeded in showing\nthat they did not corrupt but fruitfully develop Greek philosophy, the\npurpose of this study will have been sufficiently fulfilled.\n\nThe title of this chapter may have seemed to promise more than a\ncasual mention of the thinker in whom Greek Humanism attained its\nloftiest and purest expression. But in history, no less than in life,\nSocrates must ever stand apart from the Sophists. Beyond and above all\nspecialities of teaching, the transcendent dignity of a character which\npersonified philosophy itself demands a separate treatment. Readers who\nhave followed us thus far may feel interested in an attempt to throw\nsome new light on one who was a riddle to his contemporaries, and has\nremained a riddle to after-ages.\n\nFOOTNOTES:\n\n[43] ‘Thou shalt not take that which is mine, and may I do to others as\nI would that they should do to me’ (Plato, _Legg._, 913, A. Jowett’s\nTransl., vol. V., p. 483). Isocrates makes a king addressing his\ngovernors say: ‘You should be to others what you think I should be to\nyou’ (_Nicocles_, 49). And again: ‘Do not to others what it makes you\nangry to suffer yourselves’ (_Ibid._, 61). A similar observation is\nattributed to Thales, doubtless by an anachronism (Diogenes Laertius,\nI., i., 36).\n\n[44] We gladly avail ourselves of the masterly translation given by\nProf. Jebb. The whole of this splendid passage will be found in his\n_Attic Orators_, vol. II., pp. 78-79.\n\n[45] _Symposium_, 211, C; Jowett’s Transl., vol. II.\n\n[46] Aesch., _Sep. con. Theb._, 592.\n\n[47] _Legg._, 727, E; Jowett’s Transl., V, 299.\n\n[48] See Plato’s _Charmides_; and Euripides’ _Medea_, 635 (Dindorf).\n\n[49] Pindar uses καιρός and μέτρον as synonymous terms.\n\n[50] _Opp. et D._, 271.\n\n[51] Hom. _Il._, IV., 160, 235; VII., 76, 411; XVI., 386. Hes., _Opp.\net D._, 265. These references are copied from Welcker, _Griechische\nGötterlehre_, I., p. 178, q. v.\n\n[52] See Maine’s _Ancient Law_, chap. X., _The Early History of Delict\nand Crime_.\n\n[53] Preller, _Griechische Mythologie_, I., p. 523 (3rd ed.), with\nwhich cf. Welcker, _op. cit._, I., 234; and Mr. Walter Pater’s _Demeter\nand Persephone_, and _A Study of Dionysus_, in the _Fortnightly Review_\nfor Jan., Feb., and Dec. 1876. From their popular character, the\ncountry gods were favoured by the despots (Curtius, _Gr. Gesch._, I.,\np. 338).\n\n[54] Cf. Wordsworth—\n\n    ‘Thou dost preserve the stars from wrong,\n    And the most ancient heavens through thee are fresh and strong.’\n                                               _Ode to Duty._\n\n[55] Pindar, _Olymp._, II., 57 ff.; and _Fragm._, 1-4 (Donaldson).\n\n[56] _Sep. con. Theb._, 662-71.\n\n[57] _Phoenissae_, 503-23.\n\n[58]\n\n    Οὐ γὰρ ἄλλῳ γ’ ὑπακούσαιμεν τῶν νῦν μετεωροσοφιστῶν\n    πλὴν ἢ Προδίκῳ, τῷ μὲν σοφίας καὶ γνώμης οὕνεκα κ.τ.λ.—\n                        _Nub._, 361-2. Cf. _Av._, 692.\n\n[59] Plato, _Protagoras_, 337, D; Jowett’s Transl., vol. I., p. 152.\n\n[60] _Nem._, VI., _sub. in._\n\n[61] _Prom._, 518.\n\n[62] _Phoenissae_, 536-47. There is a delicious parody of this method\nin the _Clouds_. A creditor asks Strepsiades, who has been taking\nlessons in philosophy, to pay him the interest on a loan. Strepsiades\nbegs to know whether the sea is any fuller now than it used to be.\n‘No,’ replies the other, ‘for it would not be just,’ (οὐ γὰρ δίκαιον\nπλείον εἶναι). ‘Then, you wretch,’ rejoins his debtor, ‘do you suppose\nthat the sea is not to get any fuller although all the rivers are\nflowing into it, and that your money is to go on increasing?’ (1290-95.)\n\n[63] Xenophon, _Memor._, IV., iv., 19.\n\n[64] _Pol._, I., ii.\n\n[65] The _Hippias Minor_.\n\n[66] Diog. L., IX., viii., 54.\n\n[67] Diog. L., IX., viii., 51.\n\n[68] Plato, _Protagoras_, 327; Jowett’s Transl., vol. I., p. 140. On\nthe superior morality which accompanies advancing civilisation, as\nevinced by the great increase of mutual trust, see Maine’s _Ancient\nLaw_, pp. 306-7.\n\n[69] This point is noticed by Zeller, _Ph. d. Gr._, II., 22.\n\n[70] This phase of Greek life is well illustrated by the addresses of\nTheognis to Cyrnus.\n\n[71] Eristicism had also points of contact with the philosophies of\nParmenides and Socrates which will be indicated in a future chapter.\n\n[72] _Ph. d. Gr._, I., 903 (3rd ed.).\n\n[73] See Plato’s _Meno_, _sub. in._\n\n[74] Lord Beaconsfield recently [written in February 1880] spoke of the\nBalkans as forming an ‘intelligible’ frontier for Turkey. Continental\ntelegrams substituted ‘natural frontier.’ The change was characteristic\nand significant.\n\n[75] Aristoph., _Pax_, 697.\n\n[76] ‘As Mr. Grote remarks, there is no reason to suspect any greater\nmoral corruption in the age of Demosthenes than in the age of\nPericles.’ (_The Dialogues of Plato_, vol. IV., p. 380.) We do not\nremember that Grote commits himself to such a sweeping statement, nor\nwas it necessary for his purpose to do so. No one would have been more\nsurprised than Demosthenes himself to hear that the Athenians of his\ngeneration equalled the contemporaries of Pericles in public virtue.\n(Cf. Grote’s _Plato_, II., 148.)\n\n[77] _Geschichte der Entwickelung der Griechischen Philosophie_, I., p.\n204.\n\n[78] _Philosophie d. Gr._, I., p. 943 (3rd ed.).\n\n[79] The invention of memoir-writing is claimed by Prof. Mahaffy\n(_Hist. Gr. Lit._, II., 42) for Ion of Chios and his contemporary\nStesimbrotus. But—apart from their questionable authenticity—the\nsketches attributed to these two writers do not seem to have aimed at\npresenting a complete picture of a single individual, which is what was\nattempted with considerable success in Xenophon’s _Memorabilia_.\n\n\n\n\nCHAPTER III.\n\nTHE PLACE OF SOCRATES IN GREEK PHILOSOPHY.\n\n\nI.\n\nApart from legendary reputations, there is no name in the world’s\nhistory more famous than that of Socrates, and in the history of\nphilosophy there is none so famous. The only thinker that approaches\nhim in celebrity is his own disciple Plato. Every one who has heard\nof Greece or Athens has heard of him. Every one who has heard of him\nknows that he was supremely good and great. Each successive generation\nhas confirmed the reputed Delphic oracle that no man was wiser than\nSocrates. He, with one or two others, alone came near to realising the\nideal of a Stoic sage. Christians deem it no irreverence to compare\nhim with the Founder of their religion. If a few dissentient voices\nhave broken the general unanimity, they have, whether consciously or\nnot, been inspired by the Socratic principle that we should let no\nopinion pass unquestioned and unproved. Furthermore, it so happens\nthat this wonderful figure is known even to the multitude by sight as\nwell as by name. Busts, cameos, and engravings have made all familiar\nwith the Silenus-like physiognomy, the thick lips, upturned nose,\nand prominent eyes which impressed themselves so strangely on the\nimagination of a race who are accused of having cared for nothing\nbut physical beauty, because they rightly regarded it as the natural\naccompaniment of moral loveliness. Those who wish to discover what\nmanner of mind lay hid beneath this uninviting exterior may easily\nsatisfy their curiosity, for Socrates is personally better known\nthan any other character of antiquity. Dr. Johnson himself is not\na more familiar figure to the student of literature. Alone among\nclassical worthies his table-talk has been preserved for us, and the\nart of memoir-writing seems to have been expressly created for his\nbehoof.[79] We can follow him into all sorts of company and test his\nbehaviour in every variety of circumstances. He conversed with all\nclasses and on all subjects of human interest, with artisans, artists,\ngenerals, statesmen, professors, and professional beauties. We meet\nhim in the armourer’s workshop, in the sculptor’s studio, in the\nboudoirs of the _demi-monde_, in the banqueting-halls of flower-crowned\nand wine-flushed Athenian youth, combining the self-mastery of an\nAntisthenes with the plastic grace of an Aristippus; or, in graver\nmoments, cheering his comrades during the disastrous retreat from\nDelium; upholding the sanctity of law, as President of the Assembly,\nagainst a delirious populace; confronting with invincible irony the\noligarchic terrorists who held life and death in their hands; pleading\nnot for himself, but for reason and justice, before a stupid and\nbigoted tribunal; and, in the last sad scene of all, exchanging Attic\ncourtesies with the unwilling instrument of his death.[80]\n\nSuch a character would, in any case, be remarkable; it becomes of\nextraordinary, or rather of unique, interest when we consider that\nSocrates could be and do so much, not in spite of being a philosopher,\nbut because he was a philosopher, the chief though not the sole\noriginator of a vast intellectual revolution; one who, as a teacher,\nconstituted the supremacy of reason, and as an individual made\nreason his sole guide in life. He at once discovered new principles,\npopularised them for the benefit of others, and exemplified them in\nhis own conduct; but he did not accomplish these results separately;\nthey were only different aspects of the same systematising process\nwhich is identical with philosophy itself. Yet the very success of\nSocrates in harmonising life and thought makes it the more difficult\nfor us to construct a complete picture of his personality. Different\nobservers have selected from the complex combination that which best\nsuited their own mental predisposition, pushing out of sight the other\nelements which, with him, served to correct and complete it. The very\npopularity that has attached itself to his name is a proof of this; for\nthe multitude can seldom appreciate more than one excellence at a time,\nnor is that usually of the highest order. Hegel complains that Socrates\nhas been made the patron-saint of moral twaddle.[81] We are fifty\nyears further removed than Hegel from the golden age of platitude; the\ntwaddle of our own time is half cynical, half aesthetic, and wholly\nunmoral; yet there are no signs of diminution in the popular favour\nwith which Socrates has always been regarded. The man of the world, the\nwit, the _viveur_, the enthusiastic admirer of youthful beauty, the\nscornful critic of democracy is welcome to many who have no taste for\nethical discourses and fine-spun arguments.\n\nNor is it only the personality of Socrates that has been so variously\nconceived; his philosophy, so far as it can be separated from his\nlife, has equally given occasion to conflicting interpretations, and\nit has even been denied that he had, properly speaking, any philosophy\nat all. These divergent presentations of his teaching, if teaching it\ncan be called, begin with the two disciples to whom our knowledge of\nit is almost entirely due. There is, curiously enough, much the same\ninner discrepancy between Xenophon’s _Memorabilia_ and those Platonic\ndialogues where Socrates is the principal spokesman, as that which\ndistinguishes the Synoptic from the Johannine Gospels. The one gives\nus a report certainly authentic, but probably incomplete; the other\naccount is, beyond all doubt, a highly idealised portraiture, but seems\nto contain some traits directly copied from the original, which may\nwell have escaped a less philosophical observer than Plato. Aristotle\nalso furnishes us with some scanty notices which are of use in deciding\nbetween the two rival versions, although we cannot be sure that he had\naccess to any better sources of information than are open to ourselves.\nBy variously combining and reasoning from these data modern critics\nhave produced a third Socrates, who is often little more than the\nembodiment of their own favourite opinions.\n\nIn England, the most generally accepted method seems to be that\nfollowed by Grote. This consists in taking the Platonic _Apologia_ as a\nsufficiently faithful report of the defence actually made by Socrates\non his trial, and piecing it on to the details supplied by Xenophon, or\nat least to as many of them as can be made to fit, without too obvious\nan accommodation of their meaning. If, however, we ask on what grounds\na greater historical credibility is attributed to the _Apologia_ than\nto the _Republic_ or the _Phaedo_, none can be offered except the\nseemingly transparent truthfulness of the narrative itself, an argument\nwhich will not weigh much with those who remember how brilliant was\nPlato’s talent for fiction, and how unscrupulously it could be employed\nfor purposes of edification. The _Phaedo_ puts an autobiographical\nstatement into the mouth of Socrates which we only know to be imaginary\nbecause it involves the acceptance of a theory unknown to the real\nSocrates. Why, then, may not Plato have thought proper to introduce\nequally fictitious details into the speech delivered by his master\nbefore the dicastery, if, indeed, the speech, as we have it, be not a\nfancy composition from beginning to end?\n\nBefore we can come to a decision on this point it will be necessary\nbriefly to recapitulate the statements in question. Socrates is\ndefending himself against a capital charge. He fears that a prejudice\nrespecting him may exist in the minds of the jury, and tries to explain\nhow it arose without any fault of his, as follows:—A certain friend of\nhis had asked the oracle at Delphi whether there was any man wiser than\nSocrates? The answer was that no man was wiser. Not being conscious of\npossessing any wisdom, great or small, he felt considerably surprised\non hearing of this declaration, and thought to convince the god of\nfalsehood by finding out some one wiser than himself. He first went\nto an eminent politician, who, however, proved, on examination, to be\nutterly ignorant, with the further disadvantage that it was impossible\nto convince him of his ignorance. On applying the same test to others a\nprecisely similar result was obtained. It was only the handicraftsmen\nwho could give a satisfactory account of themselves, and their\nknowledge of one trade made them fancy that they understood everything\nelse equally well. Thus the meaning of the oracle was shown to be that\nGod alone is truly wise, and that of all men he is wisest who, like\nSocrates, perceives that human wisdom is worth little or nothing. Ever\nsince then, Socrates has made it his business to vindicate the divine\nveracity by seeking out and exposing every pretender to knowledge that\nhe can find, a line of conduct which has made him extremely unpopular\nin Athens, while it has also won him a great reputation for wisdom,\nas people supposed that the matters on which he convicted others of\nignorance were perfectly clear to himself.\n\nThe first difficulty that strikes one in connexion with this\nextraordinary story arises out of the oracle on which it all hinges.\nHad such a declaration been really made by the Pythia, would not\nXenophon have eagerly quoted it as a proof of the high favour in which\nhis hero stood with the gods?[82] And how could Socrates have acquired\nso great a reputation before entering on the cross-examining career\nwhich alone made him conscious of any superiority over other men, and\nhad alone won the admiration of his fellow-citizens? Our doubts are\nstill further strengthened when we find that the historical Socrates\ndid not by any means profess the sweeping scepticism attributed to\nhim by Plato. So far from believing that ignorance was the common and\nnecessary lot of all mankind, himself included, he held that action\nshould, so far as possible, be entirely guided by knowledge;[83] that\nthe man who did not always know what he was about resembled a slave;\nthat the various virtues were only different forms of knowledge; that\nhe himself possessed this knowledge, and was perfectly competent to\nshare it with his friends. We do, indeed, find him very ready to\nconvince ignorant and presumptuous persons of their deficiencies,\nbut only that he may lead them, if well disposed, into the path of\nright understanding. He also thought that there were certain secrets\nwhich would remain for ever inaccessible to the human intellect,\nfacts connected with the structure of the universe which the gods\nhad reserved for their own exclusive cognisance. This, however,\nwas, according to him, a kind of knowledge which, even if it could\nbe obtained, would not be particularly worth having, and the search\nafter which would leave us no leisure for more useful acquisitions.\nNor does the Platonic Socrates seem to have been at the trouble of\narguing against natural science. The subjects of his elenchus are the\nprofessors of such arts as politics, rhetoric, and poetry. Further,\nwe have something stronger than a simple inference from the facts\nrecorded by Xenophon; we have his express testimony to the fact that\nSocrates did not limit himself to confuting people who fancied they\nknew everything; here we must either have a direct reference to the\n_Apologia_, or to a theory identical with that which it embodies.[I]\nSome stress has been laid on a phrase quoted by Xenophon himself as\nhaving been used by Hippias, which at first sight seems to support\nPlato’s view. The Elian Sophist charges Socrates with practising a\ncontinual irony, refuting others and not submitting to be questioned\nhimself;[84] an accusation which, we may observe in passing, is not\nborne out by the discussion that subsequently takes place between\nthem. Here, however, we must remember that Socrates used to convey\ninstruction under the form of a series of leading questions, the\nanswers to which showed that his interlocutor understood and assented\nto the doctrine propounded. Such a method might easily give rise to\nthe misconception that he refused to disclose his own particular\nopinions, and contented himself with eliciting those held by others.\nFinally, it is to be noted that the idea of fulfilling a religious\nmission, or exposing human ignorance _ad majorem Dei gloriam_, on which\nGrote lays such stress, has no place in Xenophon’s conception of his\nmaster, although, had such an idea been really present, one can hardly\nimagine how it could have been passed over by a writer with whom piety\namounted to superstition. It is, on the other hand, an idea which would\nnaturally occur to a great religious reformer who proposed to base his\nreconstruction of society on faith in a supernatural order, and the\ndesire to realise it here below.\n\nSo far we have contrasted the _Apologia_ with the _Memorabilia_. We\nhave now to consider in what relation it stands to Plato’s other\nwritings. The constructive dogmatic Socrates, who is a principal\nspokesman in some of them, differs widely from the sceptical Socrates\nof the famous _Defence_, and the difference has been urged as an\nargument for the historical authenticity of the latter.[85] Plato, it\nis implied, would not have departed so far from his usual conception\nof the sage, had he not been desirous of reproducing the actual\nwords spoken on so solemn an occasion. There are, however, several\ndialogues which seem to have been composed for the express purpose of\nillustrating the negative method supposed to have been described by\nSocrates to his judges, investigations the sole result of which is to\nupset the theories of other thinkers, or to show that ordinary men\nact without being able to assign a reason for their conduct. Even the\n_Republic_ is professedly tentative in its procedure, and only follows\nout a train of thought which has presented itself almost by accident\nto the company. Unlike Charles Lamb’s Scotchman, the leading spokesman\ndoes not bring, but find, and you are invited to cry halves to whatever\nturns up in his company.\n\nPlato had, in truth, a conception of science which no knowledge then\nattained—perhaps one may add, no knowledge ever attainable—could\ncompletely satisfy. Even the rigour of mathematical demonstration did\nnot content him, for mathematical truth itself rested on unproved\nassumptions, as we also, by the way, have lately discovered. Perhaps\nthe Hegelian system would have fulfilled his requirements; perhaps\nnot even that. Moreover, that the new order which he contemplated\nmight be established, it was necessary to begin by making a clean\nsweep of all existing opinions. With the urbanity of an Athenian, the\npiety of a disciple, and the instinct of a great dramatic artist, he\npreferred to assume that this indispensable task had already been done\nby another. And of all preceding thinkers, who was so well qualified\nfor the undertaking as Socrates? Who else had wielded the weapons of\nnegative dialectic with such consummate dexterity? Who had assumed such\na critical attitude towards the beliefs of his contemporaries? Who\nhad been so anxious to find a point of attachment for every new truth\nin the minds of his interlocutors? Who therefore could, with such\nplausibility, be put forward in the guise of one who laid claim to no\nwisdom on his own account? The son of Phaenaretê seemed made to be the\nBaptist of a Greek Messiah; but Plato, in treating him as such, has\ndrawn a discreet veil over the whole positive side of his predecessor’s\nteaching, and to discover what this was we must place ourselves under\nthe guidance of Xenophon’s more faithful report.\n\nNot that Xenophon is to be taken as a perfectly accurate exponent of\nthe Socratic philosophy. His work, it must be remembered, was primarily\nintended to vindicate Socrates from a charge of impiety and immoral\nteaching, not to expound a system which he was perhaps incompetent\nto appreciate or understand. We are bound to accept everything that\nhe relates; we are bound to include nothing that he does not relate;\nbut we may fairly readjust the proportions of his sketch. It is here\nthat a judicious use of Plato will furnish us with the most valuable\nassistance. He grasped Socratism in all its parts and developed it in\nall directions, so that by following back the lines of his system to\ntheir origin we shall be put on the proper track and shall know where\nto look for the suggestions which were destined to be so magnificently\nworked out.[86]\n\n\nII.\n\nBefore entering on our task of reconstruction, we must turn aside to\nconsider with what success the same enterprise has been attempted\nby modern German criticism, especially by its chief contemporary\nrepresentative, the last and most distinguished historian of Greek\nphilosophy. The result at which Zeller, following Schleiermacher,\narrives is that the great achievement of Socrates was to put forward an\nadequate idea of knowledge; in other words, to show what true science\nought to be, and what, as yet, it had never been, with the addition\nof a demand that all action should be based on such a scientific\nknowledge as its only sure foundation.[87] To know a thing was to know\nits essence, its concept, the assemblage of qualities which together\nconstitute its definition, and make it to be what it is. Former\nthinkers had also sought for knowledge, but not _as_ knowledge, not\nwith a clear notion of what it was that they really wanted. Socrates,\non the other hand, required that men should always be prepared to give\na strict account of the end which they had in view, and of the means\nby which they hoped to gain it. Further, it had been customary to\nsingle out for exclusive attention that quality of an object by which\nthe observer happened to be most strongly impressed, passing over\nall the others; the consequence of which was that the philosophers\nhad taken a one-sided view of facts, with the result of falling into\nhopeless disagreement among themselves; the Sophists had turned these\ncontradictory points of view against one another, and thus effected\ntheir mutual destruction; while the dissolution of objective certainty\nhad led to a corresponding dissolution of moral truth. Socrates accepts\nthe Sophistic scepticism so far as it applies to the existing state of\nscience, but does not push it to the same fatal conclusion; he grants\nthat current beliefs should be thoroughly sifted and, if necessary,\ndiscarded, but only that more solid convictions may be substituted for\nthem. Here a place is found for his method of self-examination, and\nfor the self-conscious ignorance attributed to him by Plato. Comparing\nhis notions on particular subjects with his idea of what knowledge in\ngeneral ought to be, he finds that they do not satisfy it; he knows\nthat he knows nothing. He then has recourse to other men who declare\nthat they possess the knowledge of which he is in search, but their\npretended certainty vanishes under the application of his dialectic\ntest. This is the famous Socratic irony. Finally, he attempts to come\nat real knowledge, that is to say, the construction of definitions,\nby employing that inductive method with the invention of which he\nis credited by Aristotle. This method consists in bringing together\na number of simple and familiar examples from common experience,\ngeneralising from them, and correcting the generalisations by\ncomparison with negative instances. The reasons that led Socrates to\nrestrict his enquiries to human interests are rather lightly passed\nover by Zeller; he seems at a loss how to reconcile the alleged reform\nof scientific method with the complete abandonment of those physical\ninvestigations which, we are told, had suffered so severely from being\ncultivated on a different system.\n\nThere seem to be three principal points aimed at in the very ingenious\ntheory which we have endeavoured to summarise as adequately as space\nwould permit. Zeller apparently wishes to bring Socrates into line with\nthe great tradition of early Greek thought, to distinguish him markedly\nfrom the Sophists, and to trace back to his initiative the intellectual\nmethod of Plato and Aristotle. We cannot admit that the threefold\nattempt has succeeded. It seems to us that a picture into which so\nmuch Platonic colouring has been thrown would for that reason alone,\nand without any further objection, be open to very grave suspicion.\nBut even accepting the historical accuracy of everything that Plato\nhas said, or of as much as may be required, our critic’s inferences\nare not justified by his authorities. Neither the Xenophontic nor the\nPlatonic Socrates seeks knowledge for its own sake, nor does either\nof them offer a satisfactory definition of knowledge, or, indeed, any\ndefinition at all. Aristotle was the first to explain what science\nmeant, and he did so, not by developing the Socratic notion, but by\nincorporating it with the other methods independently struck out\nby physical philosophy. What would science be without the study of\ncausation? and was not this ostentatiously neglected by the founder of\nconceptualism? Again, Plato, in the _Theaetêtus_, makes his Socrates\ncriticise various theories of knowledge, but does not even hint that\nthe critic had himself a better theory than any of them in reserve.\nThe author of the _Phaedo_ and the _Republic_ was less interested in\nreforming the methods of scientific investigation than in directing\nresearch towards that which he believed to be alone worth knowing,\nthe eternal ideas which underlie phenomena. The historical Socrates\nhad no suspicion of transcendental realities; but he thought that\na knowledge of physics was unattainable, and would be worthless if\nattained. By knowledge he meant art rather than science, and his\nmethod of defining was intended not for the latter but for the former.\nThose, he said, who can clearly express what they want to do are best\nsecured against failure, and best able to communicate their skill to\nothers. He made out that the various virtues were different kinds of\nknowledge, not from any extraordinary opinion of its preciousness,\nbut because he thought that knowledge was the variable element in\nvolition and that everything else was constant. Zeller dwells strongly\non the Socratic identification of cognition with conduct; but how\ncould anyone who fell at the first step into such a confusion of ideas\nbe fitted either to explain what science meant or to come forward as\nthe reformer of its methods? Nor is it correct to say that Socrates\napproached an object from every point of view, and took note of all\nits characteristic qualities. On the contrary, one would be inclined\nto charge him with the opposite tendency, with fixing his gaze too\nexclusively on some one quality, that to him, as a teacher, was the\nmost interesting. His identification of virtue with knowledge is an\nexcellent instance of this habit. So also is his identification of\nbeauty with serviceableness, and his general disposition to judge\nof everything by a rather narrow standard of utility. On the other\nhand, Greek physical speculation would have gained nothing by a\nminute attention to definitions, and most probably would have been\nmischievously hampered by it. Aristotle, at any rate, prefers the\nmethod of Democritus to the method of Plato; and Aristotle himself\nis much nearer the truth when he follows on the Ionian or Sicilian\ntrack than when he attempts to define what in the then existing state\nof knowledge could not be satisfactorily defined. To talk about the\nvarious elements—earth, air, fire, and water—as things with which\neverybody was already familiar, may have been a crude unscientific\nprocedure; to analyse them into different combinations of the hot and\nthe cold, the light and the heavy, the dry and the moist, was not\nonly erroneous but fatally misleading; it was arresting enquiry, and\ndoing precisely what the Sophists had been accused of doing, that is,\nsubstituting the conceit for the reality of wisdom. It was, no doubt,\nnecessary that mathematical terms should be defined; but where are we\ntold that geometricians had to learn this truth from Socrates? The\nsciences of quantity, which could hardly have advanced a step without\nthe help of exact conceptions, were successfully cultivated before\nhe was born, and his influence was used to discourage rather than\nto promote their accurate study. With regard to the comprehensive\nall-sided examination of objects on which Zeller lays so much stress,\nand which he seems to regard as something peculiar to the conceptual\nmethod, it had unquestionably been neglected by Parmenides and\nHeracleitus; but had not the deficiency been already made good by their\nimmediate successors? What else is the philosophy of Empedocles,\nthe Atomists, and Anaxagoras, but an attempt—we must add, a by no\nmeans unsuccessful attempt—to recombine the opposing aspects of\nNature which had been too exclusively insisted on at Ephesus and Elea?\nAgain, to say that the Sophists had destroyed physical speculation\nby setting these partial aspects of truth against one another is,\nin our opinion, equally erroneous. First of all, Zeller here falls\ninto the old mistake, long ago corrected by Grote, of treating the\nclass in question as if they all held similar views. We have shown in\nthe preceding chapter, if indeed it required to be shown, that the\nSophists were divided into two principal schools, of which one was\ndevoted to the cultivation of physics. Protagoras and Gorgias were the\nonly sceptics; and it was not by setting one theory against another,\nbut by working out a single theory to its last consequences, that\ntheir scepticism was reached; with no more effect, be it observed,\nthan was exercised by Pyrrho on the science of his day. For the two\ngreat thinkers, with the aid of whose conclusions it was attempted to\ndiscredit objective reality, were already left far behind at the close\nof the fifth century; and neither their reasonings nor reasonings based\non theirs, could exercise much influence on a generation which had\nAnaxagoras on Nature and the encyclopaedia of Democritus in its hands.\nThere was, however, one critic who really did what the Sophists are\ncharged with doing; who derided and denounced physical science on the\nground that its professors were hopelessly at issue with one another;\nand this critic was no other than Socrates himself. He maintained, on\npurely popular and superficial grounds, the same sceptical attitude\nto which Protagoras gave at least the semblance of a psychological\njustification. And he wished that attention should be concentrated\non the very subjects which Protagoras undertook to teach—namely,\nethics, politics, and dialectics. Once more, to say that Socrates was\nconscious of not coming up to his own standard of true knowledge is\ninconsistent with Xenophon’s account, where he is represented as quite\nready to answer every question put to him, and to offer a definition\nof everything that he considered worth defining. His scepticism, if it\never existed, was as artificial and short-lived as the scepticism of\nDescartes.\n\nThe truth is that no man who philosophised at all was ever more\nfree from tormenting doubts and self-questionings; no man was ever\nmore thoroughly satisfied with himself than Socrates. Let us add\nthat, from a Hellenic point of view, no man had ever more reason\nfor self-satisfaction. None, he observed in his last days, had ever\nlived a better or a happier life. Naturally possessed of a powerful\nconstitution, he had so strengthened it by habitual moderation and\nconstant training that up to the hour of his death, at the age of\nseventy, he enjoyed perfect bodily and mental health. Neither hardship\nnor exposure, neither abstinence nor indulgence in what to other men\nwould have been excess, could make any impression on that adamantine\nframe. We know not how much truth there may be in the story that, at\none time, he was remarkable for the violence of his passions; at any\nrate, when our principal informants knew him he was conspicuous for\nthe ease with which he resisted temptation, and for the imperturbable\nsweetness of his temper. His wants, being systematically reduced to\na minimum, were easily satisfied, and his cheerfulness never failed.\nHe enjoyed Athenian society so much that nothing but military duty\ncould draw him away from it. For Socrates was a veteran who had served\nthrough three arduous campaigns, and could give lectures on the\nduties of a general, which so high an authority as Xenophon thought\nworth reporting. He seems to have been on excellent terms with his\nfellow-citizens, never having been engaged in a lawsuit, either as\nplaintiff or defendant, until the fatal prosecution which brought his\ncareer to a close. He could, on that occasion, refuse to prepare a\ndefence, proudly observing that his whole life had been a preparation,\nthat no man had ever seen him commit an unjust or impious deed. The\nanguished cries of doubt uttered by Italian and Sicilian thinkers could\nhave no meaning for one who, on principle, abstained from ontological\nspeculations; the uncertainty of human destiny which hung like a\nthunder-cloud over Pindar and the tragic poets had melted away under\nthe sunshine of arguments, demonstrating, to his satisfaction, the\nreality and beneficence of a supernatural Providence. For he believed\nthat the gods would afford guidance in doubtful conjunctures to all who\napproached their oracles in a reverent spirit; while, over and above\nthe Divine counsels accessible to all men, he was personally attended\nby an oracular voice, a mysterious monitor, which told him what to\navoid, though not what to do, a circumstance well worthy of note, for\nit shows that he did not, like Plato, attribute every kind of right\naction to divine inspiration.\n\nIt may be said that all this only proves Socrates to have been, in\nhis own estimation, a good and happy, but not necessarily a wise man.\nWith him, however, the last of these conditions was inseparable from\nthe other two. He was prepared to demonstrate, step by step, that his\nconduct was regulated by fixed and ascertainable principles, and was\nof the kind best adapted to secure happiness both for himself and for\nothers. That there were deficiencies in his ethical theory may readily\nbe admitted. The idea of universal beneficence seems never to have\ndawned on his horizon; and chastity was to him what sobriety is to us,\nmainly a self-regarding virtue. We do not find that he ever recommended\nconjugal fidelity to husbands; he regarded prostitution very much as\nit is still, unhappily, regarded by men of the world among ourselves;\nand in opposing the darker vices of his countrymen, it was the excess\nrather than the perversion of appetite which he condemned. These,\nhowever, are points which do not interfere with our general contention\nthat Socrates adopted the ethical standard of his time, that he adopted\nit on rational grounds, that having adopted he acted up to it, and\nthat in so reasoning and acting he satisfied his own ideal of absolute\nwisdom.\n\nEven as regards physical phenomena, Socrates, so far from professing\ncomplete ignorance, held a very positive theory which he was quite\nready to share with his friends. He taught what is called the doctrine\nof final causes; and, so far as our knowledge goes, he was either the\nfirst to teach it, or, at any rate, the first to prove the existence of\ndivine agencies by its means. The old poets had occasionally attributed\nthe origin of man and other animals to supernatural intelligence, but,\napparently, without being led to their conviction by any evidence of\ndesign displayed in the structure of organised creatures. Socrates, on\nthe other hand, went through the various external organs of the human\nbody with great minuteness, and showed, to his own satisfaction, that\nthey evinced the workings of a wise and beneficent Artist. We shall\nhave more to say further on about this whole argument; here we only\nwish to observe that, intrinsically, it does not differ very much\nfrom the speculations which its author derided as the fruit of an\nimpertinent curiosity; and that no one who now employed it would, for a\nsingle moment, be called an agnostic or a sceptic.\n\nMust we, then, conclude that Socrates was, after all, nothing but a\nsort of glorified Greek Paley, whose principal achievement was to\npresent the popular ideas of his time on morals and politics under\nthe form of a rather grovelling utilitarianism; and whose ‘evidences\nof natural and revealed religion’ bore much the same relation to\nGreek mythology as the corresponding lucubrations of the worthy\narchdeacon bore to Christian theology? Even were this the whole truth,\nit should be remembered that there was an interval of twenty-three\ncenturies between the two teachers, which ought to be taken due\naccount of in estimating their relative importance. Socrates, with his\nclosely-reasoned, vividly-illustrated ethical expositions, had gained\na tactical advantage over the vague declamations of Gnomic poetry and\nthe isolated aphorisms of the Seven Sages, comparable to that possessed\nby Xenophon and his Ten Thousand in dealing with the unwieldy masses\nof Persian infantry and the undisciplined mountaineers of Carduchia;\nwhile his idea of a uniformly beneficent Creator marked a still greater\nadvance on the jealous divinities of Herodotus. On the other hand,\nas against Hume and Bentham, Paley’s pseudo-scientific paraphernalia\nwere like the muskets and cannon of an Asiatic army when confronted by\nthe English conquerors of India. Yet had Socrates done no more than\ncontributed to philosophy the idea just alluded to, his place in the\nevolution of thought, though honourable, would not have been what it is\njustly held to be—unique.\n\n\nIII.\n\nSo far we have been occupied in disputing the views of others; it is\nnow time that our own view should be stated. We maintain, then, that\nSocrates first brought out the idea, not of knowledge, but of mind in\nits full significance; that he first studied the whole circle of human\ninterests as affected by mind; that, in creating dialectics, he gave\nthis study its proper method, and simultaneously gave his method the\nonly subject-matter on which it could be profitably exercised; finally,\nthat by these immortal achievements philosophy was constituted, and\nreceived a threefold verification—first, from the life of its founder;\nsecondly, from the success with which his spirit was communicated to\na band of followers; thirdly, from the whole subsequent history of\nthought. Before substantiating these assertions point by point, it will\nbe expedient to glance at the external influences which may be supposed\nto have moulded the great intellect and the great character now under\nconsideration.\n\nSocrates was, before all things, an Athenian. To understand him\nwe must first understand what the Athenian character was in itself\nand independently of disturbing circumstances. Our estimate of that\ncharacter is too apt to be biassed by the totally exceptional position\nwhich Athens occupied during the fifth century B.C. The possession\nof empire developed qualities in her children which they had not\nexhibited at an earlier period, and which they ceased to exhibit when\nempire had been lost. Among these must be reckoned military genius,\nan adventurous and romantic spirit, and a high capacity for poetical\nand artistic production—qualities displayed, it is true, by every\nGreek race, but by some for a longer and by others for a shorter\nperiod. Now, the tradition of greatness does not seem to have gone\nvery far back with Athens. Her legendary history, what we have of it,\nis singularly unexciting. The same rather monotonous though edifying\nstory of shelter accorded to persecuted fugitives, of successful\nresistance to foreign invasions, and of devoted self-sacrifice to the\nState, meets us again and again. The Attic drama itself shows how much\nmore stirring was the legendary lore of other tribes. One need only\nlook at the few remaining pieces which treat of patriotic subjects to\nappreciate the difference; and an English reader may easily convince\nhimself of it by comparing Mr. Swinburne’s _Erechtheus_ with the same\nauthor’s _Atalanta_. There is a want of vivid individuality perceptible\nall through. Even Theseus, the great national hero, strikes one as a\nrather tame sort of personage compared with Perseus, Heraclês, and\nJason. No Athenian figures prominently in the _Iliad_; and on the only\ntwo occasions when Pindar was employed to commemorate an Athenian\nvictory at the Panhellenic games, he seems unable to associate it\nwith any legendary glories in the past. The circumstances which for\na long time made Attic history so barren of incident are the same to\nwhich its subsequent importance is due. The relation in which Attica\nstood to the rest of Greece was somewhat similar to the relation in\nwhich Tuscany, long afterwards, stood to the rest of Italy. It was the\nregion least disturbed by foreign immigration, and therefore became\nthe seat of a slower but steadier mental development. It was among\nthose to whom war, revolution, colonisation, and commerce brought\nthe most many-sided experience that intellectual activity was most\nspeedily ripened. Literature, art, and science were cultivated with\nextraordinary success by the Greek cities of Asia Minor, and even\nin some parts of the old country, before Athens had a single man of\ngenius, except Solon, to boast of. But along with the enjoyment of\nundisturbed tranquillity, habits of self-government, orderliness, and\nreasonable reflection were establishing themselves, which finally\nenabled her to inherit all that her predecessors in the race had\naccomplished, and to add, what alone they still wanted, the crowning\nconsecration of self-conscious mind. There had, simultaneously, been\ngrowing up an intensely patriotic sentiment, due, in part, to the\nlong-continued independence of Attica; in part, also, we may suppose,\nto the union, at a very early period, of her different townships into a\nsingle city. The same causes had, however, also favoured a certain love\nof comfort, a jovial pleasure-seeking disposition often degenerating\ninto coarse sensuality, a thriftiness, and an inclination to grasp at\nany source of profit, coupled with extreme credulity where hopes of\nprofit were excited, together forming an element of prose-comedy which\nmingles strangely with the tragic grandeur of Athens in her imperial\nage, and emerges into greater prominence after her fall, until it\nbecomes the predominant characteristic of her later days. It is, we may\nobserve, the contrast between these two aspects of Athenian life which\ngives the plays of Aristophanes their unparalleled comic effect, and\nit is their very awkward conjunction which makes Euripides so unequal\nand disappointing a poet. We find, then, that the original Athenian\ncharacter is marked by reasonable reflection, by patriotism, and by a\ntendency towards self-seeking materialism. Let us take note of these\nthree qualities, for we shall meet with them again in the philosophy of\nSocrates.\n\nEmpire, when it came to Athens, came almost unsought. The Persian\ninvasions had made her a great naval power; the free choice of her\nallies placed her at the head of a great maritime confederacy. The\nsudden command of vast resources and the tension accumulated during\nages of repose, stimulated all her faculties into preternatural\nactivity. Her spirit was steeled almost to the Dorian temper, and\nentered into victorious rivalry with the Dorian Muse. Not only did\nher fleet sweep the sea, but her army, for once, defeated Theban\nhoplites in the field. The grand choral harmonies of Sicilian song,\nthe Sicyonian recitals of epic adventure, were rolled back into a\nframework for the spectacle of individual souls meeting one another in\nargument, expostulation, entreaty, and defiance; a nobler Doric edifice\nrose to confront the Aeginetan temple of Athênê; the strained energy\nof Aeginetan combatants was relaxed into attitudes of reposing power,\nand the eternal smile on their faces was deepened into the sadness of\nunfathomable thought. But to the violet-crowned city, Athênê was a\ngiver of wealth and wisdom rather than of prowess; her empire rested on\nthe contributions of unwilling allies, and on a technical proficiency\nwhich others were sure to equal in time; so that the Corinthian\norators could say with justice that Athenian skill was more easily\nacquired than Dorian valour. At once receptive and communicative,\nAthens absorbed all that Greece could teach her, and then returned it\nin a more elaborate form, but without the freshness of its earliest\ninspiration. Yet there was one field that still afforded scope for\ncreative originality. Habits of analysis, though fatal to spontaneous\nproduction, were favourable, or rather were necessary, to the growth\nof a new philosophy. After the exhaustion of every limited idealism,\nthere remained that highest idealisation which is the reduction of all\npast experience to a method available for the guidance of all future\naction. To accomplish this last enterprise it was necessary that a\nsingle individual should gather up in himself the spirit diffused\nthrough a whole people, bestowing on it by that very concentration\nthe capability of an infinitely wider extension when its provisional\nrepresentative should have passed away from the scene.\n\nSocrates represents the popular Athenian character much as Richardson,\nin a different sphere, represents the English middle-class\ncharacter—represents it, that is to say, elevated into transcendent\ngenius. Except this elevation, there was nothing anomalous about him.\nIf he was exclusively critical, rationalising, unadventurous, prosaic;\nin a word, as the German historians say, something of a Philistine;\nso, we may suspect, were the mass of his countrymen. His illustrations\nwere taken from such plebeian employments as cattle-breeding, cobbling,\nweaving, and sailoring. These were his ‘touches of things common’\nwhich at last ‘rose to touch the spheres.’ He both practised and\ninculcated virtues, the value of which is especially evident in humble\nlife—frugality and endurance. But he also represents the Dêmos in its\nsovereign capacity as legislator and judge. Without aspiring to be an\norator or statesman, he reserves the ultimate power of arbitration\nand election. He submits candidates for office to a severe scrutiny,\nand demands from all men an even stricter account of their lives than\nretiring magistrates had to give of their conduct, when in power, to\nthe people. He applies the judicial method of cross-examination to the\ndetection of error, and the parliamentary method of joint deliberation\nto the discovery of truth. He follows out the democratic principles\nof free speech and self-government, by submitting every question\nthat arises to public discussion, and insisting on no conclusion\nthat does not command the willing assent of his audience. Finally,\nhis conversation, popular in form, was popular also in this respect,\nthat everybody who chose to listen might have the benefit of it\ngratuitously. Here we have a great change from the scornful dogmatism\nof Heracleitus, and the virtually oligarchic exclusiveness of the\nteachers who demanded high fees for their instruction.\n\nTo be free and to rule over freemen were, with Socrates, as with\nevery Athenian, the goals of ambition, only his freedom meant\nabsolute immunity from the control of passion or habit; government\nmeant superior knowledge, and government of freemen meant the power\nof producing intellectual conviction. In his eyes, the possessor of\nany art was, so far, a ruler, and the only true ruler, being obeyed\nunder severe penalties by all who stood in need of his skill. But the\nroyal art which he himself exercised, without expressly laying claim\nto it, was that which assigns its proper sphere to every other art,\nand provides each individual with the employment which his peculiar\nfaculties demand. This is Athenian liberty and Athenian imperialism\ncarried into education, but so idealised and purified that they can\nhardly be recognised at first sight.\n\nThe philosophy of Socrates is more obviously related to the practical\nand religious tendencies of his countrymen. Neither he nor they had\nany sympathy with the cosmological speculations which seemed to be\nunconnected with human interests, and to trench on matters beyond the\nreach of human knowledge. The old Attic sentiment was averse from\nadventures of any kind, whether political or intellectual. Yet the new\nspirit of enquiry awakened by Ionian thought could not fail to react\npowerfully on the most intelligent man among the most intelligent\npeople of Hellas. Above all, one paramount idea which went beyond the\nconfines of the old philosophy had been evolved by the differentiation\nof knowledge from its object, and had been presented, although under a\nmaterialising form, by Anaxagoras to the Athenian public. Socrates took\nup this idea, which expressed what was highest and most distinctive in\nthe national character, and applied it to the development of ethical\nspeculation. We have seen, in the last chapter, how an attempt was made\nto base moral truth on the results of natural philosophy, and how that\nattempt was combated by the Humanistic school. It could not be doubtful\nwhich side Socrates would take in this controversy. That he paid any\nattention to the teaching of Protagoras and Gorgias is, indeed, highly\nproblematic, for their names are never mentioned by Xenophon, and the\nPlatonic dialogues in which they figure are evidently fictitious.\nNevertheless, he had to a certain extent arrived at the same conclusion\nwith them, although by a different path. He was opposed, on religious\ngrounds, to the theories which an acute psychological analysis\nhad led them to reject. Accordingly, the idea of Nature is almost\nentirely absent from his conversation, and, like Protagoras, he is\nguided solely by regard for human interests. To the objection that\npositive laws were always changing, he victoriously replied that it\nwas because they were undergoing an incessant adaptation to varying\nneeds.[88] Like Protagoras, again, he was a habitual student of old\nGreek literature, and sedulously sought out the practical lessons in\nwhich it abounded. To him, as to the early poets and sages, Sôphrosynê,\nor self-knowledge and self-command taken together, was the first and\nmost necessary of all virtues. Unlike them, however, he does not simply\naccept it from tradition, but gives it a philosophical foundation—the\nnewly-established distinction between mind and body; a distinction\nnot to be confounded with the old Psychism, although Plato, for his\nreforming purposes, shortly afterwards linked the two together. The\ndisembodied spirit of mythology was a mere shadow or memory, equally\ndestitute of solidity and of understanding; with Socrates, mind meant\nthe personal consciousness which retains its continuous identity\nthrough every change, and as against every passing impulse. Like the\nHumanists, he made it the seat of knowledge—more than the Humanists,\nhe gave it the control of appetite. In other words, he adds the idea\nof will to that of intellect; but instead of treating them as distinct\nfaculties or functions, he absolutely identifies them. Mind having\ncome to be first recognised as a knowing power, carried over its\nassociation with knowledge into the volitional sphere, and the two\nwere first disentangled by Aristotle, though very imperfectly even by\nhim. Yet no thinker helped so much to make the confusion apparent as\nthe one to whom it was due. Socrates deliberately insisted that those\nwho knew the good must necessarily be good themselves. He taught that\nevery virtue was a science; courage, for example, was a knowledge\nof the things which should or should not be feared; temperance, a\nknowledge of what should or should not be desired, and so forth. Such\nan account of virtue would, perhaps, be sufficient if all men did what,\nin their opinion, they ought to do; and, however strange it may seem,\nSocrates assumed that such was actually the case.[89] The paradox,\neven if accepted at the moment by his youthful friends, was sure to\nbe rejected, on examination, by cooler heads, and its rejection would\nprove that the whole doctrine was essentially unsound. Various causes\nprevented Socrates from perceiving what seemed so clear to duller\nintelligences than his. First of all, he did not separate duty from\npersonal interest. A true Athenian, he recommended temperance and\nrighteousness very largely on account of the material advantages they\nsecured. That the agreeable and the honourable, the expedient and the\njust, frequently came into collision, was at that time a rhetorical\ncommonplace; and it might be supposed that, if they were shown to\ncoincide, no motive to misconduct but ignorance could exist. Then,\nagain, being accustomed to compare conduct of every kind with the\npractice of such arts as flute-playing, he had come to take knowledge\nin a rather extended sense, just as we do when we say, indifferently,\nthat a man knows geometry and that he knows how to draw. Aristotle\nhimself did not see more clearly than Socrates that moral habits are\nonly to be acquired by incessant practice; only the earlier thinker\nwould have observed that knowledge of every kind is gained by the same\nlaborious repetition of particular actions. To the obvious objection\nthat, in this case, morality cannot, like theoretical truth, be\nimparted by the teacher to his pupils, but must be won by the learner\nfor himself, he would probably have replied that all truth is really\nevolved by the mind from itself, and that he, for that very reason,\ndisclaimed the name of a teacher, and limited himself to the seemingly\nhumbler task of awakening dormant capacities in others.\n\nAn additional influence, not the less potent because unacknowledged,\nwas the same craving for a principle of unity that had impelled early\nGreek thought to seek for the sole substance or cause of physical\nphenomena in some single material element, whether water, air, or fire;\nand just as these various principles were finally decomposed into the\nmultitudinous atoms of Leucippus, so also, but much more speedily,\ndid the general principle of knowledge tend to decompose itself into\ninnumerable cognitions of the partial ends or utilities which action\nwas directed to achieve. The need of a comprehensive generalisation\nagain made itself felt, and all good was summed up under the head\nof happiness. The same difficulties recurred under another form. To\ndefine happiness proved not less difficult than to define use or\npractical knowledge. Three points of view offered themselves, and all\nthree had been more or less anticipated by Socrates. Happiness might\nmean unmixed pleasure, or the exclusive cultivation of man’s higher\nnature, or voluntary subordination to a larger whole. The founder of\nAthenian philosophy used to present each of these, in turn, as an end,\nwithout recognising the possibility of a conflict between them; and it\ncertainly would be a mistake to represent them as constantly opposed.\nYet a truly scientific principle must either prove their identity, or\nmake its choice among them, or discover something better. Plato seems\nto have taken up the three methods, one after the other, without coming\nto any very satisfactory conclusion. Aristotle identified the first\ntwo, but failed, or rather did not attempt to harmonise them with the\nthird. Succeeding schools tried various combinations, laying more or\nless stress on different principles at different periods, till the will\nof an omnipotent Creator was substituted for every human standard.\nWith the decline of dogmatic theology we have seen them all come to\nlife again, and the old battle is still being fought out under our\neyes. Speaking broadly, it may be said that the method which we have\nplaced first on the list is more particularly represented in England,\nthe second in France, and the last in Germany. Yet they refuse to be\nseparated by any rigid line of demarcation, and each tends either to\ncombine with or to pass into one or both of the rival theories. Modern\nutilitarianism, as constituted by John Stuart Mill, although avowedly\nbased on the paramount value of pleasure, in admitting qualitative\ndifferences among enjoyments, and in subordinating individual to\nsocial good, introduces principles of action which are not, properly\nspeaking, hedonistic. Neither is the idea of the whole by any means\nfree from ambiguity. We have party, church, nation, order, progress,\nrace, humanity, and the sum total of sensitive beings, all putting in\ntheir claims to figure as that entity. Where the pursuit of any single\nend gives rise to conflicting pretensions, a wise man will check them\nby reference to the other accredited standards, and will cherish a not\nunreasonable expectation that the evolution of life is tending to bring\nthem all into ultimate agreement.\n\nReturning to Socrates, we must further note that his identification\nof virtue with science, though it does not express the whole truth,\nexpresses a considerable part of it, especially as to him conduct was\na much more complex problem than it is to some modern teachers. Only\nthose who believe in the existence of intuitive and infallible moral\nperceptions can consistently maintain that nothing is easier than\nto know our duty, and nothing harder than to do it. Even then, the\nintuitions must extend beyond general principles, and also inform us\nhow and where to apply them. That no such inward illumination exists\nis sufficiently shown by experience; so much so that the mischief done\nby foolish people with good intentions has become proverbial. Modern\ncasuists have, indeed, drawn a distinction between the intention and\nthe act, making us responsible for the purity of the former, not for\nthe consequences of the latter. Though based on the Socratic division\nbetween mind and body, this distinction would not have commended itself\nto Socrates. His object was not to save souls from sin, but to save\nindividuals, families, and states from the ruin which ignorance of fact\nentails.\n\nIf we enlarge our point of view so as to cover the moral influence of\nknowledge on society taken collectively, its relative importance will\nbe vastly increased. When Auguste Comte assigns the supreme direction\nof progress to advancing science, and when Buckle, following Fichte,\nmakes the totality of human action depend on the totality of human\nknowledge, they are virtually attributing to intellectual education an\neven more decisive part than it played in the Socratic ethics. Even\nthose who reject the theory, when pushed to such an extreme, will admit\nthat the same quantity of self-devotion must produce a far greater\neffect when it is guided by deeper insight into the conditions of\nexistence.\n\nThe same principle may be extended in a different direction if we\nsubstitute for knowledge, in its narrower significance, the more\ngeneral conception of associated feeling. We shall then see that\nbelief, habit, emotion, and instinct are only different stages of\nthe same process—the process by which experience is organised and\nmade subservient to vital activity. The simplest reflex and the\nhighest intellectual conviction are alike based on sensori-motor\nmechanism, and, so far, differ only through the relative complexity and\ninstability of the nervous connexions involved. Knowledge is life in\nthe making, and when it fails to control practice fails only by coming\ninto conflict with passion—that is to say, with the consolidated\nresults of an earlier experience. Physiology offers another analogy\nto the Socratic method which must not be overlooked. Socrates\nrecommended the formation of definite conceptions because, among other\nadvantages, they facilitated the diffusion of useful knowledge. So,\nalso, the organised associations of feelings are not only serviceable\nto individuals, but may be transmitted to offspring with a regularity\nproportioned to their definiteness. How naturally these deductions\nfollow from the doctrine under consideration, is evident from their\nhaving been, to a certain extent, already drawn by Plato. His plan\nfor the systematic education of feeling under scientific supervision\nanswers to the first; his plan for breeding an improved race of\ncitizens by placing marriage under State control answers to the second.\nYet it is doubtful whether Plato’s predecessor would have sanctioned\nany scheme tending to substitute an external compulsion, whether felt\nor not, for freedom and individual initiative, and a blind instinct for\nthe self-consciousness which can give an account of its procedure at\nevery step. He would bring us back from social physics and physiology\nto psychology, and from psychology to dialectic philosophy.\n\n\nIV.\n\nTo Socrates himself the strongest reason for believing in the\nidentity of conviction and practice was, perhaps, that he had made\nit a living reality. With him to know the right and to do it were\nthe same. In this sense we have already said that his life was the\nfirst verification of his philosophy. And just as the results of his\nethical teaching can only be ideally separated from their application\nto his conduct, so also these results themselves cannot be kept apart\nfrom the method by which they were reached; nor is the process by\nwhich he reached them for himself distinguishable from the process\nby which he communicated them to his friends. In touching on this\npoint, we touch on that which is greatest and most distinctively\noriginal in the Socratic system, or rather in the Socratic impulse\nto systematisation of every kind. What it was will be made clearer\nby reverting to the central conception of mind. With Protagoras mind\nmeant an ever-changing stream of feeling; with Gorgias it was a\nprinciple of hopeless isolation, the interchange of thoughts between\none consciousness and another, by means of signs, being an illusion.\nSocrates, on the contrary, attributed to it a steadfast control over\npassion, and a unifying function in society through its essentially\nsynthetic activity, its need of co-operation and responsive assurance.\nHe saw that the reason which overcomes animal desire tends to draw\nmen together just as sensuality tends to drive them into hostile\ncollision. If he recommended temperance on account of the increased\negoistic pleasure which it secures, he recommended it also as making\nthe individual a more efficient instrument for serving the community.\nIf he inculcated obedience to the established laws, it was no doubt\npartly on grounds of enlightened self-interest, but also because union\nand harmony among citizens were thereby secured. And if he insisted\non the necessity of forming definite conceptions, it was with the\nsame twofold reference to personal and public advantage. Along with\nthe diffusive, social character of mind he recognised its essential\nspontaneity. In a commonwealth where all citizens were free and equal,\nthere must also be freedom and equality of reason. Having worked out\na theory of life for himself, he desired that all other men should,\nso far as possible, pass through the same bracing discipline. Here we\nhave the secret of his famous erotetic method. He did not, like the\nSophists, give continuous lectures, nor profess, like some of them,\nto answer every question that might be put to him. On the contrary,\nhe put a series of questions to all who came in his way, generally in\nthe form of an alternative, one side of which seemed self-evidently\ntrue and the other self-evidently false, arranged so as to lead the\nrespondent, step by step, to the conclusion which it was desired that\nhe should accept. Socrates did not invent this method. It had long been\npractised in the Athenian law-courts as a means for extracting from\nthe opposite party admissions which could not be otherwise obtained,\nwhence it had passed into the tragic drama, and into the discussion of\nphilosophical problems. Nowhere else was the analytical power of Greek\nthought so brilliantly displayed; for before a contested proposition\ncould be subjected to this mode of treatment, it had to be carefully\ndiscriminated from confusing adjuncts, considered under all the various\nmeanings which it might possibly be made to bear, subdivided, if it was\ncomplex, into two or more distinct assertions, and linked by a minute\nchain of demonstration to the admission by which its validity was\nestablished or overthrown.\n\nSocrates, then, did not create the cross-examining elenchus, but he\ngave it two new and very important applications. So far as we can make\nout, it had hitherto been only used (again, after the example of the\nlaw-courts) for the purpose of detecting error or intentional deceit.\nHe made it an instrument for introducing his own convictions into the\nminds of others, but so that his interlocutors seemed to be discovering\nthem for themselves, and were certainly learning how, in their turn,\nto practise the same didactic interrogation on a future occasion. And\nhe also used it for the purpose of logical self-discipline in a manner\nwhich will be presently explained. Of course, Socrates also employed\nthe erotetic method as a means of confutation, and, in his hands, it\npowerfully illustrated what we have called the negative moment of\nGreek thought. To prepare the ground for new truth it was necessary\nto clear away the misconceptions which were likely to interfere with\nits admission; or, if Socrates himself had nothing to impart, he could\nat any rate purge away the false conceit of knowledge from unformed\nminds, and hold them back from attempting difficult tasks until they\nwere properly qualified for the undertaking. For example, a certain\nGlauco, a brother of Plato, had attempted to address the public\nassembly, when he was not yet twenty years of age, and was naturally\nquite unfitted for the task. At Athens, where every citizen had a\nvoice in his country’s affairs, obstruction, whether intentional or\nnot, was very summarily dealt with. Speakers who had nothing to say\nthat was worth hearing were forcibly removed from the bêma by the\npolice; and this fate had already more than once befallen the youthful\norator, much to the annoyance of his friends, who could not prevail\non him to refrain from repeating the experiment, when Socrates took\nthe matter in hand. One or two adroit compliments on his ambition drew\nGlauco into a conversation with the veteran dialectician on the aims\nand duties of a statesman. It was agreed that his first object should\nbe to benefit the country, and that a good way of achieving this end\nwould be to increase its wealth, which, again, could be done either\nby augmenting the receipts or by diminishing the expenditure. Could\nGlauco tell what was the present revenue of Athens, and whence it was\nderived?—No; he had not studied that question.—Well then, perhaps, he\nhad some useful retrenchments to propose.—No; he had not studied that\neither. But the State might, he thought, be enriched at the expense of\nits enemies.—A good idea, if we can be sure of beating them first!\nOnly, to avoid the risk of attacking somebody who is stronger than\nourselves, we must know what are the enemy’s military resources as\ncompared with our own. To begin with the latter: Can Glauco tell how\nmany ships and soldiers Athens has at her disposal?—No, he does not\nat this moment remember.—Then, perhaps, he has it all written down\nsomewhere?—He must confess not. So the conversation goes on until\nSocrates has convicted his ambitious young friend of possessing no\naccurate information whatever about political questions.[90]\n\nXenophon has recorded another dialogue in which a young man named\nEuthydêmus, who was also in training for a statesman, and who, as he\nsupposed, had learned a great deal more out of books than Socrates\ncould teach him, is brought to see how little he knows about ethical\nscience. He is asked, Can a man be a good citizen without being\njust? No, he cannot.—Can Euthydêmus tell what acts are just? Yes,\ncertainly, and also what are unjust.—Under which head does he put\nsuch actions as lying, deceiving, harming, enslaving?—Under the\nhead of injustice.—But suppose a hostile people are treated in the\nvarious manners specified, is that unjust?—No, but it was understood\nthat only one’s friends were meant.—Well, if a general encourages\nhis own army by false statements, or a father deceives his child into\ntaking medicine, or your friend seems likely to commit suicide, and\nyou purloin a deadly weapon from him, is that unjust?—No, we must add\n‘for the purpose of harming’ to our definition. Socrates, however,\ndoes not stop here, but goes on cross-examining until the unhappy\nstudent is reduced to a state of hopeless bewilderment and shame. He\nis then brought to perceive the necessity of self-knowledge, which\nis explained to mean knowledge of one’s own powers. As a further\nexercise Euthydêmus is put through his facings on the subject of good\nand evil. Health, wealth, strength, wisdom and beauty are mentioned\nas unquestionable goods. Socrates shows, in the style long afterwards\nimitated by Juvenal, that they are only means towards an end, and may\nbe productive of harm no less than good.—Happiness at any rate is an\nunquestionable good.—Yes, unless we make it consist of questionable\ngoods like those just enumerated.[91]\n\nIt is in this last conversation that the historical Socrates most\nnearly resembles the Socrates of Plato’s _Apologia_. Instead, however,\nof leaving Euthydêmus to the consciousness of his ignorance, as\nthe latter would have done, he proceeds, in Xenophon’s account, to\ndirect the young man’s studies according to the simplest and clearest\nprinciples; and we have another conversation where religious truths\nare instilled by the same catechetical process.[92] Here the erotetic\nmethod is evidently a mere didactic artifice, and Socrates could easily\nhave written out his lesson under the form of a regular demonstration.\nBut there is little doubt that in other cases he used it as a means\nfor giving increased precision to his own ideas, and also for testing\ntheir validity, that, in a word, the habit of oral communication gave\nhim a familiarity with logical processes which could not otherwise\nhave been acquired. The same cross-examination that acted as a spur\non the mind of the respondent, reacted as a bridle on the mind of the\ninterrogator, obliging him to make sure beforehand of every assertion\nthat he put forward, to study the mutual bearings of his beliefs, to\nanalyse them into their component elements, and to examine the relation\nin which they collectively stood to the opinions generally accepted.\nIt has already been stated that Socrates gave the erotetic method two\nnew applications; we now see in what direction they tended. He made it\na vehicle for positive instruction, and he also made it an instrument\nfor self-discipline, a help to fulfilling the Delphic precept, ‘Know\nthyself.’ The second application was even more important than the\nfirst. With us literary training—that is, the practice of continuous\nreading and composition—is so widely diffused, that conversation\nhas become rather a hindrance than a help to the cultivation of\nargumentative ability. The reverse was true when Socrates lived. Long\nfamiliarity with debate was unfavourable to the art of writing; and the\nspeeches in Thucydides show how difficult it was still found to present\nclose reasoning under the form of an uninterrupted exposition. The\ntraditions of conversational thrust and parry survived in rhetorical\nprose; and the crossed swords of tongue-fence were represented by the\nbristling _chevaux de frise_ of a laboured antithetical arrangement\nwhere every clause received new strength and point from contrast with\nits opposing neighbour.\n\nBy combining the various considerations here suggested we shall\narrive at a clearer understanding of the sceptical attitude commonly\nattributed to Socrates. There is, first of all, the negative and\ncritical function exercised by him in common with many other\nconstructive thinkers, and intimately associated with a fundamental\nlaw of Greek thought. Then there is the Attic courtesy and democratic\nspirit leading him to avoid any assumption of superiority over those\nwhose opinions he is examining. And, lastly, there is the profound\nfeeling that truth is a common possession, which no individual\ncan appropriate as his peculiar privilege, because it can only be\ndiscovered, tested, and preserved by the united efforts of all.\n\n\nV.\n\nThus, then, the Socratic dialogue has a double aspect. It is, like\nall philosophy, a perpetual carrying of life into ideas and of ideas\ninto life. Life is raised to a higher level by thought; thought, when\nbrought into contact with life, gains movement and growth, assimilative\nand reproductive power. If action is to be harmonised, we must regulate\nit by universal principles; if our principles are to be efficacious,\nthey must be adopted; if they are to be adopted, we must demonstrate\nthem to the satisfaction of our contemporaries. Language, consisting\nas it does almost entirely of abstract terms, furnishes the materials\nout of which alone such an ideal union can be framed. But men do not\nalways use the same words, least of all if they are abstract words, in\nthe same sense, and therefore a preliminary agreement must be arrived\nat in this respect; a fact which Socrates was the first to recognise.\nAristotle tells us that he introduced the custom of constructing\ngeneral definitions into philosophy. The need of accurate verbal\nexplanations is more felt in the discussion of ethical problems than\nanywhere else, if we take ethics in the only sense that Socrates would\nhave accepted, as covering the whole field of mental activity. It\nis true that definitions are also employed in the mathematical and\nphysical sciences, but there they are accompanied by illustrations\nborrowed from sensible experience, and would be unintelligible without\nthem. Hence it has been possible for those branches of knowledge to\nmake enormous progress, while the elementary notions on which they rest\nhave not yet been satisfactorily analysed. The case is entirely altered\nwhen mental dispositions have to be taken into account. Here, abstract\nterms play much the same part as sensible intuitions elsewhere in\nsteadying our conceptions, but without possessing the same invariable\nvalue; the experiences from which those conceptions are derived\nbeing exceedingly complex, and, what is more, exceedingly liable to\ndisturbance from unforeseen circumstances. Thus, by neglecting a series\nof minute changes the same name may come to denote groups of phenomena\nnot agreeing in the qualities which alone it originally connoted. More\nthan one example of such a gradual metamorphosis has already presented\nitself in the course of our investigation, and others will occur in\nthe sequel. Where distinctions of right and wrong are involved, it\nis of enormous practical importance that a definite meaning should\nbe attached to words, and that they should not be allowed, at least\nwithout express agreement, to depart from the recognised acceptation:\nfor such words, connoting as they do the approval or disapproval\nof mankind, exercise a powerful influence on conduct, so that their\nmisapplication may lead to disastrous consequences. Where government\nby written law prevails the importance of defining ethical terms\nimmediately becomes obvious, for, otherwise, personal rule would\nbe restored under the disguise of judicial interpretation. Roman\njurisprudence was the first attempt on a great scale to introduce a\nrigorous system of definitions into legislation. We have seen, in\nthe preceding chapter, how it tended to put the conclusions of Greek\nnaturalistic philosophy into practical shape. We now see how, on the\nformal side, its determinations are connected with the principles\nof Socrates. And we shall not undervalue this obligation if we bear\nin mind that the accurate wording of legal enactments is not less\nimportant than the essential justice of their contents. Similarly,\nthe development of Catholic theology required that its fundamental\nconceptions should be progressively defined. This alone preserved\nthe intellectual character of Catholicism in ages of ignorance and\nsuperstition, and helped to keep alive the reason by which superstition\nwas eventually overthrown. Mommsen has called theology the bastard\nchild of Religion and Science. It is something that, in the absence of\nthe robuster parent, its features should be recalled and its tradition\nmaintained even by an illegitimate offspring.\n\nSo far, we have spoken as if the Socratic definitions were merely\nverbal; they were, however, a great deal more, and their author did not\naccurately discriminate between what at that stage of thought could\nnot well be kept apart—explanations of words, practical reforms, and\nscientific generalisations. For example, in defining a ruler to be one\nwho knew more than other men, he was departing from the common usages\nof language, and showing not what was, but what ought to be true.[93]\nAnd in defining virtue as wisdom, he was putting forward a new theory\nof his own, instead of formulating the received connotation of a\nterm. Still, after making every deduction, we cannot fail to perceive\nwhat an immense service was rendered to exact thought by introducing\ndefinitions of every kind into that department of enquiry where they\nwere chiefly needed. We may observe also that a general law of Greek\nintelligence was here realising itself in a new direction. The need\nof accurate determination had always been felt, but hitherto it had\nworked under the more elementary forms of time, space, and causality,\nor, to employ the higher generalisation of modern psychology, under\nthe form of contiguous association. The earlier cosmologies were all\nprocesses of circumscription; they were attempts to fix the limits\nof the universe, and, accordingly, that element which was supposed\nto surround the others was also conceived as their producing cause,\nor else (in the theory of Heracleitus) as typifying the rationale of\ntheir continuous transformation. For this reason Parmenides, when he\nidentified existence with extension, found himself obliged to declare\nthat extension was necessarily limited. Of all the physical thinkers,\nAnaxagoras, who immediately precedes Socrates, approaches, on the\nobjective side, most nearly to his standpoint. For the governing\nNous brings order out of chaos by segregating the confused elements,\nby separating the unlike and drawing the like together, which is\nprecisely what definition does for our conceptions. Meanwhile Greek\nliterature had been performing the same task in a more restricted\nprovince, first fixing events according to their geographical and\nhistorical positions, then assigning to each its proper cause, then,\nas Thucydides does, isolating the most important groups of events from\ntheir external connexions, and analysing the causes of complex changes\ninto different classes of antecedents. The final revolution effected by\nSocrates was to substitute arrangement by difference and resemblance\nfor arrangement by contiguity in coexistence and succession. To say\nthat by so doing he created science is inexact, for science requires\nto consider nature under every aspect, including those which he\nsystematically neglected; but we may say that he introduced the method\nwhich is most particularly applicable to mental phenomena, the method\nof ideal analysis, classification, and reasoning. For, be it observed\nthat Socrates did not limit himself to searching for the One in the\nMany, he also, and perhaps more habitually, sought for the Many in the\nOne. He would take hold of a conception and analyse it into its various\nnotes, laying them, as it were, piecemeal before his interlocutor for\nseparate acceptance or rejection. If, for example, they could not agree\nabout the relative merits of two citizens, Socrates would decompose\nthe character of a good citizen into its component parts and bring the\ncomparison down to them. A good citizen, he would say, increases the\nnational resources by his administration of the finances, defeats the\nenemy abroad, wins allies by his diplomacy, appeases dissension by\nhis eloquence at home.[94] When the shy and gifted Charmides shrank\nfrom addressing a public audience on public questions, Socrates strove\nto overcome his nervousness by mercilessly subdividing the august\nEcclêsia into its constituent classes. ‘Is it the fullers that you\nare afraid of?’ he asked, ‘or the leather-cutters, or the masons, or\nthe smiths, or the husbandmen, or the traders, or the lowest class\nof hucksters?’[95] Here the analytical power of Greek thought is\nmanifested with still more searching effect than when it was applied to\nspace and motion by Zeno.\n\nNor did Socrates only consider the whole conception in relation to its\nparts, he also grouped conceptions together according to their genera\nand founded logical classification. To appreciate the bearing of this\nidea on human interests it will be enough to study the disposition\nof a code. We shall then see how much more easy it becomes to bring\nindividual cases under a general rule, and to retain the whole body\nof rules in our memory, when we can pass step by step from the most\nuniversal to the most particular categories. Now, it was by jurists\nversed in the Stoic philosophy that Roman law was codified, and it\nwas by Stoicism that the traditions of Socratic philosophy were most\nfaithfully preserved.\n\nLogical division is, however, a process not fully represented by any\nfixed and formal distribution of topics, nor yet is it equivalent\nto the arrangement of genera and species according to their natural\naffinities, as in the admirable systems of Jussieu and Cuvier. It\nis something much more flexible and subtle, a carrying down into\nthe minutest detail, of that psychological law which requires, as\na condition of perfect consciousness, that feelings, conceptions,\njudgments, and, generally speaking, all mental modes should be\napprehended together with their contradictory opposites. Heracleitus\nhad a dim perception of this truth when he taught the identity of\nantithetical couples, and it is more or less vividly illustrated by\nall Greek classic literature after him; but Socrates seems to have\nbeen the first who transformed it from a law of existence into a law\nof cognition; with him knowledge and ignorance, reason and passion,\nfreedom and slavery, virtue, and vice, right and wrong (πολλῶν ὀνομάτων\nμορφὴ μία) were apprehended in inseparable connexion, and were employed\nfor mutual elucidation, not only in broad masses, but also through\ntheir last subdivisions, like the delicate adjustments of light and\nshade on a Venetian canvas. This method of classification by graduated\ndescent and symmetrical contrast, like the whole dialectic system of\nwhich it forms a branch, is only suited to the mental phenomena for\nwhich it was originally devised; and Hegel committed a fatal error\nwhen he applied it to explain the order of external coexistence and\nsuccession. We have already touched on the essentially subjective\ncharacter of the Socratic definition, and we shall presently have to\nmake a similar restriction in dealing with Socratic induction. With\nregard to the question last considered, our limits will not permit us,\nnor, indeed, does it fall within the scope of our present study, to\npursue a vein of reflection which was never fully worked out either by\nthe Athenian philosophers or by their modern successors, at least not\nin its only legitimate direction.\n\nAfter definition and division comes reasoning. We arrange objects\nin classes, that by knowing one or some we may know all. Aristotle\nattributes to Socrates the first systematic employment of induction\nas well as of general definitions.[96] Nevertheless, his method was\nnot solely inductive, nor did it bear more than a distant resemblance\nto the induction of modern science. His principles were not gathered\nfrom the particular classes of phenomena which they determined, or\nwere intended to determine, but from others of an analogous character\nwhich had already been reduced to order. Observing that all handicrafts\nwere practised according to well-defined intelligible rules, leading,\nso far as they went, to satisfactory results, he required that life\nin its entirety should be similarly systematised. This was not so\nmuch reasoning as a demand for the more extended application of\nreasoning. It was a truly philosophic postulate, for philosophy is\nnot science, but precedes and underlies it. Belief and action tend to\ndivide themselves into two provinces, of which the one is more or less\norganised, the other more or less chaotic. We philosophise when we try\nto bring the one into order, and also when we test the foundations on\nwhich the order of the other reposes, fighting both against incoherent\nmysticism and against traditional routine. Such is the purpose that the\nmost distinguished thinkers of modern times—Francis Bacon, Spinoza,\nHume, Kant, Auguste Comte, and Herbert Spencer—however widely they\nmay otherwise differ, have, according to their respective lights, all\nset themselves to achieve. No doubt, there is this vast difference\nbetween Socrates and his most recent successors, that physical science\nis the great type of certainty to the level of which they would raise\nall speculation, while with him it was the type of a delusion and an\nimpossibility. The analogy of artistic production when applied to\nNature led him off on a completely false track, the ascription to\nconscious design of that which is, in truth, a result of mechanical\ncausation.[97] But now that the relations between the known and the\nunknown have been completely transformed, there is no excuse for\nrepeating the fallacies which imposed on his vigorous understanding;\nand the genuine spirit of Socrates is best represented by those who,\nstarting like him from the data of experience, are led to adopt a\ndiametrically opposite conclusion. We may add, that the Socratic method\nof analogical reasoning gave a retrospective justification to early\nGreek thought, of which Socrates was not himself aware. Its daring\ngeneralisations were really an inference from the known to the unknown.\nTo interpret all physical processes in terms of matter and motion, is\nonly assuming that the changes to which our senses cannot penetrate are\nhomogeneous with the changes which we can feel and see. When Socrates\nargued that, because the human body is animated by a consciousness,\nthe material universe must be similarly animated, Democritus might\nhave answered that the world presents no appearance of being organised\nlike an animal. When he argued that, because statues and pictures are\nknown to be the work of intelligence, the living models from which they\nare copied must be similarly due to design, Aristodêmus should have\nanswered, that the former are seen to be manufactured, while the others\nare seen to grow. It might also have been observed, that if our own\nintelligence requires to be accounted for by a cause like itself, so\nalso does the creative cause, and so on through an infinite regress of\nantecedents. Teleology has been destroyed by the Darwinian theory; but\nbefore the _Origin of Species_ appeared, the slightest scrutiny might\nhave shown that it was a precarious foundation for religious belief.\nIf many thoughtful men are now turning away from theism, ‘natural\ntheology’ may be thanked for the desertion. ‘I believe in God,’ says\nthe German baron in _Thorndale_, ‘until your philosophers demonstrate\nHis existence.’ ‘And then?’ asks a friend. ‘And then—I do not believe\nthe demonstration.’\n\nWhatever may have been the errors into which Socrates fell, he did\nnot commit the fatal mistake of compromising his ethical doctrine by\nassociating it indissolubly with his metaphysical opinions. Religion,\nwith him, instead of being the source and sanction of all duty, simply\nbrought in an additional duty—that of gratitude to the gods for their\ngoodness. We shall presently see where he sought for the ultimate\nfoundation of morality, after completing our survey of the dialectic\nmethod with which it was so closely connected. The induction of\nSocrates, when it went beyond that kind of analogical reasoning which\nwe have just been considering, was mainly abstraction, the process by\nwhich he obtained those general conceptions or definitions which played\nso great a part in his philosophy. Thus, on comparing the different\nvirtues, as commonly distinguished, he found that they all agreed in\nrequiring knowledge, which he accordingly concluded to be the essence\nof virtue. So other moralists have been led to conclude that right\nactions resemble one another in their felicific quality, and In that\nalone. Similarly, political economists find, or formerly found (for we\ndo not wish to be positive on the matter), that a common characteristic\nof all industrial employments is the desire to secure the maximum of\nprofit with the minimum of trouble. Another comparison shows that value\ndepends on the relation between supply and demand. Aesthetic enjoyments\nof every kind resemble one another by including an element of ideal\nemotion. It is a common characteristic of all cognitions that they are\nconstructed by association out of elementary feelings. All societies\nare marked by a more or less developed division of labour. These\nare given as typical generalisations which have been reached by the\nSocratic method. They are all taken from the philosophic sciences—that\nis, the sciences dealing with phenomena which are partly determined by\nmind, and the systematic treatment of which is so similar that they are\nfrequently studied in combination by a single thinker, and invariably\nso by the greatest thinkers of any. But were we to examine the history\nof the physical sciences, we should find that this method of wide\ncomparison and rapid abstraction cannot, as Francis Bacon imagined, be\nsuccessfully applied to them. The facts with which they deal are not\ntransparent, not directly penetrable by thought; hence they must be\ntreated deductively. Instead of a front attack, we must, so to speak,\ntake them in the rear. Bacon never made a more unfortunate observation\nthan when he said that the syllogism falls far short of the subtlety of\nNature. Nature is even simpler than the syllogism, for she accomplishes\nher results by advancing from equation to equation. That which really\ndoes fall far short of her subtlety is precisely the Baconian induction\nwith its superficial comparison of instances. No amount of observation\ncould detect any resemblance between the bursting of a thunderstorm and\nthe attraction of a loadstone, or between the burning of charcoal and\nthe rusting a nail.\n\nBut while philosophers cannot prescribe a method to physical science,\nthey may, to a certain extent, bring it under their cognisance, by\ndisengaging its fundamental conceptions and assumptions, and showing\nthat they are functions of mind; by arranging the special sciences in\nsystematic order for purposes of study; and by investigating the law\nof their historical evolution. Furthermore, since psychology is the\ncentral science of philosophy, and since it is closely connected with\nphysiology, which in turn reposes on the inorganic sciences, a certain\nknowledge of the objective world is indispensable to any knowledge of\nourselves. Lastly, since the subjective sphere not only rests, once for\nall, on the objective, but is also in a continual state of action and\nreaction with it, no philosophy can be complete which does not take\ninto account the constitution of things as they exist independently of\nourselves, in order to ascertain how far they are unalterable, and how\nfar they may be modified to our advantage. We see, then, that Socrates,\nin restricting philosophy to human interests, was guided by a just\ntact; that in creating the method of dialectic abstraction, he created\nan instrument adequate to this investigation, but to this alone;\nand, finally, that human interests, understood in the largest sense,\nembrace a number of subsidiary studies which either did not exist when\nhe taught, or which the inevitable superstitions of his age would not\nallow him to pursue.\n\nIt remains to glance at another aspect of the dialectic method first\ndeveloped on a great scale by Plato, and first fully defined by\nAristotle, but already playing a certain part in the Socratic teaching.\nThis is the testing of common assumptions by pushing them to their\nlogical conclusion, and rejecting those which lead to consequences\ninconsistent with themselves. So understood, dialectic means the\ncomplete elimination of inconsistency, and has ever since remained the\nmost powerful weapon of philosophical criticism. To take an instance\nnear at hand, it is constantly employed by thinkers so radically\ndifferent as Mr. Herbert Spencer and Professor T. H. Green; while it\nhas been generalised into an objective law of Nature and history, with\ndazzling though only momentary success, by Hegel and his school.\n\n\nVI.\n\nConsistency is, indeed, the one word which, better than any other,\nexpresses the whole character of Socrates, and the whole of philosophy\nas well. Here the supreme conception of mind reappears under its most\nrigorous, but, at the same time, its most beneficent aspect. It is the\ntemperance which no allurement can surprise; the fortitude which no\nterror can break through; the justice which eliminates all personal\nconsiderations, egoistic and altruistic alike; the truthfulness\nwhich, with exactest harmony, fits words to meanings, meanings to\nthoughts, and thoughts to things; the logic which will tolerate no\nself-contradiction; the conviction which seeks for no acceptance\nunwon by reason; the liberalism which works through free agencies for\nfreedom; the love which wills another’s good for that other’s sake\nalone.[98] It was the intellectual passion for consistency which made\nSocrates so great and which fused his life into a flawless whole; but\nit was an unconscious motive power, and therefore he attributed to mere\nknowledge what knowledge alone could not supply. A clear perception\nof right cannot by itself secure the obedience of our will. High\nprinciples are not of any value, except to those in whom a discrepancy\nbetween practice and profession produces the sharpest anguish of which\ntheir nature is capable; a feeling like, though immeasurably stronger\nthan, that which women of exquisite sensibility experience when they\nsee a candle set crooked or a table-cover awry. How moral laws have\ncome to be established, and why they prescribe or prohibit certain\nclasses of actions, are questions which still divide the schools,\nthough with an increasing consensus of authority on the utilitarian\nside: their ultimate sanction—that which, whatever they are, makes\nobedience to them truly moral—can hardly be sought elsewhere than in\nthe same consciousness of logical stringency that determines, or should\ndetermine, our abstract beliefs.\n\nBe this as it may, we venture to hope that a principle has been here\nsuggested deep and strong enough to reunite the two halves into which\nhistorians have hitherto divided the Socratic system, or, rather, the\nbeginning of that universal systematisation called philosophy, which\nis not yet, and perhaps never will be, completed; a principle which is\noutwardly revealed in the character of the philosopher himself. With\nsuch an one, ethics and dialectics become almost indistinguishable\nthrough the intermixture of their processes and the parallelism of\ntheir aims. Integrity of conviction enters, both as a means and\nas an element, into perfect integrity of conduct, nor can it be\nmaintained where any other element of rectitude is wanting. Clearness,\nconsecutiveness, and coherence are the morality of belief; while\ntemperance, justice, and beneficence, taken in their widest sense and\ntaken together, constitute the supreme logic of life.\n\nIt has already been observed that the thoughts of Socrates were thrown\ninto shape for and by communication, that they only became definite\nwhen brought into vivifying contact with another intelligence. Such was\nespecially the case with his method of ethical dialectic. Instead of\ntendering his advice in the form of a lecture, as other moralists have\nat all times been so fond of doing, he sought out some pre-existing\nsentiment or opinion inconsistent with the conduct of which he\ndisapproved, and then gradually worked round from point to point,\nuntil theory and practice were exhibited in immediate contrast. Here,\nhis reasoning, which is sometimes spoken of as exclusively inductive,\nwas strictly syllogistic, being the application of a general law to\na particular instance. With the growing emancipation of reason, we\nmay observe a return to the Socratic method of moralisation. Instead\nof rewards and punishments, which encourage selfish calculation, or\nexamples, which stimulate a mischievous jealousy when they do not\ncreate a spirit of servile imitation, the judicious trainer will\nfind his motive power in the pupil’s incipient tendency to form\nmoral judgments, which, when reflected on the individual’s own\nactions, become what we call a conscience. It has been mentioned in\nthe preceding chapter that the celebrated golden rule of justice was\nalready enunciated by Greek moralists in the fourth century B.C.\nPossibly it may have been first formulated by Socrates. In all cases\nit occurs in the writings of his disciples, and happily expresses the\ndrift of his entire philosophy. This generalising tendency was, indeed,\nso natural to a noble Greek, that instances of it occur long before\nphilosophy began. We find it in the famous question of Achilles: ‘Did\nnot this whole war begin on account of a woman? Are the Atreidae the\nonly men who love their wives?’[99] and in the now not less famous\napostrophe to Lycaon, reminding him that an early death is the lot of\nfar worthier men than he[100]—utterances which come on us with the\nawful effect of lightning flashes, that illuminate the whole horizon of\nexistence while they paralyse or destroy an individual victim.\n\nThe power which Socrates possessed of rousing other minds to\nindependent activity and apostolic transmission of spiritual gifts was,\nas we have said, the second verification of his doctrine. Even those\nwho, like Antisthenes and Aristippus, derived their positive theories\nfrom the Sophists rather than from him, preferred to be regarded as his\nfollowers; and Plato, from whom his ideas received their most splendid\ndevelopment, has acknowledged the debt by making that venerated figure\nthe centre of his own immortal Dialogues. A third verification is given\nby the subjective, practical, dialectic tendency of all subsequent\nphilosophy properly so called. On this point we will content ourselves\nwith mentioning one instance out of many, the recent declaration of Mr.\nHerbert Spencer that his whole system was constructed for the sake of\nits ethical conclusion.[101]\n\nApart, however, from abstract speculation, the ideal method seems to\nhave exercised an immediate and powerful influence on Art, an influence\nwhich was anticipated by Socrates himself. In two conversations\nreported by Xenophon,[102] he impresses on Parrhasius, the painter,\nand Cleito, the sculptor, the importance of so animating the faces and\nfigures which they represented as to make them express human feelings,\nenergies, and dispositions, particularly those of the most interesting\nand elevated type. And such, in fact, was the direction followed by\nimitative art after Pheidias, though not without degenerating into a\nsensationalism which Socrates would have severely condemned. Another\nand still more remarkable proof of the influence exercised on plastic\nrepresentation by ideal philosophy was, perhaps, not foreseen by its\nfounder. We allude to the substitution of abstract and generic for\nhistorical subjects by Greek sculpture in its later stages, and not by\nsculpture only, but by dramatic poetry as well. For early art, whether\nit addressed itself to the eye or to the imagination, and whether\nits subjects were taken from history or from fiction, had always\nbeen historical in this sense, that it exhibited the performance of\nparticular actions by particular persons in a given place and at a\ngiven time; the mode of presentment most natural to those whose ideas\nare mainly determined by contiguous association. The schools which came\nafter Socrates let fall the limitations of concrete reality, and found\nthe unifying principle of their works in association by resemblance,\nmaking their figures the personification of a single attribute or\ngroup of attributes, and bringing together forms distinguished by\nthe community of their characteristics or the convergence of their\nfunctions. Thus Aphroditê no longer figured as the lover of Arês or\nAnchisês, but as the personification of female beauty; while her\nstatues were grouped together with images of the still more transparent\nabstractions, Love, Longing, and Desire. Similarly Apollo became\na personification of musical enthusiasm, and Dionysus of Bacchic\ninspiration. So also dramatic art, once completely historical, even\nwith Aristophanes, now chose for its subjects such constantly-recurring\ntypes as the ardent lover, the stern father, the artful slave, the\nboastful soldier, and the fawning parasite.[103]\n\nNor was this all. Thought, after having, as it would seem, wandered\naway from reality in search of empty abstractions, by the help of\nthose very abstractions regained possession of concrete existence,\nand acquired a far fuller intelligence of its complex manifestations.\nFor, each individual character is an assemblage of qualities, and can\nonly be understood when those qualities, after having been separately\nstudied, are finally recombined. Thus, biography is a very late\nproduction of literature, and although biographies are the favourite\nreading of those who most despise philosophy, they could never have\nbeen written without its help. Moreover, before characters can be\ndescribed they must exist. Now, it is partly philosophy which calls\ncharacter into existence by sedulous inculcation of self-knowledge and\nself-culture, by consolidating a man’s individuality into something\nindependent of circumstances, so that it comes to form, not a figure\nin bas-relief, but what sculptors call a figure in the round. Such was\nSocrates himself, and such were the figures which he taught Xenophon\nand Plato to recognise and portray. Character-drawing begins with\nthem, and the _Memorabilia_ in particular is the earliest attempt at a\nbiographical analysis that we possess. From this to Plutarch’s _Lives_\nthere was still a long journey to be accomplished, but the interval\nbetween them is less considerable than that which divides Xenophon\nfrom his immediate predecessor, Thucydides. And when we remember how\nintimately the substance of Christian teaching is connected with the\nliterary form of its first record, we shall still better appreciate the\nall-penetrating influence of Hellenic thought, vying, as it does, with\nthe forces of nature in subtlety and universal diffusion.\n\nBesides transforming art and literature, the dialectic method helped\nto revolutionise social life, and the impulse communicated in this\ndirection is still very far from being exhausted. We allude to its\ninfluence on female education. The intellectual blossoming of Athens\nwas aided, in its first development, by a complete separation of the\nsexes. There were very few of his friends to whom an Athenian gentleman\ntalked so little as to his wife.[104] Colonel Mure aptly compares\nher position to that of an English housekeeper, with considerably\nless liberty than is enjoyed by the latter. Yet the union of tender\nadmiration with the need for intelligent sympathy and the desire to\nawaken interest in noble pursuits existed at Athens in full force, and\ncreated a field for its exercise. Wilhelm von Humboldt has observed\nthat at this time chivalrous love was kept alive by customs which, to\nus, are intensely repellent. That so valuable a sentiment should be\npreserved and diverted into a more legitimate channel was an object\nof the highest importance. The naturalistic method of ethics did\nmuch, but it could not do all, for more was required than a return to\nprimitive simplicity. Here the method of mind stepped in and supplied\nthe deficiency. Reciprocity was the soul of dialectic as practised by\nSocrates, and the dialectic of love demands a reciprocity of passion\nwhich can only exist between the sexes. But in a society where the free\nintercourse of modern Europe was not permitted, the modern sentiment\ncould not be reached at a single bound; and those who sought for the\nconversation of intelligent women had to seek for it among a class of\nwhich Aspasia was the highest representative. Such women played a great\npart in later Athenian society; they attended philosophical lectures,\nfurnished heroines to the New Comedy, and on the whole gave a healthier\ntone to literature. Their successors, the Delias and Cynthias of Roman\nelegiac poetry, called forth strains of exalted affection which need\nnothing but a worthier object to place them on a level with the noblest\nexpressions of tenderness that have since been heard. Here at least,\nto understand is to forgive; and we shall be less scandalised than\ncertain critics,[105] we shall even refuse to admit that Socrates fell\nbelow the dignity of a moralist, when we hear that he once visited a\ncelebrated beauty of this class, Theodotê by name;[106] that he engaged\nher in a playful conversation; and that he taught her to put more mind\ninto her profession; to attract by something deeper than personal\ncharms; to show at least an appearance of interest in the welfare\nof her lovers; and to stimulate their ardour by a studied reserve,\ngranting no favour that had not been repeatedly and passionately sought\nafter.\n\nXenophon gives the same interest a more edifying direction when he\nenlivens the dry details of his _Cyropaedia_ with touching episodes\nof conjugal affection, or presents lessons in domestic economy under\nthe form of conversations between a newly-married couple.[107] Plato\nin some respects transcends, in others falls short of his less gifted\ncontemporary. For his doctrine of love as an educating process—a true\ndoctrine, all sneers and perversions notwithstanding—though readily\napplicable to the relation of the sexes, is not applied to it by\nhim; and his project of a common training for men and women, though\nsuggestive of a great advance on the existing system if rightly carried\nout, was, from his point of view, a retrograde step towards savage or\neven animal life, an attempt to throw half the burdens incident to a\nmilitary organisation of society on those who had become absolutely\nincapable of bearing them.\n\nFortunately, the dialectic method proved stronger than its own\ncreators, and, once set going, introduced feelings and experiences\nof which they had never dreamed, within the horizon of philosophic\nconsciousness. It was found that if women had much to learn, much\nalso might be learned from them. Their wishes could not be taken into\naccount without giving a greatly increased prominence in the guidance\nof conduct to such sentiments as fidelity, purity, and pity; and to\nthat extent the religion which they helped to establish has, at least\nin principle, left no room for any further progress. On the other hand,\nit is only by reason that the more exclusively feminine impulses can\nbe freed from their primitive narrowness and elevated into truly human\nemotions. Love, when left to itself, causes more pain than pleasure,\nfor the words of the old idyl still remain true which associate it with\njealousy as cruel as the grave; pity, without prevision, creates more\nsuffering than it relieves; and blind fidelity is instinctively opposed\neven to the most beneficent changes. We are still suffering from the\nexcessive preponderance which Catholicism gave to the ideas of women;\nbut we need not listen to those who tell us that the varied experiences\nof humanity cannot be organised into a rational, consistent,\nself-supporting whole.\n\nA survey of the Socratic philosophy would be incomplete without some\ncomment on an element in the life of Socrates, which at first sight\nseems to lie altogether outside philosophy. There is no fact in his\nhistory more certain than that he believed himself to be constantly\naccompanied by a Daemonium, a divine voice often restraining him, even\nin trifling matters, but never prompting to positive action. That\nit was neither conscience in our sense of the word, nor a supposed\nfamiliar spirit, is now generally admitted. Even those who believe in\nthe supernatural origin and authority of our moral feelings do not\ncredit them with a power of divining the accidentally good or evil\nconsequences which may attend on our most trivial and indifferent\nactions; while, on the other hand, those feelings have a positive\nno less than a negative function, which is exhibited whenever the\nperformance of good deeds becomes a duty. That the Daemonium was not\na personal attendant is proved by the invariable use of an indefinite\nneuter adjective to designate it. How the phenomenon itself should be\nexplained is a question for professional pathologists. We have here to\naccount for the interpretation put upon it by Socrates, and this, in\nour judgment, follows quite naturally from his characteristic mode of\nthought. That the gods should signify their pleasure by visible signs\nand public oracles was an experience familiar to every Greek. Socrates,\nconceiving God as a mind diffused through the whole universe, would\nlook for traces of the Divine presence in his own mind, and would\nreadily interpret any inward suggestion, not otherwise to be accounted\nfor, as a manifestation of this all-pervading power. Why it should\ninvariably appear under the form of a restraint is less obvious. The\nonly explanation seems to be that, as a matter of fact, such mysterious\nfeelings, whether the product of unconscious experience or not, do\nhabitually operate as deterrents rather than as incentives.\n\n\nVII.\n\nThis Daemonium, whatever it may have been, formed one of the ostensible\ngrounds on which its possessor was prosecuted and condemned to death\nfor impiety. We might have spared ourselves the trouble of going\nover the circumstances connected with that tragical event, had not\nvarious attempts been made in some well-known works to extenuate\nthe significance of a singularly atrocious crime. The case stands\nthus. In the year 399 B.C. Socrates, who was then over seventy, and\nhad never in his life been brought before a law-court, was indicted\non the threefold charge of introducing new divinities, of denying\nthose already recognised by the State, and of corrupting young men.\nHis principal accuser was one Melêtus, a poet, supported by Lycon, a\nrhetorician, and by a much more powerful backer, Anytus, a leading\ncitizen in the restored democracy. The charge was tried before a\nlarge popular tribunal, numbering some five hundred members. Socrates\nregarded the whole affair with profound indifference. When urged\nto prepare a defence, he replied, with justice, that he had been\npreparing it his whole life long. He could not, indeed, have easily\nforeseen what line the prosecutors would take. Our own information\non this point is meagre enough, being principally derived from\nallusions made by Xenophon, who was not himself present at the trial.\nThere seems, however, no unfairness in concluding that the charge of\nirreligion neither was nor could be substantiated. The evidence of\nXenophon is quite sufficient to establish the unimpeachable orthodoxy\nof his friend. If it really was an offence at Athens to believe in\ngods unrecognised by the State, Socrates was not guilty of that\noffence, for his Daemonium was not a new divinity, but a revelation\nfrom the established divinities, such as individual believers have\nat all times been permitted to receive even by the most jealous\nreligious communities. The imputation of infidelity, commonly and\nindiscriminately brought against all philosophers, was a particularly\nunhappy one to fling at the great opponent of physical science, who,\nbesides, was noted for the punctual discharge of his religious duties.\nThat the first two counts of the indictment should be so frivolous\nraises a strong prejudice against the third. The charges of corruption\nseem to have come under two heads—alleged encouragement of disrespect\nto parents, and of disaffection towards democratic institutions. In\nsupport of the former some innocent expressions let fall by Socrates\nseem to have been taken up and cruelly perverted. By way of stimulating\nhis young friends to improve their minds, he had observed that\nrelations were only of value when they could help one another, and\nthat to do so they must be properly educated. This was twisted into\nan assertion that ignorant parents might properly be placed under\nrestraint by their better-informed children. That such an inference\ncould not have been sanctioned by Socrates himself is obvious from\nhis insisting on the respect due even to so intolerable a mother as\nXanthippê.[108] The political opinions of the defendant presented a\nmore vulnerable point for attack. He thought the custom of choosing\nmagistrates by lot absurd, and did not conceal his contempt for it.\nThere is, however, no reason for believing that such purely theoretical\ncriticisms were forbidden by law or usage at Athens. At any rate,\nmuch more revolutionary sentiments were tolerated on the stage. That\nSocrates would be no party to a violent subversion of the Constitution,\nand would regard it with high disapproval, was abundantly clear both\nfrom his life and from the whole tenor of his teaching. In opposition\nto Hippias, he defined justice as obedience to the law of the land.\nThe chances of the lot had, on one memorable occasion, called him to\npreside over the deliberations of the Sovereign Assembly. A proposition\nwas made, contrary to law, that the generals who were accused of having\nabandoned the crews of their sunken ships at Arginusae should be tried\nin a single batch. In spite of tremendous popular clamour, Socrates\nrefused to put the question to the vote on the single day for which\nhis office lasted. The just and resolute man, who would not yield to\nthe unrighteous demands of a crowd, had shortly afterwards to face the\nthreats of a frowning tyrant. When the Thirty were installed in power,\nhe publicly, and at the risk of his life, expressed disapproval of\ntheir sanguinary proceedings. The oligarchy, wishing to involve as many\nrespectable citizens as possible in complicity with their crimes, sent\nfor five persons, of whom Socrates was one, and ordered them to bring\na certain Leo from Salamis, that he might be put to death; the others\nobeyed, but Socrates refused to accompany them on their disgraceful\nerrand. Nevertheless, it told heavily against the philosopher that\nAlcibiades, the most mischievous of demagogues, and Critias, the most\nsavage of aristocrats, passed for having been educated by him. It was\nremembered, also, that he was in the habit of quoting a passage from\nHomer, where Odysseus is described as appealing to the reason of the\nchiefs, while he brings inferior men to their senses with rough words\nand rougher chastisement. In reality, Socrates did not mean that the\npoor should be treated with brutality by the rich, for he would have\nbeen the first to suffer had such license been permitted, but he\nmeant that where reason failed harsher methods of coercion must be\napplied. Precisely because expressions of opinion let fall in private\nconversation are so liable to be misunderstood or purposely perverted,\nto adduce them in support of a capital charge where no overt act can\nbe alleged, is the most mischievous form of encroachment on individual\nliberty.\n\nModern critics, beginning with Hegel,[109] have discovered reasons\nfor considering Socrates a dangerous character, which apparently did\nnot occur to Melêtus and his associates. We are told that the whole\nsystem of applying dialectics to morality had an unsettling tendency,\nfor if men were once taught that the sacredness of duty rested on\ntheir individual conviction they might refuse to be convinced, and act\naccordingly. And it is further alleged that Socrates first introduced\nthis principle of subjectivity into morals. The persecuting spirit\nis so insatiable that in default of acts it attacks opinions, and in\ndefault of specific opinions it fastens on general tendencies. We\nknow that Joseph de Maistre was suspected by his ignorant neighbours\nof being a Revolutionist because most of his time was spent in study;\nand but the other day a French preacher was sent into exile by his\necclesiastical superiors for daring to support Catholic morality on\nrational grounds.[110] Fortunately Greek society was not subject to\nthe rules of the Dominican Order. Never anywhere in Greece, certainly\nnot at Athens, did there exist that solid, all-comprehensive,\nunquestionable fabric of traditional obligation assumed by Hegel; and\nZeller is conceding far too much when he defends Socrates, on the sole\nground that the recognised standards of right had fallen into universal\ncontempt during the Peloponnesian war, while admitting that he might\nfairly have been silenced at an earlier period, if indeed his teaching\ncould have been conceived as possible before it actually began.[111]\nFor from the first, both in literature and in life, Greek thought\nis distinguished by an ardent desire to get to the bottom of every\nquestion, and to discover arguments of universal applicability for\nevery decision. Even in the youth of Pericles knotty ethical problems\nwere eagerly discussed without any interference on the part of the\npublic authorities. Experience had to prove how far-reaching was the\neffect of ideas before a systematic attempt could be made to control\nthem.\n\nIn what terms Socrates replied to his accusers cannot be stated with\nabsolute certainty. Reasons have been already given for believing that\nthe speech put into his mouth by Plato is not entirely historical;\nand here we may mention as a further reason that the specific charges\nmentioned by Xenophon are not even alluded to in it. This much,\nhowever, is clear, that the defence was of a thoroughly dignified\ncharacter; and that, while the allegations of the prosecution were\nsuccessfully rebutted, the defendant stood entirely on his innocence,\nand refused to make any of the customary but illegal appeals to the\ncompassion of the court. We are assured that he was condemned solely on\naccount of this defiant attitude, and by a very small majority. Melêtus\nhad demanded the penalty of death, but by Attic law Socrates had the\nright of proposing some milder sentence as an alternative. According\nto Plato, he began by stating that the justest return for his entire\ndevotion to the public good would be maintenance at the public expense\nduring the remainder of his life, an honour usually granted to victors\nat the Olympic games. In default of this he proposed a fine of thirty\nminae, to be raised by contributions among his friends. According to\nanother account,[112] he refused, on the ground of his innocence,\nto name any alternative penalty. On a second division Socrates was\ncondemned to death by a much larger majority than that which had found\nhim guilty, eighty of those who had voted for his acquittal now voting\nfor his execution.\n\nSuch was the transaction which some moderns, Grote among the number,\nholding Socrates to be one of the best and wisest of men, have\nendeavoured to excuse. Their argument is that the illustrious victim\nwas jointly responsible for his own fate, and that he was really\ncondemned, not for his teaching, but for contempt of court. To us it\nseems that this is a distinction without a difference. What has been\nso finely said of space and time may be said also of the Socratic\nlife and the Socratic doctrine; each was contained entire in every\npoint of the other. Such as he appeared to the Dicastery, such also he\nappeared everywhere, always, and to all men, offering them the truth,\nthe whole truth, and nothing but the truth. If conduct like his was\nnot permissible in a court of law, then it was not permissible at all;\nif justice could not be administered without reticences, evasions, and\ndisguises, where was sincerity ever to be practised? If reason was not\nto be the paramount arbitress in questions of public interest, what\nissues could ever be entrusted to her decision? Admit every extenuating\ncircumstance that the utmost ingenuity can devise, and from every point\nof view one fact will come out clearly, that Socrates was impeached as\na philosopher, that he defended himself like a philosopher, and that\nhe was condemned to death because he was a philosopher. Those who\nattempt to remove this stain from the character of the Athenian people\nwill find that, like the blood-stain on Bluebeard’s key, when it is\nrubbed out on one side it reappears on the other. To punish Socrates\nfor his teaching, or for the way in which he defended his teaching, was\nequally persecution, and persecution of the worst description, that\nwhich attacks not the results of free thought but free thought itself.\nWe cannot then agree with Grote when he says that the condemnation\nof Socrates ‘ought to count as one of the least gloomy items in an\nessentially gloomy catalogue.’ On the contrary, it is the gloomiest of\nany, because it reveals a depth of hatred for pure reason in vulgar\nminds which might otherwise have remained unsuspected. There is some\nexcuse for other persecutors, for Caiaphas, and St. Dominic, and\nCalvin: for the Inquisition, and for the authors of the dragonnades;\nfor the judges of Giordano Bruno, and the judges of Vanini: they were\nstriving to exterminate particular opinions, which they believed to be\nboth false and pernicious; there is no such excuse for the Athenian\ndicasts, least of all for those eighty who, having pronounced Socrates\ninnocent, sentenced him to death because he reasserted his innocence;\nif, indeed, innocence be not too weak a word to describe his life-long\nbattle against that very irreligion and corruption which were laid to\nhis charge. Here, in this one cause, the great central issue between\ntwo abstract principles, the principle of authority and the principle\nof reason, was cleared from all adventitious circumstances, and\ndisputed on its own intrinsic merits with the usual weapons of argument\non the one side and brute force on the other. On that issue Socrates\nwas finally condemned, and on it his judges must be condemned by us.\n\nNeither can we admit Grote’s further contention, that in no Greek\ncity but Athens would Socrates have been permitted to carry on his\ncross-examining activity for so long a period. On the contrary, we\nagree with Colonel Mure,[113] that in no other state would he have been\nmolested. Xenophanes and Parmenides, Heracleitus and Democritus, had\ngiven utterance to far bolder opinions than his, opinions radically\ndestructive of Greek religion, apparently without running the slightest\npersonal risk; while Athens had more than once before shown the same\nspirit of fanatical intolerance, though without proceeding to such a\nfatal extreme, thanks, probably, to the timely escape of her intended\nvictims. M. Ernest Renan has quite recently contrasted the freedom of\nthought accorded by Roman despotism with the narrowness of old Greek\nRepublicanism, quoting what he calls the Athenian Inquisition as a\nsample of the latter. The word inquisition is not too strong, only\nthe lecturer should not have led his audience to believe that Greek\nRepublicanism was in this respect fairly represented by its most\nbrilliant type, for had such been the case very little free thought\nwould have been left for Rome to tolerate.\n\nDuring the month’s respite accidentally allowed him, Socrates had one\nmore opportunity of displaying that stedfast obedience to the law\nwhich had been one of his great guiding principles through life. The\nmeans of escaping from prison were offered to him, but he refused to\navail himself of them, according to Plato, that the implicit contract\nof loyalty to which his citizenship had bound him might be preserved\nunbroken. Nor was death unwelcome to him although it is not true that\nhe courted it, any desire to figure as a martyr being quite alien from\nthe noble simplicity of his character. But he had reached an age when\nthe daily growth in wisdom which for him alone made life worth living,\nseemed likely to be exchanged for a gradual and melancholy decline.\nThat this past progress was a good in itself he never doubted, whether\nit was to be continued in other worlds, or succeeded by the happiness\nof an eternal sleep. And we may be sure that he would have held his\nown highest good to be equally desirable for the whole human race, even\nwith the clear prevision that its collective aspirations and efforts\ncannot be prolonged for ever.\n\nTwo philosophers only can be named who, in modern times, have rivalled\nor approached the moral dignity of Socrates. Like him, Spinoza\nrealised his own ideal of a good and happy life. Like him, Giordano\nBruno, without a hope of future recompense, chose death rather than a\nlife unfaithful to the highest truth, and death, too, under its most\nterrible form, not the painless extinction by hemlock inflicted in a\nheathen city, but the agonising dissolution intended by Catholic love\nto serve as a foretaste of everlasting fire. Yet with neither can the\nparallel be extended further; for Spinoza, wisely perhaps, refused\nto face the storms which a public profession and propagation of his\ndoctrine would have raised; and the wayward career of Giordano Bruno\nwas not in keeping with its heroic end. The complex and distracting\nconditions in which their lot was cast did not permit them to attain\nthat statuesque completeness which marked the classic age of Greek life\nand thought. Those times developed a wilder energy, a more stubborn\nendurance, a sweeter purity than any that the ancient world had known.\nBut until the scattered elements are recombined in a still loftier\nharmony, our sleepless thirst for perfection can be satisfied at one\nspring alone. Pericles must remain the ideal of statesmanship, Pheidias\nof artistic production, and Socrates of philosophic power.\n\nBefore the ideas which we have passed in review could go forth on their\nworld-conquering mission, it was necessary, not only that Socrates\nshould die, but that his philosophy should die also, by being absorbed\ninto the more splendid generalisations of Plato’s system. That system\nhas, for some time past, been made an object of close study in our\nmost famous seats of learning, and a certain acquaintance with it has\nalmost become part of a liberal education in England. No better source\nof inspiration, combined with discipline, could be found; but we shall\nunderstand and appreciate Plato still better by first extricating\nthe nucleus round which his speculations have gathered in successive\ndeposits, and this we can only do with the help of Xenophon, whose\nlittle work also well deserves attention for the sake of its own chaste\nand candid beauty. The relation in which it stands to the Platonic\nwritings may be symbolised by an example familiar to the experience\nof every traveller. As sometimes, in visiting a Gothic cathedral, we\nare led through the wonders of the more modern edifice—under soaring\narches, over tesselated pavements, and between long rows of clustered\ncolumns, past frescoed walls, storied windows, carven pulpits,\nand sepulchral monuments, with their endless wealth of mythologic\nimagery—down into the oldest portion of any, the bare stern crypt,\nsevere with the simplicity of early art, resting on pillars taken from\nan ancient temple, and enclosing the tomb of some martyred saint, to\nwhose glorified spirit an office of perpetual intercession before\nthe mercy-seat is assigned, and in whose honour all that external\nmagnificence has been piled up; so also we pass through the manifold\nand marvellous constructions of Plato’s imagination to that austere\nmemorial where Xenophon has enshrined with pious care, under the great\nprimary divisions of old Hellenic virtue, an authentic reliquary of\none standing foremost among those who, having worked out their own\ndeliverance from the powers of error and evil, would not be saved\nalone, but published the secret of redemption though death were the\npenalty of its disclosure; and who, by their transmitted influence,\neven more than by their eternal example, are still contributing to the\nprogressive development of all that is most rational, most consistent,\nmost social, and therefore most truly human in ourselves.\n\nFOOTNOTES:\n\n[80] Cf. Havet, _Le Christianisme et ses Origines_, I., 167.\n\n[81] _Gesch. d. Phil._, II., 47.\n\n[82] The oracle quoted in the _Apologia Socratis_ attributed to\nXenophon praises Socrates not for wisdom but for independence, justice,\nand temperance. Moreover, the work in question is held to be spurious\nby nearly every critic.\n\n[83] _Mem._, IV., vi., 1.\n\n[84] _Mem._, IV., iv., 10.\n\n[85] Zeller, _Ph. d. Gr._, II., a, 103, note 3 _sub fin._\n\n[86] It may possibly be asked, Why, if Plato gave only an ideal picture\nof Socrates, are we to accept his versions of the Sophistic teaching\nas literally exact? The answer is that he was compelled, by the nature\nof the case, to create an imaginary Socrates, while he could have no\nconceivable object in ascribing views which he did not himself hold\nto well-known historical personages. Assuming an unlimited right of\nmaking fictitious statements for the public good, his principles would\nsurely not have permitted him wantonly to calumniate his innocent\ncontemporaries by foisting on them odious theories for which they were\nnot responsible. Had nobody held such opinions as those attributed\nto Thrasymachus in the _Republic_ there would have been no object\nin attacking them; and if anybody held them, why not Thrasymachus\nas well as another? With regard to the veracity of the _Apologia_,\nGrote, in his work on Plato (I. 291), quotes a passage from Aristeides\nthe rhetor, stating that all the companions of Socrates agreed about\nthe Delphic oracle, and the Socratic disclaimer of knowledge. This,\nhowever, proves too much, for it shows that Aristeides quite overlooked\nthe absence of any reference to either point in Xenophon, and therefore\ncannot be trusted to give an accurate report of the other authorities.\n\n[87] _Ph. d. Gr._, II., a, 93 ff.\n\n[88] In the conversation with Hippias already referred to.\n\n[89] _Mem._, III., ix., 4.\n\n[90] _Mem._, III., vi.\n\n[91] _Mem._, IV., ii.\n\n[92] _Mem._, IV., iii.\n\n[93] _Mem._, III., ix., 10.\n\n[94] _Mem._, IV., vi., 14.\n\n[95] Xenophon, _Mem._, III., vii. We may incidentally notice that this\npassage is well worth the attention of those who look on the Athenian\nDêmos as an idle and aristocratic body, supported by slave labour.\n\n[96] _Metaph._, XIII., iv.\n\n[97] _Mem._, I., iv.\n\n[98] ‘Il sait que, dans l’intérêt même du bien, il ne faut pas imposer\nle bien d’une manière trop absolue, le jeu libre de la liberté étant\nla condition de la vie humaine.... poursuite en toutes choses du bien\npublic, non des applaudissements.’—Renan, _Marc-Aurèle_, pp. 18, 19.\n\n[99] _Il._, IX., 337.\n\n[100] _Ib._, XXI., 106.\n\n[101] In the preface to the _Data of Ethics_.\n\n[102] _Mem._, III., x.\n\n[103] Curtius, _Griechische Geschichte_, III., 526-30 (3rd ed.), where,\nhowever, the revolution in art is attributed to the influence of the\nSophists.\n\n[104] Xenoph., _Oeconom._, iii., 12.\n\n[105] Mure, _History of Grecian Literature_, IV., 451.\n\n[106] _Mem._, III., xi.\n\n[107] _Oeconom._, vii., 4 ff.\n\n[108] _Mem._, II., i.\n\n[109] _Gesch. d. Ph._, II., 100 ff.\n\n[110] Written in the spring of 1880. The allusion is to Father Didon,\nwho was at that time rusticated in Corsica.\n\n[111] _Ph. d. Gr._, II., a, 192.\n\n[112] In the _Apologia_, attributed to Xenophon.\n\n[113] _Hist. of Gr. Lit._, IV., App. A.\n\n\n\n\nCHAPTER IV.\n\nPLATO: HIS TEACHERS AND HIS TIMES.\n\n\nI.\n\nIn studying the growth of philosophy as an historical evolution,\nrepetitions and anticipations must necessarily be of frequent\noccurrence. Ideas meet us at every step which can only be appreciated\nwhen we trace out their later developments, or only understood when\nwe refer them back to earlier and half-forgotten modes of thought.\nThe speculative tissue is woven out of filaments so delicate and so\ncomplicated that it is almost impossible to say where one begins and\nthe other ends. Even conceptions which seem to have been transmitted\nwithout alteration are constantly acquiring a new value according\nto the connexions into which they enter or the circumstances to\nwhich they are applied. But if the method of evolution, with its two\ngreat principles of continuity and relativity, substitutes a maze\nof intricate lines, often returning on themselves, for the straight\npath along which progress was once supposed to move, we are more\nthan compensated by the new sense of coherence and rationality where\nillusion and extravagance once seemed to reign supreme. It teaches us\nthat the dreams of a great intellect may be better worth our attention\nthan the waking perceptions of ordinary men. Combining fragments of\nthe old order with rudimentary outlines of the new, they lay open the\nsecret laboratory of spiritual chemistry, and help to bridge over the\ninterval separating the most widely contrasted phases of life and\nthought. Moreover, when we have once accustomed ourselves to break up\npast systems of philosophy into their component elements, when we see\nhow heterogeneous and ill-cemented were the parts of this and that\nproud edifice once offered as the only possible shelter against dangers\nthreatening the very existence of civilisation—we shall be prepared\nfor the application of a similar method to contemporary systems of\nequally ambitious pretensions; distinguishing that which is vital,\nfruitful, original, and progressive in their ideal synthesis from\nthat which is of merely provisional and temporary value, when it is\nnot the literary resuscitation of a dead past, visionary, retrograde,\nand mischievously wrong. And we shall also be reminded that the most\nprecious ideas have only been shaped, preserved, and transmitted\nthrough association with earthy and perishable ingredients. The\nfunction of true criticism is, like Robert Browning’s Roman jeweller,\nto turn on them ‘the proper fiery acid’ of purifying analysis which\ndissolves away the inferior metal and leaves behind the gold ring\nwhereby thought and action are inseparably and fruitfully united.\n\nSuch, as it seems to us, is the proper spirit in which we should\napproach the great thinker whose works are to occupy us in this and\nthe succeeding chapter. No philosopher has ever offered so extended\nand vulnerable a front to hostile criticism. None has so habitually\nprovoked reprisals by his own incessant and searching attacks on\nall existing professions, customs, and beliefs. It might even be\nmaintained that none has used the weapons of controversy with more\nunscrupulous zeal. And it might be added that he who dwells so much on\nthe importance of consistency has occasionally denounced and ridiculed\nthe very principles which he elsewhere upholds as demonstrated truths.\nIt was an easy matter for others to complete the work of destruction\nwhich he had begun. His system seems at first sight to be made up of\nassertions, one more outrageous than another. The ascription of an\nobjective concrete separate reality to verbal abstractions is assuredly\nthe most astounding paradox ever maintained even by a metaphysician.\nYet this is the central article of Plato’s creed. That body is\nessentially different from extension might, one would suppose, have\nbeen sufficiently clear to a mathematician who had the advantage of\ncoming after Leucippus and Democritus. Their identity is implicitly\naffirmed in the _Timaeus_. That the soul cannot be both created and\neternal; that the doctrine of metempsychosis is incompatible with the\nhereditary transmission of mental qualities; that a future immortality\nequivalent to, and proved by the same arguments as, our antenatal\nexistence, would be neither a terror to the guilty nor a consolation\nto the righteous:—are propositions implicitly denied by Plato’s\npsychology. Passing from theoretical to practical philosophy, it\nmight be observed that respect for human life, respect for individual\nproperty, respect for marriage, and respect for truthfulness, are\ngenerally numbered among the strongest moral obligations, and those\nthe observance of which most completely distinguishes civilised\nfrom savage man; while infanticide, communism, promiscuity, and the\noccasional employment of deliberate deceit, form part of Plato’s scheme\nfor the redemption of mankind. We need not do more than allude to\nthose Dialogues where the phases and symptoms of unnameable passion\nare delineated with matchless eloquence, and apparently with at least\nas much sympathy as censure. Finally, from the standpoint of modern\nscience, it might be urged that Plato used all his powerful influence\nto throw back physical speculation into the theological stage; that he\ndeliberately discredited the doctrine of mechanical causation which,\nfor us, is the most important achievement of early Greek thought; that\nhe expatiated on the criminal folly of those who held the heavenly\nbodies to be, what we now know them to be, masses of dead matter with\nno special divinity about them; and that he proposed to punish this\nand other heresies with a severity distinguishable from the fitful\nfanaticism of his native city only by its more disciplined and rigorous\napplication.\n\nA plain man might find it difficult to understand how such\nextravagances could be deliberately propounded by the greatest\nintellect that Athens ever produced, except on the principle, dear to\nmediocrity, that genius is but little removed from madness, and that\nphilosophical genius resembles it more nearly than any other. And his\nsurprise would become much greater on learning that the best and wisest\nmen of all ages have looked up with reverence to Plato; that thinkers\nof the most opposite schools have resorted to him for instruction and\nstimulation; that his writings have never been more attentively studied\nthan in our own age—an age which has witnessed the destruction of so\nmany illusive reputations; and that the foremost of English educators\nhas used all his influence to promote the better understanding and\nappreciation of Plato as a prime element in academic culture—an\ninfluence now extended far beyond the limits of his own university\nthrough that translation of the Platonic Dialogues which is too well\nknown to need any commendation on our part, but which we may mention as\none of the principal authorities used for the present study, together\nwith the work of a German scholar, his obligations to whom Prof. Jowett\nhas acknowledged with characteristic grace.[114]\n\nAs a set-off against the list of paradoxes cited from Plato, it would\nbe easy to quote a still longer list of brilliant contributions to\nthe cause of truth and right, to strike a balance between the two,\nand to show that there was a preponderance on the positive side\nsufficiently great to justify the favourable verdict of posterity.\nWe believe, however, that such a method would be as misleading as\nit is superficial. Neither Plato nor any other thinker of the same\ncalibre—if any other there be—should be estimated by a simple\nanalysis of his opinions. We must go back to the underlying forces\nof which individual opinions are the resultant and the revelation.\nEvery systematic synthesis represents certain profound intellectual\ntendencies, derived partly from previous philosophies, partly from the\nsocial environment, partly from the thinker’s own genius and character.\nEach of such tendencies may be salutary and necessary, according to the\nconditions under which it comes into play, and yet two or more of them\nmay form a highly unstable and explosive compound. Nevertheless, it is\nin speculative combinations that they are preserved and developed with\nthe greatest distinctness, and it is there that we must seek for them\nif we would understand the psychological history of our race. And this\nis why we began by intimating that the lines of our investigation may\ntake us back over ground which has been already traversed, and forward\ninto regions which cannot at present be completely surveyed.\n\nWe have this great advantage in dealing with Plato—that his\nphilosophical writings have come down to us entire, while the thinkers\nwho preceded him are known only through fragments and second-hand\nreports. Nor is the difference merely accidental. Plato was the creator\nof speculative literature, properly so called: he was the first and\nalso the greatest artist that ever clothed abstract thought in language\nof appropriate majesty and splendour; and it is probably to their\nbeauty of form that we owe the preservation of his writings. Rather\nunfortunately, however, along with the genuine works of the master, a\ncertain number of pieces have been handed down to us under his name, of\nwhich some are almost universally admitted to be spurious, while the\nauthenticity of others is a question on which the best scholars are\nstill divided. In the absence of any very cogent external evidence,\nan immense amount of industry and learning has been expended on this\nsubject, and the arguments employed on both sides sometimes make\nus doubt whether the reasoning powers of philologists are better\ndeveloped than, according to Plato, were those of mathematicians\nin his time. The two extreme positions are occupied by Grote, who\naccepts the whole Alexandrian canon, and Krohn, who admits nothing\nbut the _Republic_;[115] while much more serious critics, such as\nSchaarschmidt, reject along with a mass of worthless compositions\nseveral Dialogues almost equal in interest and importance to those\nwhose authenticity has never been doubted. The great historian\nof Greece seems to have been rather undiscriminating both in his\nscepticism and in his belief; and the exclusive importance which he\nattributed to contemporary testimony, or to what passed for such\nwith him, may have unduly biassed his judgment in both directions.\nAs it happens, the authority of the canon is much weaker than Grote\nimagined; but even granting his extreme contention, our view of\nPlato’s philosophy would not be seriously affected by it, for the\npieces which are rejected by all other critics have no speculative\nimportance whatever. The case would be far different were we to\nagree with those who impugn the genuineness of the _Parmenides_, the\n_Sophist_, the _Statesman_, the _Philêbus_, and the _Laws_; for these\ncompositions mark a new departure in Platonism amounting to a complete\ntransformation of its fundamental principles, which indeed is one of\nthe reasons why their authenticity has been denied. Apart, however,\nfrom the numerous evidences of Platonic authorship furnished by the\nDialogues themselves, as well as by the indirect references to them\nin Aristotle’s writings, it seems utterly incredible that a thinker\nscarcely, if at all, inferior to the master himself—as the supposed\nimitator must assuredly have been—should have consented to let his\nreasonings pass current under a false name, and that, too, the name of\none whose teaching he in some respects controverted; while there is a\nfurther difficulty in assuming that his existence could pass unnoticed\nat a period marked by intense literary and philosophical activity.\nReaders who wish for fuller information on the subject will find in\nZeller’s pages a careful and lucid digest of the whole controversy\nleading to a moderately conservative conclusion. Others will doubtless\nbe content to accept Prof. Jowett’s verdict, that ‘on the whole not\na sixteenth part of the writings which pass under the name of Plato,\nif we exclude the works rejected by the ancients themselves, can be\nfairly doubted by those who are willing to allow that a considerable\nchange and growth may have taken place in his philosophy.’[116] To\nwhich we may add that the Platonic dialogues, whether the work of one\nor more hands, and however widely differing among themselves, together\nrepresent a single phase of thought, and are appropriately studied as a\nconnected series.\n\nWe have assumed in our last remark that it is possible to discover some\nsort of chronological order in the Platonic Dialogues, and to trace a\ncertain progressive modification in the general tenor of their teaching\nfrom first to last. But here also the positive evidence is very scanty,\nand a variety of conflicting theories have been propounded by eminent\nscholars. Where so much is left to conjecture, the best that can be\nsaid for any hypothesis is that it explains the facts according to\nknown laws of thought. It will be for the reader to judge whether our\nown attempt to trace the gradual evolution of Plato’s system satisfies\nthis condition. In making it we shall take as a basis the arrangement\nadopted by Prof. Jowett, with some reservations hereafter to be\nspecified.\n\nBefore entering on our task, one more difficulty remains to be noticed.\nPlato, although the greatest master of prose composition that ever\nlived, and for his time a remarkably voluminous author, cherished a\nstrong dislike for books, and even affected to regret that the art of\nwriting had ever been invented. A man, he said, might amuse himself\nby putting down his ideas on paper, and might even find written\nmemoranda useful for private reference, but the only instruction\nworth speaking of was conveyed by oral communication, which made it\npossible for objections unforeseen by the teacher to be freely urged\nand answered.[117] Such had been the method of Socrates, and such was\ndoubtless the practice of Plato himself whenever it was possible for\nhim to set forth his philosophy by word of mouth. It has been supposed,\nfor this reason, that the great writer did not take his own books in\nearnest, and wished them to be regarded as no more than the elegant\nrecreations of a leisure hour, while his deeper and more serious\nthoughts were reserved for lectures and conversations, of which,\nbeyond a few allusions in Aristotle, every record has perished. That\nsuch, however, was not the case, may be easily shown. In the first\nplace it is evident, from the extreme pains taken by Plato to throw\nhis philosophical expositions into conversational form, that he did\nnot despair of providing a literary substitute for spoken dialogue.\nSecondly, it is a strong confirmation of this theory that Aristotle,\na personal friend and pupil of Plato during many years, should so\nfrequently refer to the Dialogues as authoritative evidences of his\nmaster’s opinions on the most important topics. And, lastly, if it\ncan be shown that the documents in question do actually embody a\ncomprehensive and connected view of life and of the world, we shall\nfeel satisfied that the oral teaching of Plato, had it been preserved,\nwould not modify in any material degree the impression conveyed by his\nwritten compositions.\n\n\nII.\n\nThere is a story that Plato used to thank the gods, in what some might\nconsider a rather Pharisaic spirit, for having made him a human being\ninstead of a brute, a man instead of a woman, and a Greek instead\nof a barbarian; but more than anything else for having permitted\nhim to be born in the time of Socrates. It will be observed that all\nthese blessings tended in one direction, the complete supremacy in\nhis character of reason over impulse and sense. To assert, extend,\nand organise that supremacy was the object of his whole life. Such,\nindeed, had been the object of all his predecessors, and such, stated\ngenerally, has been always and everywhere the object of philosophy;\nbut none had pursued it so consciously before, and none has proclaimed\nit so enthusiastically since then. Now, although Plato could not have\ndone this without a far wider range of knowledge and experience than\nSocrates had possessed, it was only by virtue of the Socratic method\nthat his other gifts and acquisitions could be turned to complete\naccount; while, conversely, it was only when brought to bear upon\nthese new materials that the full power of the method itself could be\nrevealed. To be continually asking and answering questions; to elicit\ninformation from everybody on every subject worth knowing; and to\nelaborate the resulting mass of intellectual material into the most\nconvenient form for practical application or for further transmission,\nwas the secret of true wisdom with the sage of the market-place and\nthe workshop. But the process of dialectic investigation as an end in\nitself, the intense personal interest of conversation with living men\nand women of all classes, the impatience for immediate and visible\nresults, had gradually induced Socrates to restrict within far too\nnarrow limits the sources whence his ideas were derived and the\npurposes to which they were applied. And the dialectic method itself\ncould not but be checked in its internal development by this want of\nbreadth and variety in the topics submitted to its grasp. Therefore the\ndeath of Socrates, however lamentable in its occasion, was an unmixed\nbenefit to the cause for which he laboured, by arresting (as we must\nsuppose it to have arrested) the popular and indiscriminate employment\nof his cross-examining method, liberating his ablest disciple from\nthe ascendency of a revered master, and inducing him to reconsider\nthe whole question of human knowledge and action from a remoter point\nof view. For, be it observed that Plato did not begin where Socrates\nhad left off; he went back to the germinal point of the whole system,\nand proceeded to reconstruct it on new lines of his own. The loss of\nthose whom we love habitually leads our thoughts back to the time of\nour first acquaintance with them, or, if these are ascertainable, to\nthe circumstances of their early life. In this manner Plato seems to\nhave been at first occupied exclusively with the starting-point of\nhis friend’s philosophy, and we know, from the narrative given in the\n_Apologia_, under what form he came to conceive it. We have attempted\nto show that the account alluded to cannot be entirely historical.\nNevertheless it seems sufficiently clear that Socrates began with a\nconviction of his own ignorance, and that his efforts to improve others\nwere prefaced by the extraction of a similar confession of ignorance on\ntheir part. It is also certain that through life he regarded the causes\nof physical phenomena as placed beyond the reach of human reason and\nreserved by the gods for their own exclusive cognisance, pointing, by\nway of proof, to the notorious differences of opinion prevalent among\nthose who had meddled with such matters. Thus, his scepticism worked\nin two directions, but on the one side it was only provisional and\non the other it was only partial. Plato began by combining the two.\nHe maintained that human nescience is universal and necessary; that\nthe gods had reserved all knowledge for themselves; and that the only\nwisdom left for men is a consciousness of their absolute ignorance. The\nSocratic starting-point gave the centre of his agnostic circle; the\nSocratic theology gave the distance at which it was described. Here we\nhave to note two things—first, the breadth of generalisation which\ndistinguishes the disciple from the master; and, secondly, the symptoms\nof a strong religious reaction against Greek humanism. Even before the\nend of the Peloponnesian War, evidence of this reaction had appeared,\nand the _Bacchae_ of Euripides bears striking testimony to its gloomy\nand fanatical character. The last agony of Athens, the collapse of\nher power, and the subsequent period of oligarchic terrorism, must\nhave given a stimulus to superstition like that which quite recently\nafflicted France with an epidemic of apparitions and pilgrimages almost\ntoo childish for belief. Plato followed the general movement, although\non a much higher plane. While looking down with undisguised contempt\non the immoral idolatry of his countrymen, he was equally opposed\nto the irreligion of the New Learning, and, had an opportunity been\ngiven him, he would, like the Reformers of the sixteenth century, have\nput down both with impartial severity. Nor was this the only analogy\nbetween his position and that of a Luther or a Calvin. Like them, and\nindeed like all great religious teachers, he exalted the Creator by\nenlarging on the nothingness of the creature; just as Christianity\nexhibits the holiness of God in contrast and correlation with the\nsinfulness of unregenerate hearts; just as to Pindar man’s life seemed\nbut the fleeting shadow in a dream when compared with the beauty and\nstrength and immortality of the Olympian divinities; so also did Plato\ndeepen the gloom of human ignorance that he might bring out in dazzling\nrelief the fulness of that knowledge which he had been taught to prize\nas a supreme ideal, but which, for that very reason, seemed proper to\nthe highest existences alone. And we shall presently see how Plato\nalso discovered a principle in man by virtue of which he could claim\nkindred with the supernatural, and elaborated a scheme of intellectual\nmediation by which the fallen spirit could be regenerated and made a\npartaker in the kingdom of speculative truth.\n\nYet if Plato’s theology, from its predominantly rational character,\nseemed to neglect some feelings which were better satisfied by the\nearlier or the later faiths of mankind, we cannot say that it really\nexcluded them. The unfading strength of the old gods was comprehended\nin the self-existence of absolute ideas, and moral goodness was\nonly a particular application of reason to the conduct of life. An\nemotional or imaginative element was also contributed by the theory\nthat every faculty exercised without a reasoned consciousness of its\nprocesses and aims was due to some saving grace and inspiration from\na superhuman power. It was thus, according to Plato, that poets and\nartists were able to produce works of which they were not able to\nrender an intelligent account; and it was thus that society continued\nto hold together with such an exceedingly small amount of wisdom and\nvirtue. Here, however, we have to observe a marked difference between\nthe religious teachers pure and simple, and the Greek philosopher\nwho was a dialectician even more than he was a divine. For Plato\nheld that providential government was merely provisional; that the\ninspired prophet stood on a distinctly lower level than the critical,\nself-conscious thinker; that ratiocination and not poetry was the\nhighest function of mind; and that action should be reorganised in\naccordance with demonstrably certain principles.[118]\n\nThis search after a scientific basis for conduct was quite in the\nspirit of Socrates, but Plato seems to have set very little value on\nhis master’s positive contributions to the systematisation of life.\nWe have seen that the _Apologia_ is purely sceptical in its tendency;\nand we find a whole group of Dialogues, probably the earliest of\nPlato’s compositions, marked by the same negative, inconclusive tone.\nThese are commonly spoken of as Socratic, and so no doubt they are in\nreference to the subjects discussed; but they would be more accurately\ndescribed as an attempt to turn the Socratic method against its first\noriginator. We know from another source that temperance, fortitude,\nand piety were the chief virtues inculcated and practised by Socrates;\nwhile friendship, if not strictly speaking a virtue, was equally with\nthem one of his prime interests in life. It is clear that he considered\nthem the most appropriate and remunerative subjects of philosophical\ndiscussion; that he could define their nature to his own satisfaction;\nand that he had, in fact, defined them as so many varieties of wisdom.\nNow, Plato has devoted a separate Dialogue to each of the conceptions\nin question,[119] and in each instance he represents Socrates, who is\nthe principal spokesman, as professedly ignorant of the whole subject\nunder discussion, offering no definition of his own (or at least none\nthat he will stand by), but asking his interlocutors for theirs, and\npulling it to pieces when it is given. We do, indeed, find a tendency\nto resolve the virtues into knowledge, and, so far, either to identify\nthem with one another, or to carry them up into the unity of a higher\nidea. To this extent Plato follows in the footsteps of his master,\nbut a result which had completely satisfied Socrates became the\nstarting-point of a new investigation with his successor. If virtue is\nknowledge, it must be knowledge of what we most desire—of the good.\nThus the original difficulty returns under another form, or rather\nwe have merely restated it in different terms. For, to ask what is\ntemperance or fortitude, is equivalent to asking what is its use. And\nthis was so obvious to Socrates, that, apparently, he never thought\nof distinguishing between the two questions. But no sooner were they\ndistinguished than his reduction of all morality to a single principle\nwas shown to be illusive. For each specific virtue had been substituted\nthe knowledge of a specific utility, and that was all. Unless the\nhighest good were one, the means by which it was sought could not\nconverge to a single point; nor, according to the new ideas, could\ntheir mastery come under the jurisdiction of a single art.\n\nWe may also suspect that Plato was dissatisfied not only with the\npositive results obtained by Socrates, but also with the Socratic\nmethod of constructing general definitions. To rise from the part to\nthe whole, from particular instances to general notions, was a popular\nrather than a scientific process; and sometimes it only amounted\nto taking the current explanations and modifying them to suit the\nexigencies of ordinary experience. The resulting definitions could\nnever be more than tentative, and a skilful dialectician could always\nupset them by producing an unlooked-for exception, or by discovering an\nambiguity in the terms by which they were conveyed.\n\nBefore ascertaining in what direction Plato sought for an outlet\nfrom these accumulated difficulties, we have to glance at a Dialogue\nbelonging apparently to his earliest compositions, but in one respect\noccupying a position apart from the rest. The _Crito_ tells us for\nwhat reasons Socrates refused to escape from the fate which awaited\nhim in prison, as, with the assistance of generous friends, he might\neasily have done. The aged philosopher considered that by adopting\nsuch a course he would be setting the Athenian laws at defiance, and\ndoing what in him lay to destroy their validity. Now, we know that the\nhistorical Socrates held justice to consist in obedience to the law\nof the land; and here for once we find Plato agreeing with him on a\ndefinite and positive issue. Such a sudden and singular abandonment\nof the sceptical attitude merits our attention. It might, indeed, be\nsaid that Plato’s inconsistencies defy all attempts at reconciliation,\nand that in this instance the desire to set his maligned friend in a\nfavourable light triumphed over the claims of an impracticable logic.\nWe think, however, that a deeper and truer solution can be found. If\nthe _Crito_ inculcates obedience to the laws as a binding obligation,\nit is not for the reasons which, according to Xenophon, were adduced\nby the real Socrates in his dispute with the Sophist Hippias; general\nutility and private interest were the sole grounds appealed to then.\nPlato, on the other hand, ignores all such external considerations.\nTrue to his usual method, he reduces the legal conscience to a purely\ndialectical process. Just as in an argument the disputants are, or\nought to be, bound by their own admissions, so also the citizen\nis bound by a tacit compact to fulfil the laws whose protection\nhe has enjoyed and of whose claims his protracted residence is an\nacknowledgment. Here there is no need of a transcendent foundation for\nmorality, as none but logical considerations come into play. And it\nalso deserves to be noticed that, where this very idea of an obligation\nbased on acceptance of services had been employed by Socrates, it was\ndiscarded by Plato. In the _Euthyphro_, a Dialogue devoted to the\ndiscussion of piety, the theory that religion rests on an exchange of\ngood offices between gods and men is mentioned only to be scornfully\nrejected. Equally remarkable, and equally in advance of the Socratic\nstandpoint, is a principle enunciated in the _Crito_, that retaliation\nis wrong, and that evil should never be returned for evil.[120] And\nboth are distinct anticipations of the earliest Christian teaching,\nthough both are implicitly contradicted by the so-called religious\nservices celebrated in Christian churches and by the doctrine of\na divine retribution which is only not retaliatory because it is\ninfinitely in excess of the provocation received.\n\nIf the earliest of Plato’s enquiries, while they deal with the same\nsubjects and are conducted on the same method as those cultivated by\nSocrates, evince a breadth of view surpassing anything recorded of him\nby Xenophon, they also exhibit traces of an influence disconnected with\nand inferior in value to his. On more than one occasion[121] Plato\nreasons, or rather quibbles, in a style which he has elsewhere held up\nto ridicule as characteristic of the Sophists, with such success that\nthe name of sophistry has clung to it ever since. Indeed, some of the\nverbal fallacies employed are so transparent that we can hardly suppose\nthem to be unintentional, and we are forced to conclude that the young\ndespiser of human wisdom was resolved to maintain his thesis with any\nweapons, good or bad, which came to hand. And it seems much more likely\nthat he learned the eristic art from Protagoras or from his disciples\nthan from Socrates. Plato spent a large part of his life in opposing\nthe Sophists—that is to say, the paid professors of wisdom and virtue;\nbut in spite of, or rather perhaps because of, this very opposition,\nhe was profoundly affected by their teaching and example. It is quite\nconceivable, although we do not find it stated as a fact, that he\nresorted to them for instruction when a young man, and before coming\nunder the influence of Socrates, an event which did not take place\nuntil he was twenty years old; or he may have been directed to them by\nSocrates himself. With all its originality, his style bears traces of\na rhetorical training in the more elaborate passages, and the Sophists\nwere the only teachers of rhetoric then to be found. His habit of\nclothing philosophical lessons in the form of a myth seems also to have\nbeen borrowed from them. It would, therefore, not be surprising that he\nshould cultivate their argumentative legerdemain side by side with the\nmore strict and severe discipline of Socratic dialectics.\n\nPlato does, no doubt, make it a charge against the Sophists that\ntheir doctrines are not only false and immoral, but that they are\nput together without any regard for logical coherence. It would\nseem, however, that this style of attack belongs rather to the later\nand constructive than to the earlier and receptive period of his\nintellectual development. The original cause of his antagonism to the\nprofessional teachers seems to have been their general pretensions to\nknowledge, which, from the standpoint of universal scepticism, were,\nof course, utterly illusive; together with a feeling of aristocratic\ncontempt for a calling in which considerations of pecuniary interest\nwere involved, heightened in this instance by a conviction that the\nbuyer received nothing better than a sham article in exchange for\nhis money. Here, again, a parallel suggests itself with the first\npreaching of the Gospel. The attitude of Christ towards the scribes and\nPharisees, as also that of St. Paul towards Simon Magus, will help us\nto understand how Plato, in another order of spiritual teaching, must\nhave regarded the hypocrisy of wisdom, the intrusion of fraudulent\ntraders into the temple of Delphic inspiration, and the sale of a\npriceless blessing whose unlimited diffusion should have been its own\nand only reward.\n\nYet throughout the philosophy of Plato we meet with a tendency to\nambiguous shiftings and reversions of which, here also, due account\nmust be taken. That curious blending of love and hate which forms the\nsubject of a mystical lyric in Mr. Browning’s _Pippa Passes_, is not\nwithout its counterpart in purely rationalistic discussion. If Plato\nused the Socratic method to dissolve away much that was untrue, because\nincomplete, in Socratism, he used it also to absorb much that was\ndeserving of development in Sophisticism. If, in one sense, the latter\nwas a direct reversal of his master’s teaching, in another it served\nas a sort of intermediary between that teaching and the unenlightened\nconsciousness of mankind. The shadow should not be confounded with the\nsubstance, but it might show by contiguity, by resemblance, and by\ncontrast where the solid reality lay, what were its outlines, and how\nits characteristic lights might best be viewed.\n\nSuch is the mild and conciliatory mode of treatment at first adopted\nby Plato in dealing with the principal representative of the\nSophists—Protagoras. In the Dialogue which bears his name the famous\nhumanist is presented to us as a professor of popular unsystematised\nmorality, proving by a variety of practical arguments and ingenious\nillustrations that virtue can be taught, and that the preservation\nof social order depends upon the possibility of teaching it; but\nunwilling to go along with the reasonings by which Socrates shows the\napplicability of rigorously scientific principles to conduct. Plato\nhas here taken up one side of the Socratic ethics, and developed it\ninto a complete and self-consistent theory. The doctrine inculcated is\nthat form of utilitarianism to which Mr. Sidgwick has given the name of\negoistic hedonism. We are brought to admit that virtue is one because\nthe various virtues reduce themselves in the last analysis to prudence.\nIt is assumed that happiness, in the sense of pleasure and the absence\nof pain, is the sole end of life. Duty is identified with interest.\nMorality is a calculus for computing quantities of pleasure and pain,\nand all virtuous action is a means for securing a maximum of the one\ntogether with a minimum of the other. Ethical science is constituted;\nit can be taught like mathematics; and so far the Sophists are right,\nbut they have arrived at the truth by a purely empirical process;\nwhile Socrates, who professes to know nothing, by simply following the\ndialectic impulse strikes out a generalisation which at once confirms\nand explains their position; yet from self-sufficiency or prejudice\nthey refuse to agree with him in taking their stand on its only logical\nfoundation.\n\nThat Plato put forward the ethical theory of the Protagoras in perfect\ngood faith cannot, we think, be doubted; although in other writings\nhe has repudiated hedonism with contemptuous aversion; and it seems\nequally evident that this was his earliest contribution to positive\nthought. Of all his theories it is the simplest and most Socratic;\nfor Socrates, in endeavouring to reclaim the foolish or vicious,\noften spoke as if self-interest was the paramount principle of human\nnature; although, had his assumption been formulated as an abstract\nproposition, he too might have shrunk from it with something of the\nuneasiness attributed to Protagoras. And from internal evidence of\nanother description we have reason to think that the Dialogue in\nquestion is a comparatively juvenile production, remembering always\nthat the period of youth was much more protracted among the Greeks\nthan among ourselves. One almost seems to recognise the hand of a\nboy just out of college, who delights in drawing caricatures of his\nteachers; and who, while he looks down on classical scholarship in\ncomparison with more living and practical topics, is not sorry to show\nthat he can discuss a difficult passage from Simonides better than the\nprofessors themselves.\n\n\nIII.\n\nOur survey of Plato’s first period is now complete; and we have to\nenter on the far more arduous task of tracing out the circumstances,\nimpulses, and ideas by which all the scattered materials of Greek\nlife, Greek art, and Greek thought were shaped into a new system and\nstamped with the impress of an imperishable genius. At the threshold\nof this second period the personality of Plato himself emerges into\ngreater distinctness, and we have to consider what part it played in\nan evolution where universal tendencies and individual leanings were\ninseparably combined.\n\nPlato was born in the year 429, or according to some accounts 427,\nand died 347 B.C. Few incidents in his biography can be fixed with\nany certainty; but for our purpose the most general facts are also\nthe most interesting, and about these we have tolerably trustworthy\ninformation. His family was one of the noblest in Athens, being\nconnected on the father’s side with Codrus, and on the mother’s with\nSolon; while two of his kinsmen, Critias and Charmides, were among the\nchiefs of the oligarchic party. It is uncertain whether he inherited\nany considerable property, nor is the question one of much importance.\nIt seems clear that he enjoyed the best education Athens could afford,\nand that through life he possessed a competence sufficient to relieve\nhim from the cares of material existence. Possibly the preference\nwhich he expressed, when far advanced in life, for moderate health\nand wealth arose from having experienced those advantages himself.\nIf the busts which bear his name are to be trusted, he was remarkably\nbeautiful, and, like some other philosophers, very careful of his\npersonal appearance. Perhaps some reminiscences of the admiration\nbestowed on himself may be mingled with those pictures of youthful\nloveliness and of its exciting effect on the imaginations of older\nmen which give such grace and animation to his earliest dialogues. We\nknow not whether as lover or beloved he passed unscathed through the\nstorms of passion which he has so powerfully described, nor whether his\napparently intimate acquaintance with them is due to divination or to\nregretful experience. We may pass by in silence whatever is related on\nthis subject, with the certainty that, whether true or not, scandalous\nstories could not fail to be circulated about him.\n\nIt was natural that one who united a great intellect to a glowing\ntemperament should turn his thoughts to poetry. Plato wrote a quantity\nof verses—verse-making had become fashionable just then—but wisely\ncommitted them to the flames on making the acquaintance of Socrates.\nIt may well be doubted whether the author of the _Phaedrus_ and the\n_Symposium_ would ever have attained eminence in metrical composition,\neven had he lived in an age far more favourable to poetic inspiration\nthan that which came after the flowering time of Attic art. It seems\nas if Plato, with all his fervour, fancy, and dramatic skill, lacked\nthe most essential quality of a singer; his finest passages are on a\nlevel with the highest poetry, and yet they are separated from it by a\nchasm more easily felt than described. Aristotle, whom we think of as\nhard and dry and cold, sometimes comes much nearer to the true lyric\ncry. And, as if to mark out Plato’s style still more distinctly from\nevery other, it is also deficient in oratorical power. The philosopher\nevidently thought that he could beat the rhetoricians on their own\nground; if the _Menexenus_ be genuine, he tried to do so and failed;\nand even without its testimony we are entitled to say as much on\nthe strength of shorter attempts. We must even take leave to doubt\nwhether dialogue, properly so called, was Plato’s forte. Where one\nspeaker is placed at such a height above the others as Socrates, or\nthe Eleatic Stranger, or the Athenian in the _Laws_, there cannot be\nany real conversation. The other interlocutors are good listeners,\nand serve to break the monotony of a continuous exposition by their\nexpressions of assent or even by their occasional inability to follow\nthe argument, but give no real help or stimulus. And when allowed to\noffer an opinion of their own, they, too, lapse into a monologue,\naddressed, as our silent trains of thought habitually are, to an\nimaginary auditor whose sympathy and support are necessary but are\nalso secure. Yet if Plato’s style is neither exactly poetical, nor\noratorical, nor conversational, it has affinities with each of these\nthree varieties; it represents the common root from which they spring,\nand brings us, better than any other species of composition, into\nimmediate contact with the mind of the writer. The Platonic Socrates\nhas eyes like those of a portrait which follow us wherever we turn, and\nthrough which we can read his inmost soul, which is no other than the\nuniversal reason of humanity in the delighted surprise of its first\nawakening to self-conscious activity. The poet thinks and feels for us;\nthe orator makes our thoughts and feelings his own, and then restores\nthem to us in a concentrated form, ‘receiving in vapour what he gives\nback in a flood.’ Plato removes every obstacle to the free development\nof our faculties; he teaches us by his own example how to think and\nto feel for ourselves. If Socrates personified philosophy, Plato has\nreproduced the personification in artistic form with such masterly\neffect that its influence has been extended through all ages and over\nthe whole civilised world. This portrait stands as an intermediary\nbetween its original and the far-reaching effects indirectly due to his\ndialectic inspiration, like that universal soul which Plato himself has\nplaced between the supreme artificer and the material world, that it\nmight bring the fleeting contents of space and time into harmony with\nuncreated and everlasting ideas.\n\nTo paint Socrates at his highest and his best, it was necessary to\nbreak through the narrow limits of his historic individuality, and to\nshow how, had they been presented to him, he would have dealt with\nproblems outside the experience of a home-staying Athenian citizen.\nThe founder of idealism—that is to say, the realisation of reason,\nthe systematic application of thought to life—had succeeded in his\ntask because he had embodied the noblest elements of the Athenian\nDêmos, orderliness, patriotism, self-control, and publicity of debate,\ntogether with a receptive intelligence for improvements effected in\nother states. But, just as the impulse which enabled those qualities to\ntell decisively on Greek history at a moment of inestimable importance\ncame from the Athenian aristocracy, with its Dorian sympathies, its\nadventurous ambition, and its keen attention to foreign affairs, so\nalso did Plato, carrying the same spirit into philosophy, bring the\ndialectic method into contact with older and broader currents of\nspeculation, and employ it to recognise the whole spiritual activity of\nhis race.\n\nA strong desire for reform must always be preceded by a deep\ndissatisfaction with things as they are; and if the reform is to be\nvery sweeping the discontent must be equally comprehensive. Hence the\ngreat renovators of human life have been remarkable for the severity\nwith which they have denounced the failings of the world where they\nwere placed, whether as regards persons, habits, institutions, or\nbeliefs. Yet to speak of their attitude as pessimistic would either\nbe unfair, or would betray an unpardonable inability to discriminate\nbetween two utterly different theories of existence. Nothing can well\nbe more unlike the systematised pusillanimity of those lost souls,\nwithout courage and without hope, who find a consolation for their own\nfailure in the belief that everything is a failure, than the fiery\nenergy which is drawn into a perpetual tension by the contrast of what\nis with the vision of what yet may be. But if pessimism paralyses\nevery generous effort and aspiration by teaching that misery is the\nirremediable lot of animated beings, or even, in the last analysis,\nof all being, the opposing theory of optimism exercises as deadly an\ninfluence when it induces men to believe that their present condition\nis, on the whole, a satisfactory one, or that at worst wrong will be\nrighted without any criticism or interference on their part. Even\nthose who believe progress to have been, so far, the most certain\nfact in human history, cannot blind themselves to the existence of\nenormous forces ever tending to draw society back into the barbarism\nand brutality of its primitive condition; and they know also, that\nwhatever ground we have won is due to the efforts of a small minority,\nwho were never weary of urging forward their more sluggish companions,\nwithout caring what angry susceptibilities they might arouse—risking\nrecrimination, insult, and outrage, so that only, under whatever form,\nwhether of divine mandate or of scientific demonstration, the message\nof humanity to her children might be delivered in time. Nor is it only\nwith immobility that they have had to contend. Gains in one direction\nare frequently balanced by losses in another; while at certain periods\nthere is a distinct retrogression along the whole line. And it is well\nif, amid the general decline to a lower level, sinister voices are not\nheard proclaiming that the multitude may safely trust to their own\npromptings, and that self-indulgence or self-will should be the only\nlaw of life. It is also on such occasions that the rallying cry is\nmost needed, and that the born leaders of civilisation must put forth\ntheir most strenuous efforts to arrest the disheartened fugitives and\nto denounce the treacherous guides. It was in this aspect that Plato\nviewed his age; and he set himself to continue the task which Socrates\nhad attempted, but had been trampled down in endeavouring to achieve.\n\nThe illustrious Italian poet and essayist, Leopardi, has observed\nthat the idea of the world as a vast confederacy banded together for\nthe repression of everything good and great and true, originated with\nJesus Christ.[122] It is surprising that so accomplished a Hellenist\nshould not have attributed the priority to Plato. It is true that\nhe does not speak of the world itself in Leopardi’s sense, because\nto him it meant something different—a divinely created order which\nit would have been blasphemy to revile; but the thing is everywhere\npresent to his thoughts under other names, and he pursues it with\nrelentless hostility. He looks on the great majority of the human race,\nindividually and socially, in their beliefs and in their practices,\nas utterly corrupt, and blinded to such an extent that they are ready\nto turn and rend any one who attempts to lead them into a better\npath. The many ‘know not wisdom and virtue, and are always busy with\ngluttony and sensuality. Like cattle, with their eyes always looking\ndown and their heads stooping, not, indeed, to the earth, but to the\ndining-table, they fatten and feed and breed, and in their excessive\nlove of these delights they kick and butt at one another with horns and\nhoofs which are made of iron; and they kill one another by reason of\ntheir insatiable lust.’[123] Their ideal is the man who nurses up his\ndesires to the utmost intensity, and procures the means for gratifying\nthem by fraud or violence. The assembled multitude resembles a strong\nand fierce brute expressing its wishes by inarticulate grunts, which\nthe popular leaders make it their business to understand and to comply\nwith.[J] A statesman of the nobler kind who should attempt to benefit\nthe people by thwarting their foolish appetites will be denounced as\na public enemy by the demagogues, and will stand no more chance of\nacquittal than a physician if he were brought before a jury of children\nby the pastry-cook.\n\nThat an Athenian, or, indeed, any Greek gentleman, should regard\nthe common people with contempt and aversion was nothing strange.\nA generation earlier such feelings would have led Plato to look on\nthe overthrow of democracy and the establishment of an aristocratic\ngovernment as the remedy for every evil. The upper classes, accustomed\nto decorate themselves with complimentary titles, had actually come\nto believe that all who belonged to them were paragons of wisdom and\ngoodness. With the rule of the Thirty came a terrible awakening. In\na few months more atrocities were perpetrated by the oligarchs than\nthe Dêmos had been guilty of in as many generations. It was shown\nthat accomplished gentlemen like Critias were only distinguished from\nthe common herd by their greater impatience of opposition and by the\nmore destructive fury of their appetites. With Plato, at least, all\nallusions on this head came to an end. He now ‘smiled at the claims\nof long descent,’ considering that ‘every man has had thousands and\nthousands of progenitors, and among them have been rich and poor, kings\nand slaves, Hellenes and barbarians, many times over;’ and even the\npossession of a large landed property ceased to inspire him with any\nrespect when he compared it with the surface of the whole earth.[K]\n\nThere still remained one form of government to be tried, the despotic\nrule of a single individual. In the course of his travels Plato came\ninto contact with an able and powerful specimen of the tyrant class,\nthe elder Dionysius. A number of stories relating to their intercourse\nhave been preserved; but the different versions disagree very widely,\nand none of them can be entirely trusted. It seems certain, however,\nthat Plato gave great offence to the tyrant by his freedom of speech,\nthat he narrowly escaped death, and that he was sold into slavery,\nfrom which condition he was redeemed by the generosity of Anniceris, a\nCyrenaean philosopher. It is supposed that the scathing description in\nwhich Plato has held up to everlasting infamy the unworthy possessor\nof absolute power—a description long afterwards applied by Tacitus to\nthe vilest of the Roman emperors—was suggested by the type which had\ncome under his own observation in Sicily.\n\nOf all existing constitutions that of Sparta approached nearest to the\nideal of Plato, or, rather, he regarded it as the least degraded. He\nliked the conservatism of the Spartans, their rigid discipline, their\nhaughty courage, the participation of their daughters in gymnastic\nexercises, the austerity of their manners, and their respect for old\nage; but he found much to censure both in their ancient customs and\nin the characteristics which the possession of empire had recently\ndeveloped among them. He speaks with disapproval of their exclusively\nmilitary organisation, of their contempt for philosophy, and of\nthe open sanction which they gave to practices barely tolerated at\nAthens. And he also comments on their covetousness, their harshness\nto inferiors, and their haste to throw off the restraints of the law\nwhenever detection could be evaded.[124]\n\nSo far we have spoken as if Plato regarded the various false polities\nexisting around him as so many fixed and disconnected types. This,\nhowever, was not the case. The present state of things was bad enough,\nbut it threatened to become worse wherever worse was possible. The\nconstitutions exhibiting a mixture of good and evil contained within\nthemselves the seeds of a further corruption, and tended to pass\ninto the form standing next in order on the downward slope. Spartan\ntimocracy must in time become an oligarchy, to oligarchy would succeed\ndemocracy, and this would end in tyranny, beyond which no further fall\nwas possible.[125] The degraded condition of Syracuse seemed likely\nto be the last outcome of Hellenic civilisation. We know not how far\nthe gloomy forebodings of Plato may have been justified by his own\nexperience, but he sketched with prophetic insight the future fortunes\nof the Roman Republic. Every phase of the progressive degeneration is\nexemplified in its later history, and the order of their succession is\nmost faithfully preserved. Even his portraits of individual timocrats,\noligarchs, demagogues, and despots are reproduced to the life in the\npages of Plutarch, of Cicero, and of Tacitus.\n\nIf our critic found so little to admire in Hellas, still less did he\nseek for the realisation of his dreams in the outlying world. The\nlessons of Protagoras had not been wasted on him, and, unlike the\nnature-worshippers of the eighteenth century, he never fell into the\ndelusion that wisdom and virtue had their home in primaeval forests or\nin corrupt Oriental despotisms. For him, Greek civilisation, with all\nits faults, was the best thing that human nature had produced, the only\nhearth of intellectual culture, the only soil where new experiments\nin education and government could be tried. He could go down to the\nroots of thought, of language, and of society; he could construct a new\nstyle, a new system, and a new polity, from the foundation up; he could\ngrasp all the tendencies that came under his immediate observation, and\nfollow them out to their utmost possibilities of expansion; but his\nvast powers of analysis and generalisation remained subject to this\nrestriction, that a Hellene he was and a Hellene he remained to the end.\n\nA Hellene, and an aristocrat as well. Or, using the word in its most\ncomprehensive sense, we may say that he was an aristocrat all round,\na believer in inherent superiorities of race, sex, birth, breeding,\nand age. Everywhere we find him restlessly searching after the wisest,\npurest, best, until at last, passing beyond the limits of existence\nitself, words fail him to describe the absolute ineffable only good,\nnot being and not knowledge, but creating and inspiring both. Thus it\ncame to pass that his hopes of effecting a thorough reform did not\nlie in an appeal to the masses, but in the selection and seclusion\nfrom evil influences of a few intelligent youths. Here we may detect\na remarkable divergence between him and his master. Socrates, himself\na man of the people, did not like to hear the Athenians abused. If\nthey went wrong, it was, he said, the fault of their leaders.[126] But\naccording to Plato, it was from the people themselves that corruption\noriginally proceeded, it was they who instilled false lessons into the\nmost intelligent minds, teaching them from their very infancy to prefer\nshow to substance, success to merit, and pleasure to virtue; making\nthe study of popular caprice the sure road to power, and poisoning\nthe very sources of morality by circulating blasphemous stories about\nthe gods—stories which represented them as weak, sensual, capricious\nbeings, setting an example of iniquity themselves, and quite willing to\npardon it in men on condition of going shares in the spoil. The poets\nhad a great deal to do with the manufacture of these discreditable\nmyths; and towards poets as a class Plato entertained feelings of\nmingled admiration and contempt. As an artist, he was powerfully\nattracted by the beauty of their works; as a theologian, he believed\nthem to be the channels of divine inspiration, and sometimes also the\nguardians of a sacred tradition; but as a critic, he was shocked at\ntheir incapacity to explain the meaning of their own works, especially\nwhen it was coupled with ridiculous pretensions to omniscience; and he\nregarded the imitative character of their productions as illustrating,\nin a particularly flagrant manner, that substitution of appearance for\nreality which, according to his philosophy, was the deepest source of\nerror and evil.\n\nIf private society exercised a demoralising influence on its most\ngifted members, and in turn suffered a still further debasement by\nlistening to their opinions, the same fatal interchange of corruption\nwent on still more actively in public life, so far, at least, as\nAthenian democracy was concerned. The people would tolerate no\nstatesman who did not pamper their appetites; and the statesmen, for\ntheir own ambitious purposes, attended solely to the material wants\nof the people, entirely neglecting their spiritual interests. In this\nrespect, Pericles, the most admired of all, had been the chief of\nsinners; for ‘he was the first who gave the people pay and made them\nidle and cowardly, and encouraged them in the love of talk and of\nmoney.’ Accordingly, a righteous retribution overtook him, for ‘at the\nvery end of his life they convicted him of theft, and almost put him\nto death.’ So it had been with the other boasted leaders, Miltiades,\nThemistocles, and Cimon; all suffered from what is falsely called the\ningratitude of the people. Like injudicious keepers, they had made the\nanimal committed to their charge fiercer instead of gentler, until\nits savage propensities were turned against themselves. Or, changing\nthe comparison, they were like purveyors of luxury, who fed the State\non a diet to which its present ‘ulcerated and swollen condition’\nwas due. They had ‘filled the city full of harbours, and docks, and\nwalls, and revenues and all that, and had left no room for justice\nand temperance.’ One only among the elder statesmen, Aristeides, is\nexcepted from this sweeping condemnation, and, similarly, Socrates is\ndeclared to have been the only true statesman of his time.[127]\n\nOn turning from the conduct of State affairs to the administration of\njustice in the popular law courts, we find the same tale of iniquity\nrepeated, but this time with more telling satire, as Plato is speaking\nfrom his own immediate experience. He considers that, under the\nmanipulation of dexterous pleaders, judicial decisions had come to be\nframed with a total disregard of righteousness. That disputed claims\nshould be submitted to a popular tribunal and settled by counting\nheads was, indeed, according to his view, a virtual admission that no\nabsolute standard of justice existed; that moral truth varied with\nindividual opinion. And this is how the character of the lawyer had\nbeen moulded in consequence:—\n\n He has become keen and shrewd; he has learned how to flatter his\n master in word and indulge him in deed; but his soul is small and\n unrighteous. His slavish condition has deprived him of growth and\n uprightness and independence; dangers and fears which were too much\n for his truth and honesty came upon him in early years, when the\n tenderness of youth was unequal to them, and he has been driven\n into crooked ways; from the first he has practised deception and\n retaliation, and has become stunted and warped. And so he has passed\n out of youth into manhood, having no soundness in him, and is now, as\n he thinks, a master in wisdom.[128]\n\nTo make matters worse, the original of this unflattering portrait\nwas rapidly becoming the most powerful man in the State. Increasing\nspecialisation had completely separated the military and political\nfunctions which had formerly been discharged by a single eminent\nindividual, and the business of legislation was also becoming a\ndistinct profession. No orator could obtain a hearing in the assembly\nwho had not a technical acquaintance with the subject of deliberation,\nif it admitted of technical treatment, which was much more frequently\nthe case now than in the preceding generation. As a consequence of this\nrevolution, the ultimate power of supervision and control was passing\ninto the hands of the law courts, where general questions could be\ndiscussed in a more popular style, and often from a wider or a more\nsentimental point of view. They were, in fact, beginning to wield an\nauthority like that exercised until quite lately by the press in modern\nEurope, only that its action was much more direct and formidable. A\nvote of the Ecclêsia could only deprive a statesman of office: a vote\nof the Dicastery might deprive him of civil rights, home, freedom,\nproperty, or even life itself. Moreover, with the loss of empire and\nthe decline of public spirit, private interests had come to attract a\nproportionately larger share of attention; and unobtrusive citizens\nwho had formerly escaped from the storms of party passion, now found\nthemselves marked out as a prey by every fluent and dexterous pleader\nwho could find an excuse for dragging them before the courts. Rhetoric\nwas hailed as the supreme art, enabling its possessor to dispense with\nevery other study, and promising young men were encouraged to look on\nit as the most paying line they could take up. Even those whose civil\nstatus or natural timidity precluded them from speaking in public could\ngain an eminent and envied position by composing speeches for others to\ndeliver. Behind these, again, stood the professed masters of rhetoric,\nclaiming to direct the education and the whole public opinion of the\nage by their lectures and pamphlets. Philosophy was not excluded from\ntheir system of training, but it occupied a strictly subordinate place.\nStudied in moderation, they looked on it as a bracing mental exercise\nand a repertory of sounding commonplaces, if not as a solvent for\nold-fashioned notions of honesty; but a close adherence to the laws of\nlogic or to the principles of morality seemed puerile pedantry to the\nelegant stylists who made themselves the advocates of every crowned\nfilibuster abroad, while preaching a policy of peace at any price at\nhome.\n\nIt is evident that the fate of Socrates was constantly in Plato’s\nthoughts, and greatly embittered his scorn for the multitude as\nwell as for those who made themselves its ministers and minions. It\nso happened that his friend’s three accusers had been respectively\na poet, a statesman, and a rhetor; thus aptly typifying to the\nphilosopher’s lively imagination the triad of charlatans in whom\npublic opinion found its appropriate representatives and spokesmen.\nYet Plato ought consistently to have held that the condemnation of\nSocrates was, equally with the persecution of Pericles, a satire\non the teaching which, after at least thirty years’ exercise, had\nleft its auditors more corrupt than it found them. In like manner\nthe ostracism of Aristeides might be set against similar sentences\npassed on less puritanical statesmen. For the purpose of the argument\nit would have been sufficient to show that in existing circumstances\nthe office of public adviser was both thankless and dangerous. We\nmust always remember that when Plato is speaking of past times he is\nprofoundly influenced by aristocratic traditions, and also that under a\nretrospective disguise he is really attacking contemporary abuses. And\nif, even then, his denunciations seem excessive, their justification\nmay be found in that continued decay of public virtue which, not\nlong afterwards, brought about the final catastrophe of Athenian\nindependence.\n\n\nIV.\n\nTo illustrate the relation in which Plato stood towards his own times,\nwe have already had occasion to draw largely on the productions of\nhis maturer manhood. We have now to take up the broken thread of our\nsystematic exposition, and to trace the development of his philosophy\nthrough that wonderful series of compositions which entitle him to\nrank among the greatest writers, the most comprehensive thinkers, and\nthe purest religious teachers of all ages. In the presence of such\nglory a mere divergence of opinion must not be permitted to influence\nour judgment. High above all particular truths stands the principle\nthat truth itself exists, and it was for this that Plato fought. If\nthere were others more completely emancipated from superstition, none\nso persistently appealed to the logic before which superstition must\nultimately vanish. If his schemes for the reconstruction of society\nignore many obvious facts, they assert with unrivalled force the\nnecessary supremacy of public welfare over private pleasure; and their\navowed utilitarianism offers a common ground to the rival reformers\nwho will have nothing to do with the mysticism of their metaphysical\nfoundation. Those, again, who hold, like the youthful Plato himself,\nthat the ultimate interpretation of existence belongs to a science\ntranscending human reason, will here find the doctrines of their\nreligion anticipated as in a dream. And even those who, standing aloof\nboth from theology and philosophy, live, as they imagine, for beauty\nalone, will observe with interest how the spirit of Greek art survived\nin the denunciation of its idolatry, and ‘the light that never was\non sea or land,’ after fading away from the lower levels of Athenian\nfancy, came once more to suffuse the frozen steeps of dialectic with\nits latest and divinest rays.\n\nThe glowing enthusiasm of Plato is, however, not entirely derived from\nthe poetic traditions of his native city; or perhaps we should rather\nsay that he and the great writers who preceded him drew from a common\nfount of inspiration. Mr. Emerson, in one of the most penetrating\ncriticisms ever written on our philosopher,[129] has pointed out the\nexistence of two distinct elements in the Platonic Dialogues—one\ndispersive, practical, prosaic; the other mystical, absorbing,\ncentripetal. The American scholar is, however, as we think, quite\nmistaken when he attributes the second of these tendencies to Asiatic\ninfluence. It is extremely doubtful whether Plato ever travelled\nfarther east than Egypt; it is probable that his stay in that country\nwas not of long duration; and it is certain that he did not acquire a\nsingle metaphysical idea from its inhabitants. He liked their rigid\nconservatism; he liked their institution of a dominant priesthood; he\nliked their system of popular education, and the place which it gave\nto mathematics made him look with shame on the ‘swinish ignorance’ of\nhis own countrymen in that respect;[130] but on the whole he classes\nthem among the races exclusively devoted to money-making, and in\naptitude for philosophy he places them far below the Greeks. Very\ndifferent were the impressions brought home from his visits to Sicily\nand Southern Italy. There he became acquainted with modes of thought\nin which the search after hidden resemblances and analogies was a\npredominant passion; there the existence of a central unity underlying\nall phenomena was maintained, as against sense and common opinion,\nwith the intensity of a religious creed; there alone speculation was\nclothed in poetic language; there first had an attempt been made to\ncarry thought into life by associating it with a reform of manners and\nbeliefs. There, too, the arts of dance and song had assumed a more\norderly and solemn aspect; the chorus received its final constitution\nfrom a Sicilian master; and the loftiest strains of Greek lyric poetry\nwere composed for recitation in the streets of Sicilian cities or at\nthe courts of Sicilian kings. Then, with the rise of rhetoric, Greek\nprose was elaborated by Sicilian teachers into a sort of rhythmical\ncomposition, combining rich imagery with studied harmonies and\ncontrasts of sense and sound. And as the hold of Asiatic civilisation\non eastern Hellas grew weaker, the attention of her foremost spirits\nwas more and more attracted to this new region of wonder and romance.\nThe stream of colonisation set thither in a steady flow; the scenes\nof mythical adventure were rediscovered in Western waters; and it was\nimagined that, by grasping the resources of Sicily, an empire extending\nover the whole Mediterranean might be won. Perhaps, without being\ntoo fanciful, we may trace a likeness between the daring schemes of\nAlcibiades and the more remote but not more visionary kingdom suggested\nby an analogous inspiration to the idealising soul of Plato. Each had\nlearned to practise, although for far different purposes, the royal art\nof Socrates—the mastery over men’s minds acquired by a close study of\ntheir interests, passions, and beliefs. But the ambition of the one\ndefeated his own aim, to the destruction of his country and of himself;\nwhile the other drew into Athenian thought whatever of Western force\nand fervour was needed for the accomplishment of its imperial task.\nWe may say of Plato what he has said of his own Theaetêtus, that ‘he\nmoves surely and smoothly and successfully in the path of knowledge\nand inquiry; always making progress like the noiseless flow of a river\nof oil’;[131] but everywhere beside or beneath that placid lubricating\nflow we may trace the action of another current, where still sparkles,\nfresh and clear as at first, the fiery Sicilian wine.\n\nIt will be remembered that in an earlier section of this chapter we\naccompanied Plato to a period when he had provisionally adopted a\ntheory in which the Protagorean contention that virtue can be taught\nwas confirmed and explained by the Socratic contention that virtue is\nknowledge; while this knowledge again was interpreted in the sense of\na hedonistic calculus, a prevision and comparison of the pleasures and\npains consequent on our actions. We have now to trace the lines of\nthought by which he was guided to a different conception of ethical\nscience.\n\nAfter resolving virtue into knowledge of pleasure, the next questions\nwhich would present themselves to so keen a thinker were obviously,\nWhat is knowledge? and What is pleasure? The _Theaetêtus_ is chiefly\noccupied with a discussion of the various answers already given to\nthe first of these enquiries. It seems, therefore, to come naturally\nnext after the _Protagoras_; and our conjecture receives a further\nconfirmation when we find that here also a large place is given to\nthe opinions of the Sophist after whom that dialogue is named; the\nchief difference being that the points selected for controversy are\nof a speculative rather than of a practical character. There is,\nhowever, a close connexion between the argument by which Protagoras\nhad endeavoured to prove that all mankind are teachers of virtue, and\nhis more general principle that man is the measure of all things. And\nperhaps it was the more obvious difficulties attending the latter view\nwhich led Plato, after some hesitation, to reject the former along\nwith it. In an earlier chapter we gave some reasons for believing\nthat Protagoras did not erect every individual into an arbiter of\ntruth in the sweeping sense afterwards put upon his words. He was\nprobably opposing a human to a theological or a naturalistic standard.\nNevertheless, it does not follow that Plato was fighting with a\nshadow when he pressed the Protagorean dictum to its most literal\ninterpretation. There are plenty of people still who would maintain\nit to that extent. Wherever and whenever the authority of ancient\ntraditions is broken down, the doctrine that one man’s opinion is as\ngood as another’s immediately takes its place; or rather the doctrine\nin question is a survival of traditionalism in an extremely pulverised\nform. And when we are told that the majority must be right—which is\na very different principle from holding that the majority should be\nobeyed—we may take it as a sign that the loose particles are beginning\nto coalesce again. The substitution of an individual for a universal\nstandard of truth is, according to Plato, a direct consequence of\nthe theory which identifies knowledge with sense-perception. It is,\nat any rate, certain that the most vehement assertors of the former\ndoctrine are also those who are fondest of appealing to what they and\ntheir friends have seen, heard, or felt; and the more educated among\nthem place enormous confidence in statistics. They are also fond of\nrepeating the adage that an ounce of fact is worth a ton of theory,\nwithout considering that theory alone can furnish the balance in which\nfacts are weighed. Plato does not go very deep into the _rationale_ of\nobservation, nor in the infancy of exact science was it to be expected\nthat he should. He fully recognised the presence of two factors, an\nobjective and a subjective, in every sensation, but lost his hold on\nthe true method in attempting to trace a like dualism through the\nwhole of consciousness. Where we should distinguish between the mental\nenergies and the physical processes underlying them, or between the\nelements respectively contributed to every cognition by immediate\nexperience and reflection, he conceived the inner and outer worlds as\ntwo analogous series related to one another as an image to its original.\n\nAt this last point we touch on the final generalisation by which Plato\nextended the dialectic method to all existence, and readmitted into\nphilosophy the earlier speculations provisionally excluded from it\nby Socrates. The cross-examining elenchus, at first applied only to\nindividuals, had been turned with destructive effect on every class,\nevery institution, and every polity, until the whole of human life\nwas made to appear one mass of self-contradiction, instability, and\nillusion. It had been held by some that the order of nature offered\na contrast and a correction to this bewildering chaos. Plato, on the\nother hand, sought to show that the ignorance and evil prevalent among\nmen were only a part of the imperfection necessarily belonging to\nderivative existence of every kind. For this purpose the philosophy\nof Heracleitus proved a welcome auxiliary. The pupil of Socrates had\nbeen taught in early youth by Cratylus, an adherent of the Ephesian\nschool, that movement, relativity, and the conjunction of opposites\nare the very conditions under which Nature works. We may conjecture\nthat Plato did not at first detect any resemblance between the\nHeracleitean flux and the mental bewilderment produced or brought to\nlight by the master of cross-examination. But his visit to Italy would\nprobably enable him to take a new view of the Ionian speculations,\nby bringing him into contact with schools maintaining a directly\nopposite doctrine. The Eleatics held that existence remained eternally\nundivided, unmoved, and unchanged. The Pythagoreans arranged all\nthings according to a strained and rigid antithetical construction.\nThen came the identifying flash.[132] Unchangeable reality, divine\norder, mathematical truth—these were the objective counterpart of\nthe Socratic definitions, of the consistency which Socrates introduced\ninto conduct. The Heracleitean system applied to phenomena only; and\nit faithfully reflected the incoherent beliefs and disorderly actions\nof uneducated men. We are brought into relation with the fluctuating\nsea of generated and perishing natures by sense and opinion, and these\nreproduce, in their irreconcilable diversity, the shifting character of\nthe objects with which they are conversant. Whatever we see and feel\nis a mixture of being and unreality; it is, and is not, at the same\ntime. Sensible magnitudes are equal or greater or less according as the\nstandard of comparison is chosen. Yet the very act of comparison shows\nthat there is something in ourselves deeper than mere sense; something\nto which all individual sensations are referred as to a common centre,\nand in which their images are stored up. Knowledge, then, can no\nlonger be identified with sensation, since the mental reproductions of\nexternal objects are apprehended in the absence of their originals, and\nsince thought possesses the further faculty of framing abstract notions\nnot representing any sensible objects at all.\n\nWe need not follow Plato’s investigations into the meaning of knowledge\nand the causes of illusion any further; especially as they do not lead,\nin this instance, to any positive conclusion. The general tendency is\nto seek for truth within rather than without; and to connect error\npartly with the disturbing influence of sense-impressions on the higher\nmental faculties, partly with the inherent confusion and instability\nof the phenomena whence those impressions are derived. Our principal\nconcern here is to note the expansive power of generalisation which\nwas carrying philosophy back again from man to Nature—the deep-seated\ncontempt of Plato for public opinion—and the incipient differentiation\nof demonstrated from empirical truth.\n\nA somewhat similar vein of reflection is worked out in the _Cratylus_,\na Dialogue presenting some important points of contact with the\n_Theaetêtus_, and probably belonging to the same period. There is the\nsame constant reference to Heracleitus, whose philosophy is here also\ntreated as in great measure, but not entirely, true; and the opposing\nsystem of Parmenides is again mentioned, though much more briefly, as\na valuable set-off against its extravagances. The _Cratylus_ deals\nexclusively with language, just as the _Theaetêtus_ had dealt with\nsensation and mental imagery, but in such a playful and ironical tone\nthat its speculative importance is likely to be overlooked. Some of the\nGreek philosophers seem to have thought that the study of things might\nadvantageously be replaced by the study of words, which were supposed\nto have a natural and necessary connexion with their accepted meanings.\nThis view was particularly favoured by the Heracleiteans, who found,\nor fancied that they found, a confirmation of their master’s teaching\nin etymology. Plato professes to adopt the theory in question, and\nsupports it with a number of derivations which to us seem ludicrously\nabsurd, but which may possibly have been transcribed from the pages\nof contemporary philologists. At last, however, he turns round and\nshows that other verbal arguments, equally good, might be adduced on\nbehalf of Parmenides. But the most valuable part of the discussion is\na protest against the whole theory that things can be studied through\ntheir names. Plato justly observes that an image, to be perfect,\nshould not reproduce its original, but only certain aspects of it;\nthat the framers of language were not infallible; and that we are just\nas competent to discover the nature of things as they could be. One\ncan imagine the delight with which he would have welcomed the modern\ndiscovery that sensations, too, are a language; and that the associated\ngroups into which they most readily gather are determined less by the\nnecessary connexions of things in themselves than by the exigencies of\nself-preservation and reproduction in sentient beings.\n\nThrough all his criticisms on the popular sources of\ninformation—sense, language and public opinion—Plato refers to an\nideal of perfect knowledge which he assumes without being able to\ndefine it. It must satisfy the negative condition of being free from\nself-contradiction, but further than this we cannot go. Yet, in the\nhands of a metaphysician, no more than this was required to reconstruct\nthe world. The demand for consistency explains the practical philosophy\nof Socrates. It also explains, under another form, the philosophy,\nboth practical and speculative, of his disciple. Identity and the\ncorrelative of identity, difference, gradually came to cover with their\nmanifold combinations all knowledge, all life, and all existence.\n\nIt was from mathematical science that the light of certainty first\nbroke. Socrates had not encouraged the study of mathematics, either\npure or applied; nor, if we may judge from some disparaging allusions\nto Hippias and his lectures in the _Protagoras_, did Plato at first\nregard it with any particular favour. He may have acquired some notions\nof arithmetic and geometry at school; but the intimate acquaintance\nwith, and deep interest in them, manifested throughout his later works,\nprobably dates from his visits to Italy, Sicily, Cyrênê, and Egypt.\nIn each of these places the exact sciences were cultivated with more\nassiduity than at Athens; in southern Italy they had been brought into\nclose connexion with philosophy by a system of mystical interpretation.\nThe glory of discovering their true speculative significance was\nreserved for Plato. Just as he had detected a profound analogy between\nthe Socratic scepticism and the Heracleitean flux, so also, by\nanother vivid intuition, he saw in the definitions and demonstrations\nof geometry a type of true reasoning, a particular application of\nthe Socratic logic. Thus the two studies were brought into fruitful\nreaction, the one gaining a wider applicability, and the other an\nexacter method of proof. The mathematical spirit ultimately proved\ntoo strong for Plato, and petrified his philosophy into a lifeless\nformalism; but no extraneous influence helped so much to bring about\nthe complete maturity of his constructive powers, in no direction has\nhe more profoundly influenced the thought of later ages.\n\nBoth the _Theaetêtus_ and the _Cratylus_ contain allusions to\nmathematical reasoning, but its full significance is first exhibited\nin the _Meno_. Here the old question, whether virtue can be taught,\nis again raised, to be discussed from an entirely new point of view,\nand resolved into the more general question, Can anything be taught?\nThe answer is, Yes and No. You may stimulate the native activity of\nthe intellect, but you cannot create it. Take a totally uneducated\nman, and, under proper guidance, he shall discover the truths of\ngeometry for himself, by virtue of their self-evident clearness. Being\nindependent of any traceable experience, the elementary principles of\nthis science, of all science, must have been acquired in some antenatal\nperiod, or rather they were never acquired at all, they belong to the\nvery nature of the soul herself. The doctrine here unfolded had a\ngreat future before it; and it has never, perhaps, been discussed with\nso much eagerness as during the last half-century among ourselves.\nThe masters of English thought have placed the issue first raised by\nPlato in the very front of philosophical controversy; and the general\npublic have been brought to feel that their dearest interests hang on\nits decision. The subject has, however, lost much of its adventitious\ninterest to those who know that the _à priori_ position was turned, a\nhundred years ago, by Kant. The philosopher of Königsberg showed that,\ngranting knowledge to be composed of two elements, mind adds nothing\nto outward experience but its own forms, the system of connexions\naccording to which it groups phenomena. Deprive these forms of the\ncontent given to them by feeling, and the soul will be left beating her\nwings in a vacuum. The doctrine that knowledge is not a dead deposit\nin consciousness or memory, but a living energy whereby phenomena\nare, to use Kant’s words, gathered up into the synthetic unity of\napperception, has since found a physiological basis in the theory of\ncentral innervation. And the experiential school of psychology have\nsimultaneously come to recognise the existence of fixed conditions\nunder which consciousness works and grows, and which, in the last\nanalysis, resolve themselves into the apprehension of resemblance,\ndifference, coexistence, and succession. The most complex cognition\ninvolves no more than these four categories; and it is probable that\nthey all co-operate in the most elementary perception.\n\nThe truths here touched on seem to have been dimly present to the mind\nof Plato. He never doubts that all knowledge must, in some way or\nother, be derived from experience; and, accordingly, he assumes that\nwhat cannot have been learned in this world was learned in another. But\nhe does not (in the _Meno_ at least) suppose that the process ever had\na beginning. It would seem that he is trying to express in figurative\nlanguage the distinction, lost almost as soon as found, between\nintelligence and the facts on which intelligence is exercised, An\nexamination of the steps by which Meno’s slave is brought to perceive,\nwithout being directly told, the truth of the Pythagorean theorem, will\nshow that his share in the demonstration is limited to the intuition\nof certain numerical equalities and inequalities. Now, to Plato, the\nperception of sameness and difference meant everything. He would have\ndenied that the sensible world presented examples of these relations in\ntheir ideal absoluteness and purity. In tracing back their apprehension\nto the self-reflection of the soul, the consciousness of personal\nidentity, he would not have transgressed the limits of a legitimate\nenquiry. But self-consciousness involved a possible abstraction from\ndisturbing influences, which he interpreted as a real separation\nbetween mind and matter; and, to make it more complete, an independent\npre-existence of the former. Nor was this all. Since knowledge is of\nlikeness in difference, then the central truth of things, the reality\nunderlying all appearance, must be an abiding identity recognised by\nthe soul through her previous communion with it in a purer world. The\ninevitable tendency of two identities, one subjective and the other\nobjective, was to coalesce in an absolute unity where all distinctions\nof time and space would have disappeared, carrying the whole mythical\nmachinery along with them; and Plato’s logic is always hovering on\nthe verge of such a consummation without being able fully to accept\nit. Still, the mystical tendency, which it was reserved for Plotinus\nto carry out in its entirety, is always present, though restrained by\nother motives, working for the ascertainment of uniformity in theory\nand for the enforcement of uniformity in practice.\n\nWe have accompanied Plato to a point where he begins to see his\nway towards a radical reconstruction of all existing beliefs and\ninstitutions. In the next chapter we shall attempt to show how\nfar he succeeded in this great purpose, how much, in his positive\ncontributions to thought is of permanent, and how much of merely\nbiographical or literary value.\n\nFOOTNOTES:\n\n[114] _The Dialogues of Plato translated into English._ By B. Jowett,\nM. A. 2nd ed., 1875. Zeller, _Die Philosophie der Griechen_. Zweiter\nTheil, erste Abtheilung. _Plato und die alte Academie_, 3rd ed., 1875.\n\n[115] Krohn, _Der Platonische Staat_, Halle 1876. [I know this work\nonly through Chiapelli, _Della Interpretazione panteistica di Platone_,\nFlorence, 1881.]\n\n[116] III., 418.\n\n[117] _Phaedr._, p. 274 B ff.\n\n[118] See Zeller’s note on the θεία μοῖρα, _op. cit._ p. 497.\n\n[119] The _Charmides_, _Laches_, _Euthyphro_, and _Lysis_.\n\n[120] P. 49, A ff. Zeller, 142.\n\n[121] _Charmides_, 161 E; _Lysis_, 212 C.\n\n[122] _Pensieri_, lxxxiv and lxxxv.\n\n[123] _Repub._, 586, A. Jowett, III, p. 481.\n\n[124] Zeller, _op. cit._, 777-8.\n\n[125] _Repub._, VIII. and IX.\n\n[126] Xenophon, _Mem._, III., v., 18.\n\n[127] _Gorgias_, 515, C., ff. Jowett, II., 396-400.\n\n[128] _Theaetêtus_, 173, A. Jowett, IV., 322.\n\n[129] The lecture on Plato in _Representative Man_.\n\n[130] _Legg._ 819, D. Jowett, V., 390.\n\n[131] _Theaet._, 144. Jowett’s Transl.\n\n[132] This expression is borrowed from Prof. Bain. See the chapter on\nAssociation by Resemblance in _The Senses and the Intellect_.\n\n[133] _Legg._ 716, C.\n\n\n\n\nCHAPTER V.\n\nPLATO AS A REFORMER.\n\n\nI.\n\nIn the last chapter we considered the philosophy of Plato chiefly\nunder its critical and negative aspects. We saw how it was exclusively\nfrom that side that he at first apprehended and enlarged the dialectic\nof Socrates, how deeply his scepticism was coloured by the religious\nreaction of the age, and how he attempted, out of his master’s mouth,\nto overturn the positive teaching of the master himself. We saw how,\nin the _Protagoras_, he sketched a theory of ethics, which was no\nsooner completed than it became the starting-point of a still more\nextended and arduous enquiry. We followed the widening horizon of his\nspeculations until they embraced the whole contemporary life of Hellas,\nand involved it in a common condemnation as either hopelessly corrupt,\nor containing within itself the seeds of corruption. We then saw how,\nby a farther generalisation, he was led to look for the sources of\nerror in the laws of man’s sensuous nature and of the phenomenal world\nwith which it holds communion; how, moreover, under the guidance of\nsuggestions coming both from within and from without, he reverted to\nthe earlier schools of Greek thought, and brought their results into\nparallelism with the main lines of Socratic dialectic. And finally,\nwe watched him planting a firm foothold on the basis of mathematical\ndemonstration; seeking in the very constitution of the soul itself for\na derivation of the truths which sensuous experience could not impart,\nand winning back from a more profoundly reasoned religion the hope,\nthe self-confidence, the assurance of perfect knowledge, which had been\nformerly surrendered in deference to the demands of a merely external\nand traditional faith. That God alone is wise, and by consequence alone\ngood, might still remain a fixed principle with Plato; but it ceased\nto operate as a restraint on human aspiration when he had come to\nrecognise an essential unity among all forms of conscious life, which,\nthough it might be clouded and forgotten, could never be entirely\neffaced. And when Plato tells us, at the close of his career, that God,\nfar more than any individual man, is the measure of all things,[133]\nwho can doubt that he had already learned to identify the human and\ndivine essences in the common notion of a universal soul?\n\nThe germ of this new dogmatism was present in Plato’s mind from\nthe very beginning, and was partly an inheritance from older forms\nof thought. The _Apologia_ had reproduced one important feature in\nthe positive teaching of Socrates—the distinction between soul\nand body, and the necessity of attending to the former rather than\nto the latter: and this had now acquired such significance as to\nleave no standing-room for the agnosticism with which it had been\nincompatible from the first. The same irresistible force of expansion\nwhich had brought the human soul into communion with absolute truth,\nwas to be equally verified in a different direction. Plato was too\nmuch interested in practical questions to be diverted from them long\nby any theoretical philosophy; or, perhaps, we should rather say\nthat this interest had accompanied and inspired him throughout. It\nis from the essential relativity of mind, the profound craving for\nintellectual sympathy with other minds, that all mystical imaginations\nand super-subtle abstractions take rise; so that, when the strain of\ntranscendent absorption and ecstasy is relaxed under the chilling\nbut beneficent contact of earthly experience, they become condensed\ninto ideas for the reconstitution of life and society on a basis of\nreciprocity, of self-restraint, and of self-devotion to a commonwealth\ngreater and more enduring than any individual, while, at the same\ntime, presenting to each in objective form the principle by virtue of\nwhich only, instead of being divided, he can become reconciled with\nhimself. Here we have the creed of all philosophy, whether theological,\nmetaphysical, or positive, that there is, or that there should be, this\nthreefold unity of feeling, of action, and of thought, of the soul,\nof society, and of universal existence, to win which is everlasting\nlife, while to be without it is everlasting death. This creed must be\nre-stated and re-interpreted at every revolution of thought. We have to\nsee how it was, for the first time, stated and interpreted by Plato.\n\nThe principal object of Plato’s negative criticism had been to\nemphasise the distinction between reality and appearance in the world\nwithout, between sense, or imagination, and reason in the human soul.\nTrue to the mediatorial spirit of Greek thought, his object now was to\nbridge over the seemingly impassable gulf. We must not be understood to\nsay that these two distinct, and to some extent contrasted, tendencies\ncorrespond to two definitely divided periods of his life. It is evident\nthat the tasks of dissection and reconstruction were often carried on\nconjointly, and represented two aspects of an indivisible process.\nBut on the whole there is good reason to believe that Plato, like\nother men, was more inclined to pull to pieces in his youth and to\nbuild up in his later days. We are, therefore, disposed to agree with\nthose critics who assign both the _Phaedrus_ and the _Symposium_ to a\ncomparatively advanced stage of Platonic speculation. It is less easy\nto decide which of the two was composed first, for there seems to be a\ngreater maturity of thought in the one and of style in the other. For\nour purposes it will be most convenient to consider them together.\n\nWe have seen how Plato came to look on mathematics as an introduction\nto absolute knowledge. He now discovered a parallel method of approach\ntowards perfect wisdom in an order of experience which to most persons\nmight seem as far as possible removed from exact science—in those\npassionate feelings which were excited in the Greek imagination by the\nspectacle of youthful beauty, without distinction of sex. There was,\nat least among the Athenians, a strong intellectual element in the\nattachments arising out of such feelings; and the strange anomaly might\noften be seen of a man devoting himself to the education of a youth\nwhom he was, in other respects, doing his utmost to corrupt. Again, the\nbeauty by which a Greek felt most fascinated came nearer to a visible\nembodiment of mind than any that has ever been known, and as such could\nbe associated with the purest philosophical aspirations. And, finally,\nthe passion of love in its normal manifestations is an essentially\ngeneric instinct, being that which carries an individual most entirely\nout of himself, making him instrumental to the preservation of the race\nin forms of ever-increasing comeliness and vigour; so that, given a\nwise training and a wide experience, the maintenance of a noble breed\nmay safely be entrusted to its infallible selection.[134] All these\npoints of view have been developed by Plato with such copiousness\nof illustration and splendour of language that his name is still\nassociated in popular fancy with an ideal of exalted and purified\ndesire.\n\nSo far, however, we only stand on the threshold of Platonic love. The\nearthly passion, being itself a kind of generalisation, is our first\nstep in the ascent to that highest stage of existence where wisdom\nand virtue and happiness are one—the good to which all other goods\nare related as means to an end. But love is not only an introduction\nto philosophy, it is a type of philosophy itself. Both are conditions\nintermediate between vacuity and fulfilment; desire being by its very\nnature dissatisfied, and vanishing at the instant that its object\nis attained. The philosopher is a lover of wisdom, and therefore not\nwise; and yet not wholly ignorant, for he knows that he knows nothing.\nThus we seem to be thrown back on the standpoint of Plato’s earliest\nagnosticism. Nevertheless, if the _Symposium_ agrees nominally with\nthe _Apologia_, in reality it marks a much more advanced point of\nspeculation. The idea of what knowledge is has begun to assume a much\nclearer expression. We gather from various hints and suggestions\nthat it is the perception of likeness; the very process of ascending\ngeneralisation typified by intellectual love.\n\nIt is worthy of remark that in the Platonic Erôs we have the germ—or\nsomething more than the germ—of Aristotle’s whole metaphysical\nsystem.[135] According to the usual law of speculative evolution, what\nwas subjective in the one becomes objective in the other. With Plato\nthe passion for knowledge had been merely the guiding principle of a\nfew chosen spirits. With Aristotle it is the living soul of Nature,\nthe secret spring of movement, from the revolution of the outermost\nstarry sphere to the decomposition and recomposition of our mutable\nterrestrial elements; and from these again through the whole scale of\norganic life, up to the moral culture of man and the search for an\nideally-constituted state. What enables all these myriad movements\nto continue through eternity, returning ever in an unbroken circle\non themselves, is the yearning of unformed matter—that is to say,\nof unrealised power—towards the absolute unchanging actuality,\nthe self-thinking thought, unmoved, but moving every other form of\nexistence by the desire to participate in its ineffable perfection.\nBorn of the Hellenic enthusiasm for beauty, this wonderful conception\nsubsequently became incorporated with the official teaching of Catholic\ntheology. What had once been a theme for ribald merriment or for\nrhetorical ostentation among the golden youth of Athens, furnished\nthe motive for his most transcendent meditations to the Angel of the\nSchools; but the fire which lurked under the dusty abstractions of\nAquinas needed the touch of a poet and a lover before it could be\nrekindled into flame. The eyes of Beatrice completed what the dialectic\nof Plato had begun; and the hundred cantos of her adorer found their\nfitting close in the love that moves the sun and the other stars.\n\nWe must, however, observe that, underlying all these poetical\nimaginations, there is a deeper and wider law of human nature to which\nthey unconsciously bear witness—the intimate connexion of religious\nmysticism with the passion of love. By this we do not mean the constant\ninterference of the one with the other, whether for the purpose of\nstimulation, as with the naturalistic religions, or for the purpose\nof restraint, as with the ethical religions; but we mean that they\nseem to divide between them a common fund of nervous energy, so that\nsometimes their manifestations are inextricably confounded, as in\ncertain debased forms of modern Christianity; sometimes they utterly\nexclude one another; and sometimes, which is the most frequent case of\nany, the one is transformed into the other, their substantial identity\nand continuity being indicated very frankly by their use of the same\nlanguage, the same ritual, and the same aesthetic decoration. And this\nwill show how the decay of religious belief may be accompanied by\nan outbreak of moral licence, without our being obliged to draw the\ninference that passion can only be held in check by irrational beliefs,\nor by organisations whose supremacy is fatal to industrial, political,\nand intellectual progress. For, if our view of the case be correct,\nthe passion was not really restrained, but only turned in a different\ndirection, and frequently nourished into hysterical excess; so that,\nwith the inevitable decay of theology, it returns to its old haunts,\nbringing with it seven devils worse than the first. After the Crusades\ncame the Courts of Love; after the Dominican and Franciscan movements,\nthe Renaissance; after Puritanism, the Restoration; after Jesuitism,\nthe Regency. Nor is this all. The passion of which we are speaking,\nwhen abnormally developed and unbalanced by severe intellectual\nexercise, is habitually accompanied by delirious jealousy, by cruelty,\nand by deceit. On taking the form of religion, the influence of its\nevil associates immediately becomes manifest in the suppression of\nalien creeds, in the tortures inflicted on their adherents, and in the\nmaxim that no faith need be kept with a heretic. Persecution has been\nexcused on the ground that any means were justifiable for the purpose\nof saving souls from eternal torment. But how came it to be believed\nthat such a consequence was involved in a mere error of judgment? The\nfaith did not create the intolerance, but the intolerance created\nthe faith, and so gave an idealised expression to the jealous fury\naccompanying a passion which no spiritual alchemy can purify from\nits original affinities. It is not by turning this most terrible\ninstinct towards a supernatural object that we should combat it, but by\ndeveloping the active and masculine in preference to the emotional and\nfeminine side of our nervous organisation.[136]\n\nIn addition to its other great lessons, the _Symposium_ has afforded\nPlato an opportunity for contrasting his own method of philosophising\nwith pre-Socratic modes of thought. For it consists of a series of\ndiscourses in praise of love, so arranged as to typify the manner in\nwhich Greek speculation, after beginning with mythology, subsequently\nadvanced to physical theories of phenomena, then passed from the\nhistorical to the contemporary method, asking, not whence did things\ncome, but what are they in themselves; and finally arrived at the\nlogical standpoint of analysis, classification, and induction.\n\nThe nature of dialectic is still further elucidated in the _Phaedrus_,\nwhere it is also contrasted with the method, or rather the no-method,\nof popular rhetoric. Here, again, discussions about love are chosen\nas an illustration. A discourse on the subject by no less a writer\nthan Lysias is quoted and shown to be deficient in the most elementary\nrequisites of logical exposition. The different arguments are strung\ntogether without any principle of arrangement, and ambiguous terms\nare used without being defined. In insisting on the necessity of\ndefinition, Plato followed Socrates; but he defines according to a\ntotally different method. Socrates had arrived at his general notions\npartly by a comparison of particular instances with a view to eliciting\nthe points where they agreed, partly by amending the conceptions\nalready in circulation. We have seen that the earliest Dialogues\nattributed to Plato are one long exposure of the difficulties attending\nsuch a procedure; and his subsequent investigations all went to prove\nthat nothing solid could be built on such shifting foundations as\nsense and opinion. Meanwhile increasing familiarity with the great\nontological systems had taught him to begin with the most general\nnotions, and to work down from them to the most particular. The\nconsequence was that dialectic came to mean nothing but classification\nor logical division. Definition was absorbed into this process, and\nreasoning by syllogism was not yet differentiated from it. To tell\nwhat a thing was, meant to fix its place in the universal order of\nexistence, and its individual existence was sufficiently accounted for\nby the same determination. If we imagine first a series of concentric\ncircles, then a series of contrasts symmetrically disposed on either\nside of a central dividing line, and finally a series of transitions\ndescending from the most absolute unity to the most irregular\ndiversity—we shall, by combining the three schemes, arrive at some\nunderstanding of the Platonic dialectic. To assign anything its place\nin these various sequences was at once to define it and to demonstrate\nthe necessity of its existence. The arrangement is also equivalent to\na theory of final causes; for everything has a function to perform,\nmarked out by its position, and bringing it into relation with the\nuniversal order. Such a system would inevitably lead to the denial of\nevil, were not evil itself interpreted as the necessary correlative\nof good, or as a necessary link in the descending manifestations of\nreality. Moreover, by virtue of his identifying principle, Plato saw\nin the lowest forms a shadow or reflection of the highest. Hence the\nmany surprises, concessions, and returns to abandoned positions which\nwe find in his later writings. The three moments of Greek thought,\ncircumscription, antithesis, and mediation, work in such close union,\nor with such bewildering rapidity of alternation, through all his\ndialectic, that we are never sure whither he is leading us, and not\nalways sure that he knows it himself.\n\nIn the opening chapter of this work we endeavoured to explain how the\nPythagorean philosophy arose out of the intoxicated delight inspired by\na first acquaintance with the manifold properties of number and figure.\nIf we would enter into the spirit of Platonism, we must similarly\nthrow ourselves back into the time when the idea of a universal\nclassification first dawned on men’s minds. We must remember how it\ngratified the Greek love of order combined with individuality; what\nunbounded opportunities for asking and answering questions it supplied;\nand what promises of practical regeneration it held out. Not without\na shade of sadness for so many baffled efforts and so many blighted\nhopes, yet also with a grateful recollection of all that reason\nhas accomplished, and with something of his own high intellectual\nenthusiasm, shall we listen to Plato’s prophetic words—words of deeper\nimport than their own author knew—‘If I find any man who is able to\nsee a One and Many in Nature, him I follow and walk in his steps as if\nhe were a god.’[137]\n\nIt is interesting to see how the most comprehensive systems of the\npresent century, even when most opposed to the metaphysical spirit,\nare still constructed on the plan long ago sketched by Plato. Alike\nin his classification of the sciences, in his historical deductions,\nand in his plans for the reorganisation of society, Auguste Comte\nadopts a scheme of ascending or descending generality. The conception\nof differentiation and integration employed both by Hegel and by\nMr. Herbert Spencer is also of Platonic origin; only, what with the\nancient thinker was a statical law of order has become with his modern\nsuccessors a dynamic law of progress; while, again, there is this\ndistinction between the German and the English philosopher, that the\nformer construes as successive moments of the Idea what the latter\nregards as simultaneous and interdependent processes of evolution.\n\n\nII.\n\nThe study of psychology with Plato stands in a fourfold relation to\nhis general theory of the world. The dialectic method, without which\nNature would remain unintelligible, is a function of the soul, and\nconstitutes its most essential activity; then soul, as distinguished\nfrom body, represents the higher, supersensual element of existence;\nthirdly, the objective dualism of reality and appearance is reproduced\nin the subjective dualism of reason and sense; and lastly, soul, as\nthe original spring of movement, mediates between the eternal entities\nwhich are unmoved and the material phenomena which are subject to\na continual flux. It is very characteristic of Plato that he first\nstrains an antithesis to the utmost and then endeavours to reconcile\nits extremes by the interposition of one or more intermediate links.\nSo, while assigning this office to soul as a part of the universe, he\nclassifies the psychic functions themselves according to a similar\nprinciple. On the intellectual side he places true opinion, or what\nwe should now call empirical knowledge, midway between demonstration\nand sense-perception. Such at least seems to be the result reached in\nthe _Theaetêtus_ and the _Meno_. In the _Republic_ a further analysis\nleads to a somewhat different arrangement. Opinion is placed between\nknowledge and ignorance; while the possible objects to which it\ncorresponds form a transition from being to not-being. Subsequently\nmathematical reasoning is distinguished from the higher science which\ntakes cognisance of first principles, and thus serves to connect it\nwith simple opinion; while this again, dealing as it does with material\nobjects, is related to the knowledge of their shadows as the most\nperfect science is related to mathematics.[138]\n\nTurning from dialectic to ethics, Plato in like manner feels the need\nof interposing a mediator between reason and appetite. The quality\nchosen for this purpose he calls θυμός, a term which does not, as has\nbeen erroneously supposed, correspond to our word Will, but rather\nto pride, or the feeling of personal honour. It is both the seat of\nmilitary courage and the natural auxiliary of reason, with which it\nco-operates in restraining the animal desires. It is a characteristic\ndifference between Socrates and Plato that the former should have\nhabitually reinforced his arguments for virtue by appeals to\nself-interest; while the latter, with his aristocratic way of looking\nat things, prefers to enlist the aid of a haughtier feeling on their\nbehalf. Aristotle followed in the same track when he taught that to be\novercome by anger is less discreditable than to be overcome by desire.\nIn reality none of the instincts tending to self-preservation is more\npraiseworthy than another, or more amenable to the control of reason.\nPlato’s tripartite division of mind cannot be made to fit into the\nclassifications of modern psychology, which are adapted not only to a\nmore advanced state of knowledge but also to more complex conditions\nof life. But the characters of women, by their greater simplicity and\nuniformity, show to some extent what those of men may once have been;\nand it will, perhaps, confirm the analysis of the _Phaedrus_ to recall\nthe fact that personal pride is still associated with moral principle\nin the guardianship of female virtue.\n\nIf the soul served to connect the eternal realities with the fleeting\nappearances by which they were at once darkened, relieved, and shadowed\nforth, it was also a bond of union between the speculative and the\npractical philosophy of Plato; and in discussing his psychology we have\nalready passed from the one to the other. The transition will become\nstill easier if we remember that the question, ‘What is knowledge?’\nwas, according to our view, originally suggested by a theory reducing\nethical science to a hedonistic calculus, and that along with it would\narise another question, ‘What is pleasure?’ This latter enquiry,\nthough incidentally touched on elsewhere, is not fully dealt with in\nany Dialogue except the _Philêbus_, which we agree with Prof. Jowett\nin referring to a very late period of Platonic authorship. But the\nline of argument which it pursues had probably been long familiar\nto our philosopher. At any rate, the _Phaedo_, the _Republic_, and\nperhaps the _Gorgias_, assume, as already proved, that pleasure is\nnot the highest good. The question is one on which thinkers are still\ndivided. It seems, indeed, to lie outside the range of reason, and\nthe disputants are accordingly obliged to invoke the authority either\nof individual consciousness or of common consent on behalf of their\nrespective opinions. We have, however, got so far beyond the ancients\nthat the doctrine of egoistic hedonism has been abandoned by almost\neverybody. The substitution of another’s pleasure for our own as the\nobject of pursuit was not a conception which presented itself to\nany Greek moralist, although the principle of self-sacrifice was\nmaintained by some of them, and especially by Plato, to its fullest\nextent. Pleasure-seeking being inseparably associated with selfishness,\nthe latter was best attacked through the former, and if Plato’s logic\ndoes not commend itself to our understanding, we must admit that it was\nemployed in defence of a noble cause.\n\nThe style of polemics adopted on this occasion, whatever else may\nbe its value, will serve excellently to illustrate the general\ndialectic method of attack. When Plato particularly disliked a class\nof persons, or an institution, or an art, or a theory, or a state of\nconsciousness, he tried to prove that it was confused, unstable, and\nself-contradictory; besides taking full advantage of any discredit\npopularly attached to it. All these objections are brought to bear\nwith full force against pleasure. Some pleasures are delusive, since\nthe reality of them falls far short of the anticipation; all pleasure\nis essentially transitory, a perpetual becoming, never a fixed state,\nand therefore not an end of action; pleasures which ensue on the\nsatisfaction of desires are necessarily accompanied by pains and\ndisappear simultaneously with them; the most intense, and for that\nreason the most typical, pleasures, are associated with feelings of\nshame, and their enjoyment is carefully hidden out of sight.\n\nSuch arguments have almost the air of an afterthought, and Plato was\nperhaps more powerfully swayed by other considerations, which we\nshall now proceed to analyse. When pleasure was assumed to be the\nhighest good, knowledge was agreed to be the indispensable means\nfor its attainment; and, as so often happens, the means gradually\nsubstituted itself for the end. Nor was this all; for knowledge (or\nreason) being not only the means but the supreme arbiter, when called\non to adjudicate between conflicting claims, would naturally pronounce\nin its own favour. Naturally, also, a moralist who made science the\nchief interest of his own life would come to believe that it was the\nproper object of all life, whether attended or not by any pleasurable\nemotion. And so, in direct opposition to the utilitarian theory,\nPlato declares at last that to brave a lesser pain in order to escape\nfrom a greater, or to renounce a lesser pleasure in order to secure a\ngreater, is cowardice and intemperance in disguise; and that wisdom,\nwhich he had formerly regarded as a means to other ends, is the one\nend for which everything else should be exchanged.[139] Perhaps it may\nhave strengthened him in this attitude to observe that the many, whose\nopinion he so thoroughly despised, made pleasure their aim in life,\nwhile the fastidious few preferred knowledge. Yet, after a time, even\nthe latter alternative failed to satisfy his restless spirit. For the\nconception of knowledge resolved itself into the deeper conceptions of\na knowing subject and a known object, the soul and the universe, each\nof which became in turn the supreme ideal. What interpretation should\nbe given to virtue depended on the choice between them. According to\nthe one view it was a purification of the higher principle within us\nfrom material wants and passions. Sensual gratifications should be\navoided, because they tend to degrade and pollute the soul. Death\nshould be fearlessly encountered, because it will release her from the\nrestrictions of bodily existence. But Plato had too strong a grasp\non the realities of life to remain satisfied with a purely ascetic\nmorality. Knowledge, on the objective side, brought him into relation\nwith an organised universe where each individual existed, not for his\nown sake but for the sake of the whole, to fulfil a definite function\nin the system of which he formed a part. And if from one point of\nview the soul herself was an absolutely simple indivisible substance,\nfrom another point of view she reflected the external order, and only\nfulfilled the law of her being when each separate faculty was exercised\nwithin its appropriate sphere.\n\nThere still remained one last problem to solve, one point where the\nconverging streams of ethical and metaphysical speculation met and\nmixed. Granted that knowledge is the soul’s highest energy, what is the\nobject of this beatific vision? Granted that all particular energies\nco-operate for a common purpose, what is the end to which they are\nsubordinated? Granted that dialectic leads us up through ascending\ngradations to one all-comprehensive idea, how is that idea to be\ndefined? Plato only attempts to answer this last question by re-stating\nit under the form of an illustration. As the sun at once gives life to\nall Nature, and light to the eye by which Nature is perceived, so also\nthe idea of Good is the cause of existence and of knowledge alike, but\ntranscends them both as an absolute unity, of which we cannot even say\nthat it is, for the distinction of subject and predicate would bring\nback relativity and plurality again. Here we seem to have the Socratic\nparadox reversed. Socrates identified virtue with knowledge, but, at\nthe same time, entirely emptied the latter of its speculative content.\nPlato, inheriting the idea of knowledge in its artificially restricted\nsignificance, was irresistibly drawn back to the older philosophy\nwhence it had been originally borrowed; then, just as his master had\ngiven an ethical application to science, so did he, travelling over the\nsame ground in an opposite direction, extend the theory of ethics far\nbeyond its legitimate range, until a principle which seemed to have no\nmeaning, except in reference to human conduct, became the abstract bond\nof union between all reality and all thought.\n\nWhether Plato ever succeeded in making the idea of Good quite clear to\nothers, or even to himself, is more than we can tell. In the _Republic_\nhe declines giving further explanations on the ground that his pupils\nhave not passed through the necessary mathematical initiation. Whether\nquantitative reasoning was to furnish the form or the matter of\ntranscendent dialectic is left undetermined. We are told that on one\noccasion a large audience assembled to hear Plato lecture on the Good,\nbut that, much to their disappointment, the discourse was entirely\nfilled with geometrical and astronomical investigations. Bearing in\nmind, however, that mathematical science deals chiefly with equations,\nand that astronomy, according to Plato, had for its object to prove\nthe absolute uniformity of the celestial motions, we may perhaps\nconclude that the idea of Good meant no more than the abstract notion\nof identity or indistinguishable likeness. The more complex idea of law\nas a uniformity of relations, whether coexistent or successive, had not\nthen dawned, but it has since been similarly employed to bring physics\ninto harmony with ethics and logic.\n\n\nIII.\n\nSo far we have followed the evolution of Plato’s philosophy as it may\nhave been effected under the impulse of purely theoretical motives.\nWe have now to consider what form was imposed on it by the more\nimperious exigencies of practical experience. Here, again, we find\nPlato taking up and continuing the work of Socrates, but on a vastly\ngreater scale. There was, indeed, a kind of pre-established harmony\nbetween the expression of thought on the one hand and the increasing\nneed for its application to life on the other. For the spread of\npublic corruption had gone on _pari passu_ with the development of\nphilosophy. The teaching of Socrates was addressed to individuals,\nand dealt chiefly with private morality. On other points he was\ncontent to accept the law of the land and the established political\nconstitution as sufficiently safe guides. He was not accustomed to see\nthem defied or perverted into instruments of selfish aggrandisement;\nnor, apparently, had the possibility of such a contingency occurred\nto him. Still less did he imagine that all social institutions then\nexisting were radically wrong. Hence the personal virtues held a more\nimportant place in his system than the social virtues. His attacks\nwere directed against slothfulness and self-indulgence, against the\nignorant temerity which hurried some young men into politics before\ntheir education was finished, and the timidity or fastidiousness which\nprevented others from discharging the highest duties of citizenship.\nNor, in accepting the popular religion of his time, had he any\nsuspicion that its sanctions might be invoked on behalf of successful\nviolence and fraud. We have already shown how differently Plato felt\ntowards his age, and how much deeper as well as more shameless was\nthe demoralisation with which he set himself to contend. It must also\nbe remembered how judicial proceedings had come to overshadow every\nother public interest; and how the highest culture of the time had, at\nleast in his eyes, become identified with the systematic perversion\nof truth and right. These considerations will explain why Greek\nphilosophy, while moving on a higher plane, passed through the same\norbit which had been previously described by Greek poetry. Precisely\nas the lessons of moderation in Homer had been followed by the lessons\nof justice in Aeschylus, precisely as the religion which was a selfish\ntraffic between gods and men, and had little to tell of a life beyond\nthe grave, was replaced by the nobler faith in a divine guardianship\nof morality and a retributive judgment after death—so also did the\nSocratic ethics and the Socratic theology lead to a system which\nmade justice the essence of morality and religion its everlasting\nconsecration.\n\nTemperance and justice are very clearly distinguished in our minds.\nThe one is mainly a self-regarding, the other mainly a social virtue.\nBut it would be a mistake to suppose that the distinction was equally\nclear to Plato. He had learned from Socrates that all virtue is one.\nHe found himself confronted by men who pointedly opposed interest to\nhonour and expediency to fair-dealing, without making any secret of\ntheir preference for the former. Here, as elsewhere, he laboured to\ndissolve away the vulgar antithesis and to substitute for it a deeper\none—the antithesis between real and apparent goods. He was quite\nready to imagine the case of a man who might have to incur all sorts\nof suffering in the practice of justice even to the extent of infamy,\ntorture, and death; but without denying that these were evils, he held\nthat to practise injustice with the accompaniment of worldly prosperity\nwas a greater evil still. And this conviction is quite unconnected\nwith his belief in a future life. He would not have agreed with St.\nPaul that virtue is a bad calculation without the hope of a reward for\nit hereafter. His morality is absolutely independent of any extrinsic\nconsiderations. Nevertheless, he holds that in our own interest we\nshould do what is right; and it never seems to have entered his\nthoughts that there could be any other motive for doing it. We have to\nexplain how such a paradox was possible.\n\nPlato seems to have felt very strongly that all virtuous action tends\ntowards a good exceeding in value any temporary sacrifice which it may\ninvolve; and the accepted connotation of ethical terms went entirely\nalong with this belief. But he could not see that a particular action\nmight be good for the community at large and bad for the individual who\nperformed it, not in a different sense but in the very same sense, as\ninvolving a diminution of his happiness. For from Plato’s abstract and\ngeneralising point of view all good was homogeneous, and the welfare of\nthe individual was absolutely identified with the welfare of the whole\nto which he belonged. As against those who made right dependent on\nmight and erected self-indulgence into the law of life Plato occupied\nan impregnable position. He showed that such principles made society\nimpossible, and that without honour even a gang of thieves cannot\nhold together.[140] He also saw that it is reason which brings each\nindividual into relation with the whole and enables him to understand\nhis obligations towards it; but at the same time he gave this reason a\npersonal character which does not properly belong to it; or, what comes\nto the same thing, he treated human beings as pure _entia rationis_,\nthus unwittingly removing the necessity for having any morality at all.\nOn his assumption it would be absurd to break the law; but neither\nwould there be any temptation to break it, nor would any unpleasant\nconsequences follow on its violation. Plato speaks of injustice as an\ninjury to the soul’s health, and therefore as the greatest evil that\ncan befall a human being, without observing that the inference involves\na confusion of terms. For his argument requires that soul should mean\nboth the whole of conscious life and the system of abstract notions\nthrough which we communicate and co-operate with our fellow-creatures.\nAll crime is a serious disturbance to the latter, for it cannot without\nabsurdity be made the foundation of a general rule; but, apart from\npenal consequences, it does not impair, and may benefit the former.\n\nWhile Plato identified the individual with the community by slurring\nover the possible divergence of their interests, he still further\ncontributed to their logical confusion by resolving the ego into a\nmultitude of conflicting faculties and impulses supposed to represent\nthe different classes of which a State is made up. His opponents\nheld that justice and law emanate from the ruling power in the body\npolitic; and they were brought to admit that supreme power is properly\nvested in the wisest and best citizens. Transferring these principles\nto the inner forum, he maintained that a psychological aristocracy\ncould only be established by giving reason a similar control over the\nanimal passions.[141] At first sight, this seemed to imply no more\nthan a return to the standpoint of Socrates, or of Plato himself in\nthe _Protagoras_. The man who indulges his desires within the limits\nprescribed by a regard for their safe satisfaction through his whole\nlife, may be called temperate and reasonable, but he is not necessarily\njust. If, however, we identify the paramount authority within with\nthe paramount authority without, we shall have to admit that there\nis a faculty of justice in the individual soul corresponding to the\nobjective justice of political law; and since the supreme virtue is\nagreed on all hands to be reason, we must go a step further and admit\nthat justice is reason, or that it is reasonable to be just; and\nthat by consequence the height of injustice is the height of folly.\nMoreover, this fallacious substitution of justice for temperance was\nfacilitated by the circumstance that although the former virtue is not\ninvolved in the latter, the latter is to a very great extent involved\nin the former. Self-control by no means carries with it a respect for\nthe rights of others; but where such respect exists it necessitates a\nconsiderable amount of self-control.\n\nWe trust that the steps of a difficult argument have been made clear by\nthe foregoing analysis; and that the whole process has been shown to\nhinge on the ambiguous use of such notions as the individual and the\ncommunity, of which the one is paradoxically construed as a plurality\nand the other as a unity; justice, which is alternately taken in the\nsense of control exercised by the worthiest, control of passion in the\ngeneral interest, control of our passions in the interest of others,\nand control of the same passions in our own interest; and wisdom or\nreason, which sometimes means any kind of excellence, sometimes the\nexcellence of a harmonious society, and sometimes the excellence of a\nwell-balanced mind. Thus, out of self-regarding virtue social virtue\nis elicited, the whole process being ultimately conditioned by that\nidentifying power which was at once the strength and the weakness of\nPlato’s genius.\n\nPlato knew perfectly well that although rhetoricians and men of\nthe world might be silenced, they could not be converted nor even\nconvinced by such arguments as these. So far from thinking it possible\nto reason men into virtue, he has observed of those who are slaves\nto their senses that you must improve them before you can teach them\nthe truth.[L] And he felt that if the complete assimilation of the\nindividual and the community was to become more than a mere logical\nformula, it must be effected by a radical reform in the training of\nthe one and in the institutions of the other. Accordingly, he set\nhimself to elaborate a scheme for the purpose, our knowledge of which\nis chiefly derived from his greatest work, the _Republic_. We have\nalready made large use of the negative criticism scattered through that\nDialogue; we have now to examine the positive teaching by which it was\nsupplemented.\n\n\nIV.\n\nPlato, like Socrates, makes religious instruction the basis of\neducation. But where the master had been content to set old beliefs on\na new basis of demonstration, the disciple aimed at nothing less than\ntheir complete purification from irrational and immoral ingredients.\nHe lays down two great principles, that God is good, and that He is\ntrue.[142] Every story which is inconsistent with such a character must\nbe rejected; so also must everything in the poets which redounds to the\ndiscredit of the national heroes, together with everything tending in\nthe remotest degree to make vice attractive or virtue repellent. It is\nevident that Plato, like Xenophanes, repudiated not only the scandalous\ndetails of popular mythology, but also the anthropomorphic conceptions\nwhich lay at its foundation; although he did not think it advisable to\nstate his unbelief with equal frankness. His own theology was a sort\nof star-worship, and he proved the divinity of the heavenly bodies by\nan appeal to the uniformity of their movements.[143] He further taught\nthat the world was created by an absolutely good Being; but we cannot\nbe sure that this was more than a popular version of the theory which\nplaced the abstract idea of Good at the summit of the dialectic series.\nThe truth is that there are two distinct types of religion, the one\nchiefly interested in the existence and attributes of God, the other\nchiefly interested in the destiny of the human soul. The former is best\nrepresented by Judaism, the latter by Buddhism. Plato belongs to the\npsychic rather than to the theistic type. The doctrine of immortality\nappears again and again in his Dialogues, and one of the most beautiful\namong them is entirely devoted to proving it. He seems throughout to be\nconscious that he is arguing in favour of a paradox. Here, at least,\nthere are no appeals to popular prejudice such as figure so largely in\nsimilar discussions among ourselves. The belief in immortality had long\nbeen stirring; but it had not taken deep root among the Ionian Greeks.\nWe cannot even be sure that it was embraced as a consoling hope by any\nbut the highest minds anywhere in Hellas, or by them for more than a\nbrief period. It would be easy to maintain that this arose from some\nnatural incongeniality to the Greek imagination in thoughts which drew\nit away from the world of sense and the delights of earthly life. But\nthe explanation breaks down immediately when we attempt to verify it\nby a wider experience. No modern nation enjoys life so keenly as the\nFrench. Yet, quite apart from traditional dogmas, there is no nation\nthat counts so many earnest supporters of the belief in a spiritual\nexistence beyond the grave. And, to take an individual example, it is\njust the keen relish which Mr. Browning’s Cleon has for every sort of\nenjoyment which makes him shrink back with horror from the thought of\nannihilation, and grasp at any promise of a happiness to be prolonged\nthrough eternity. A closer examination is needed to show us by what\ncauses the current of Greek thought was swayed.\n\nThe great religious movement of the sixth and fifth centuries—chiefly\nrepresented for us by the names of Pythagoras, Aeschylus, and\nPindar—would in all probability have entirely won over the educated\nclasses, and given definiteness to the half-articulate utterances\nof popular tradition, had it not been arrested prematurely by\nthe development of physical speculation. We showed in the first\nchapter that Greek philosophy in its earliest stages was entirely\nmaterialistic. It differed, indeed, from modern materialism in holding\nthat the soul, or seat of conscious life, is an entity distinct from\nthe body; but the distinction was one between a grosser and a finer\nmatter, or else between a simpler and a more complex arrangement of\nthe same matter, not between an extended and an indivisible substance.\nWhatever theories, then, were entertained with respect to the one\nwould inevitably come to be entertained also with respect to the\nother. Now, with the exception of the Eleates, who denied the reality\nof change and separation altogether, every school agreed in teaching\nthat all particular bodies are formed either by differentiation or by\ndecomposition and recomposition out of the same primordial elements.\nFrom this it followed, as a natural consequence, that, although\nthe whole mass of matter was eternal, each particular aggregate of\nmatter must perish in order to release the elements required for the\nformation of new aggregates. It is obvious that, assuming the soul to\nbe material, its immortality was irreconcilable with such a doctrine as\nthis. A combination of four elements and two conflicting forces, such\nas Empedocles supposed the human mind to be, could not possibly outlast\nthe organism in which it was enclosed; and if Empedocles himself, by\nan inconsistency not uncommon with men of genius, refused to draw the\nonly legitimate conclusion from his own principles, the discrepancy\ncould not fail to force itself on his successors. Still more fatal to\nthe belief in a continuance of personal identity after death was the\ntheory put forward by Diogenes of Apollonia, that there is really no\npersonal identity even in life—that consciousness is only maintained\nby a perpetual inhalation of the vital air in which all reason resides.\nThe soul very literally left the body with the last breath, and had a\npoor chance of holding together afterwards, especially, as the wits\nobserved, if a high wind happened to be blowing at the time.\n\nIt would appear that even in the Pythagorean school there had been a\nreaction against a doctrine which its founder had been the first to\npopularise in Hellas. The Pythagoreans had always attributed great\nimportance to the conceptions of harmony and numerical proportion; and\nthey soon came to think of the soul as a ratio which the different\nelements of the animal body bore to one another; or as a musical\nconcord resulting from the joint action of its various members, which\nmight be compared to the strings of a lute. But\n\n              ‘When the lute is broken\n    Sweet tones are remembered not.’\n\nAnd so, with the dissolution of our bodily organism, the music of\nconsciousness would pass away for ever. Perhaps no form of psychology\ntaught in the Greek schools has approached nearer to modern thought\nthan this. It was professed at Thebes by two Pythagoreans, Cebes and\nSimmias, in the time of Plato. He rightly regarded them as formidable\nopponents, for they were ready to grant whatever he claimed for\nthe soul in the way of immateriality and superiority to the body,\nwhile denying the possibility of its separate existence. We may\nso far anticipate the course of our exposition as to mention that\nthe direct argument by which he met them was a reference to the\nmoving power of mind, and to the constraint exercised by reason over\npassionate impulse; characteristics which the analogy with a musical\nharmony failed to explain. But his chief reliance was on an order of\nconsiderations, the historical genesis of which we shall now proceed to\ntrace.\n\nIt was by that somewhat slow and circuitous process, the negation of\na negation, that spiritualism was finally established. The shadows\nof doubt gathered still more thickly around futurity before another\nattempt could be made to remove them. For the scepticism of the\nHumanists and the ethical dialectic of Socrates, if they tended to\nweaken the dogmatic materialism of physical philosophy, were at first\nnot more favourable to the new faith which that philosophy had suddenly\neclipsed. For the one rejected every kind of supernaturalism; and the\nother did not attempt to go behind what had been directly revealed by\nthe gods, or was discoverable from an examination of their handiwork.\nNevertheless, the new enquiries, with their exclusively subjective\ndirection, paved the way for a return to the religious development\npreviously in progress. By leading men to think of mind as, above all,\na principle of knowledge and deliberate action, they altogether freed\nit from those material associations which brought it under the laws of\nexternal Nature, where every finite existence was destined, sooner or\nlater, to be reabsorbed and to disappear. The position was completely\nreversed when Nature was, as it were, brought up before the bar of\nMind to have her constitution determined or her very existence denied\nby that supreme tribunal. If the subjective idealism of Protagoras and\nGorgias made for spiritualism, so also did the teleological religion\nof Socrates. It was impossible to assert the priority and superiority\nof mind to matter more strongly than by teaching that a designing\nintelligence had created the whole visible universe for the exclusive\nenjoyment of man. The infinite without was in its turn absorbed by the\ninfinite within. Finally, the logical method of Socrates contained\nin itself the germs of a still subtler spiritualism which Plato now\nproceeded to work out.\n\nThe dialectic theory, considered in its relation to physics, tended\nto substitute the study of uniformity for the study of mechanical\ncausation. But the general conceptions established by science were\na kind of soul in Nature; they were immaterial, they could not be\nperceived by sense, and yet, remaining as they did unchanged in a world\nof change, they were far truer, far more real, than the phenomena to\nwhich they gave unity and definition. Now these self-existent ideas,\nbeing subjective in their origin, readily reacted on mind, and\ncommunicated to it those attributes of fixedness and eternal duration\nwhich had in truth been borrowed by them from Nature, not by Nature\nfrom them. Plato argued that the soul was in possession of ideas too\npure to have been derived from the suggestions of sense, and therefore\ntraceable to the reminiscences of an ante-natal experience. But we can\nsee that the reminiscence was all on the side of the ideas; it was they\nthat betrayed their human origin by the birthmark of abstraction and\nfinality—betokening the limitation of man’s faculties and the interest\nof his desires—which still clung to them when from a temporary law of\nthought they were erected into an everlasting law of things. As Comte\nwould say, Plato was taking out of his conceptions what he had first\nput into them himself. And, if this consideration applies to all his\nreasonings on the subject of immortality, it applies especially to what\nhe regards as the most convincing demonstration of any. There is one\nidea, he tells us, with which the soul is inseparably and essentially\nassociated—namely, the idea of life. Without this, soul can no more\nbe conceived than snow without cold or fire without heat; nor can\ndeath approach it without involving a logical contradiction. To assume\nthat the soul is separable from the body, and that life is inseparable\nfrom the soul, was certainly an expeditious method of proof. To a\nmodern, it would have the further disadvantage of proving too much.\nFor, by parity of reasoning, every living thing must have an immortal\nsoul, and every soul must have existed from all eternity. Plato\nfrankly accepted both conclusions, and even incorporated them with his\nethical system. He looked on the lower animals as so many stages in a\nprogressive degradation to which human beings had descended through\ntheir own violence or sensuality, but from which it was possible for\nthem to return after a certain period of penitence and probation.\nAt other times he describes a hell, a purgatory, and a heaven, not\nunlike what we read of in Dante, without apparently being conscious\nof any inconsistency between the two representations. It was, indeed,\nan inconsistency such as we find in the highest order of intellects,\nthe inconsistency of one who mediated between two worlds, between\nnaturalistic metempsychosis on the one side, and ethical individualism\non the other.\n\nIt was not merely the immortality, it was the eternity of the soul that\nPlato taught. For him the expectation of a life beyond the grave was\nidentified with the memory of an ante-natal existence, and the two must\nstand or fall together. When Shelley’s shipwrecked mother exclaims to\nher child:—\n\n    ‘Alas! what is life, what is death, what are we,\n    That when the ship sinks we no longer may be!\n    What! to see thee no more, and to feel thee no more,\n    To be after life what we have been before!’\n\nHer despair is but the inverted image of Plato’s hope, the return to\na purer state of being where knowledge will no longer be obscured\nby passing through the perturbing medium of sight and touch. Again,\nmodern apologists for the injustice and misery of the present\nsystem[144] argue that its inequalities will be redressed in a future\nstate. Plato conversely regarded the sufferings of good men as a\nretribution for former sin, or as the result of a forgotten choice.\nThe authority of Pindar and of ancient tradition generally may have\ninfluenced his belief, but it had a deeper ground in the logic of a\nspiritualistic philosophy. The dualism of soul and body is only one\nform of his fundamental antithesis between the changeless essence\nand the transitory manifestations of existence. A pantheism like\nSpinoza’s was the natural outcome of such a system; but his practical\ngenius or his ardent imagination kept Plato from carrying it so far.\nNor in the interests of progress was the result to be regretted; for\ntheology had to pass through one more phase before the term of its\nbeneficent activity could be reached. Ethical conceptions gained a new\nsignificance in the blended light of mythology and metaphysics; those\nwho made it their trade to pervert justice at its fountain-head might\nstill tremble before the terrors of a supernatural tribunal; or if\nPlato could not regenerate the life of his own people he could foretell\nwhat was to be the common faith of Europe in another thousand years;\nand memory, if not hope, is the richer for those magnificent visions\nwhere he has projected the eternal conflict between good and evil into\nthe silence and darkness by which our lives are shut in on every side.\n\n\nV.\n\nPlato had begun by condemning poetry only in so far as it was\ninconsistent with true religion and morality. At last, with his usual\npropensity to generalise, he condemned it and, by implication, every\nimitative art _quâ_ art, as a delusion and a sham, twice removed\nfrom the truth of things, because a copy of the phenomena which\nare themselves unreal representations of an archetypal idea. His\niconoclasm may remind us of other ethical theologians both before and\nafter, whether Hebrew, Moslem, or Puritan. If he does not share their\nfanatical hatred for plastic and pictorial representations, it is only\nbecause works of that class, besides being of a chaster character,\nexercised far less power over the Greek imagination than epic and\ndramatic poetry. Moreover, the tales of the poets were, according\nto Plato, the worst lies of any, since they were believed to be\ntrue; whereas statues and pictures differed too obviously from their\noriginals for any such illusion to be produced in their case. Like the\nPuritans, again, Plato sanctioned the use of religious hymns, with the\naccompaniment of music in its simplest and most elevated forms. Like\nthem, also, he would have approved of literary fiction when it was\nemployed for edifying purposes. Works like the _Faery Queen_, _Paradise\nLost_, and the _Pilgrim’s Progress_, would have been his favourites in\nEnglish literature; and he might have extended the same indulgence to\nfictions of the Edgeworthian type, where the virtuous characters always\ncome off best in the end.\n\nThe reformed system of education was to be not only moral and religious\nbut also severely scientific. The place given to mathematics as the\nfoundation of a right intellectual training is most remarkable, and\nshows how truly Plato apprehended the conditions under which knowledge\nis acquired and enlarged. Here, as in other respects, he is, more\neven than Aristotle, the precursor of Auguste Comte. He arranges the\nmathematical sciences, so far as they then existed, in their logical\norder; and his remarks on the most general ideas suggested by astronomy\nread like a divination of rational mechanics. That a recommendation of\nsuch studies should be put into the mouth of Socrates is a striking\nincongruity. The older Plato grew the farther he seems to have advanced\nfrom the humanist to the naturalistic point of view; and, had he been\nwilling to confess it, Hippias and Prodicus were the teachers with whom\nhe finally found himself most in sympathy.\n\nMacaulay has spoken as if the Platonic philosophy was totally unrelated\nto the material wants of men. This, however, is a mistake. It is true\nthat, in the _Republic_, science is not regarded as an instrument for\nheaping up fresh luxuries, or for curing the diseases which luxury\nbreeds; but only because its purpose is held to be the discovery of\nthose conditions under which a healthy, happy, and virtuous race can\nbest be reared. The art of the true statesman is to weave the web of\nlife with perfect skill, to bring together those couples from whose\nunion the noblest progeny shall issue; and it is only by mastering the\nlaws of the physical universe that this art can be acquired. Plato knew\nno natural laws but those of mathematics and astronomy; consequently,\nhe set far too much store on the times and seasons at which bride and\nbridegroom were to meet, and on the numerical ratios by which they\nwere supposed to be determined. He even tells us about a mysterious\nformula for discovering the nuptial number, by which the ingenuity of\ncommentators has been considerably exercised. The true laws by which\nmarriage should be regulated among a civilised people have remained\nwrapped in still more impenetrable darkness. Whatever may be the best\nsolution, it can hardly fail to differ in many respects from our\npresent customs. It cannot be right that the most important act in\nthe life of a human being should be determined by social ambition, by\navarice, by vanity, by pique, or by accident—in a word, by the most\ncontemptible impulses of which human nature is susceptible; nor is\nit to be expected that sexual selection will always necessitate the\nemployment of insincerity, adulation, and bribery by one of the parties\nconcerned, while fostering in the other credulity, egoism, jealousy,\ncapriciousness, and petty tyranny—the very qualities which a wise\ntraining would have for its object to root out.[145]\n\nIt seems difficult to reconcile views about marriage involving\na recognition of the fact that mental and moral qualities are\nhereditarily transmitted, with the belief in metempsychosis elsewhere\nprofessed by Plato. But perhaps his adhesion to the latter doctrine\nis not to be taken very seriously. In imitation of the objective\nworld, whose essential truth is half hidden and half disclosed by\nits phenomenal manifestations, he loves to present his speculative\nteaching under a mythical disguise; and so he may have chosen the\nold doctrine of transmigration as an apt expression for the unity\nand continuity of life. And, at worst, he would not be guilty of any\ngreater inconsistency than is chargeable to those modern philosophers\nwho, while they admit that mental qualities are inherited, hold each\nindividual soul to be a separate and independent creation.\n\nThe rules for breeding and education set forth in the _Republic_\nare not intended for the whole community, but only for the ruling\nminority. It was by the corruption of the higher classes that Plato was\nmost distressed, and the salvation of the State depended, according\nto him, on their reformation. This leads us on to his scheme for\nthe reconstitution of society. It is intimately connected with his\nmethod of logical definition and classification. He shows with great\nforce that the collective action of human beings is conditioned by\nthe division of labour; and argues from this that every individual\nought, in the interest of the whole, to be restricted to a single\noccupation. Therefore, the industrial classes, who form the bulk of\nthe population, are to be excluded both from military service and\nfrom political power. The Peloponnesian War had led to a general\nsubstitution of professional soldiers for the old levies of untrained\ncitizens in Greek warfare. Plato was deeply impressed by the dangers,\nas well as by the advantages, of this revolution. That each profession\nshould be exercised only by persons trained for it, suited his notions\nalike as a logician, a teacher, and a practical reformer. But he saw\nthat mercenary fighters might use their power to oppress and plunder\nthe defenceless citizens, or to establish a military despotism. And,\nholding that government should, like strategy, be exercised only by\nfunctionaries naturally fitted and expressly trained for the work, he\nsaw equally that a privileged class would be tempted to abuse their\nposition in order to fill their pockets and to gratify their passions.\nHe proposed to provide against these dangers, first by the new system\nof education already described, and secondly by pushing the division\nof labour to its logical conclusion. That they might the better attend\nto their specific duties, the defenders and the rulers of the State\nwere not to practise the art of money-making; in other words, they were\nnot to possess any property of their own, but were to be supported\nby the labour of the industrial classes. Furthermore, that they need\nnot quarrel among themselves, he proposed that every private interest\nshould be eliminated from their lives, and that they should, as a\nclass, be united by the closest bonds of family affection. This purpose\nwas to be effected by the abolition of marriage and of domesticity.\nThe couples chosen for breeding were to be separated when the object\nof their union had been attained; children were to be taken from their\nmothers immediately after birth and brought up at the expense and under\nthe supervision of the State. Sickly and deformed infants were to be\ndestroyed. Those who fell short of the aristocratic standard were to\nbe degraded, and their places filled up by the exceptionally gifted\noffspring of low-class parents. Members of the military and governing\ncaste were to address each other according to the kinship which might\npossibly exist between them. In the absence of home-employments, women\nwere to be, so far as possible, assimilated to men; to pass through the\nsame bodily and mental training; to be enrolled in the army; and, if\nthey showed the necessary capacity, to discharge the highest political\nfunctions. In this practical dialectic the identifying no less than\nthe differentiating power of logic is displayed, and displayed also in\ndefiance of common ideas, as in the modern classifications of zoology\nand botany. Plato introduces distinctions where they did not before\nexist, and annuls those which were already recognised. The sexes were\nto be assimilated, political life was to be identified with family\nlife, and the whole community was to present an exact parallel with the\nindividual soul. The ruling committee corresponded to reason, the army\nto passionate spirit, and the industrial classes to the animal desires;\nand each, in its perfect constitution, represented one of the cardinal\nvirtues as reinterpreted by Plato. Wisdom belonged to the ruling\npart, courage to the intermediate executive power, and temperance or\nobedience to the organs of material existence; while justice meant the\ngeneral harmony resulting from the fulfilment of their appropriate\nfunctions by all. We may add that the whole State reproduced the Greek\nfamily in a much deeper sense than Plato himself was aware of. For his\naristocracy represents the man, whose virtue, in the words of Gorgias,\nwas to ‘administer the State;’ and his industrial class takes the place\nof the woman, whose duty was ‘to order her house, and keep what is\nindoors, and obey her husband.’[146]\n\nSuch was the celebrated scheme by which Plato proposed to regenerate\nmankind. We have already taken occasion to show how it was connected\nwith his ethical and dialectical philosophy. We have now to consider\nin what relation it stands to the political experience of his own\nand other times, as well as to the revolutionary proposals of other\nspeculative reformers.\n\n\nVI.\n\nAccording to Hegel,[147] the Platonic polity, so far from being an\nimpracticable dream, had already found its realisation in Greek life,\nand did but give a purer expression to the constitutive principle\nof every ancient commonwealth. There are, he tells us, three stages\nin the moral development of mankind. The first is purely objective.\nIt represents a régime where rules of conduct are entirely imposed\nfrom without; they are, as it were, embodied in the framework of\nsociety; they rest, not on reason and conscience, but on authority\nand tradition; they will not suffer themselves to be questioned,\nfor, being unproved, a doubt would be fatal to their very existence.\nHere the individual is completely sacrificed to the State; but in\nthe second or subjective stage he breaks loose, asserting the right\nof his private judgment and will as against the established order\nof things. This revolution was, still according to Hegel, begun by\nthe Sophists and Socrates. It proved altogether incompatible with\nthe spirit of Greek civilisation, which it ended by shattering to\npieces. The subjective principle found an appropriate expression in\nChristianity, which attributes an infinite importance to the individual\nsoul; and it appears also in the political philosophy of Rousseau.\nWe may observe that it corresponds very nearly to what Auguste Comte\nmeant by the metaphysical period. The modern State reconciles both\nprinciples, allowing the individual his full development, and at the\nsame time incorporating him with a larger whole, where, for the first\ntime, he finds his own reason fully realised. Now, Hegel looks on the\nPlatonic republic as a reaction against the subjective individualism,\nthe right of private judgment, the self-seeking impulse, or whatever\nelse it is to be called, which was fast eating into the heart of Greek\ncivilisation. To counteract this fatal tendency, Plato goes back to\nthe constitutive principle of Greek society—that is to say, the\nomnipotence, or, in Benthamite parlance, omnicompetence, of the State;\nexhibiting it, in ideal perfection, as the suppression of individual\nliberty under every form, more especially the fundamental forms of\nproperty, marriage, and domestic life.\n\nIt seems to us that Hegel, in his anxiety to crush every historical\nprocess into the narrow symmetry of a favourite metaphysical formula,\nhas confounded several entirely distinct conceptions under the common\nname of subjectivity. First, there is the right of private judgment,\nthe claim of each individual to have a voice in the affairs of the\nState, and to have the free management of his own personal concerns.\nBut this, so far from being modern, is one of the oldest customs\nof the Aryan race; and perhaps, could we look back to the oldest\nhistory of other races now despotically governed, we should find it\nprevailing among them also. It was no new nor unheard-of privilege that\nRousseau vindicated for the peoples of his own time, but their ancient\nbirthright, taken from them by the growth of a centralised military\nsystem, just as it had been formerly taken from the city communities of\nthe Graeco-Roman world. In this respect, Plato goes against the whole\nspirit of his country, and no period of its development, not even the\nage of Homer, would have satisfied him.\n\nWe have next the disposition of individuals, no longer to interfere in\nmaking the law, but to override it, or to bend it into an instrument\nfor their own purposes. Doubtless there existed such a tendency in\nPlato’s time, and his polity was very largely designed to hold it\nin check. But such unprincipled ambition was nothing new in Greece,\nhowever the mode of its manifestations might vary. What had formerly\nbeen seized by armed violence was now sought after with the more subtle\nweapons of rhetorical skill; just as at the present moment, among these\nsame Greeks, it is the prize of parliamentary intrigue. The Cretan and\nSpartan institutions may very possibly have been designed with a view\nto checking this spirit of selfish lawlessness, by reducing private\ninterests to a minimum; and Plato most certainly had them in his mind\nwhen he pushed the same method still further; but those institutions\nwere not types of Hellenism as a whole, they only represented one, and\nthat a very abnormal, side of it. Plato borrowed some elements from\nthis quarter, but, as we shall presently show, he incorporated them\nwith others of a widely different character. Sparta was, indeed, on\nany high theory of government, not a State at all, but a robber-clan\nestablished among a plundered population whom they never tried or cared\nto conciliate. How little weight her rulers attributed to the interests\nof the State as such, was well exhibited during the Peloponnesian War,\nwhen political advantages of the utmost importance were surrendered\nin deference to the noble families whose kinsmen had been captured at\nSphactêria, and whose sole object was to rescue them from the fate with\nwhich they were threatened by the Athenians as a means of extorting\nconcessions;—conduct with which the refusal of Rome to ransom the\nsoldiers who had surrendered at Cannae may be instructively contrasted.\n\nWe have, thirdly, to consider a form of individualism directly opposed\nin character to those already specified. It is the complete withdrawal\nfrom public affairs for the sake of attending exclusively to one’s\nprivate duties or pleasures. Such individualism is the characteristic\nweakness of conservatives, who are, by their very nature, the party\nof timidity and quiescence. To them was addressed the exhortation\nof Cato, _capessenda est respublica_. The two other forms of which\nwe have spoken are, on the contrary, diseases of liberalism. We see\nthem exemplified when the leaders of a party are harassed by the\nperpetual criticism of their professed supporters; or, again, when\nan election is lost because the votes of the Liberal electors are\ndivided among several candidates. But when a party—generally the\nConservative party—loses an election because its voters will not\ngo to the poll, that is owing to the lazy individualism which shuns\npolitical contests altogether. It was of this disease that the public\nlife of Athens really perished; and, so far, Hegel is on the right\ntrack; but although its action was more obviously and immediately fatal\nin antiquity, we are by no means safe from a repetition of the same\nexperience in modern society. Nor can it be said that Plato reacted\nagainst an evil which, in his eyes, was an evil only when it deprived\na very few properly-qualified persons of political supremacy. With\nregard to all others he proposed to sanction and systematise what was\nalready becoming a common custom—namely, entire withdrawal from the\nadministration of affairs in peace and war. Hegel seems to forget\nthat it is only a single class, and that the smallest, in Plato’s\nrepublic which is not allowed to have any private interests; while the\nindustrial classes, necessarily forming a large majority of the whole\npopulation, are not only suffered to retain their property and their\nfamilies, but are altogether thrown back for mental occupation on the\ninterests arising out of these. The resulting state of things would\nhave found its best parallel, not in old Greek city life, but in modern\nEurope, as it was between the Reformation and the French Revolution.\n\nThe three forms of individualism already enumerated do not exhaust\nthe general conception of subjectivity. According to Hegel, if we\nunderstand him aright, the most important aspect of the principle in\nquestion would be the philosophical side, the return of thought on\nitself, already latent in physical speculation, proclaimed by the\nSophists as an all-dissolving scepticism, and worked up into a theory\nof life by Socrates. That there was such a movement is, of course,\ncertain; but that it contributed perceptibly to the decay of old\nGreek morality, or that it was essentially opposed to the old Greek\nspirit, cannot, we think, be truly asserted. What has been already\nobserved of political liberty and of political unscrupulousness may be\nrepeated of intellectual inquisitiveness, rationalism, scepticism, or\nby whatever name the tendency in question is to be called—it always\nwas, and still is, essentially characteristic of the Greek race. It\nmay very possibly have been a source of political disintegration at\nall times, but that it became so to a greater extent after assuming\nthe form of systematic speculation has never been proved. If the study\nof science, or the passion for intellectual gymnastics, drew men away\nfrom the duties of public life, it was simply as one more private\ninterest among many, just like feasting, or lovemaking, or travelling,\nor poetry, or any other of the occupations in which a wealthy Greek\ndelighted; not from any intrinsic incompatibility with the duties of a\nstatesman or a soldier. So far, indeed, was this from being true, that\nliberal studies, even of the abstrusest order, were pursued with every\nadvantage to their patriotic energy by such citizens as Zeno, Melissus,\nEmpedocles, and, above all, by Pericles and Epameinondas. If Socrates\nstood aloof from public business it was that he might have more leisure\nto train others for its proper performance; and he himself, when called\nupon to serve the State, proved fully equal to the emergency. As for\nthe Sophists, it is well known that their profession was to give young\nmen the sort of education which would enable them to fill the highest\npolitical offices with honour and advantage. It is true that such a\nspecial preparation would end by throwing increased difficulties in\nthe way of a career which it was originally intended to facilitate, by\nraising the standard of technical proficiency in statesmanship; and\nthat many possible aspirants would, in consequence, be driven back\non less arduous pursuits. But Plato was so far from opposing this\nspecialisation that he wished to carry it much farther, and to make\ngovernment the exclusive business of a small class who were to be\nphysiologically selected and to receive an education far more elaborate\nthan any that the Sophists could give. If, however, we consider Plato\nnot as the constructor of a new constitution but in relation to the\npolitics of his own time, we must admit that his whole influence was\nused to set public affairs in a hateful and contemptible light. So far,\ntherefore, as philosophy was represented by him, it must count for a\ndisintegrating force. But in just the same degree we are precluded from\nassimilating his idea of a State to the old Hellenic model. We must\nrather say, what he himself would have said, that it never was realised\nanywhere; although, as we shall presently see, a certain approach to it\nwas made in the Middle Ages.\n\nOnce more, looking at the whole current of Greek philosophy, and\nespecially the philosophy of mind, are we entitled to say that it\nencouraged, if it did not create, those other forms of individualism\nalready defined as mutinous criticism on the part of the people, and\nselfish ambition on the part of its chiefs? Some historians have\nmaintained that there was such a connexion, operating, if not directly,\nat least through a chain of intermediate causes. Free thought destroyed\nreligion, with religion fell morality, and with morality whatever\nrestraints had hitherto kept anarchic tendencies of every description\nwithin bounds. These are interesting reflections; but they do not\nconcern us here, for the issue raised by Hegel is entirely different.\nIt matters nothing to him that Socrates was a staunch defender of\nsupernaturalism and of the received morality. The essential antithesis\nis between the Socratic introspection and the Socratic dialectics on\nthe one side, and the unquestioned authority of ancient institutions\non the other. If this be what Hegel means, we must once more record\nour dissent. We cannot admit that the philosophy of subjectivity, so\ninterpreted, was a decomposing ferment; nor that the spirit of Plato’s\nrepublic was, in any case, a protest against it. The Delphic precept,\n‘Know thyself,’ meant in the mouth of Socrates: Let every man find out\nwhat work he is best fitted for, and stick to that, without meddling in\nmatters for which he is not qualified. The Socratic dialectic meant:\nLet the whole field of knowledge be similarly studied; let our ideas\non all subjects be so systematised that we shall be able to discover\nat a moment’s notice the bearing of any one of them on any of the\nothers, or on any new question brought up for decision. Surely nothing\ncould well be less individualistic, in a bad sense, less anti-social,\nless anarchic than this. Nor does Plato oppose, he generalises his\nmaster’s principles; he works out the psychology and dialectic of\nthe whole state; and if the members of his governing class are not\npermitted to have any separate interests in their individual capacity,\neach individual soul is exalted to the highest dignity by having\nthe community reorganised on the model of its own internal economy.\nThere are no violent peripeteias in this great drama of thought, but\neverywhere harmony, continuity, and gradual development.\n\nWe have entered at some length into Hegel’s theory of the _Republic_,\nbecause it seems to embody a misleading conception not only of Greek\npolitics but also of the most important attempt at a social reformation\never made by one man in the history of philosophy. Thought would be\nmuch less worth studying if it only reproduced the abstract form of\na very limited experience, instead of analysing and recombining the\nelements of which that experience is composed. And our faith in the\npower of conscious efforts towards improvement will very much depend on\nwhich side of the alternative we accept.\n\nZeller, while taking a much wider view than Hegel, still assumes that\nPlato’s reforms, so far as they were suggested by experience, were\nsimply an adaptation of Dorian practices.[148] He certainly succeeds\nin showing that private property, marriage, education, individual\nliberty, and personal morality were subjected, at least in Sparta, to\nmany restrictions resembling those imposed in the Platonic state. And\nPlato himself, by treating the Spartan system as the first form of\ndegeneration from his own ideal, seems to indicate that this of all\nexisting polities made the nearest approach to it. The declarations of\nthe _Timaeus_[149] are, however, much more distinct; and according to\nthem it was in the caste-divisions of Egypt that he found the nearest\nparallel to his own scheme of social reorganisation. There, too, the\npriests, or wise men came first, and after them the warriors, while\nthe different branches of industry were separated from one another by\nrigid demarcations. He may also have been struck by that free admission\nof women to employments elsewhere filled exclusively by men, which so\nsurprised Herodotus, from his inability to discern its real cause—the\nmore advanced differentiation of Egyptian as compared with Greek\nsociety.[150]\n\n\nVII.\n\nBut a profounder analysis of experience is necessary before we can come\nto the real roots of Plato’s scheme. It must be remembered that our\nphilosopher was a revolutionist of the most thorough-going description,\nthat he objected not to this or that constitution of his time, but to\nall existing constitutions whatever. Now, every great revolutionary\nmovement, if in some respects an advance and an evolution, is in other\nrespects a retrogression and a dissolution. When the most complex forms\nof political association are broken up, the older or subordinate forms\nsuddenly acquire new life and meaning. What is true of practice is\ntrue also of speculation. Having broken away from the most advanced\ncivilisation, Plato was thrown back on the spontaneous organisation of\nindustry, on the army, the school, the family, the savage tribe, and\neven the herd of cattle, for types of social union. It was by taking\nsome hints from each of these minor aggregates that he succeeded in\nbuilding up his ideal polity, which, notwithstanding its supposed\nsimplicity and consistency, is one of the most heterogeneous ever\nframed. The principles on which it rests are not really carried out\nto their logical consequences; they interfere with and supplement\none another. The restriction of political power to a single class is\navowedly based on the necessity for a division of labour. One man, we\nare told, can only do one thing well. But Plato should have seen that\nthe producer is not for that reason to be made a monopolist; and that,\nto borrow his own favourite example, shoes are properly manufactured\nbecause the shoemaker is kept in order by the competition of his rivals\nand by the freedom of the consumer to purchase wherever he pleases.\nAthenian democracy, so far from contradicting the lessons of political\neconomy, was, in truth, their logical application to government. The\npeople did not really govern themselves, nor do they in any modern\ndemocracy, but they listened to different proposals, just as they might\nchoose among different articles in a shop or different tenders for\nbuilding a house, accepted the most suitable, and then left it to be\ncarried out by their trusted agents.\n\nAgain, Plato is false to his own rule when he selects his philosophic\ngovernors out of the military caste. If the same individual can be a\nwarrior in his youth and an administrator in his riper years, one\nman can do two things well, though not at the same time. If the same\nperson can be born with the qualifications both of a soldier and of\na politician, and can be fitted by education for each calling in\nsuccession, surely a much greater number can combine the functions of\na manual labourer with those of an elector. What prevented Plato from\nperceiving this obvious parallel was the tradition of the paterfamilias\nwho had always been a warrior in his youth; and a commendable\nanxiety to keep the army closely connected with the civil power. The\nanalogies of domestic life have also a great deal to do with his\nproposed community of women and children. Instead of undervaluing the\nfamily affections, he immensely overvalued them; as is shown by his\nsupposition that the bonds of consanguinity would prevent dissensions\nfrom arising among his warriors. He should have known that many a home\nis the scene of constant wrangling, and that quarrels between kinsfolk\nare the bitterest of any. Then, looking on the State as a great school,\nPlato imagined that the obedience, docility, and credulity of young\nscholars could be kept up through a lifetime; that full-grown citizens\nwould swallow the absurdest inventions; and that middle-aged officers\ncould be sent into retirement for several years to study dialectic. To\nsuppose that statesmen must necessarily be formed by the discipline\nin question is another scholastic trait. The professional teacher\nattributes far more practical importance to his abstruser lessons\nthan they really possess. He is not content to wait for the indirect\ninfluence which they may exert at some remote period and in combination\nwith forces of perhaps a widely different character. He looks for\nimmediate and telling results. He imagines that the highest truth\nmust have a mysterious power of transforming all things into its own\nlikeness, or at least of making its learners more capable than other\nmen of doing the world’s work. Here also Plato, instead of being too\nlogical, was not logical enough. By following out the laws of economy,\nas applied to mental labour, he might have arrived at the separation\nof the spiritual and temporal powers, and thus anticipated the best\nestablished social doctrine of our time.\n\nWith regard to the propagation of the race, Plato’s methods\nare avowedly borrowed from those practised by bird-fanciers,\nhorse-trainers, and cattle-breeders. It had long been a Greek custom to\ncompare the people to a flock of sheep and their ruler to a shepherd,\nphrases which still survive in ecclesiastical parlance. Socrates\nhabitually employed the same simile in his political discussions;\nand the rhetoricians used it as a justification of the governors\nwho enriched themselves at the expense of those committed to their\ncharge. Plato twisted the argument out of their hands and showed that\nthe shepherd, as such, studies nothing but the good of his sheep.\nHe failed to perceive that the parallel could not be carried out in\nevery detail, and that, quite apart from more elevated considerations,\nthe system which secures a healthy progeny in the one case cannot be\ntransferred to creatures possessing a vastly more complex and delicate\norganisation. The destruction of sickly and deformed children could\nonly be justified on the hypothesis that none but physical qualities\nwere of any value to the community. Our philosopher forgets his own\ndistinction between soul and body just when he most needed to remember\nit.\n\nThe position assigned to women by Plato may perhaps have seemed to\nhis contemporaries the most paradoxical of all his projects, and it\nhas been observed that here he is in advance even of our own age. But\na true conclusion may be deduced from false premises; and Plato’s\nconclusion is not even identical with that reached on other grounds by\nthe modern advocates of women’s rights, or rather of their equitable\nclaims. The author of the _Republic_ detested democracy; and the\nenfranchisement of women is now demanded as a part of the general\ndemocratic programme. It is an axiom, at least with liberals, that\nno class will have its interests properly attended to which is left\nwithout a voice in the election of parliamentary representatives;\nand the interests of the sexes are not more obviously identical than\nthose of producers and consumers, or of capitalists and labourers.\nAnother democratic principle is that individuals are, as a rule, the\nbest judges of what occupation they are fit for; and as a consequence\nof this it is further demanded that women should be admitted to every\nemployment on equal terms with men; leaving competition to decide in\neach instance whether they are suited for it or not. Their continued\nexclusion from the military profession would be an exception more\napparent than real; because, like the majority of the male sex, they\nare physically disqualified for it. Now, the profession of arms is\nthe very one for which Plato proposes to destine the daughters of his\naristocratic caste, without the least intention of consulting their\nwishes on the subject. He is perfectly aware that his own principle of\ndifferentiation will be quoted against him, but he turns the difficulty\nin a very dexterous manner. He contends that the difference of the\nsexes, so far as strength and intelligence are concerned, is one not\nof kind but of degree; for women are not distinguished from men by\nthe possession of any special aptitude, none of them being able to do\nanything that some men cannot do better. Granting the truth of this\nrather unflattering assumption, the inference drawn from it will still\nremain economically unsound. The division of labour requires that each\ntask should be performed, not by those who are absolutely, but by\nthose who are relatively, best fitted for it. In many cases we must be\ncontent with work falling short of the highest attainable standard,\nthat the time and abilities of the best workmen may be exclusively\ndevoted to functions for which they alone are competent. Even if women\ncould be trained to fight, it does not follow that their energies\nmight not be more advantageously expended in another direction. Here,\nagain, Plato improperly reasons from low to high forms of association.\nHe appeals to the doubtful example of nomadic tribes, whose women took\npart in the defence of the camps, and to the fighting power possessed\nby the females of predatory animals. In truth, the elimination of home\nlife left his women without any employment peculiar to themselves;\nand so, not to leave them completely idle, they were drafted into the\narmy, more with the hope of imposing on the enemy by an increase of\nits apparent strength than for the sake of any real service which they\nwere expected to perform.[151] When Plato proposes that women of proved\nability should be admitted to the highest political offices, he is far\nmore in sympathy with modern reformers; and his freedom from prejudice\nis all the more remarkable when we consider that no Greek lady (except,\nperhaps, Artemisia) is known to have ever displayed a talent for\ngovernment, although feminine interference in politics was common\nenough at Sparta; and that personally his feeling towards women was\nunsympathetic if not contemptuous.[152] Still we must not exaggerate\nthe importance of his concession. The Platonic polity was, after all,\na family rather than a true State; and that women should be allowed a\nshare in the regulation of marriage and in the nurture of children,\nwas only giving them back with one hand what had been taken away with\nthe other. Already, among ourselves, women have a voice in educational\nmatters; and were marriage brought under State control, few would doubt\nthe propriety of making them eligible to the new Boards which would be\ncharged with its supervision.\n\nThe foregoing analysis will enable us to appreciate the true\nsignificance of the resemblance pointed out by Zeller[153] between\nthe Platonic republic and the organisation of mediaeval society. The\nimportance given to religious and moral training; the predominance\nof the priesthood; the sharp distinction drawn between the military\ncaste and the industrial population; the exclusion of the latter from\npolitical power; the partial abolition of marriage and property;\nand, it might be added, the high position enjoyed by women as\nregents, châtelaines, abbesses, and sometimes even as warriors or\nprofessors,—are all innovations more in the spirit of Plato than\nin the spirit of Pericles. Three converging influences united to\nbring about this extraordinary verification of a philosophical deal.\nThe profound spiritual revolution effected by Greek thought was\ntaken up and continued by Catholicism, and unconsciously guided to\nthe same practical conclusions the teaching which it had in great\npart originally inspired. Social differentiation went on at the\nsame time, and led to the political consequences logically deduced\nfrom it by Plato. And the barbarian conquest of Rome brought in its\ntrain some of those more primitive habits on which his breach with\ncivilisation had equally thrown him back. Thus the coincidence between\nPlato’s _Republic_ and mediaeval polity is due in one direction to\ncausal agency, in another to speculative insight, and in a third to\nparallelism of effects, independent of each other but arising out of\nanalogous conditions.\n\nIf, now, we proceed to compare the _Republic_ with more recent schemes\nhaving also for their object the identification of public with private\ninterests, nothing, at first sight, seems to resemble it so closely\nas the theories of modern Communism; especially those which advocate\nthe abolition not only of private property but also of marriage. The\nsimilarity, however, is merely superficial, and covers a radical\ndivergence, For, to begin with, the Platonic polity is not a system of\nCommunism at all, in our sense of the word. It is not that the members\nof the ruling caste are to throw their property into a common fund;\nneither as individuals nor as a class do they possess any property\nwhatever. Their wants are provided for by the industrial classes, who\napparently continue to live under the old system of particularism.\nWhat Plato had in view was not to increase the sum of individual\nenjoyments by enforcing an equal division of their material means, but\nto eliminate individualism altogether, and thus give human feeling the\nabsolute generality which he so much admired in abstract ideas. On the\nother hand, unless we are mistaken, modern Communism has no objection\nto private property as such, could it remain divided either with\nabsolute equality or in strict proportion to the wants of its holders;\nbut only as the inevitable cause of inequalities which advancing\ncivilisation seems to aggravate rather than to redress. So also with\nmarriage; the modern assailants of that institution object to it as a\nrestraint on the freedom of individual passion, which, according to\nthem, would secure the maximum of pleasure by perpetually varying its\nobjects. Plato would have looked on such reasonings as a parody and\nperversion of his own doctrine; as in very truth, what some of them\nhave professed to be, pleas for the rehabilitation of the flesh in its\noriginal supremacy over the spirit, and therefore the direct opposite\nof a system which sought to spiritualise by generalising the interests\nof life. And so, when in the _Laws_ he gives his Communistic principles\ntheir complete logical development by extending them to the whole\npopulation, he is careful to preserve their philosophical character as\nthe absorption of individual in social existence.[154]\n\nThe parentage of the two ideas will further elucidate their\nessentially heterogeneous character. For modern Communism is an\noutgrowth of the democratic tendencies which Plato detested; and\nas such had its counterpart in ancient Athens, if we may trust the\n_Ecclêsiazusae_ of Aristophanes, where also it is associated with\nunbridled licentiousness.[155] Plato, on the contrary, seems to have\nreceived the first suggestion of his Communism from the Pythagorean and\naristocratic confraternities of Southern Italy, where the principle\nthat friends have all things in common was an accepted maxim.\n\nIf Plato stands at the very antipodes of Fourier and St. Simon, he is\nconnected by a real relationship with those thinkers who, like Auguste\nComte and Mr. Herbert Spencer, have based their social systems on a\nwide survey of physical science and human history. It is even probable\nthat his ideas have exercised a decided though not a direct influence\non the two writers whom we have named. For Comte avowedly took many of\nhis proposed reforms from the organisation of mediaeval Catholicism,\nwhich was a translation of philosophy into dogma and discipline, just\nas Positivism is a re-translation of theology into the human thought\nfrom which it sprang. And Mr. Spencer’s system, while it seems to be\nthe direct antithesis of Plato’s, might claim kindred with it through\nthe principle of differentiation and integration, which, after passing\nfrom Greek thought into political economy and physiology, has been\nrestored by our illustrious countryman to something more than its\noriginal generality. It has also to be observed that the application of\nvery abstract truths to political science needs to be most jealously\nguarded, since their elasticity increases in direct proportion to\ntheir width. When one thinker argues from the law of increasing\nspecialisation to a vast extension of governmental interference with\npersonal liberty, and another thinker to its restriction within the\nnarrowest possible limits, it seems time to consider whether experience\nand expediency are not, after all, the safest guides to trust.\n\n\nVIII.\n\nThe social studies through which we have accompanied Plato seem to have\nreacted on his more abstract speculations, and to have largely modified\nthe extreme opposition in which these had formerly stood to current\nnotions, whether of a popular or a philosophical character. The change\nfirst becomes perceptible in his theory of Ideas. This is a subject on\nwhich, for the sake of greater clearness, we have hitherto refrained\nfrom entering; and that we should have succeeded in avoiding it so long\nwould seem to prove that the doctrine in question forms a much less\nimportant part of his philosophy than is commonly imagined. Perhaps,\nas some think, it was not an original invention of his own, but was\nborrowed from the Megarian school; and the mythical connexion in which\nit frequently figures makes us doubtful how far he ever thoroughly\naccepted it. The theory is, that to every abstract name or conception\nof the mind there corresponds an objective entity possessing a separate\nexistence quite distinct from that of the scattered particulars by\nwhich it is exemplified to our senses or to our imagination. Just as\nthe Heracleitean flux represented the confusion of which Socrates\nconvicted his interlocutors, so also did these Ideas represent the\ndefinitions by which he sought to bring method and certainty into\ntheir opinions. It may be that, as Grote suggests, Plato adopted this\nhypothesis in order to escape from the difficulty of defining common\nnotions in a satisfactory manner. It is certain that his earliest\nDialogues seem to place true definitions beyond the reach of human\nknowledge. And at the beginning of Plato’s constructive period we\nfind the recognition of abstract conceptions, whether mathematical or\nmoral, traced to the remembrance of an ante-natal state, where the soul\nheld direct converse with the transcendent realities to which those\nconceptions correspond. Justice, temperance, beauty, and goodness, are\nespecially mentioned as examples of Ideas revealed in this manner.\nSubsequent investigations must, however, have led Plato to believe\nthat the highest truths are to be found by analysing not the loose\ncontents but the fixed forms of consciousness; and that, if each virtue\nexpressed a particular relation between the various parts of the soul,\nno external experience was needed to make her acquainted with its\nmeaning; still less could conceptions arising out of her connexion with\nthe material world be explained by reference to a sphere of purely\nspiritual existence. At the same time, innate ideas would no longer be\nrequired to prove her incorporeality, when the authority of reason over\nsense furnished so much more satisfactory a ground for believing the\ntwo to be of different origin. To all who have studied the evolution\nof modern thought, the substitution of Kantian forms for Cartesian\nideas will at once elucidate and confirm our hypothesis of a similar\nreformation in Plato’s metaphysics.\n\nAgain, the new position occupied by Mind as an intermediary between\nthe world of reality and the world of appearance, tended more and more\nto obliterate or confuse the demarcations by which they had hitherto\nbeen separated. The most general headings under which it was usual to\ncontrast them were, the One and the Many, Being and Nothing, the Same\nand the Different, Rest and Motion. Parmenides employed the one set of\nterms to describe his Absolute, and the other to describe the objects\nof vulgar belief. They also served respectively to designate the wise\nand the ignorant, the dialectician and the sophist, the knowledge\nof gods and the opinions of men; besides offering points of contact\nwith the antithetical couples of Pythagoreanism. But Plato gradually\nfound that the nature of Mind could not be understood without taking\nboth points of view into account. Unity and plurality, sameness and\ndifference, equally entered into its composition; although undoubtedly\nbelonging to the sphere of reality, it was self-moved and the cause\nof all motion in other things. The dialectic or classificatory method,\nwith its progressive series of differentiations and assimilations, also\ninvolved a continual use of categories which were held to be mutually\nexclusive. And on proceeding to an examination of the summa genera, the\nhighest and most abstract ideas which it had been sought to distinguish\nby their absolute purity and simplicity from the shifting chaos of\nsensible phenomena, Plato discovered that even these were reduced\nto a maze of confusion and contradiction by a sincere application\nof the cross-examining elenchus. For example, to predicate being of\nthe One was to mix it up with a heterogeneous idea and let in the\nvery plurality which it denied. To distinguish them was to predicate\ndifference of both, and thus open the door to fresh embarrassments.\n\nFinally, while the attempt to attain extreme accuracy of definition was\nleading to the destruction of all thought and all reality within the\nSocratic school, the dialectic method had been taken up and parodied\nin a very coarse style by a class of persons called Eristics. These\nmen had, to some extent, usurped the place of the elder Sophists\nas paid instructors of youth; but their only accomplishment was to\nupset every possible assertion by a series of verbal juggles. One of\ntheir favourite paradoxes was to deny the reality of falsehood on the\nParmenidean principle that ‘nothing cannot exist.’ Plato satirises\ntheir method in the _Euthydêmus_, and makes a much more serious\nattempt to meet it in the _Sophist_; two Dialogues which seem to have\nbeen composed not far from one another.[156] The _Sophist_ effects a\nconsiderable simplification in the ideal theory by resolving negation\ninto difference, and altogether omitting the notions of unity and\nplurality,—perhaps as a result of the investigations contained in the\n_Parmenides_, another dialogue belonging to the same group, where the\ncouple referred to are analysed with great minuteness, and are shown to\nbe infected with numerous self-contradictions. The remaining five ideas\nof Existence, Sameness, Difference, Rest, and Motion, are allowed to\nstand; but the fact of their inseparable connexion is brought out with\ngreat force and clearness. The enquiry is one of considerable interest,\nincluding, as it does, the earliest known analysis of predication,\nand forming an indispensable link in the transition from Platonic to\nAristotelian logic—that is to say, from the theory of definition and\nclassification to the theory of syllogism.\n\nOnce the Ideas had been brought into mutual relation and shown to be\ncompounded with one another, the task of connecting them with the\nexternal world became considerably easier; and the same intermediary\nwhich before had linked them to it as a participant in the nature of\nboth, was now raised to a higher position and became the efficient\ncause of their intimate union. Such is the standpoint of the\n_Philêbus_, where all existence is divided into four classes, the\nlimit, the unlimited, the union of both, and the cause of their union.\nMind belongs to the last and matter to the second class. There can\nhardly be a doubt that the first class is either identical with the\nIdeas or fills the place once occupied by them. The third class is the\nworld of experience, the Cosmos of early Greek thought, which Plato\nhad now come to look on as a worthy object of study. In the _Timaeus_,\nalso a very late Dialogue, he goes further, and gives us a complete\ncosmogony, the general conception of which is clear enough, although\nthe details are avowedly conjectural and figurative; nor do they seem\nto have exercised any influence or subsequent speculation until the\ntime of Descartes. We are told that the world was created by God,\nwho is absolutely good, and, being without jealousy, wished that all\nthings should be like himself. He makes it to consist of a soul and\na body, the former constructed in imitation of the eternal archetypal\nideas which now seem to be reduced to three—Existence, Sameness, and\nDifference.[157] The soul of the world is formed by mixing these three\nelements together, and the body is an image of the soul. Sameness is\nrepresented by the starry sphere rotating on its own axis; Difference\nby the inclination of the ecliptic to the equator; Existence, perhaps,\nby the everlasting duration of the heavens. The same analogy extends\nto the human figure, of which the head is the most essential part, all\nthe rest of the body being merely designed for its support. Plato seems\nto regard the material world as a sort of machinery designed to meet\nthe necessities of sight and touch, by which the human soul arrives\nat a knowledge of the eternal order without;—a direct reversal of\nhis earlier theories, according to which matter and sense were mere\nencumbrances impeding the soul in her efforts after truth.\n\nWhat remains of the visible world after deducting its ideal elements is\npure space. This, which to some seems the clearest of all conceptions,\nwas to Plato one of the obscurest. He can only describe it as the\nformless substance out of which the four elements, fire, air, water,\nand earth, are differentiated. It closes the scale of existence and\neven lies half outside it, just as the Idea of Good in the _Republic_\ntranscends the same scale at the other end. We may conjecture that\nthe two principles are opposed as absolute self-identity and absolute\nself-separation; the whole intermediate series of forms serving\nto bridge over the interval between them. It will then be easy to\nunderstand how, as Aristotle tells us, Plato finally came to adopt the\nPythagorean nomenclature and designated his two generating principles\nas the monad and the indefinite dyad. Number was formed by their\ncombination, and all other things were made out of number. Aristotle\ncomplains that the Platonists had turned philosophy into mathematics;\nand perhaps in the interests of science it was fortunate that the\ntransformation occurred. To suppose that matter could be built up out\nof geometrical triangles, as Plato teaches in the _Timaeus_, was,\nno doubt, a highly reprehensible confusion; but that the systematic\nstudy of science should be based on mathematics was an equally new and\nimportant aperçu. The impulse given to knowledge followed unforeseen\ndirections; and at a later period Plato’s true spirit was better\nrepresented by Archimedes and Hipparchus than by Arcesilaus and\nCarneades.\n\nIt is remarkable that the spontaneous development of Greek thought\nshould have led to a form of Theism not unlike that which some persons\nstill imagine was supernaturally revealed to the Hebrew race; for the\nabsence of any connexion between the two is now almost universally\nadmitted. Modern science has taken up the attitude of Laplace towards\nthe hypothesis in question; and those critics who, like Lange, are most\nimbued with the scientific spirit, feel inclined to regard its adoption\nby Plato as a retrograde movement. We may to a certain extent agree\nwith them, without admitting that philosophy, as a whole, was injured\nby departing from the principles of Democritus. An intellectual like\nan animal organism may sometimes have to choose between retrograde\nmetamorphosis and total extinction. The course of events drove\nspeculation to Athens, where it could only exist on the condition of\nassuming a theological form. Moreover, action and reaction were equal\nand contrary. Mythology gained as much as philosophy lost. It was\npurified from immoral ingredients, and raised to the highest level\nwhich supernaturalism is capable of attaining. If the _Republic_ was\nthe forerunner of the Catholic Church, the _Timaeus_ was the forerunner\nof the Catholic faith.\n\n\nIX.\n\nThe old age of Plato seems to have been marked by restless activity\nin more directions than one. He began various works which were never\nfinished, and projected others which were never begun. He became\npossessed by a devouring zeal for social reform. It seemed to him that\nnothing was wanting but an enlightened despot to make his ideal State\na reality. According to one story, he fancied that such an instrument\nmight be found in the younger Dionysius. If so, his expectations were\nspeedily disappointed. As Hegel acutely observes, only a man of half\nmeasures will allow himself to be guided by another; and such a man\nwould lack the energy needed to carry out Plato’s scheme.[158] However\nthis may be, the philosopher does not seem to have given up his idea\nthat absolute monarchy was, after all, the government from which most\ngood might be expected. A process of substitution which runs through\nhis whole intellectual evolution was here exemplified for the last\ntime. Just as in his ethical system knowledge, after having been\nregarded solely as the means for procuring an ulterior end, pleasure,\nsubsequently became an end in itself; just as the interest in knowledge\nwas superseded by a more absorbing interest in the dialectical\nmachinery which was to facilitate its acquisition, and this again by\nthe social re-organisation which was to make education a department of\nthe State; so also the beneficent despotism originally invoked for the\npurpose of establishing an aristocracy on the new model, came at last\nto be regarded by Plato as itself the best form of government. Such,\nat least, seems to be the drift of a remarkable Dialogue called the\n_Statesman_, which we agree with Prof. Jowett in placing immediately\nbefore the _Laws_. Some have denied its authenticity, and others have\nplaced it very early in the entire series of Platonic compositions.\nBut it contains passages of such blended wit and eloquence that no\nother man could have written them; and passages so destitute of life\nthat they could only have been written when his system had stiffened\ninto mathematical pedantry and scholastic routine. Moreover, it seems\ndistinctly to anticipate the scheme of detailed legislation which Plato\nspent his last years in elaborating. After covering with ridicule the\nnotion that a truly competent ruler should ever be hampered by written\nenactments, the principal spokesman acknowledges that, in the absence\nof such a ruler, a definite and unalterable code offers the best\nguarantees for political stability.\n\nThis code Plato set himself to construct in his last and longest work,\nthe _Laws_. Less than half of that Dialogue, however, is occupied\nwith the details of legislation. The remaining portions deal with the\nfamiliar topics of morality, religion, science, and education. The\nfirst book propounds a very curious theory of asceticism, which has\nnot, we believe, been taken up by any subsequent moralist. On the\nprinciple of _in vino veritas_ Plato proposes that drunkenness should\nbe systematically employed for the purpose of testing self-control.\nTrue temperance is not abstinence, but the power of resisting\ntemptation; and we can best discover to what extent any man possesses\nthat power by surprising him when off his guard. If he should be\nproof against seductive influences even when in his cups, we shall\nbe doubly sure of his constancy at other times. Prof. Jowett rather\nmaliciously suggests that a personal proclivity may have suggested\nthis extraordinary apology for hard drinking. Were it so, we should be\nreminded of the successive revelations by which indulgences of another\nkind were permitted to Mohammed, and of the one case in which divorce\nwas sanctioned by Auguste Comte. We should also remember that the\nChristian Puritanism to which Plato approached so near has always been\nsingularly lenient to this disgraceful vice. But perhaps a somewhat\nhigher order of considerations will help us to a better understanding\nof the paradox. Plato was averse from rejecting any tendency of his\nage that could possibly be turned to account in his philosophy.\nHence, as we have seen, the use which he makes of love, even under\nits most unlawful forms, in the _Symposium_ and the _Phaedrus_. Now,\nit would appear, from our scanty sources of information, that social\nfestivities, always very popular at Athens, had become the chief\ninterest in life about the time when Plato was composing his _Laws_.\nAccording to one graceful legend, the philosopher himself breathed his\nlast at a marriage-feast. It may, therefore, have occurred to him that\nthe prevalent tendency could, like the amorous passions of a former\ngeneration, be utilised for moral training and made subservient to the\nvery cause with which, at first sight, it seemed to conflict.\n\nThe concessions to common sense and to contemporary schools of thought,\nalready pointed out in those Dialogues which we suppose to have been\nwritten after the _Republic_, are still more conspicuous in the _Laws_.\nWe do not mean merely the project of a political constitution avowedly\noffered as the best possible in existing circumstances, though not\nthe best absolutely; but we mean that there is throughout a desire to\npresent philosophy from its most intelligible, practical, and popular\nside. The extremely rigorous standard of sexual morality (p. 838)\nseems, indeed, more akin to modern than to ancient notions, but it was\nin all probability borrowed from the naturalistic school of ethics,\nthe forerunner of Stoicism; for not only is there a direct appeal to\nNature’s teaching in that connexion; but throughout the entire work\nthe terms ‘nature’ and ‘naturally’ occur with greater frequency, we\nbelieve, than in all the rest of Plato’s writings put together. When,\non the other hand, it is asserted that men can be governed by no other\nmotive than pleasure (p. 663, B), we seem to see in this declaration\na concession to the Cyrenaic school, as well as a return to the\nforsaken standpoint of the _Protagoras_. The increasing influence of\nPythagoreanism is shown by the exaggerated importance attributed to\nexact numerical determinations. The theory of ideas is, as Prof. Jowett\nobserves, entirely absent, its place being taken by the distinction\nbetween mind and matter.[159]\n\nThe political constitution and code of laws recommended by Plato to\nhis new city are adapted to a great extent from the older legislation\nof Athens. As such they have supplied the historians of ancient\njurisprudence with some valuable indications. But from a philosophic\npoint of view the general impression produced is wearisome and even\noffensive. A universal system of espionage is established, and the\nodious trade of informer receives ample encouragement. Worst of all,\nit is proposed, in the true spirit of Athenian intolerance, to uphold\nreligious orthodoxy by persecuting laws. Plato had actually come to\nthink that disagreement with the vulgar theology was a folly and a\ncrime. One passage may be quoted as a warning to those who would set\nearly associations to do the work of reason; and who would overbear new\ntruths by a method which at one time might have been used with fatal\neffect against their own opinions:—\n\n Who can be calm when he is called upon to prove the existence of the\n gods? Who can avoid hating and abhorring the men who are and have been\n the cause of this argument? I speak of those who will not believe the\n words which they have heard as babes and sucklings from their mothers\n and nurses, repeated by them both in jest and earnest like charms;\n who have also heard and seen their parents offering up sacrifices and\n prayers—sights and sounds delightful to children—sacrificing, I say,\n in the most earnest manner on behalf of them and of themselves, and\n with eager interest talking to the gods and beseeching them as though\n they were firmly convinced of their existence; who likewise see and\n hear the genuflexions and prostrations which are made by Hellenes and\n barbarians to the rising and setting sun and moon, in all the various\n turns of good and evil fortune, not as if they thought that there\n were no gods, but as if there could be no doubt of their existence,\n and no suspicion of their non-existence; when men, knowing all these\n things, despise them on no real grounds, as would be admitted by all\n who have any particle of intelligence, and when they force us to say\n what we are now saying, how can any one in gentle terms remonstrate\n with the like of them, when he has to begin by proving to them the\n very existence of the gods?[160]\n\nLet it be remembered that the gods of whom Plato is speaking are the\nsun, moon, and stars; that the atheists whom he denounces only taught\nwhat we have long known to be true, which is that those luminaries\nare no more divine, no more animated, no more capable of accepting\nour sacrifices or responding to our cries than is the earth on which\nwe tread; and that he attempts to prove the contrary by arguments\nwhich, even if they were not inconsistent with all that we know about\nmechanics, would still be utterly inadequate to the purpose for which\nthey are employed.\n\nTurning back once more from the melancholy decline of a great genius\nto the splendour of its meridian prime, we will endeavour briefly\nto recapitulate the achievements which entitle Plato to rank among\nthe five or six greatest Greeks, and among the four or five greatest\nthinkers of all time. He extended the philosophy of mind until it\nembraced not only ethics and dialectics but also the study of politics,\nof religion, of social science, of fine art, of economy, of language,\nand of education. In other words, he showed how ideas could be applied\nto life on the most comprehensive scale. Further, he saw that the study\nof Mind, to be complete, necessitates a knowledge of physical phenomena\nand of the realities which underlie them; accordingly, he made a return\non the objective speculations which had been temporarily abandoned,\nthus mediating between Socrates and early Greek thought; while on\nthe other hand by his theory of classification he mediated between\nSocrates and Aristotle. He based physical science on mathematics, thus\nestablishing a method of research and of education which has continued\nin operation ever since. He sketched the outlines of a new religion in\nwhich morality was to be substituted for ritualism, and intelligent\nimitation of God for blind obedience to his will; a religion of\nmonotheism, of humanity, of purity, and of immortal life. And he\nembodied all these lessons in a series of compositions distinguished\nby such beauty of form that their literary excellence alone would\nentitle them to rank among the greatest masterpieces that the world\nhas ever seen. He took the recently-created instrument of prose style\nand at once raised it to the highest pitch of excellence that it has\never attained. Finding the new art already distorted by false taste and\noverlaid with meretricious ornament, he cleansed and regenerated it in\nthat primal fount of intellectual life, that richest, deepest, purest\nsource of joy, the conversation of enquiring spirits with one another,\nwhen they have awakened to the desire for truth and have not learned to\ndespair of its attainment. Thus it was that the philosopher’s mastery\nof expression gave added emphasis to his protest against those who made\nstyle a substitute for knowledge, or, by a worse corruption, perverted\nit into an instrument of profitable wrong. They moved along the surface\nin a confused world of words, of sensations, and of animal desires;\nhe penetrated through all those dumb images and blind instincts,\nto the central verity and supreme end which alone can inform them\nwith meaning, consistency, permanence, and value. To conclude: Plato\nbelonged to that nobly practical school of idealists who master all the\ndetails of reality before attempting its reformation, and accomplish\ntheir great designs by enlisting and reorganising whatever spontaneous\nforces are already working in the same direction; but the fertility of\nwhose own suggestions it needs more than one millennium to exhaust.\nThere is nothing in heaven or earth that was not dreamt of in his\nphilosophy: some of his dreams have already come true; others still\nawait their fulfilment; and even those which are irreconcilable with\nthe demands of experience will continue to be studied with the interest\nattaching to every generous and daring adventure, in the spiritual no\nless than in the secular order of existence.\n\n\nCHAPTER VI.\n\nCHARACTERISTICS OF ARISTOTLE.\n\n\nI.\n\nWithin the last twelve years several books, both large and small, have\nappeared, dealing either with the philosophy of Aristotle as a whole,\nor with the general principles on which it is constructed. The Berlin\nedition of Aristotle’s collected works was supplemented in 1870 by\nthe publication of a magnificent index, filling nearly nine hundred\nquarto pages, for which we have to thank the learning and industry of\nBonitz.[161] Then came the unfinished treatise of George Grote, planned\non so vast a scale that it would, if completely carried out, have\nrivalled the author’s _History of Greece_ in bulk, and perhaps exceeded\nthe authentic remains of the Stagirite himself. As it is, we have a\nfull account, expository and critical, of the _Organon_, a chapter on\nthe _De Animâ_, and some fragments on other Aristotelian writings, all\nmarked by Grote’s wonderful sagacity and good sense. In 1879 a new and\ngreatly enlarged edition brought that portion of Zeller’s work on Greek\nPhilosophy which deals with Aristotle and the Peripatetics[162] fully\nup to the level of its companion volumes; and we are glad to see that,\nlike them, it is shortly to appear in an English dress. The older work\nof Brandis[163] goes over the same ground, and, though much behind the\npresent state of knowledge, may still be consulted with advantage, on\naccount of its copious and clear analyses of the Aristotelian texts.\nTogether with these ponderous tomes, we have to mention the little\nwork of Sir Alexander Grant,[164] which, although intended primarily\nfor the unlearned, is a real contribution to Aristotelian scholarship,\nand, probably as such, received the honours of a German translation\nalmost immediately after its first publication. Mr. Edwin Wallace’s\n_Outlines of the Philosophy of Aristotle_[165] is of a different\nand much less popular character. Originally designed for the use of\nthe author’s own pupils, it does for Aristotle’s entire system what\nTrendelenburg has done for his logic, and Ritter and Preller for all\nGreek philosophy—that is to say, it brings together the most important\ntexts, and accompanies them with a remarkably lucid and interesting\ninterpretation. Finally we have M. Barthélemy Saint-Hilaire’s\nIntroduction to his translation of Aristotle’s _Metaphysics_,\nrepublished in a pocket volume.[166] We can safely recommend it to\nthose who wish to acquire a knowledge of the subject with the least\npossible expenditure of trouble. The style is delightfully simple,\nand that the author should write from the standpoint of the French\nspiritualistic school is not altogether a disadvantage, for that school\nis partly of Aristotelian origin, and its adherents are, therefore,\nmost likely to reproduce the master’s theories with sympathetic\nappreciation.\n\nIn view of such extensive labours, we might almost imagine ourselves\ntransported back to the times when Chaucer could describe a student as\nbeing made perfectly happy by having\n"
  }
]