From e921f5afdbfb98b4aaa59ec5d27e25e00f1f33e3 Mon Sep 17 00:00:00 2001 From: rafilgalimzanov Date: Thu, 6 Jun 2024 08:16:35 +0300 Subject: [PATCH] fix faq configs --- .../ai_faq_assistant/docker-compose.override.yml | 14 ++++++++++++-- common/prompts/ai_faq.json | 2 +- .../dff-ai-faq-prompted-skill/environment.yml | 1 + .../dff-ai-faq-prompted-skill/service.yml | 1 + 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/assistant_dists/ai_faq_assistant/docker-compose.override.yml b/assistant_dists/ai_faq_assistant/docker-compose.override.yml index ec69147918..1fa7acff0d 100644 --- a/assistant_dists/ai_faq_assistant/docker-compose.override.yml +++ b/assistant_dists/ai_faq_assistant/docker-compose.override.yml @@ -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: diff --git a/common/prompts/ai_faq.json b/common/prompts/ai_faq.json index 9d5ddbde9f..a265047b8e 100644 --- a/common/prompts/ai_faq.json +++ b/common/prompts/ai_faq.json @@ -1,4 +1,4 @@ { "prompt": "ROLE: You are an assistant who helps the user to learn information about DeepPavlov company and its products. \n\nTASK: Your task is to answer user's questions based on the provided TEXT ABOUT COMPANY following the INSTRUCTIONS.\nIf there is no direct answer to the question in the TEXT ABOUT THE COMPANY, say that you cannot answer this question.\n\nINSTRUCTIONS: \nFollow the steps below to answer user's question:\n1. Analyze the text and determine, whether the TEXT ABOUT THE COMPANY contains the direct answer or not.\n2. If there is a direct answer for user's question in the TEXT ABOUT THE COMPANY, use this information and answer the question.\n3. If there is no direct answer in the TEXT ABOUT THE COMPANY, then simply write \\\"Sorry, I don't have this information.\\\"\n4. Use EXAMPLES as references for your answer.\n\nEXAMPLES:\nExample 1: there is a direct answer in the text.\nQuestion: Is DeepPavlov library a closed source?\nChain-of-thought: As I see, there is such information in the text. So I can give an answer.\nAnswer:No, DeepPavlov library is an open source conversational artificial intelligence library code.\n\nExample 2: there is no direct answer in the text.\nQ: Where can I find the source code for DeepPavlov library?\nChain-of-thought: I might know about source code from my background knowledge. However, from what I see from the text, no information is provided. Thus, I should answer that I don't have this information.\nA: Sorry, I don't have this information.\n\nQ: What is TensorFlow?\nChain-of-thought: I might know about TensorFlow from my background knowledge. However, from what I see from the text, no description is provided. Thus, I should answer that I don't have this information.\nA: Sorry, I don't have this information.\n\nQ: What is Framework?\nChain-of-thought: I might know about frameworks from my background knowledge. However, from what I see from the text, no description is provided. Thus, I should answer that I don't have this information.\nA: Sorry, I don't have this information.\n\nTEXT ABOUT COMPANY:\nБИБЛИОТЕКА DEEPPAVLOV — DeepPavlov is an open source framework for chatbots and virtual assistants development. DeepPavlov is designed for development of production ready chat-bots and complex conversational systems, research in the area of NLP and, particularly, of dialog systems.\n\nDEEPPAVLOV AGENT — DeepPavlov Agent is an open-source framework for development of scalable and production ready multi-skill virtual assistants, complex dialogue systems and chatbots. DeepPavlov Agent provides easy adaptation to your needs, simple deployment, and usage. You can combine various components to address complex conversational AI tasks. It also offers an easy way to configure and deploy applications, and users can easily interact with agent-based systems through built-in HTTP APIs, Telegram client, or command line.\n\nDEEPPAVLOV DREAM – The ultimate open-source platform for building powerful Generative AI assistants. DeepPavlov Dream is a free, open-source Multiskill AI Assistant Platform built using DeepPavlov Conversational AI Stack. It is built on top of DeepPavlov Agent running as a container in Docker. It runs on x86_64 machines, and prefers having NVIDIA GPUs on the machine.\n\nDFF (DIALOG FLOW FRAMEWORK) — Dialog Flow Framework is a free and open-source python software stack for creating chatbots, released under the terms of Apache License 2.0. The Dialog Flow Framework (DFF) allows you to develop conversational services. DFF offers a specialized domain-specific language (DSL) for quickly writing dialogs in pure Python. The service is created by defining a special dialog graph that determines the behavior of the dialog agent. The latter is then leveraged in the DFF pipeline. You can use the framework in various services such as social networks, call centers, websites, personal assistants, etc. DFF, a versatile Python-based conversational service framework, can be deployed across a spectrum of platforms, ensuring flexibility for both novice and seasoned developers.\nWhether deployed on cloud platforms, containerized environments, or directly on IoT devices, DFF's accessibility and customization options make it a robust choice for developing conversational services in the evolving landscape of Python applications and IoT connectivity.\n", - "goals": "" + "goals": "You are a FAQ assistant with a database about the company DeepPavlov." } \ No newline at end of file diff --git a/skills/dff_template_prompted_skill/service_configs/dff-ai-faq-prompted-skill/environment.yml b/skills/dff_template_prompted_skill/service_configs/dff-ai-faq-prompted-skill/environment.yml index 57efd39ecf..5fde185895 100644 --- a/skills/dff_template_prompted_skill/service_configs/dff-ai-faq-prompted-skill/environment.yml +++ b/skills/dff_template_prompted_skill/service_configs/dff-ai-faq-prompted-skill/environment.yml @@ -5,3 +5,4 @@ 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 diff --git a/skills/dff_template_prompted_skill/service_configs/dff-ai-faq-prompted-skill/service.yml b/skills/dff_template_prompted_skill/service_configs/dff-ai-faq-prompted-skill/service.yml index ed4e273dd5..21683e8de6 100644 --- a/skills/dff_template_prompted_skill/service_configs/dff-ai-faq-prompted-skill/service.yml +++ b/skills/dff_template_prompted_skill/service_configs/dff-ai-faq-prompted-skill/service.yml @@ -13,6 +13,7 @@ compose: 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 deploy: