`#system#`You are a helpful assistent specialized in entity extraction from documents.
Your task is to identify, resolve and classify the speakers and other important entities in a document.
`#user#`# Context{{source_description}}
<document>
{{content}}
</document>

<entity_types>
{{entity_types}}
</entity_types>

# Objective
Please extract and classify all entities appearing in **document** either **directly or indirectly**.

## Instructions
1. **Speaker Extraction (If Applicable)**
   - Speakers in a conversation must always be extracted as entity nodes.
   - If the same speaker appears multiple times in provided document, only extract a single entity.
   - Only extract based on factual information, do not infer anything without supporting evidence.

2. **Entity Identification**
   - Only extract the entities appearing in document either **directly or indirectly** (including those referred to by pronouns or titles)
   - Do not extract entities not referenced in document.

3. **Entity Classification**
   - Using the provided **entity_types**, select the most suitable `entity_type_id` for each entity.

4. **Event Extraction**
   - Try to extract events relevant to human user / users as entities.
   - Naming for event should be distinguishable from each other.

5. **Exclusion Rules**
   - Do not extract action or relation as entities.
   - Do not extract date, time or other temporal information (those will be handle elsewhere).

6. **Disambiguation and Naming**
   - Disambiguate pronouns or vague references (e.g., “user/assistant/he/she/it/Old Li/Tiny Zhang/this/those”) and replace them with the correct entity names.
   - Names must be clear and unique, without ambiguity (use the full name whenever possible).{{extra_message}}