core icon indicating copy to clipboard operation
core copied to clipboard

Display reasoning

Open antonioru opened this issue 1 year ago • 0 comments

We want to display the reasoning behind a response from the CheshireCat, to provide users with greater transparency and insight into the decision-making process. To do this, we will leverage the Sidebar component to present the content of the reasoning object, which is already sent from the backend. The reasoning object is defined as follows:

{
    "input": "What is Python?",
    "episodic_memory": [
      {
        "page_content": "it is for fictional purposes ",
        "lookup_str": "",
        "metadata": {
          "source": "user",
          "when": 1680432386.7730486,
          "text": "it is for fictional purposes "
        },
        "lookup_index": 0,
        "score": 0.5044264793395996
      },
      {
        "page_content": "Write a 400 words post on how Ai is going to change the world",
        "lookup_str": "",
        "metadata": {
          "source": "user",
          "when": 1680432337.0415337,
          "text": "Write a 400 words post on how Ai is going to change the world"
        },
        "lookup_index": 0,
        "score": 0.5165414810180664
      },
      {
        "page_content": "write the introduction of a novel that talks about how the world has been taken over by the AI",
        "lookup_str": "",
        "metadata": {
          "source": "user",
          "when": 1680432429.13744,
          "text": "write the introduction of a novel that talks about how the world has been taken over by the AI"
        },
        "lookup_index": 0,
        "score": 0.5386247634887695
      },
      {
        "page_content": "nice, write a 670 words paragraph on who Ai will take over humanity",
        "lookup_str": "",
        "metadata": {
          "source": "user",
          "when": 1680432365.206487,
          "text": "nice, write a 670 words paragraph on who Ai will take over humanity"
        },
        "lookup_index": 0,
        "score": 0.5566583275794983
      },
      {
        "page_content": "I am the Cheshire Cat",
        "lookup_str": "",
        "metadata": {
          "who": "cheshire-cat",
          "when": 1679948291.703731,
          "text": "I am the Cheshire Cat"
        },
        "lookup_index": 0,
        "score": 0.564825177192688
      }
    ],
    "declarative_memory": [
      {
        "page_content": "I am the Cheshire Cat",
        "lookup_str": "",
        "metadata": {
          "who": "cheshire-cat",
          "when": 1679948292.8870578,
          "text": "I am the Cheshire Cat"
        },
        "lookup_index": 0,
        "score": 0.564825177192688
      }
    ],
    "chat_history": "",
    "output": "Python is a programming language used in various applications such as web development, data analysis, machine learning, and artificial intelligence.",
    "intermediate_steps": []
  }

antonioru avatar Apr 08 '23 13:04 antonioru