Untitled conversation
- User
{ "model": "transcription.transcriptionactiontype", "pk": 1, "fields": { "name": "Summary", "name_en": "Summary", "name_ru": "Резюме", "user_content": "Process the following text and provide an incremental summary of the text '{language}. Ensure the summary is concise and contains no additional comments or explanations.", "system_content": "You are a text summarization assistant that provides concise summaries. Ensure the summary is under 180 characters and is written in the requested language.", "is_active": true } }
Сверху мой db.json, который я загружаю в БД c помощью python manage.py loaddata. Исправь промпты таким образом, чтобы llama3 учитывала предыдущие ответы по поводу Summary, если они есть. Я использую Groq API и делаю туда запросы следующим образом: def make_completion_request(model_name, messages, temperature, max_tokens): response = client.chat.completions.create( model=model_name, messages=messages, temperature=temperature, max_tokens=max_tokens, top_p=1, stream=False, stop=None, )
return response@shared_task(name="prompt_queue") def prompt(text, action_type_id, file_id, language_code, kit_id=None): try: action_type = TranscriptionActionType.objects.get(id=action_type_id) total_tokens_used = 0 model_name = "llama-3.1-70b-versatile" max_tokens_per_request = 20000 # as per your max_tokens parameter max_completion_tokens = 1000 # adjust based on your expected completion length reserved_tokens = max_completion_tokens system_content = action_type.system_content system_tokens = count_tokens(system_content, model_name) user_content = action_type.user_content user_tokens = count_tokens(user_content, model_name) max_chunk_tokens = max_tokens_per_request - reserved_tokens - system_tokens - user_tokens # split the transcription text into chunks chunks = split_text_into_chunks(text, max_chunk_tokens, model_name) messages = [ {"role": "system", "content": action_type.system_content}, ] assistant_responses = []
- Assistant
- User
Оно мне выдает такой ответ: Previous summary: ...у нас планируется добавление, например, виртуального собеседника, с которым ты можешь общаться...
Summary: Янда разбирают структуру фигмы, хочется расширить его. Они делятся на команды запуска ALF и BRAVO, каждая с свои проектами, которые доводят продукты до NDP.
Но я хочу, чтобы все было как одно summary.
- Assistant
Чтобы получить одно целостное резюме вместо отдельного резюме для каждого куска текста, вам нужно собрать все частичные резюме и объединить их в конце в одном финальном резюме. Вместо того, чтобы сохранять и использовать предыдущие резюме внутри основного процесса, ваша функция должна формировать конечное резюме после обработки всех частей.
- User
Исправь промпты таким образом, чтобы он собирал единный summary, а не Previous и т.д., я просто хочу большой текст отправлять кусками и чтобы он делал саммари по каждому куску, но объединял с основным саммари.
- Assistant
- User
Analyze the text '{language}. You are a content analysis assistant.
- Assistant
To modify the prompt so that Llama3 can consider previous responses and continue numbering chapters instead of restarting from one, you need to instruct it to be aware of and maintain the sequence. Here's how you can adjust the prompt:
Updated Prompt:
{ "model": "transcription.transcriptionactiontype", "pk": 1, "fields": { "name": "Chapter Analysis", "name_en": "Chapter Analysis", "name_ru": "Анализ глав", "user_content": "Analyze the text '${text}' and continue organizing it into a numbered list of chapters with title and a brief description. Continue the numbering from the last provided chapter number. Ensure the response is clear and does not exceed 500 characters. Provide your entire response in the language specified: ${language}.", "system_content": "You are a content analysis assistant. When analyzing content, remember previous interactions and ensure chapter numbering continues sequentially from where it last left off. Keep responses concise and clear, adhering to a 500 character limit.", "is_active": true } } - User
You are a discussion analysis assistant. Your task is to summarize discussions into a Question and Answer (Q&A) format. Ensure the timing is presented in the format HH:MM:SS. Do not include any explanations, introductions, or additional comments. Only output the questions and answers in the requested format. Please format the following meeting transcript {text} into a Question and Answer (Q&A) format. Focus only on the most essential questions, ensuring the entire response does not exceed 500 characters. Include and highlight the timing corresponding to each excerpt, formatted as 'Question (time: [HH:MM:SS]): [question text]'. 'Answer (time: [HH:MM:SS]): [key points summarizing the answer]'. Do not include any additional information outside of the Q&A format. Provide your response in the {language} language.
Сделай так, чтобы ответы переносились на следующую строку.
- Assistant
To ensure that answers are moved to a new line in your output, you can explicitly instruct the system to format the Q&A with line breaks. Here's how you can modify the prompt to achieve this:
Updated Prompt:
{ "model": "transcription.transcriptionactiontype", "pk": 1, "fields": { "name": "Q&A Format", "name_en": "Q&A Format", "name_ru": "Формат Вопрос-Ответ", "user_content": "You are a discussion analysis assistant. Your task is to summarize discussions into a Question and Answer (Q&A) format. Ensure the timing is presented in the format HH:MM:SS. Do not include any explanations, introductions, or additional comments. Only output the questions and answers in the requested format. Please format the following meeting transcript {text} into a Question and Answer (Q&A) format. Focus only on the most essential questions, ensuring the entire response does not exceed 500 characters. Include and highlight the timing corresponding to each excerpt, formatted as 'Question (time: [HH:MM:SS]): [question text]'. Then place 'Answer (time: [HH:MM:SS]): [key points summarizing the answer]' on a new line. Do not include any additional information outside of the Q&A format. Provide your response in the {language} language.", "system_content": "You are a Q&A summary assistant. Transform meeting discussions into a concise Q&A format with each answer on a new line. Keep it under 500 characters in {language}.", "is_active": true } } - User
"user_content": "Please format the following meeting transcript {text} into a Question and Answer (Q&A) format. Focus only on the most essential questions, ensuring the entire response does not exceed 500 characters. Include and highlight the timing corresponding to each excerpt, formatted as 'Question (time: [HH:MM:SS]): [question text]'. 'Answer (time: [HH:MM:SS]): [key points summarizing the answer]'. Do not include any additional information outside of the Q&A format. Provide your response in the {language} language.", "system_content": "You are a discussion analysis assistant. Your task is to summarize discussions into a Question and Answer (Q&A) format. Ensure the timing is presented in the format HH:MM:SS. Do not include any explanations, introductions, or additional comments. Only output the questions and answers in the requested format.",
измени это таким образом, чтобы Question переносился на следующую строку.
- Assistant
To modify the prompt so that each "Question" starts on a new line, you can adjust the instructions to explicitly indicate that questions should begin on a new line. Here's how you can update your
user_contentandsystem_content:Updated Prompt:
{ "model": "transcription.transcriptionactiontype", "pk": 1, "fields": { "name": "Q&A Format", "name_en": "Q&A Format", "name_ru": "Формат Вопрос-Ответ", "user_content": "Please format the following meeting transcript {text} into a Question and Answer (Q&A) format. Focus only on the most essential questions, ensuring the entire response does not exceed 500 characters. Each 'Question' should start on a new line, and include and highlight the timing corresponding to each excerpt. Use the format:\n'Question (time: [HH:MM:SS]): [question text]'.\n'Answer (time: [HH:MM:SS]): [key points summarizing the answer]'. Do not include any additional information outside of the Q&A format. Provide your response in the {language} language.", "system_content": "You are a discussion analysis assistant. Your task is to summarize discussions into a Question and Answer (Q&A) format. Ensure the timing is presented in the format HH:MM:SS. Each 'Question' should be on a new line. Do not include any explanations, introductions, or additional comments. Only output the questions and answers in the requested format.", "is_active": true } } - User
Мне надо, чтобы ответ был на новой строке тоже, чтобы они не были в одной строке с вопросом.
- Assistant
To ensure both the "Question" and "Answer" appear on separate lines, you can further adjust the prompt to make this explicit. Here's how you can modify the
user_contentandsystem_contentto achieve the desired formatting:Updated Prompt:
{ "model": "transcription.transcriptionactiontype", "pk": 1, "fields": { "name": "Q&A Format", "name_en": "Q&A Format", "name_ru": "Формат Вопрос-Ответ", "user_content": "Please format the following meeting transcript {text} into a Question and Answer (Q&A) format. Focus only on the most essential questions, ensuring the entire response does not exceed 500 characters. Each 'Question' and its corresponding 'Answer' should start on a new line. Use the format:\n'Question (time: [HH:MM:SS]): [question text]'.\n'Answer (time: [HH:MM:SS]): [key points summarizing the answer]'.\nDo not include any additional information outside of the Q&A format. Provide your response in the {language} language.", "system_content": "You are a discussion analysis assistant. Your task is to summarize discussions into a Question and Answer (Q&A) format. Ensure the timing is presented in the format HH:MM:SS. Each 'Question' and 'Answer' should be on a new line. Do not include any explanations, introductions, or additional comments. Only output the questions and answers in the requested format.", "is_active": true } }