OfficeDev / Copilot-for-M365-Samples

Microsoft Copilot for Microsoft 365 samples

Home Page:https://aka.ms/extendcopilotm365

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: Multiple parameters are not working in Copilot chat

edgerley opened this issue · comments

Sample

msgext-multiparam-ts

Description

When I run the sample it works correctly using Copilot chat so long as I use prompts that trigger the 1st parameter only to be queried. However I am experiencing two unique issues whenever I submit a prompt that should send multiple parameters, or non-1st position parameters.

  • Issue a prompt that should send the 1st parameter along with additional parameters. This results in only the 1st parameter being send to the sample code.
    For example: Submit prompt text "Find top 10 stocks in NASDAQ Stocks with P/B < 2 and P/E < 30" results in the following being logged by the sample code. For some reason only parameter 1 is received by the sample code. The Copilot response indicates success, but parameter 2, 3, and 4 were never passed to the sample code endpoint.
    issue1

  • Issue a prompt that should send no 1st parameter but submit non-1st position parameters.
    For example: Submit prompt text "Ask NASDAQ for data where Ranked Number of Stocks is 3" results in nothing being received by the sample code and Copilot indicating an execution "Fail". Whenever I issue a prompt that should pass a parameter to "non-1st position parameters" I receive this "Fail" response.
    fail

Steps to reproduce

  • Run the project "msgext-multiparam-ts" in Visual Studio Code and make sure the app is enabled in Copilot chat in teams.
  • In Teams Copilot Chat type the prompt "Find top 10 stocks in NASDAQ Stocks with P/B < 2 and P/E < 30"
  • I observe the sample code logs the following, only parameter 1 is passed.
    issue1

Expected results

I expect to see a log message indicating values being passed in for parameter 2, 3, and 4. for example something like this:
StockIndex: 'NASDAQ' | NumberofStocks: '10' | P/B: '<2' | P/E: '< 20'

Actual results

I only see parameter 1 passed in:
issue1

Additional Info

My system is using the following:

  • I am running Microsoft Office in "Current Channel (Preview)"
  • I am running the latest version of Teams with "Public preview" checked

Sorry for the trouble @edgerley

I just tested this and it's working fine for me in the Copilot app in Teams using the prompt Find top 10 stocks in NASDAQ Stocks with P/B < 2 and P/E < 30

image

Here is the debug output.

image

I just pulled the latest code from the GitHub repository and re-tested and am still experiencing the same results. I'm wondering if something in my tenant/environment is somehow causing Copilot to use different/older logic to parse the input/call the endpoint where it's not parsing/passing multiple parameters.

My chat looks similar to yours, but slightly different:

  • Your prompt when rendered in the chat is displaying < as &lt; and > as &gt;
  • Your pop-up adaptive card has a title bar image and text NASDAQ where mine has no image/text header.
  • Your references are using the projects .png image and "NASDAQ" text were mine is rendering with a person icon and no text.
    copilotchat

My debug log is still showing only the first parameter is passed in:
copilotdebug

Ryan

Thanks for sharing the screenshot @edgerley.

  • Your prompt when rendered in the chat is displaying < as < and > as >

I noticed this as well, the > and < characters were automatically escaped for me, I didn't enter &lt; or &gt;

I used the Teams v2 web client and v3.5.2 of the Copilot app to test.

You can check the version of the app by right clicking on the app in the sidebar and selecting About.

image

image

Thanks @garrytrinder, I'm also using the v2 Teams web client and my Copilot version is also v3.5.2.

One strange thing is that the Teams web client under "About Teams" has "Early access" > "Public preview" unchecked. And if I try to check it it doesn't do anything. However my Teams desktop app does have "Public preview" checked.

My Teams web client version:
teamsweb

My Teams desktop client version:
teamsdesktop

My Copilot version (it's the same for both Web and Desktop Teams):
copilotversion

Thanks for sharing @edgerley, this is an odd one.

As this is looks to be a tenant issue, I suggest the next step is for you to raise a support ticket in the admin portal and reference this issue in the description.