Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add faq assistants #614

Merged
merged 3 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions assistant_dists/ai_faq_assistant/pipeline_conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,9 @@
}
},
"metadata": {
"display_name": "AI FAQ Assistant",
"author": "AI for General Public",
"description": "You can use this Assistant to ask simple questions about today's AI technology. It will provide answers based on the FAQ given in the prompt as well as the underlying model's internal knowledge.",
"display_name": "FAQ Assistant",
"author": "DeepPavlov",
"description": "You can use this Assistant to ask simple questions about today's DeepPavlov company.",
"version": "0.0.1",
"date_created": "2023-01-10T02:00:00",
"ram_usage": "50 GB",
Expand Down
139 changes: 139 additions & 0 deletions assistant_dists/ai_faq_ru_assistant/docker-compose.override.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
services:
agent:
build:
args:
WAIT_HOSTS: prompt-selector-ru:8135, dialogrpt-ru:8122, dff-ai-faq-ru-prompted-skill:8190,
ranking-based-response-selector-ru:8002
WAIT_HOSTS_TIMEOUT: ${WAIT_TIMEOUT:-480}
HIGH_PRIORITY_INTENTS: 1
RESTRICTION_FOR_SENSITIVE_CASE: 1
ALWAYS_TURN_ON_ALL_SKILLS: 0
LANGUAGE: RU
FALLBACK_FILE: fallbacks_dream_ru.json
command: sh -c 'bin/wait && python -m deeppavlov_agent.run agent.pipeline_config=assistant_dists/business_ru_assistant/pipeline_conf.json'
environment:
WAIT_HOSTS: prompt-selector-ru:8135, dialogrpt-ru:8122, dff-ai-faq-ru-prompted-skill:8190,
ranking-based-response-selector-ru:8002
WAIT_HOSTS_TIMEOUT: ${WAIT_TIMEOUT:-480}
HIGH_PRIORITY_INTENTS: 1
RESTRICTION_FOR_SENSITIVE_CASE: 1
ALWAYS_TURN_ON_ALL_SKILLS: 0
LANGUAGE: RU
FALLBACK_FILE: fallbacks_dream_ru.json
deploy:
resources:
limits:
memory: 200M
reservations:
memory: 200M
prompt-selector-ru:
env_file:
- .env
build:
args:
SERVICE_PORT: 8135
SERVICE_NAME: prompt_selector
N_SENTENCES_TO_RETURN: 3
PROMPTS_TO_CONSIDER: s9qkdg4i9g01
FLASK_APP: server
context: .
dockerfile: annotators/prompt_selector/Dockerfile
command: flask run -h 0.0.0.0 -p 8135
environment:
SERVICE_PORT: 8135
SERVICE_NAME: prompt_selector
N_SENTENCES_TO_RETURN: 3
PROMPTS_TO_CONSIDER: s9qkdg4i9g01
FLASK_APP: server
deploy:
resources:
limits:
memory: 100M
reservations:
memory: 100M
dialogrpt-ru:
env_file:
- .env_ru
build:
args:
SERVICE_PORT: 8122
PRETRAINED_MODEL_FNAME: dialogrpt_ru_ckpt_v0.pth
TOKENIZER_NAME_OR_PATH: DeepPavlov/rudialogpt3_medium_based_on_gpt2_v2
CUDA_VISIBLE_DEVICES: '0'
FLASK_APP: server
context: services/dialogrpt_ru
command: flask run -h 0.0.0.0 -p 8122
environment:
SERVICE_PORT: 8122
PRETRAINED_MODEL_FNAME: dialogrpt_ru_ckpt_v0.pth
TOKENIZER_NAME_OR_PATH: DeepPavlov/rudialogpt3_medium_based_on_gpt2_v2
CUDA_VISIBLE_DEVICES: '0'
FLASK_APP: server
deploy:
resources:
limits:
memory: 4G
reservations:
memory: 4G
dff-ai-faq-ru-prompted-skill:
env_file:
- .env
build:
args:
SERVICE_PORT: 8190
SERVICE_NAME: dff_ai_faq_ru_prompted_skill
PROMPT_FILE: common/prompts/ai_faq_ru.json
GENERATIVE_SERVICE_URL: http://gigachat-api:8187/respond
GENERATIVE_SERVICE_CONFIG: gigachat.json
GENERATIVE_TIMEOUT: 120
N_UTTERANCES_CONTEXT: 7
ENVVARS_TO_SEND: GIGACHAT_CREDENTIAL,GIGACHAT_SCOPE
context: .
dockerfile: skills/dff_template_prompted_skill/Dockerfile
environment:
SERVICE_PORT: 8190
SERVICE_NAME: dff_ai_faq_ru_prompted_skill
PROMPT_FILE: common/prompts/ai_faq_ru.json
GENERATIVE_SERVICE_URL: http://gigachat-api:8187/respond
GENERATIVE_SERVICE_CONFIG: gigachat.json
GENERATIVE_TIMEOUT: 120
N_UTTERANCES_CONTEXT: 7
ENVVARS_TO_SEND: GIGACHAT_CREDENTIAL,GIGACHAT_SCOPE
deploy:
resources:
limits:
memory: 128M
reservations:
memory: 128M
ranking-based-response-selector-ru:
env_file:
- .env
build:
args:
SERVICE_PORT: 8002
SERVICE_NAME: response_selector
SENTENCE_RANKER_ANNOTATION_NAME: dialogrpt
SENTENCE_RANKER_SERVICE_URL: http://dialogrpt-ru:8122/rank_sentences
SENTENCE_RANKER_TIMEOUT: 3
N_UTTERANCES_CONTEXT: 5
FILTER_TOXIC_OR_BADLISTED: 1
FLASK_APP: server
context: .
dockerfile: response_selectors/ranking_based_response_selector/Dockerfile
command: flask run -h 0.0.0.0 -p 8002
environment:
SERVICE_PORT: 8002
SERVICE_NAME: response_selector
SENTENCE_RANKER_ANNOTATION_NAME: dialogrpt
SENTENCE_RANKER_SERVICE_URL: http://dialogrpt-ru:8122/rank_sentences
SENTENCE_RANKER_TIMEOUT: 3
N_UTTERANCES_CONTEXT: 5
FILTER_TOXIC_OR_BADLISTED: 1
FLASK_APP: server
deploy:
resources:
limits:
memory: 100M
reservations:
memory: 100M
version: '3.7'
232 changes: 232 additions & 0 deletions assistant_dists/ai_faq_ru_assistant/pipeline_conf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,232 @@
{
"services": {
"last_chance_service": {
"group": "last_chance_service",
"connector": {
"protocol": "python",
"class_name": "PredefinedTextConnector",
"response_text": "Извини, что-то пошло не так в моем мозгу. Пожалуйста, повтори предыдущую реплику.",
"annotations": {
"sentseg": {
"punct_sent": "Извини, что-то пошло не так в моем мозгу. Пожалуйста, повтори предыдущую реплику.",
"segments": [
"Извини, что-то пошло не так в моем мозгу.",
"Пожалуйста, повтори предыдущую реплику."
]
}
}
},
"state_manager_method": "add_bot_utterance_last_chance",
"tags": [
"last_chance"
],
"endpoint": "respond",
"is_enabled": true,
"source": {
"component": "components/ktwzbud2l5ug.yml",
"service": "services/agent_services/service_configs/0o5hpk4t0wl7"
}
},
"timeout_service": {
"group": "timeout_service",
"connector": {
"protocol": "python",
"class_name": "PredefinedTextConnector",
"response_text": "Извини, что-то пошло не так в моем мозгу. Пожалуйста, повтори предыдущую реплику.",
"annotations": {
"sentseg": {
"punct_sent": "Извини, что-то пошло не так в моем мозгу. Пожалуйста, повтори предыдущую реплику.",
"segments": [
"Извини, что-то пошло не так в моем мозгу.",
"Пожалуйста, повтори предыдущую реплику."
]
}
}
},
"state_manager_method": "add_bot_utterance_last_chance",
"tags": [
"timeout"
],
"endpoint": "respond",
"is_enabled": true,
"source": {
"component": "components/tnqsdvixagp6.yml",
"service": "services/agent_services/service_configs/0o5hpk4t0wl7"
}
},
"annotators": {
"prompt_goals_collector": {
"group": "annotators",
"connector": {
"protocol": "http",
"timeout": 2.0,
"url": "http://prompt-selector-ru:8135/collect_goals"
},
"dialog_formatter": "state_formatters.dp_formatters:prompts_goals_collector_formatter",
"response_formatter": "state_formatters.dp_formatters:simple_formatter_service",
"state_manager_method": "update_attributes",
"endpoint": "collect_goals",
"is_enabled": true,
"source": {
"component": "components/k3j2h498hvflekdfdfbfgh34r.yml",
"service": "annotators/prompt_selector/service_configs/prompt-selector-ru"
}
},
"prompt_selector": {
"group": "annotators",
"connector": {
"protocol": "http",
"timeout": 2.0,
"url": "http://prompt-selector-ru:8135/respond"
},
"dialog_formatter": "state_formatters.dp_formatters:context_formatter_dialog",
"response_formatter": "state_formatters.dp_formatters:simple_formatter_service",
"state_manager_method": "add_annotation",
"endpoint": "respond",
"is_enabled": true,
"source": {
"component": "components/ctl9rk5pcthb.yml",
"service": "annotators/prompt_selector/service_configs/56nyak2w8mxz"
}
}
},
"response_annotators": {},
"response_annotator_selectors": {
"group": "response_annotator_selectors",
"connector": {
"protocol": "python",
"class_name": "skill_selectors.post_annotator_selector.connector:PostAnnotatorSelectorConnector",
"annotator_names": [
"sentseg"
]
},
"response_formatter": "state_formatters.dp_formatters:simple_formatter_service",
"tags": [
"selector"
],
"is_enabled": true,
"source": {
"component": "components/LXrJDIf43gwNmPMNXG5Eg.yml",
"service": "services/response_annotator_selectors/service_configs/agent"
}
},
"candidate_annotators": {
"dialogrpt": {
"group": "candidate_annotators",
"connector": {
"protocol": "http",
"timeout": 1.0,
"url": "http://dialogrpt-ru:8122/respond"
},
"dialog_formatter": "state_formatters.dp_formatters:hypotheses_with_context_list",
"response_formatter": "state_formatters.dp_formatters:simple_formatter_service",
"previous_services": [
"skills"
],
"state_manager_method": "add_hypothesis_annotation_batch",
"endpoint": "respond",
"is_enabled": true,
"source": {
"component": "components/DUW2u7FwPMyhBOWrK1HTg.yml",
"service": "services/dialogrpt_ru/service_configs/dialogrpt-ru"
}
}
},
"skill_selectors": {
"description_based_skill_selector": {
"group": "skill_selectors",
"connector": {
"protocol": "python",
"class_name": "skill_selectors.description_based_skill_selector.connector:DescriptionBasedSkillSelectorConnector"
},
"dialog_formatter": "state_formatters.dp_formatters:base_skill_selector_formatter_dialog",
"response_formatter": "state_formatters.dp_formatters:simple_formatter_service",
"previous_services": [
"annotators"
],
"tags": [
"selector"
],
"endpoint": "respond",
"is_enabled": true,
"source": {
"component": "components/dfsw4bji8bgjq2.yml",
"service": "skill_selectors/description_based_skill_selector/service_configs/agent"
}
}
},
"skills": {
"dummy_skill": {
"group": "skills",
"connector": {
"protocol": "python",
"class_name": "skills.dummy_skill.connector:DummySkillConnector"
},
"dialog_formatter": "state_formatters.dp_formatters:utt_sentrewrite_modified_last_dialog",
"response_formatter": "state_formatters.dp_formatters:skill_with_attributes_formatter_service",
"previous_services": [
"skill_selectors"
],
"state_manager_method": "add_hypothesis",
"is_enabled": true,
"source": {
"component": "components/uYkoK0vRp4bbIg9akI1yw.yml",
"service": "skills/dummy_skill/service_configs/agent"
}
},
"dff_ai_faq_ru_prompted_skill": {
"connector": {
"protocol": "http",
"timeout": 120.0,
"url": "http://dff-ai-faq-ru-prompted-skill:8190/respond"
},
"dialog_formatter": {
"name": "state_formatters.dp_formatters:dff_prompted_skill_formatter",
"skill_name": "dff_ai_faq_ru_prompted_skill"
},
"response_formatter": "state_formatters.dp_formatters:skill_with_attributes_formatter_service",
"previous_services": [
"skill_selectors"
],
"state_manager_method": "add_hypothesis",
"is_enabled": true,
"source": {
"component": "components/0Anxjzdjfajdfjsndfdkmthmdsknv4a.yml",
"service": "skills/dff_template_prompted_skill/service_configs/dff-ai-faq-ru-prompted-skill"
}
}
},
"response_selectors": {
"response_selector": {
"group": "response_selectors",
"connector": {
"protocol": "http",
"timeout": 1.0,
"url": "http://ranking-based-response-selector-ru:8002/respond"
},
"dialog_formatter": "state_formatters.dp_formatters:cropped_dialog",
"response_formatter": "state_formatters.dp_formatters:base_response_selector_formatter_service",
"previous_services": [
"candidate_annotators"
],
"state_manager_method": "add_bot_utterance",
"tags": [
"selector"
],
"endpoint": "respond",
"is_enabled": true,
"source": {
"component": "components/hE12LfxAkX3K9gU0nU4yE2.yml",
"service": "response_selectors/ranking_based_response_selector/service_configs/ranking-based-response-selector-ru"
}
}
},
"actors": {}
},
"metadata": {
"display_name": "FAQ ассистент",
"author": "DeepPavlov",
"description": "Вы можете использовать этого помощника, чтобы задавать простые вопросы о сегодняшней компании DeepPavlov.",
"date_created": "2024-02-19T20:31:06"
}
}
Loading
Loading