394 lines
18 KiB
JSON
394 lines
18 KiB
JSON
{
|
||
"trace_id": "EwP7Fn4s_b8B8U",
|
||
"timestamp": "2026-03-23T13:52:54.527Z",
|
||
"model": "gpt-4o-mini",
|
||
"prompt_version": "normalizer_v1",
|
||
"schema_version": "v1",
|
||
"user_question_raw": "По каким поставщикам не бьются взаиморасчеты по 60 счету, и разложи это по документам, оплатам и закрывающим?",
|
||
"context": {
|
||
"period_hint": "2020-06",
|
||
"business_context": "предзакрытие июня, проверка взаиморасчетов с поставщиками",
|
||
"expected_route": "hybrid_store_plus_live"
|
||
},
|
||
"request_payload_redacted": {
|
||
"model": "gpt-4o-mini",
|
||
"baseUrl": "https://api.openai.com/v1",
|
||
"temperature": 0,
|
||
"maxOutputTokens": 900,
|
||
"systemPrompt": "Ты semantic-normalizer для бухгалтерского ассистента NDC.\nТвоя роль: только нормализация запроса пользователя в строгий JSON-контракт.\n\nЖесткие правила:\n1) Не давай бухгалтерский ответ по сути вопроса.\n2) Возвращай только JSON без markdown и пояснений.\n3) JSON обязан соответствовать переданной schema normalized_query_v1.\n4) Если период не указан, не выдумывай его; отмечай ambiguity.\n5) Для цепочек документов/проводок/оплат поднимай causal и cross-entity признаки.\n6) Для точечного object trace (номер/строка/ref) поднимай needs_exact_object_trace=true.\n7) Используй терминологию NDC.",
|
||
"developerPrompt": "Классификация intent_class:\n- heavy_analytical: общий агрегированный риск-срез, рейтинг, приоритизация.\n- cross_entity: связки между документами/проводками/оплатами/договорами/контрагентами.\n- drilldown_explain: точечное объяснение причин по объекту или малому набору объектов.\n- rule_based_account_control: контрольные правила по счетам (ОС, 97, 10 и т.п.).\n- anomaly_probe: поиск нетипичных паттернов.\n- period_close_risk: фокус на предзакрытии периода.\n- ambiguous_human_query: широкая человеческая формулировка без точного scope.\n- simple_factual: простой факт без сложной аналитики.\n\nПравила route_hint:\n- live_mcp_drilldown: если точечный object trace.\n- hybrid_store_plus_live: если cross_entity + causal explain.\n- batch_refresh_then_store: если full-period heavy aggregate/ranking без готовой агрегации.\n- store_feature_risk: если тренд/аномалии/контроли, когда точечный runtime не обязателен.\n- store_canonical: простые факты и легкие запросы при достаточном контексте.\n\nПравила requires:\n- needs_cross_entity_join=true для связок между разными сущностями.\n- needs_causal_chain=true для формулировок \"почему\", \"чем подтверждается\", \"разложи цепочку\".\n- needs_exact_object_trace=true для конкретного документа/проводки/строки/номера/ref.\n- needs_period_cut=true если вопрос про конец периода или периодную сверку.\n- needs_evidence=true если требуется подтверждение документами/движениями/проводками.",
|
||
"domainPrompt": "Домен бухгалтерии:\n- ключевые счета: 01, 02, 10, 41, 51, 60, 62, 68.02, 90, 97;\n- сущности: контрагент, договор, реализация, поступление, оплата, проводка, регистр;\n- типовые паттерны: \"не бьется\", \"хвост\", \"акт сверки\", \"закрывающие\", \"реализация без оплаты\";\n- товарные аномалии: \"продажа раньше прихода\", \"подозрительный остаток\";\n- ОС: \"амортизационная группа\", \"срок амортизации\", \"карточка ОС\";\n- банк: \"выписка\", \"движение по 51\", \"разрыв цепочки документ-проводка\";\n- периодная аналитика: предзакрытие, риск-срез, приоритизация ручных проверок.\n\nЕсли присутствуют одновременно риск-слова и document/payment/posting chain,\nне понижать сценарий до чистого risk-route автоматически.",
|
||
"fewShotExamples": "Q: По каким покупателям у нас отгрузки без оплаты на конец июня, свяжи с реализациями, договорами и проводками.\nExpected:\n{\n \"intent_class\": \"cross_entity\",\n \"requires\": {\n \"needs_cross_entity_join\": true,\n \"needs_causal_chain\": true,\n \"needs_exact_object_trace\": false\n },\n \"expected_output_shape\": \"reconciliation_report\",\n \"route_hint\": \"hybrid_store_plus_live\"\n}\n\nQ: Сделай рейтинг самых рисковых счетов перед закрытием июня.\nExpected:\n{\n \"intent_class\": \"heavy_analytical\",\n \"requires\": {\n \"needs_ranking\": true,\n \"needs_period_cut\": true\n },\n \"expected_output_shape\": \"ranked_list\",\n \"route_hint\": \"batch_refresh_then_store\"\n}\n\nQ: Покажи документ №123 и проводку по нему, нужна точная строка.\nExpected:\n{\n \"intent_class\": \"drilldown_explain\",\n \"requires\": {\n \"needs_exact_object_trace\": true,\n \"needs_runtime_truth\": true\n },\n \"expected_output_shape\": \"evidence_chain\",\n \"route_hint\": \"live_mcp_drilldown\"\n}",
|
||
"userQuestion": "По каким поставщикам не бьются взаиморасчеты по 60 счету, и разложи это по документам, оплатам и закрывающим?",
|
||
"context": {
|
||
"period_hint": "2020-06",
|
||
"business_context": "предзакрытие июня, проверка взаиморасчетов с поставщиками",
|
||
"expected_route": "hybrid_store_plus_live"
|
||
},
|
||
"saveAsTestCase": true,
|
||
"useMock": false
|
||
},
|
||
"raw_model_response": {
|
||
"id": "resp_0991c151f3001bef0069c145af2910819da31ec2a01febdc5f",
|
||
"object": "response",
|
||
"created_at": 1774273967,
|
||
"status": "completed",
|
||
"background": false,
|
||
"billing": {
|
||
"payer": "developer"
|
||
},
|
||
"completed_at": 1774273974,
|
||
"error": null,
|
||
"frequency_penalty": 0,
|
||
"incomplete_details": null,
|
||
"instructions": null,
|
||
"max_output_tokens": 900,
|
||
"max_tool_calls": null,
|
||
"model": "gpt-4o-mini-2024-07-18",
|
||
"output": [
|
||
{
|
||
"id": "msg_0991c151f3001bef0069c145b03714819d8147be145dfcf66f",
|
||
"type": "message",
|
||
"status": "completed",
|
||
"content": [
|
||
{
|
||
"type": "output_text",
|
||
"annotations": [],
|
||
"logprobs": [],
|
||
"text": "{\n \"schema_version\": \"normalized_query_v1\",\n \"user_question_raw\": \"По каким поставщикам не бьются взаиморасчеты по 60 счету, и разложи это по документам, оплатам и закрывающим?\",\n \"normalized_question\": \"Не бьются взаиморасчеты по 60 счету по поставщикам, разложить по документам, оплатам и закрывающим.\",\n \"intent_class\": \"cross_entity\",\n \"business_problem_type\": \"анализ взаиморасчетов\",\n \"domain_entities\": [\"контрагент\", \"договор\", \"оплата\", \"проводка\"],\n \"accounts_mentioned\": [\"60\"],\n \"documents_mentioned\": [],\n \"registers_mentioned\": [],\n \"period_scope\": {\n \"type\": \"missing\",\n \"value\": null,\n \"confidence\": \"low\"\n },\n \"requires\": {\n \"needs_cross_entity_join\": true,\n \"needs_causal_chain\": true,\n \"needs_exact_object_trace\": false\n ,\n \"needs_ranking\": false,\n \"needs_anomaly_summary\": false,\n \"needs_runtime_truth\": false,\n \"needs_period_cut\": false,\n \"needs_evidence\": true\n },\n \"expected_output_shape\": \"reconciliation_report\",\n \"route_hint\": \"hybrid_store_plus_live\",\n \"ambiguities\": [],\n \"confidence\": {\n \"overall\": \"medium\",\n \"intent_class\": \"medium\",\n \"route_hint\": \"medium\"\n }\n}"
|
||
}
|
||
],
|
||
"role": "assistant"
|
||
}
|
||
],
|
||
"parallel_tool_calls": true,
|
||
"presence_penalty": 0,
|
||
"previous_response_id": null,
|
||
"prompt_cache_key": null,
|
||
"prompt_cache_retention": null,
|
||
"reasoning": {
|
||
"effort": null,
|
||
"summary": null
|
||
},
|
||
"safety_identifier": null,
|
||
"service_tier": "default",
|
||
"store": true,
|
||
"temperature": 0,
|
||
"text": {
|
||
"format": {
|
||
"type": "json_schema",
|
||
"description": null,
|
||
"name": "normalized_query_v1",
|
||
"schema": {
|
||
"$id": "normalized_query_v1",
|
||
"title": "Normalized Query V1",
|
||
"type": "object",
|
||
"additionalProperties": false,
|
||
"required": [
|
||
"schema_version",
|
||
"user_question_raw",
|
||
"normalized_question",
|
||
"intent_class",
|
||
"business_problem_type",
|
||
"domain_entities",
|
||
"accounts_mentioned",
|
||
"documents_mentioned",
|
||
"registers_mentioned",
|
||
"period_scope",
|
||
"requires",
|
||
"expected_output_shape",
|
||
"route_hint",
|
||
"ambiguities",
|
||
"confidence"
|
||
],
|
||
"properties": {
|
||
"schema_version": {
|
||
"type": "string",
|
||
"const": "normalized_query_v1"
|
||
},
|
||
"user_question_raw": {
|
||
"type": "string",
|
||
"minLength": 1
|
||
},
|
||
"normalized_question": {
|
||
"type": "string",
|
||
"minLength": 1
|
||
},
|
||
"intent_class": {
|
||
"type": "string",
|
||
"enum": [
|
||
"heavy_analytical",
|
||
"cross_entity",
|
||
"drilldown_explain",
|
||
"rule_based_account_control",
|
||
"anomaly_probe",
|
||
"period_close_risk",
|
||
"ambiguous_human_query",
|
||
"simple_factual"
|
||
]
|
||
},
|
||
"business_problem_type": {
|
||
"type": "string",
|
||
"minLength": 1
|
||
},
|
||
"domain_entities": {
|
||
"type": "array",
|
||
"items": {
|
||
"type": "string"
|
||
}
|
||
},
|
||
"accounts_mentioned": {
|
||
"type": "array",
|
||
"items": {
|
||
"type": "string"
|
||
}
|
||
},
|
||
"documents_mentioned": {
|
||
"type": "array",
|
||
"items": {
|
||
"type": "string"
|
||
}
|
||
},
|
||
"registers_mentioned": {
|
||
"type": "array",
|
||
"items": {
|
||
"type": "string"
|
||
}
|
||
},
|
||
"period_scope": {
|
||
"type": "object",
|
||
"additionalProperties": false,
|
||
"required": [
|
||
"type",
|
||
"value",
|
||
"confidence"
|
||
],
|
||
"properties": {
|
||
"type": {
|
||
"type": "string",
|
||
"enum": [
|
||
"explicit",
|
||
"inferred",
|
||
"missing"
|
||
]
|
||
},
|
||
"value": {
|
||
"type": [
|
||
"string",
|
||
"null"
|
||
]
|
||
},
|
||
"confidence": {
|
||
"type": "string",
|
||
"enum": [
|
||
"high",
|
||
"medium",
|
||
"low"
|
||
]
|
||
}
|
||
}
|
||
},
|
||
"requires": {
|
||
"type": "object",
|
||
"additionalProperties": false,
|
||
"required": [
|
||
"needs_cross_entity_join",
|
||
"needs_causal_chain",
|
||
"needs_exact_object_trace",
|
||
"needs_ranking",
|
||
"needs_anomaly_summary",
|
||
"needs_runtime_truth",
|
||
"needs_period_cut",
|
||
"needs_evidence"
|
||
],
|
||
"properties": {
|
||
"needs_cross_entity_join": {
|
||
"type": "boolean"
|
||
},
|
||
"needs_causal_chain": {
|
||
"type": "boolean"
|
||
},
|
||
"needs_exact_object_trace": {
|
||
"type": "boolean"
|
||
},
|
||
"needs_ranking": {
|
||
"type": "boolean"
|
||
},
|
||
"needs_anomaly_summary": {
|
||
"type": "boolean"
|
||
},
|
||
"needs_runtime_truth": {
|
||
"type": "boolean"
|
||
},
|
||
"needs_period_cut": {
|
||
"type": "boolean"
|
||
},
|
||
"needs_evidence": {
|
||
"type": "boolean"
|
||
}
|
||
}
|
||
},
|
||
"expected_output_shape": {
|
||
"type": "string",
|
||
"enum": [
|
||
"ranked_list",
|
||
"evidence_chain",
|
||
"anomaly_summary",
|
||
"point_answer",
|
||
"reconciliation_report",
|
||
"prioritized_review_list"
|
||
]
|
||
},
|
||
"route_hint": {
|
||
"type": "string",
|
||
"enum": [
|
||
"store_canonical",
|
||
"store_feature_risk",
|
||
"hybrid_store_plus_live",
|
||
"live_mcp_drilldown",
|
||
"batch_refresh_then_store"
|
||
]
|
||
},
|
||
"ambiguities": {
|
||
"type": "array",
|
||
"items": {
|
||
"type": "object",
|
||
"additionalProperties": false,
|
||
"required": [
|
||
"field",
|
||
"reason",
|
||
"severity"
|
||
],
|
||
"properties": {
|
||
"field": {
|
||
"type": "string"
|
||
},
|
||
"reason": {
|
||
"type": "string"
|
||
},
|
||
"severity": {
|
||
"type": "string",
|
||
"enum": [
|
||
"low",
|
||
"medium",
|
||
"high"
|
||
]
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"confidence": {
|
||
"type": "object",
|
||
"additionalProperties": false,
|
||
"required": [
|
||
"overall",
|
||
"intent_class",
|
||
"route_hint"
|
||
],
|
||
"properties": {
|
||
"overall": {
|
||
"type": "string",
|
||
"enum": [
|
||
"high",
|
||
"medium",
|
||
"low"
|
||
]
|
||
},
|
||
"intent_class": {
|
||
"type": "string",
|
||
"enum": [
|
||
"high",
|
||
"medium",
|
||
"low"
|
||
]
|
||
},
|
||
"route_hint": {
|
||
"type": "string",
|
||
"enum": [
|
||
"high",
|
||
"medium",
|
||
"low"
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"strict": true
|
||
},
|
||
"verbosity": "medium"
|
||
},
|
||
"tool_choice": "auto",
|
||
"tools": [],
|
||
"top_logprobs": 0,
|
||
"top_p": 1,
|
||
"truncation": "disabled",
|
||
"usage": {
|
||
"input_tokens": 1583,
|
||
"input_tokens_details": {
|
||
"cached_tokens": 0
|
||
},
|
||
"output_tokens": 331,
|
||
"output_tokens_details": {
|
||
"reasoning_tokens": 0
|
||
},
|
||
"total_tokens": 1914
|
||
},
|
||
"user": null,
|
||
"metadata": {}
|
||
},
|
||
"parsed_normalized_json": {
|
||
"schema_version": "normalized_query_v1",
|
||
"user_question_raw": "По каким поставщикам не бьются взаиморасчеты по 60 счету, и разложи это по документам, оплатам и закрывающим?",
|
||
"normalized_question": "Не бьются взаиморасчеты по 60 счету по поставщикам, разложить по документам, оплатам и закрывающим.",
|
||
"intent_class": "cross_entity",
|
||
"business_problem_type": "анализ взаиморасчетов",
|
||
"domain_entities": [
|
||
"контрагент",
|
||
"договор",
|
||
"оплата",
|
||
"проводка"
|
||
],
|
||
"accounts_mentioned": [
|
||
"60"
|
||
],
|
||
"documents_mentioned": [],
|
||
"registers_mentioned": [],
|
||
"period_scope": {
|
||
"type": "missing",
|
||
"value": null,
|
||
"confidence": "low"
|
||
},
|
||
"requires": {
|
||
"needs_cross_entity_join": true,
|
||
"needs_causal_chain": true,
|
||
"needs_exact_object_trace": false,
|
||
"needs_ranking": false,
|
||
"needs_anomaly_summary": false,
|
||
"needs_runtime_truth": false,
|
||
"needs_period_cut": false,
|
||
"needs_evidence": true
|
||
},
|
||
"expected_output_shape": "reconciliation_report",
|
||
"route_hint": "hybrid_store_plus_live",
|
||
"ambiguities": [],
|
||
"confidence": {
|
||
"overall": "medium",
|
||
"intent_class": "medium",
|
||
"route_hint": "medium"
|
||
}
|
||
},
|
||
"validation_result": {
|
||
"passed": true,
|
||
"errors": []
|
||
},
|
||
"route_hint": "hybrid_store_plus_live",
|
||
"confidence": "medium",
|
||
"usage": {
|
||
"input_tokens": 1583,
|
||
"output_tokens": 331,
|
||
"total_tokens": 1914
|
||
},
|
||
"latency_ms": 8128,
|
||
"expected_route": "hybrid_store_plus_live"
|
||
} |