# FIRST_TURN = """
# **-Goal-**
# A text document and a list of entity types are given.
# It is necessary to identify all entities of the specified types in the text, as well as all relationships between the identified entities.
#
# **-Steps-**
# 1. **Identify all entities.**
#     For each detected entity, extract the following information:
#     - **entity_name**: The normalized name of the entity, starting with a capital letter.
#         Normalization means reducing the word to its base form.
#         Example: рождеству → Рождество, кошек → Кошки, Павла → Павел.
#     - **entity_type**: The type of the entity.
#     The entity type must be one of the following: AGE, FAMILY, AWARD, IDEOLOGY, PERCENT, CITY, LANGUAGE, PERSON, COUNTRY, LAW, PRODUCT, CRIME, PENALTY, PROFESSION, DATE, MONEY, RELIGION, DISEASE, NATIONALITY, STATE_OR_PROV, ORDINAL, TIME, EVENT, DISTRICT, WORK_OF_ART, ORGANIZATION, FACILITY, NUMBER, LOCATION\n
#     - **description**: A detailed description of the entity according to the given text. The description must be precise and as complete as possible.
#
# 2. **Determine relationships between entities.**
#     Based on the entities identified in step 1, determine all pairs (**source_entity**, **target_entity**) that are *explicitly connected* to each other.
#     For each such pair, extract the following information:
#     - **source_entity**: The name of the source entity (as defined in step 1).
#     - **target_entity**: The name of the target entity (as defined in step 1).
#     - **relation_type**: The type of the relation.
#     The relation type must be one of the following: ABBREVIATION, AGE_DIED_AT, AGE_IS, AGENT, ALTERNATIVE_NAME, AWARDED_WITH, CAUSE_OF_DEATH, CONVICTED_OF, DATE_DEFUNCT_IN, DATE_FOUNDED_IN, DATE_OF_BIRTH, DATE_OF_CREATION, DATE_OF_DEATH, END_TIME, EXPENDITURE, FOUNDED_BY, HAS_CAUSE, HEADQUARTERED_IN, IDEOLOGY_OF, INANIMATE_INVOLVED, INCOME, KNOWS, LOCATED_IN, MEDICAL_CONDITION, MEMBER_OF, ORGANIZES, ORIGINS_FROM, OWNER_OF, PARENT_OF, PART_OF, PARTICIPANT_IN, PENALIZED_AS, PLACE_OF_BIRTH, PLACE_OF_DEATH, PLACE_RESIDES_IN, POINT_IN_TIME, PRICE_OF, PRODUCES, RELATIVE, RELIGION_OF, SCHOOLS_ATTENDED, SIBLING, SPOUSE, START_TIME, SUBEVENT_OF, SUBORDINATE_OF, TAKES_PLACE_IN, WORKPLACE, WORKS_AS
#     - **description**: A description of the relationship between the two entities.
#     - **relationship_strength**: A numeric value representing the strength of the relationship between the entities, ranging from 0 to 5,
#     where 0 = weak connection and 5 = strong connection.
#
# Text:
# Bjørnstjerne Martinius Bjørnson (/ˈbjɜːrnsən/ BYURN-sən,[1] Norwegian: [ˈbjø̂ːɳstjæːɳə mɑrˈtiːnɪʉ̂s ˈbjø̂ːɳsɔn]; 8 December 1832 – 26 April 1910) was a Norwegian writer who received the 1903 Nobel Prize in Literature "as a tribute to his noble, magnificent and versatile poetry, which has always been distinguished by both the freshness of its inspiration and the rare purity of its spirit". The first Norwegian Nobel laureate, he was a prolific polemicist and extremely influential in Norwegian public life and Scandinavian cultural debate.[2] Bjørnson is considered to be one of the four great Norwegian writers, alongside Ibsen, Lie, and Kielland.[3] He is also celebrated for his lyrics to the Norwegian national anthem, "Ja, vi elsker dette landet".[4] The composer Fredrikke Waaler based a composition for voice and piano (Spinnersken) on a text by Bjørnson, as did Anna Teichmüller (Die Prinzessin).
# Childhood and education
# a painting of the farmyard in winter shows the barn, house and outbuildings around a central yard.
# Bjørnson was born at the farmstead of Bjørgan in Kvikne, a secluded village in the Østerdalen district, some 60 miles (97 km) south of Trondheim. In 1837, Bjørnson's father Peder Bjørnson, who was the pastor of Kvikne Municipality, was transferred to the parish of Nesset Municipality, outside Molde in Romsdal. It was in this scenic district that Bjørnson spent his childhood, living at the Nesset Parsonage.
#
# Provide the answer in the following language: english
# Return the result as valid JSON matching the provided schema.
#
# {'$defs': {'EntityModel': {'properties': {'entity_name': {'description': 'Normalized entity name, capitalized', 'title': 'Entity Name', 'type': 'string'}, 'entity_type': {'description': 'Entity type', 'title': 'Entity Type', 'type': 'string'}, 'description': {'description': 'Detailed description of the entity from the text', 'title': 'Description', 'type': 'string'}}, 'required': ['entity_name', 'entity_type', 'description'], 'title': 'EntityModel', 'type': 'object'}, 'RelationModel': {'properties': {'source_entity': {'description': 'Name of the source entity (matches an Entity.entity_name)', 'title': 'Source Entity', 'type': 'string'}, 'target_entity': {'description': 'Name of the target entity (matches an Entity.entity_name)', 'title': 'Target Entity', 'type': 'string'}, 'relation_type': {'description': 'Type of relation', 'title': 'Relation Type', 'type': 'string'}, 'description': {'description': 'Description of the relationship', 'title': 'Description', 'type': 'string'}, 'relationship_strength': {'description': 'Relationship strength 0–5 (0 = weak, 5 = strong)', 'maximum': 5, 'minimum': 0, 'title': 'Relationship Strength', 'type': 'integer'}}, 'required': ['source_entity', 'target_entity', 'relation_type', 'description', 'relationship_strength'], 'title': 'RelationModel', 'type': 'object'}}, 'properties': {'entities': {'description': 'List of extracted entities', 'items': {'$ref': '#/$defs/EntityModel'}, 'title': 'Entities', 'type': 'array'}, 'relations': {'description': 'List of extracted relationships', 'items': {'$ref': '#/$defs/RelationModel'}, 'title': 'Relations', 'type': 'array'}}, 'title': 'ArtifactsModel', 'type': 'object'}
# """
#
# FIRST_TURN_RESPONSE = """
# {
#   "entities": [
#     {
#       "entity_name": "Bjørnstjerne Martinius Bjørnson",
#       "entity_type": "PERSON",
#       "description": "A Norwegian writer (also described as a prolific polemicist) who received the 1903 Nobel Prize in Literature and was extremely influential in Norwegian public life and Scandinavian cultural debate."
#     },
#     {
#       "entity_name": "Norwegian",
#       "entity_type": "NATIONALITY",
#       "description": "The nationality attributed to Bjørnstjerne Martinius Bjørnson in the text."
#     },
#     {
#       "entity_name": "8 December 1832",
#       "entity_type": "DATE",
#       "description": "The birth date of Bjørnstjerne Martinius Bjørnson."
#     },
#     {
#       "entity_name": "26 April 1910",
#       "entity_type": "DATE",
#       "description": "The death date of Bjørnstjerne Martinius Bjørnson."
#     },
#     {
#       "entity_name": "1903",
#       "entity_type": "DATE",
#       "description": "The year in which Bjørnstjerne Martinius Bjørnson received the Nobel Prize in Literature."
#     },
#     {
#       "entity_name": "Nobel Prize In Literature",
#       "entity_type": "AWARD",
#       "description": "A literary award that Bjørnstjerne Martinius Bjørnson received in 1903."
#     },
#     {
#       "entity_name": "Norway",
#       "entity_type": "COUNTRY",
#       "description": "The country associated with Bjørnson (he is described as Norwegian) and with the Norwegian national anthem referenced in the text."
#     },
#     {
#       "entity_name": "Scandinavia",
#       "entity_type": "LOCATION",
#       "description": "A region referenced in connection with Scandinavian cultural debate in which Bjørnson was influential."
#     },
#     {
#       "entity_name": "Ibsen",
#       "entity_type": "PERSON",
#       "description": "One of the four great Norwegian writers listed alongside Bjørnson."
#     },
#     {
#       "entity_name": "Lie",
#       "entity_type": "PERSON",
#       "description": "One of the four great Norwegian writers listed alongside Bjørnson."
#     },
#     {
#       "entity_name": "Kielland",
#       "entity_type": "PERSON",
#       "description": "One of the four great Norwegian writers listed alongside Bjørnson."
#     },
#     {
#       "entity_name": "Ja, Vi Elsker Dette Landet",
#       "entity_type": "WORK_OF_ART",
#       "description": "The Norwegian national anthem for which Bjørnson is celebrated for writing the lyrics."
#     },
#     {
#       "entity_name": "Fredrikke Waaler",
#       "entity_type": "PERSON",
#       "description": "A composer who based a composition for voice and piano on a text by Bjørnson."
#     },
#     {
#       "entity_name": "Spinnersken",
#       "entity_type": "WORK_OF_ART",
#       "description": "A composition for voice and piano by Fredrikke Waaler, based on a text by Bjørnson."
#     },
#     {
#       "entity_name": "Anna Teichmüller",
#       "entity_type": "PERSON",
#       "description": "A person who, like Fredrikke Waaler, based a work on a text by Bjørnson."
#     },
#     {
#       "entity_name": "Die Prinzessin",
#       "entity_type": "WORK_OF_ART",
#       "description": "A work by Anna Teichmüller that was based on a text by Bjørnson."
#     },
#     {
#       "entity_name": "Bjørgan",
#       "entity_type": "FACILITY",
#       "description": "The farmstead where Bjørnson was born."
#     },
#     {
#       "entity_name": "Kvikne",
#       "entity_type": "DISTRICT",
#       "description": "A secluded village where the farmstead Bjørgan is located and associated with Bjørnson’s birthplace."
#     },
#     {
#       "entity_name": "Østerdalen",
#       "entity_type": "DISTRICT",
#       "description": "The district in which Kvikne is located; described as a secluded district where Bjørnson was born."
#     },
#     {
#       "entity_name": "Trondheim",
#       "entity_type": "CITY",
#       "description": "A city referenced as a point of distance: Kvikne is described as some 60 miles (97 km) south of Trondheim."
#     },
#     {
#       "entity_name": "1837",
#       "entity_type": "DATE",
#       "description": "The year in which Bjørnson’s father was transferred from Kvikne Municipality to Nesset Municipality."
#     },
#     {
#       "entity_name": "Peder Bjørnson",
#       "entity_type": "PERSON",
#       "description": "Bjørnson’s father, described as the pastor of Kvikne Municipality who was transferred to Nesset Municipality in 1837."
#     },
#     {
#       "entity_name": "Kvikne Municipality",
#       "entity_type": "LOCATION",
#       "description": "A municipality where Peder Bjørnson served as pastor prior to his transfer in 1837."
#     },
#     {
#       "entity_name": "Nesset Municipality",
#       "entity_type": "LOCATION",
#       "description": "A municipality (outside Molde in Romsdal) to which Peder Bjørnson was transferred in 1837; the area where Bjørnson spent his childhood."
#     },
#     {
#       "entity_name": "Molde",
#       "entity_type": "CITY",
#       "description": "A city referenced as being outside/near the parish of Nesset Municipality."
#     },
#     {
#       "entity_name": "Romsdal",
#       "entity_type": "DISTRICT",
#       "description": "A district referenced as the area where Nesset Municipality is located (outside Molde in Romsdal)."
#     },
#     {
#       "entity_name": "Nesset Parsonage",
#       "entity_type": "FACILITY",
#       "description": "The parsonage where Bjørnson lived during his childhood after his father’s transfer to Nesset Municipality."
#     }
#   ],
#   "relations": [
#     {
#       "source_entity": "Bjørnstjerne Martinius Bjørnson",
#       "target_entity": "Norwegian",
#       "relation_type": "ORIGINS_FROM",
#       "description": "Bjørnson is described as a Norwegian writer, indicating he is associated with Norway by nationality.",
#       "relationship_strength": 4
#     },
#     {
#       "source_entity": "Bjørnstjerne Martinius Bjørnson",
#       "target_entity": "8 December 1832",
#       "relation_type": "DATE_OF_BIRTH",
#       "description": "The text states that Bjørnson was born on 8 December 1832.",
#       "relationship_strength": 5
#     },
#     {
#       "source_entity": "Bjørnstjerne Martinius Bjørnson",
#       "target_entity": "26 April 1910",
#       "relation_type": "DATE_OF_DEATH",
#       "description": "The text states that Bjørnson died on 26 April 1910.",
#       "relationship_strength": 5
#     },
#     {
#       "source_entity": "Bjørnstjerne Martinius Bjørnson",
#       "target_entity": "Nobel Prize In Literature",
#       "relation_type": "AWARDED_WITH",
#       "description": "Bjørnson received the Nobel Prize in Literature.",
#       "relationship_strength": 5
#     },
#     {
#       "source_entity": "Bjørnstjerne Martinius Bjørnson",
#       "target_entity": "1903",
#       "relation_type": "POINT_IN_TIME",
#       "description": "The text specifies that Bjørnson received the Nobel Prize in Literature in 1903.",
#       "relationship_strength": 4
#     },
#     {
#       "source_entity": "Bjørnstjerne Martinius Bjørnson",
#       "target_entity": "Ibsen",
#       "relation_type": "PART_OF",
#       "description": "Bjørnson is considered one of the four great Norwegian writers, listed alongside Ibsen.",
#       "relationship_strength": 2
#     },
#     {
#       "source_entity": "Bjørnstjerne Martinius Bjørnson",
#       "target_entity": "Lie",
#       "relation_type": "PART_OF",
#       "description": "Bjørnson is considered one of the four great Norwegian writers, listed alongside Lie.",
#       "relationship_strength": 2
#     },
#     {
#       "source_entity": "Bjørnstjerne Martinius Bjørnson",
#       "target_entity": "Kielland",
#       "relation_type": "PART_OF",
#       "description": "Bjørnson is considered one of the four great Norwegian writers, listed alongside Kielland.",
#       "relationship_strength": 2
#     },
#     {
#       "source_entity": "Bjørnstjerne Martinius Bjørnson",
#       "target_entity": "Ja, Vi Elsker Dette Landet",
#       "relation_type": "CREATED_BY",
#       "description": "Bjørnson is celebrated for his lyrics to the Norwegian national anthem titled \"Ja, vi elsker dette landet\".",
#       "relationship_strength": 4
#     },
#     {
#       "source_entity": "Fredrikke Waaler",
#       "target_entity": "Spinnersken",
#       "relation_type": "CREATED_BY",
#       "description": "Fredrikke Waaler composed the work titled \"Spinnersken\" for voice and piano.",
#       "relationship_strength": 4
#     },
#     {
#       "source_entity": "Spinnersken",
#       "target_entity": "Bjørnstjerne Martinius Bjørnson",
#       "relation_type": "BASED_ON",
#       "description": "The composition \"Spinnersken\" was based on a text by Bjørnson.",
#       "relationship_strength": 4
#     },
#     {
#       "source_entity": "Anna Teichmüller",
#       "target_entity": "Die Prinzessin",
#       "relation_type": "CREATED_BY",
#       "description": "Anna Teichmüller created the work titled \"Die Prinzessin\".",
#       "relationship_strength": 4
#     },
#     {
#       "source_entity": "Die Prinzessin",
#       "target_entity": "Bjørnstjerne Martinius Bjørnson",
#       "relation_type": "BASED_ON",
#       "description": "The work \"Die Prinzessin\" was based on a text by Bjørnson.",
#       "relationship_strength": 4
#     },
#     {
#       "source_entity": "Bjørnstjerne Martinius Bjørnson",
#       "target_entity": "Bjørgan",
#       "relation_type": "PLACE_OF_BIRTH",
#       "description": "The text states that Bjørnson was born at the farmstead of Bjørgan.",
#       "relationship_strength": 5
#     },
#     {
#       "source_entity": "Bjørgan",
#       "target_entity": "Kvikne",
#       "relation_type": "LOCATED_IN",
#       "description": "The farmstead Bjørgan is described as being in Kvikne.",
#       "relationship_strength": 5
#     },
#     {
#       "source_entity": "Kvikne",
#       "target_entity": "Østerdalen",
#       "relation_type": "LOCATED_IN",
#       "description": "Kvikne is described as a village in the Østerdalen district.",
#       "relationship_strength": 4
#     },
#     {
#       "source_entity": "Kvikne",
#       "target_entity": "Trondheim",
#       "relation_type": "LOCATED_IN",
#       "description": "Kvikne is described as some 60 miles (97 km) south of Trondheim (a location relationship by relative position).",
#       "relationship_strength": 2
#     },
#     {
#       "source_entity": "Bjørnstjerne Martinius Bjørnson",
#       "target_entity": "Peder Bjørnson",
#       "relation_type": "PARENT_OF",
#       "description": "Peder Bjørnson is identified as Bjørnson's father.",
#       "relationship_strength": 5
#     },
#     {
#       "source_entity": "Peder Bjørnson",
#       "target_entity": "Kvikne Municipality",
#       "relation_type": "WORKPLACE",
#       "description": "Peder Bjørnson is described as the pastor of Kvikne Municipality.",
#       "relationship_strength": 4
#     },
#     {
#       "source_entity": "Peder Bjørnson",
#       "target_entity": "Nesset Municipality",
#       "relation_type": "WORKPLACE",
#       "description": "In 1837, Peder Bjørnson was transferred to the parish of Nesset Municipality.",
#       "relationship_strength": 4
#     },
#     {
#       "source_entity": "Peder Bjørnson",
#       "target_entity": "1837",
#       "relation_type": "POINT_IN_TIME",
#       "description": "The transfer of Peder Bjørnson to Nesset Municipality occurred in 1837.",
#       "relationship_strength": 3
#     },
#     {
#       "source_entity": "Nesset Municipality",
#       "target_entity": "Molde",
#       "relation_type": "LOCATED_IN",
#       "description": "Nesset Municipality is described as being outside Molde.",
#       "relationship_strength": 3
#     },
#     {
#       "source_entity": "Nesset Municipality",
#       "target_entity": "Romsdal",
#       "relation_type": "LOCATED_IN",
#       "description": "Nesset Municipality is described as being in Romsdal.",
#       "relationship_strength": 3
#     },
#     {
#       "source_entity": "Bjørnstjerne Martinius Bjørnson",
#       "target_entity": "Nesset Parsonage",
#       "relation_type": "PLACE_RESIDES_IN",
#       "description": "Bjørnson spent his childhood living at the Nesset Parsonage.",
#       "relationship_strength": 4
#     },
#     {
#       "source_entity": "Nesset Parsonage",
#       "target_entity": "Nesset Municipality",
#       "relation_type": "LOCATED_IN",
#       "description": "The Nesset Parsonage is the parsonage associated with Nesset Municipality where Bjørnson lived.",
#       "relationship_strength": 4
#     }
#   ]
# }
# """
#
#
# SECOND_TURN = """
# **-Goal-**
# A text document and a list of entity types are given.
# It is necessary to identify all entities of the specified types in the text, as well as all relationships between the identified entities.
#
# **-Steps-**
# 1. **Identify all entities.**
#     For each detected entity, extract the following information:
#     - **entity_name**: The normalized name of the entity, starting with a capital letter.
#         Normalization means reducing the word to its base form.
#         Example: рождеству → Рождество, кошек → Кошки, Павла → Павел.
#     - **entity_type**: The type of the entity.
#     The entity type must be one of the following: AGE, FAMILY, AWARD, IDEOLOGY, PERCENT, CITY, LANGUAGE, PERSON, COUNTRY, LAW, PRODUCT, CRIME, PENALTY, PROFESSION, DATE, MONEY, RELIGION, DISEASE, NATIONALITY, STATE_OR_PROV, ORDINAL, TIME, EVENT, DISTRICT, WORK_OF_ART, ORGANIZATION, FACILITY, NUMBER, LOCATION\n
#     - **description**: A detailed description of the entity according to the given text. The description must be precise and as complete as possible.
#
# 2. **Determine relationships between entities.**
#     Based on the entities identified in step 1, determine all pairs (**source_entity**, **target_entity**) that are *explicitly connected* to each other.
#     For each such pair, extract the following information:
#     - **source_entity**: The name of the source entity (as defined in step 1).
#     - **target_entity**: The name of the target entity (as defined in step 1).
#     - **relation_type**: The type of the relation.
#     The relation type must be one of the following: ABBREVIATION, AGE_DIED_AT, AGE_IS, AGENT, ALTERNATIVE_NAME, AWARDED_WITH, CAUSE_OF_DEATH, CONVICTED_OF, DATE_DEFUNCT_IN, DATE_FOUNDED_IN, DATE_OF_BIRTH, DATE_OF_CREATION, DATE_OF_DEATH, END_TIME, EXPENDITURE, FOUNDED_BY, HAS_CAUSE, HEADQUARTERED_IN, IDEOLOGY_OF, INANIMATE_INVOLVED, INCOME, KNOWS, LOCATED_IN, MEDICAL_CONDITION, MEMBER_OF, ORGANIZES, ORIGINS_FROM, OWNER_OF, PARENT_OF, PART_OF, PARTICIPANT_IN, PENALIZED_AS, PLACE_OF_BIRTH, PLACE_OF_DEATH, PLACE_RESIDES_IN, POINT_IN_TIME, PRICE_OF, PRODUCES, RELATIVE, RELIGION_OF, SCHOOLS_ATTENDED, SIBLING, SPOUSE, START_TIME, SUBEVENT_OF, SUBORDINATE_OF, TAKES_PLACE_IN, WORKPLACE, WORKS_AS
#     - **description**: A description of the relationship between the two entities.
#     - **relationship_strength**: A numeric value representing the strength of the relationship between the entities, ranging from 0 to 5,
#     where 0 = weak connection and 5 = strong connection.
#
# Text:
# По завершении романа «Идиот» Достоевский задумал эпопею «Атеизм» (1869—1870), впоследствии изменив её название на «Житие великого грешника»[242]. Этот план не был осуществлён, но части замысла воплотились в 1870—1872 годах при подготовительной работе романа «Бесы», в 1874—1875 годах при написании романа «Подросток», и в 1878—1880 годах при создании романа «Братья Карамазовы»[243]. В августе 1869 года писатель приступил к написанию повести «Вечный муж»[244][245], текст которой через три месяца был отослан для публикации в журнале «3аря»[246]. Осенью того же года Достоевский одновременно работал над другими неосуществлёнными замыслами, вошедшими впоследствии в роман «Бесы», в частности персонаж одного из них — Картузов — воплотился в образ Лебядкина[247]. Обращает внимание помета писателя данного периода: «Всё кратко, по-пушкински, с самого начала без психологических тонкостей, с короткими фразами. Учиться писать»[248].
#
# Provide the answer in the following language: russian
# Return the result as valid JSON matching the provided schema.
#
# {'$defs': {'EntityModel': {'properties': {'entity_name': {'description': 'Normalized entity name, capitalized', 'title': 'Entity Name', 'type': 'string'}, 'entity_type': {'description': 'Entity type', 'title': 'Entity Type', 'type': 'string'}, 'description': {'description': 'Detailed description of the entity from the text', 'title': 'Description', 'type': 'string'}}, 'required': ['entity_name', 'entity_type', 'description'], 'title': 'EntityModel', 'type': 'object'}, 'RelationModel': {'properties': {'source_entity': {'description': 'Name of the source entity (matches an Entity.entity_name)', 'title': 'Source Entity', 'type': 'string'}, 'target_entity': {'description': 'Name of the target entity (matches an Entity.entity_name)', 'title': 'Target Entity', 'type': 'string'}, 'relation_type': {'description': 'Type of relation', 'title': 'Relation Type', 'type': 'string'}, 'description': {'description': 'Description of the relationship', 'title': 'Description', 'type': 'string'}, 'relationship_strength': {'description': 'Relationship strength 0–5 (0 = weak, 5 = strong)', 'maximum': 5, 'minimum': 0, 'title': 'Relationship Strength', 'type': 'integer'}}, 'required': ['source_entity', 'target_entity', 'relation_type', 'description', 'relationship_strength'], 'title': 'RelationModel', 'type': 'object'}}, 'properties': {'entities': {'description': 'List of extracted entities', 'items': {'$ref': '#/$defs/EntityModel'}, 'title': 'Entities', 'type': 'array'}, 'relations': {'description': 'List of extracted relationships', 'items': {'$ref': '#/$defs/RelationModel'}, 'title': 'Relations', 'type': 'array'}}, 'title': 'ArtifactsModel', 'type': 'object'}
# """
#
#
# SECOND_TURN_RESPONSE = """
# ```json
# {
#   "entities": [
#     {
#       "entity_name": "Достоевский",
#       "entity_type": "PERSON",
#       "description": "Писатель, который после завершения романа «Идиот» задумал эпопею «Атеизм», затем переименовал её в «Житие великого грешника», а также работал над повестью «Вечный муж» и подготовительными материалами к ряду романов."
#     },
#     {
#       "entity_name": "Идиот",
#       "entity_type": "WORK_OF_ART",
#       "description": "Роман, после завершения которого Достоевский задумал эпопею «Атеизм»."
#     },
#     {
#       "entity_name": "Атеизм",
#       "entity_type": "WORK_OF_ART",
#       "description": "Задуманная Достоевским эпопея (1869—1870), впоследствии переименованная в «Житие великого грешника»; план не был осуществлён."
#     },
#     {
#       "entity_name": "1869—1870",
#       "entity_type": "DATE",
#       "description": "Период, к которому относится замысел эпопеи «Атеизм»."
#     },
#     {
#       "entity_name": "Житие великого грешника",
#       "entity_type": "WORK_OF_ART",
#       "description": "Новое название эпопеи «Атеизм», на которое Достоевский впоследствии изменил первоначальный замысел."
#     },
#     {
#       "entity_name": "1870—1872",
#       "entity_type": "DATE",
#       "description": "Период, когда части неосуществлённого плана воплотились при подготовительной работе к роману «Бесы»."
#     },
#     {
#       "entity_name": "Бесы",
#       "entity_type": "WORK_OF_ART",
#       "description": "Роман Достоевского, в котором воплотились части более раннего неосуществлённого замысла; также упоминается, что осенью 1869 года Достоевский работал над неосуществлёнными замыслами, вошедшими впоследствии в этот роман."
#     },
#     {
#       "entity_name": "1874—1875",
#       "entity_type": "DATE",
#       "description": "Период, когда части замысла воплотились при написании романа «Подросток»."
#     },
#     {
#       "entity_name": "Подросток",
#       "entity_type": "WORK_OF_ART",
#       "description": "Роман Достоевского, при написании которого (1874—1875) воплотились части более раннего замысла."
#     },
#     {
#       "entity_name": "1878—1880",
#       "entity_type": "DATE",
#       "description": "Период, когда части замысла воплотились при создании романа «Братья Карамазовы»."
#     },
#     {
#       "entity_name": "Братья Карамазовы",
#       "entity_type": "WORK_OF_ART",
#       "description": "Роман Достоевского, при создании которого (1878—1880) воплотились части более раннего замысла."
#     },
#     {
#       "entity_name": "Август 1869",
#       "entity_type": "DATE",
#       "description": "Месяц и год, когда Достоевский приступил к написанию повести «Вечный муж»."
#     },
#     {
#       "entity_name": "Вечный муж",
#       "entity_type": "WORK_OF_ART",
#       "description": "Повесть, которую Достоевский начал писать в августе 1869 года; её текст через три месяца был отправлен для публикации в журнале «Заря»."
#     },
#     {
#       "entity_name": "Три месяца",
#       "entity_type": "TIME",
#       "description": "Промежуток времени после начала работы над «Вечным мужем», по истечении которого текст был отослан для публикации."
#     },
#     {
#       "entity_name": "Заря",
#       "entity_type": "WORK_OF_ART",
#       "description": "Журнал, в который был отослан для публикации текст повести «Вечный муж»."
#     },
#     {
#       "entity_name": "Осень 1869",
#       "entity_type": "DATE",
#       "description": "Период, когда Достоевский одновременно работал над другими неосуществлёнными замыслами, позднее вошедшими в роман «Бесы»."
#     },
#     {
#       "entity_name": "Картузов",
#       "entity_type": "PERSON",
#       "description": "Персонаж одного из неосуществлённых замыслов Достоевского осени 1869 года; впоследствии воплотился в образ Лебядкина."
#     },
#     {
#       "entity_name": "Лебядкин",
#       "entity_type": "PERSON",
#       "description": "Образ/персонаж, в котором воплотился персонаж Картузов из одного из ранних неосуществлённых замыслов."
#     },
#     {
#       "entity_name": "Пушкин",
#       "entity_type": "PERSON",
#       "description": "Автор, стиль которого упоминается в помете Достоевского: «по-пушкински», как ориентир на краткость и отсутствие психологических тонкостей."
#     }
#   ],
#   "relations": [
#     {
#       "source_entity": "Достоевский",
#       "target_entity": "Идиот",
#       "relation_type": "CREATED_BY",
#       "description": "В тексте говорится, что после завершения романа «Идиот» Достоевский задумал новый крупный замысел, что связывает автора с романом «Идиот».",
#       "relationship_strength": 4
#     },
#     {
#       "source_entity": "Достоевский",
#       "target_entity": "Атеизм",
#       "relation_type": "AGENT",
#       "description": "Достоевский задумал эпопею «Атеизм».",
#       "relationship_strength": 5
#     },
#     {
#       "source_entity": "Атеизм",
#       "target_entity": "1869—1870",
#       "relation_type": "POINT_IN_TIME",
#       "description": "Замысел эпопеи «Атеизм» относится к периоду 1869—1870 годов.",
#       "relationship_strength": 4
#     },
#     {
#       "source_entity": "Достоевский",
#       "target_entity": "Житие великого грешника",
#       "relation_type": "AGENT",
#       "description": "Достоевский впоследствии изменил название замысла на «Житие великого грешника».",
#       "relationship_strength": 4
#     },
#     {
#       "source_entity": "Атеизм",
#       "target_entity": "Житие великого грешника",
#       "relation_type": "ALTERNATIVE_NAME",
#       "description": "Замысел «Атеизм» впоследствии был переименован в «Житие великого грешника».",
#       "relationship_strength": 5
#     },
#     {
#       "source_entity": "Достоевский",
#       "target_entity": "Бесы",
#       "relation_type": "AGENT",
#       "description": "Части неосуществлённого плана воплотились при подготовительной работе романа «Бесы», а также упоминается работа Достоевского над замыслами, вошедшими позже в этот роман.",
#       "relationship_strength": 4
#     },
#     {
#       "source_entity": "Бесы",
#       "target_entity": "1870—1872",
#       "relation_type": "POINT_IN_TIME",
#       "description": "В 1870—1872 годах части замысла воплотились при подготовительной работе к роману «Бесы».",
#       "relationship_strength": 4
#     },
#     {
#       "source_entity": "Достоевский",
#       "target_entity": "Подросток",
#       "relation_type": "AGENT",
#       "description": "Части замысла воплотились при написании романа «Подросток».",
#       "relationship_strength": 4
#     },
#     {
#       "source_entity": "Подросток",
#       "target_entity": "1874—1875",
#       "relation_type": "POINT_IN_TIME",
#       "description": "В 1874—1875 годах части замысла воплотились при написании романа «Подросток».",
#       "relationship_strength": 4
#     },
#     {
#       "source_entity": "Достоевский",
#       "target_entity": "Братья Карамазовы",
#       "relation_type": "AGENT",
#       "description": "Части замысла воплотились при создании романа «Братья Карамазовы».",
#       "relationship_strength": 4
#     },
#     {
#       "source_entity": "Братья Карамазовы",
#       "target_entity": "1878—1880",
#       "relation_type": "POINT_IN_TIME",
#       "description": "В 1878—1880 годах части замысла воплотились при создании романа «Братья Карамазовы».",
#       "relationship_strength": 4
#     },
#     {
#       "source_entity": "Достоевский",
#       "target_entity": "Вечный муж",
#       "relation_type": "AGENT",
#       "description": "В августе 1869 года Достоевский приступил к написанию повести «Вечный муж».",
#       "relationship_strength": 5
#     },
#     {
#       "source_entity": "Вечный муж",
#       "target_entity": "Август 1869",
#       "relation_type": "START_TIME",
#       "description": "Начало работы над «Вечным мужем» датируется августом 1869 года.",
#       "relationship_strength": 4
#     },
#     {
#       "source_entity": "Вечный муж",
#       "target_entity": "Заря",
#       "relation_type": "PART_OF",
#       "description": "Текст «Вечного мужа» был отослан для публикации в журнал «Заря».",
#       "relationship_strength": 4
#     },
#     {
#       "source_entity": "Вечный муж",
#       "target_entity": "Три месяца",
#       "relation_type": "END_TIME",
#       "description": "Текст повести был отправлен на публикацию через три месяца после начала работы.",
#       "relationship_strength": 3
#     },
#     {
#       "source_entity": "Достоевский",
#       "target_entity": "Осень 1869",
#       "relation_type": "POINT_IN_TIME",
#       "description": "Осенью 1869 года Достоевский одновременно работал над другими неосуществлёнными замыслами, позднее вошедшими в роман «Бесы».",
#       "relationship_strength": 3
#     },
#     {
#       "source_entity": "Картузов",
#       "target_entity": "Лебядкин",
#       "relation_type": "ALTERNATIVE_NAME",
#       "description": "В тексте сказано, что персонаж одного из замыслов — Картузов — воплотился в образ Лебядкина.",
#       "relationship_strength": 4
#     },
#     {
#       "source_entity": "Достоевский",
#       "target_entity": "Пушкин",
#       "relation_type": "KNOWS",
#       "description": "В помете Достоевского указан ориентир «по-пушкински», что прямо связывает его с упоминанием Пушкина как образца стиля письма.",
#       "relationship_strength": 2
#     }
#   ]
# }
# ```
# """
#
# THIRD_TURN = """
# **-Goal-**
# A text document and a list of entity types are given.
# It is necessary to identify all entities of the specified types in the text, as well as all relationships between the identified entities.
#
# **-Steps-**
# 1. **Identify all entities.**
#     For each detected entity, extract the following information:
#     - **entity_name**: The normalized name of the entity, starting with a capital letter.
#         Normalization means reducing the word to its base form.
#         Example: рождеству → Рождество, кошек → Кошки, Павла → Павел.
#     - **entity_type**: The type of the entity.
#     The entity type must be one of the following: AGE, FAMILY, AWARD, IDEOLOGY, PERCENT, CITY, LANGUAGE, PERSON, COUNTRY, LAW, PRODUCT, CRIME, PENALTY, PROFESSION, DATE, MONEY, RELIGION, DISEASE, NATIONALITY, STATE_OR_PROV, ORDINAL, TIME, EVENT, DISTRICT, WORK_OF_ART, ORGANIZATION, FACILITY, NUMBER, LOCATION\n
#     - **description**: A detailed description of the entity according to the given text. The description must be precise and as complete as possible.
#
# 2. **Determine relationships between entities.**
#     Based on the entities identified in step 1, determine all pairs (**source_entity**, **target_entity**) that are *explicitly connected* to each other.
#     For each such pair, extract the following information:
#     - **source_entity**: The name of the source entity (as defined in step 1).
#     - **target_entity**: The name of the target entity (as defined in step 1).
#     - **relation_type**: The type of the relation.
#     The relation type must be one of the following: ABBREVIATION, AGE_DIED_AT, AGE_IS, AGENT, ALTERNATIVE_NAME, AWARDED_WITH, CAUSE_OF_DEATH, CONVICTED_OF, DATE_DEFUNCT_IN, DATE_FOUNDED_IN, DATE_OF_BIRTH, DATE_OF_CREATION, DATE_OF_DEATH, END_TIME, EXPENDITURE, FOUNDED_BY, HAS_CAUSE, HEADQUARTERED_IN, IDEOLOGY_OF, INANIMATE_INVOLVED, INCOME, KNOWS, LOCATED_IN, MEDICAL_CONDITION, MEMBER_OF, ORGANIZES, ORIGINS_FROM, OWNER_OF, PARENT_OF, PART_OF, PARTICIPANT_IN, PENALIZED_AS, PLACE_OF_BIRTH, PLACE_OF_DEATH, PLACE_RESIDES_IN, POINT_IN_TIME, PRICE_OF, PRODUCES, RELATIVE, RELIGION_OF, SCHOOLS_ATTENDED, SIBLING, SPOUSE, START_TIME, SUBEVENT_OF, SUBORDINATE_OF, TAKES_PLACE_IN, WORKPLACE, WORKS_AS
#     - **description**: A description of the relationship between the two entities.
#     - **relationship_strength**: A numeric value representing the strength of the relationship between the entities, ranging from 0 to 5,
#     where 0 = weak connection and 5 = strong connection.
#
# Text:
# Guido van Rossum began working on Python in the late 1980s as a successor to the ABC programming language. Python 3.0, released in 2008, was a major revision and not completely backward-compatible with earlier versions. Beginning with Python 3.5,[34] capabilities and keywords for typing were added to the language, allowing optional static typing.[35] As of 2026, the Python Software Foundation supports Python 3.10, 3.11, 3.12, 3.13, and 3.14, following the project's annual release cycle and five-year support policy. Python 3.15 is currently in the alpha development phase, and the stable release is expected to come out in October 2026."[36]Earlier versions in the 3.x series have reached end-of-life and no longer receive security updates.
#
# Provide the answer in the following language: english
# Return the result as valid JSON matching the provided schema.
#
# {'$defs': {'EntityModel': {'properties': {'entity_name': {'description': 'Normalized entity name, capitalized', 'title': 'Entity Name', 'type': 'string'}, 'entity_type': {'description': 'Entity type', 'title': 'Entity Type', 'type': 'string'}, 'description': {'description': 'Detailed description of the entity from the text', 'title': 'Description', 'type': 'string'}}, 'required': ['entity_name', 'entity_type', 'description'], 'title': 'EntityModel', 'type': 'object'}, 'RelationModel': {'properties': {'source_entity': {'description': 'Name of the source entity (matches an Entity.entity_name)', 'title': 'Source Entity', 'type': 'string'}, 'target_entity': {'description': 'Name of the target entity (matches an Entity.entity_name)', 'title': 'Target Entity', 'type': 'string'}, 'relation_type': {'description': 'Type of relation', 'title': 'Relation Type', 'type': 'string'}, 'description': {'description': 'Description of the relationship', 'title': 'Description', 'type': 'string'}, 'relationship_strength': {'description': 'Relationship strength 0–5 (0 = weak, 5 = strong)', 'maximum': 5, 'minimum': 0, 'title': 'Relationship Strength', 'type': 'integer'}}, 'required': ['source_entity', 'target_entity', 'relation_type', 'description', 'relationship_strength'], 'title': 'RelationModel', 'type': 'object'}}, 'properties': {'entities': {'description': 'List of extracted entities', 'items': {'$ref': '#/$defs/EntityModel'}, 'title': 'Entities', 'type': 'array'}, 'relations': {'description': 'List of extracted relationships', 'items': {'$ref': '#/$defs/RelationModel'}, 'title': 'Relations', 'type': 'array'}}, 'title': 'ArtifactsModel', 'type': 'object'}
# """
#
#
# THIRD_TURN_RESPONSE = """
# {
#   "entities": [
#     {
#       "entity_name": "Guido Van Rossum",
#       "entity_type": "PERSON",
#       "description": "A person who began working on Python in the late 1980s, with Python described as a successor to the ABC programming language."
#     },
#     {
#       "entity_name": "Python",
#       "entity_type": "PRODUCT",
#       "description": "A programming language that Guido van Rossum began working on in the late 1980s; it has multiple versions including the 3.x series and receives ongoing releases and support."
#     },
#     {
#       "entity_name": "Late 1980s",
#       "entity_type": "DATE",
#       "description": "The time period when Guido van Rossum began working on Python."
#     },
#     {
#       "entity_name": "ABC",
#       "entity_type": "PRODUCT",
#       "description": "A programming language described as the predecessor, with Python developed as its successor."
#     },
#     {
#       "entity_name": "Python 3.0",
#       "entity_type": "PRODUCT",
#       "description": "A version of Python released in 2008; described as a major revision and not completely backward-compatible with earlier versions."
#     },
#     {
#       "entity_name": "2008",
#       "entity_type": "DATE",
#       "description": "The year when Python 3.0 was released."
#     },
#     {
#       "entity_name": "Python 3.5",
#       "entity_type": "PRODUCT",
#       "description": "A Python version from which capabilities and keywords for typing were added, enabling optional static typing."
#     },
#     {
#       "entity_name": "Typing",
#       "entity_type": "PRODUCT",
#       "description": "Capabilities and keywords added to the Python language beginning with Python 3.5, enabling optional static typing."
#     },
#     {
#       "entity_name": "Static typing",
#       "entity_type": "PRODUCT",
#       "description": "An optional typing approach enabled in Python by the addition of typing capabilities and keywords (beginning with Python 3.5)."
#     },
#     {
#       "entity_name": "2026",
#       "entity_type": "DATE",
#       "description": "A reference year in the text describing which Python versions are supported by the Python Software Foundation and the expected timing for Python 3.15."
#     },
#     {
#       "entity_name": "Python Software Foundation",
#       "entity_type": "ORGANIZATION",
#       "description": "An organization that, as of 2026, supports Python versions 3.10, 3.11, 3.12, 3.13, and 3.14 under an annual release cycle and five-year support policy."
#     },
#     {
#       "entity_name": "Python 3.10",
#       "entity_type": "PRODUCT",
#       "description": "A Python version listed as supported by the Python Software Foundation as of 2026."
#     },
#     {
#       "entity_name": "Python 3.11",
#       "entity_type": "PRODUCT",
#       "description": "A Python version listed as supported by the Python Software Foundation as of 2026."
#     },
#     {
#       "entity_name": "Python 3.12",
#       "entity_type": "PRODUCT",
#       "description": "A Python version listed as supported by the Python Software Foundation as of 2026."
#     },
#     {
#       "entity_name": "Python 3.13",
#       "entity_type": "PRODUCT",
#       "description": "A Python version listed as supported by the Python Software Foundation as of 2026."
#     },
#     {
#       "entity_name": "Python 3.14",
#       "entity_type": "PRODUCT",
#       "description": "A Python version listed as supported by the Python Software Foundation as of 2026."
#     },
#     {
#       "entity_name": "Annual release cycle",
#       "entity_type": "EVENT",
#       "description": "The project's release pattern referenced to explain how supported Python versions are maintained."
#     },
#     {
#       "entity_name": "Five-year support policy",
#       "entity_type": "LAW",
#       "description": "A support policy referenced alongside the annual release cycle to describe how long Python releases are supported."
#     },
#     {
#       "entity_name": "Python 3.15",
#       "entity_type": "PRODUCT",
#       "description": "A Python version described as currently in the alpha development phase, with a stable release expected in October 2026."
#     },
#     {
#       "entity_name": "Alpha development phase",
#       "entity_type": "EVENT",
#       "description": "The development stage in which Python 3.15 is described as currently being."
#     },
#     {
#       "entity_name": "October 2026",
#       "entity_type": "DATE",
#       "description": "The expected time when the stable release of Python 3.15 is stated to come out."
#     },
#     {
#       "entity_name": "3.x series",
#       "entity_type": "PRODUCT",
#       "description": "A series of Python versions; the text notes that earlier versions in the 3.x series have reached end-of-life and no longer receive security updates."
#     },
#     {
#       "entity_name": "End-of-life",
#       "entity_type": "EVENT",
#       "description": "A lifecycle status indicating that earlier 3.x versions no longer receive security updates."
#     },
#     {
#       "entity_name": "Security updates",
#       "entity_type": "PRODUCT",
#       "description": "Updates that earlier 3.x versions no longer receive after reaching end-of-life."
#     }
#   ],
#   "relations": [
#     {
#       "source_entity": "Guido Van Rossum",
#       "target_entity": "Python",
#       "relation_type": "AGENT",
#       "description": "Guido van Rossum began working on Python in the late 1980s.",
#       "relationship_strength": 5
#     },
#     {
#       "source_entity": "Python",
#       "target_entity": "Late 1980s",
#       "relation_type": "START_TIME",
#       "description": "Work on Python began in the late 1980s.",
#       "relationship_strength": 4
#     },
#     {
#       "source_entity": "Python",
#       "target_entity": "ABC",
#       "relation_type": "PART_OF",
#       "description": "Python is described as a successor to the ABC programming language, explicitly linking Python to ABC as its predecessor.",
#       "relationship_strength": 4
#     },
#     {
#       "source_entity": "Python 3.0",
#       "target_entity": "Python",
#       "relation_type": "PART_OF",
#       "description": "Python 3.0 is a version within the Python language family.",
#       "relationship_strength": 5
#     },
#     {
#       "source_entity": "Python 3.0",
#       "target_entity": "2008",
#       "relation_type": "DATE_OF_CREATION",
#       "description": "Python 3.0 was released in 2008.",
#       "relationship_strength": 5
#     },
#     {
#       "source_entity": "Python 3.0",
#       "target_entity": "3.x series",
#       "relation_type": "PART_OF",
#       "description": "Python 3.0 is part of the 3.x series of Python versions.",
#       "relationship_strength": 4
#     },
#     {
#       "source_entity": "Python 3.5",
#       "target_entity": "Python",
#       "relation_type": "PART_OF",
#       "description": "Python 3.5 is a version within the Python language family.",
#       "relationship_strength": 5
#     },
#     {
#       "source_entity": "Typing",
#       "target_entity": "Python",
#       "relation_type": "PART_OF",
#       "description": "Typing capabilities and keywords were added to the Python language beginning with Python 3.5.",
#       "relationship_strength": 4
#     },
#     {
#       "source_entity": "Typing",
#       "target_entity": "Python 3.5",
#       "relation_type": "START_TIME",
#       "description": "The addition of typing capabilities and keywords is stated to begin with Python 3.5.",
#       "relationship_strength": 4
#     },
#     {
#       "source_entity": "Typing",
#       "target_entity": "Static typing",
#       "relation_type": "HAS_CAUSE",
#       "description": "Typing capabilities and keywords enabled optional static typing in the language.",
#       "relationship_strength": 4
#     },
#     {
#       "source_entity": "Python Software Foundation",
#       "target_entity": "Python 3.10",
#       "relation_type": "MEMBER_OF",
#       "description": "As of 2026, the Python Software Foundation supports Python 3.10.",
#       "relationship_strength": 5
#     },
#     {
#       "source_entity": "Python Software Foundation",
#       "target_entity": "Python 3.11",
#       "relation_type": "MEMBER_OF",
#       "description": "As of 2026, the Python Software Foundation supports Python 3.11.",
#       "relationship_strength": 5
#     },
#     {
#       "source_entity": "Python Software Foundation",
#       "target_entity": "Python 3.12",
#       "relation_type": "MEMBER_OF",
#       "description": "As of 2026, the Python Software Foundation supports Python 3.12.",
#       "relationship_strength": 5
#     },
#     {
#       "source_entity": "Python Software Foundation",
#       "target_entity": "Python 3.13",
#       "relation_type": "MEMBER_OF",
#       "description": "As of 2026, the Python Software Foundation supports Python 3.13.",
#       "relationship_strength": 5
#     },
#     {
#       "source_entity": "Python Software Foundation",
#       "target_entity": "Python 3.14",
#       "relation_type": "MEMBER_OF",
#       "description": "As of 2026, the Python Software Foundation supports Python 3.14.",
#       "relationship_strength": 5
#     },
#     {
#       "source_entity": "Python Software Foundation",
#       "target_entity": "Annual release cycle",
#       "relation_type": "PART_OF",
#       "description": "The Python Software Foundation's support is described as following the project's annual release cycle.",
#       "relationship_strength": 3
#     },
#     {
#       "source_entity": "Python Software Foundation",
#       "target_entity": "Five-year support policy",
#       "relation_type": "PART_OF",
#       "description": "The Python Software Foundation's support is described as following a five-year support policy.",
#       "relationship_strength": 3
#     },
#     {
#       "source_entity": "Python 3.15",
#       "target_entity": "Alpha development phase",
#       "relation_type": "PART_OF",
#       "description": "Python 3.15 is stated to be currently in the alpha development phase.",
#       "relationship_strength": 4
#     },
#     {
#       "source_entity": "Python 3.15",
#       "target_entity": "October 2026",
#       "relation_type": "POINT_IN_TIME",
#       "description": "The stable release of Python 3.15 is expected to come out in October 2026.",
#       "relationship_strength": 4
#     },
#     {
#       "source_entity": "3.x series",
#       "target_entity": "End-of-life",
#       "relation_type": "HAS_CAUSE",
#       "description": "Earlier versions in the 3.x series have reached end-of-life.",
#       "relationship_strength": 3
#     },
#     {
#       "source_entity": "End-of-life",
#       "target_entity": "Security updates",
#       "relation_type": "HAS_CAUSE",
#       "description": "After reaching end-of-life, earlier versions no longer receive security updates.",
#       "relationship_strength": 4
#     }
#   ]
# }
# """