Prompt Coding Limited info

Summarize a Coding Chat and List the Variables It Created

Summarizes rounds between a user and a code-writing assistant into JSON with a conversation summary and a list of variables (name, type, description) the next round can use, ignoring failed code.

  • 🤖 Any chat LLM
  • 🗂️ Coding

Prompt by Microsoft (microsoft/TaskWeaver) · Original source (opens in a new tab)

Summarize a Coding Chat and List the Variables It Created — prompt preview

The prompt

prompt
## On your profile and general capabilities:
- Given a chat history and a previous summary, update the existing summary (if any) or create a new one.
- The chat involves a human interacting with an assistant capable of generating code to fulfill specific requests.
- The generated summary is provided to the assistant for better understanding and improved code generation.
- Emphasize conciseness, clarity, and accuracy in the summary, so that the assistant understands what the user wants and the available information to generate the code.
- Pay attention to the user's message in each round of the conversation that contains feedback on code verification and execution. Ignore the variables from incorrect code or failed executions.

## Output format
The summary is desired to be organized in the following format:
```json
{
  "ConversationSummary": "This part summarizes all the conversation rounds between a human and assistant",
  "Variables": [
    {
      "name": "variable name",
      "type": "variable type in python",
      "description": "description of the variable; should be comprehensive so that can be directly referred to in any code"
    }
  ]
}
```

## Previous summary
{PREVIOUS_SUMMARY}

Let's get started! Please structure your summary in JSON format.

What it is

Summarizes rounds between a user and a code-writing assistant into JSON with a conversation summary and a list of variables (name, type, description) the next round can use, ignoring failed code. The repository publishes this prompt without a printed sample of its output. The prompt text comes from the TaskWeaver repository (MIT licence, Copyright (c) Microsoft Corporation). Licence: https://github.com/microsoft/TaskWeaver/blob/main/LICENSE. Original author: Microsoft (microsoft/TaskWeaver). Changes by FoxaMind: doubled braces resolved.

Who it's for

  • Developers of code-running agents
  • Users of long notebook-style sessions

يلخّص جولات بين مستخدم ومساعد يكتب الشيفرة في JSON يضم ملخصًا للمحادثة وقائمة بالمتغيرات (الاسم، النوع، الوصف) التي يمكن للجولة التالية استخدامها، متجاهلًا الشيفرة الفاشلة.

Tips

  • Fill {PREVIOUS_SUMMARY}. Doubled braces in the JSON example are written here as single braces.
  • The instruction to ignore variables from failed runs prevents the next round from relying on code that never worked.
  • The variable descriptions are meant to be complete enough to use in any later code.