microsoft / teams-copilot-starter

Teams Copilot Starter has been developed as a starter template for solutions targeting generative AI chatbots in Microsoft Teams. It can assist companies jumpstart their AI and Copilot efforts.
MIT License
32 stars 15 forks source link

When using combined action with a url "give me details about Microsoft and summarize https://en.wikipedia.org/wiki/Earth", the webretrieval fails #15

Open svandenhoven opened 5 months ago

svandenhoven commented 5 months ago

When the command is "give me details about Microsoft and summarize https://en.wikipedia.org/wiki/Earth"

The action plan is

{
  "type": "plan",
  "commands": [
    {
      "type": "SAY",
      "response": {
        "content": "Absolutely! Please wait while I'm retrieving the details about Microsoft and summarizing the provided Wikipedia page on Earth.",
        "role": "assistant"
      }
    },
    {
      "type": "DO",
      "action": "getCompanyDetails",
      "parameters": {
        "entity": "Microsoft"
      },
      "parallelActions": []
    },
    {
      "type": "DO",
      "action": "webRetrieval",
      "parameters": {
        "entity": "https://en.wikipedia.org/wiki/Earth"
      }
    }
  ]
}

However the input in Webretrieval get the wrong command: "give me details about Microsoft and summarize \r\n ".

image

This results in the wrong answer image

svandenhoven commented 4 months ago

I have introduced a new parameter called input. This is per action in the actionplan. In the Action Handler the input is used instead of the whole sentence.

For instance if the user input is: "give me detail company info for Apple and summarize https://www.cbc.ca/lite/story/1.7276177"

the action plan is:

{
  "type": "plan",
  "commands": [
    {
      "type": "SAY",
      "response": {
        "content": "Absolutely! Please wait while I'm retrieving the financial details about Apple and summarizing the provided webpage.",
        "role": "assistant"
      }
    },
    {
      "type": "DO",
      "action": "getCompanyDetails",
      "parameters": {
        "entity": "Apple",
        "input": "Give me the detailed information for Apple"
      },
      "parallelActions": []
    },
    {
      "type": "DO",
      "action": "webRetrieval",
      "parameters": {
        "entity": "https://www.cbc.ca/lite/story/1.7276177",
        "input": "Summarize https://www.cbc.ca/lite/story/1.7276177"
      }
    }
  ]
}

The parameter.input is used to execute the action. This does result in the correct execution of the action as only the input that is applicable for the action is used.

image