Skip to content

Commit

Permalink
Merge pull request #614 from deeppavlov/feat/add-faq
Browse files Browse the repository at this point in the history
Add faq assistants
  • Loading branch information
RafilGalimzyanov authored Jul 10, 2024
2 parents dc48669 + 205c976 commit 016aedc
Show file tree
Hide file tree
Showing 12 changed files with 469 additions and 16 deletions.
14 changes: 12 additions & 2 deletions assistant_dists/ai_faq_assistant/docker-compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,22 @@ services:
SERVICE_PORT: 8143
SERVICE_NAME: dff_ai_faq_prompted_skill
PROMPT_FILE: common/prompts/ai_faq.json
GENERATIVE_SERVICE_URL: http://transformers-lm-gptjt:8161/respond
GENERATIVE_SERVICE_CONFIG: default_generative_config.json
GENERATIVE_SERVICE_URL: http://openai-api-chatgpt-16k:8167/respond
GENERATIVE_SERVICE_CONFIG: openai-chatgpt.json
GENERATIVE_TIMEOUT: 120
N_UTTERANCES_CONTEXT: 7
ENVVARS_TO_SEND: OPENAI_API_KEY,OPENAI_ORGANIZATION
context: .
dockerfile: ./skills/dff_template_prompted_skill/Dockerfile
environment:
SERVICE_PORT: 8143
SERVICE_NAME: dff_ai_faq_prompted_skill
PROMPT_FILE: common/prompts/ai_faq.json
GENERATIVE_SERVICE_URL: http://openai-api-chatgpt-16k:8167/respond
GENERATIVE_SERVICE_CONFIG: openai-chatgpt.json
GENERATIVE_TIMEOUT: 120
N_UTTERANCES_CONTEXT: 7
ENVVARS_TO_SEND: OPENAI_API_KEY,OPENAI_ORGANIZATION
deploy:
resources:
limits:
Expand Down
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'
Loading

0 comments on commit 016aedc

Please sign in to comment.