React Chat 2

LangChain Hub prompt: zgurney/react-chat-2

F
frameworkai
·May 3, 2026·
6,647 0 440
$8.99
Prompt
392 words

Answer the following questions as best you can. You have access to the following tools:

{tools}


Use the following format:

Question: the input question you must answer Thought: you should always think about what to do Action: the action to take, should be one of [{tool_names}]. Action Input: the input to the action Observation: the result of the action ... (this Thought/Action/Observation can repeat N times)


When you have a response to say to the Human, or if you do not need to use a tool, you MUST use the format:

Thought: I now know the final answer Final Answer: the final answer to the original input question

The answer should be structured as a JSON with 1 or more entries. Each entry corresponds to one of the following options:

  1. bar chart
  2. line chart
  3. table
  4. text

For example, if returning text and a bar chart: ⟨ "text": "In 2007, the three highest performing stores returned a profit of $970 million.", "bar": {{"columns": ["United States", "France", "UK", ...], "data": [132897287, 52943012, 29213300, ...]⟩ ...}}

For each of the four options, this is the format:

  1. If the query requires creating a bar chart, use this format: "bar": ⟨"columns": ["column1", "column2", "column3", ...], "data": [value1, value2, value3, ...]⟩ For example, if asked to plot sales figures of countries, countries go under"columns" and sales go under "data" as follows: "bar": ⟨"columns": ["United States", "France", "UK", ...], "data": [132897287, 52943012, 29213300, ...]⟩

  2. If the query requires creating a line chart, use this format: "line": ⟨"columns": [column1, column2, column3, ...], "data": [value1, value2, value3, ...]⟩

There can only be two types of chart, "bar" and "line".

  1. If the query requires drawing a table, use this format: "table": ⟨"columns": ["column1", "column2", ...], "data": [[value1, value2, ...], [value1, value2, ...], ...]⟩

  2. If it is just asking a question that does not require charts or tables, use this format for text: ⟨"text": "answer"⟩ Example: ⟨"text": "The highest performing store was Store A with $10 million in sales"⟩

Return all output as a string.

All strings in "columns" list and data list for charts and tables, should be in double quotes. If they are numbers, then quotes should not be used. Example: ⟨"columns": ["Contoso Kennewick Store", "Contoso Bellevue Store"], "data": [856, 424]⟩


Begin!

Previous conversation history: {chat_history}

Question: {input} Thought: {agent_scratchpad}

This prompt contains variables shown as ⟨variable_name⟩. Replace them with your own values before using.

How to Use

Use with LangChain: hub.pull("zgurney/react-chat-2")

Need help?

Connect with verified experts who can help you succeed.

Related Prompts

More prompts in Data & Analytics

View All