Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create references - Expected Property Values & BUG: Required Properties #119

Open
RickardHF opened this issue Dec 20, 2024 · 0 comments
Open

Comments

@RickardHF
Copy link

RickardHF commented Dec 20, 2024

As per the current documentation a reference can be created as such (included for easier reference)

import { createReferencesEvent } from "@copilot-extensions/preview-sdk";

response.write(
  createReferencesEvent([
    {
      id: "123",
      type: "issue",
      data: {
        number: 123,
      },
      is_implicit: false,
      metadata: {
        display_name: "My issue",
        display_icon: "issue-opened",
        display_url: "https://github.com/monalisa/hello-world/issues/123",
    },
  ])
);

Expected Property Values

The property .type is one of the required properties. However it is not clear how this is expected to be used, what values are expected etc.
Is this just to be able to detect it later if this reference is later added to the chat so that one can handle this reference differently?

The property .data is optional, but what is the use of this?

Based on the naming of the propery .metadata.display_icon one would expect this should influence how the reference is rendered in the agent, webUI etc - are there standard values that would be "accepted" by the copilot extensions?

Could you improve the documentation on these?

Possible Bug - Optional Properties are Required

Using the sdk to provide references we found it caused errors for both the VS Code agent, and the GitHub web agent if the following properties were not included:

  • .data - If this property wasn't included in the response, the rendering of the references would fail. It could be an empty object, but it neeeded to be set.
  • .metadata - If this property wasn`t set rendering failed.

Both of these properties are marked as optional in the documentation. While omitting them doesn't cause any errors on the API, it causes errors on at least two different agents ( VSCode and GitHub Web )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant