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

feat: add example types to manifest #68

Open
wants to merge 1 commit into
base: development
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/types/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,17 @@ import { emitterEventNames } from "@octokit/webhooks";

export const runEvent = T.Union(emitterEventNames.map((o) => T.Literal(o)));

export const exampleCommandExecutionSchema = T.Object({
commandInvokation: T.String({ minLength: 1 }),
parameters: T.Optional(T.Record(T.String(), T.Any())),
expectedOutput: T.String({ minLength: 1 }),
});
Comment on lines +6 to +10
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spelling mistake commandInvocation

is commandInvocation supposed to be the comment? example: @UbiquityOS can you change my address to 0x00
Parameters are the expected way to infer parameters from the comment, right?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{
  "examples": [
    {
      "commandInvocation": "@UbiquityOS what is my wallet address?",
      "parameters": {
        "repositoryOwner": "repoOwnerUsername",
        "repositoryName": "example-repo",
        "issueNumber": 42,
        "author": "user1"
      },
      "expectedOutput": "{function: 'command-query', parameters: {\"username\": \"user1\"}}"
    }
  ]
}

Yes,commandInvocation is supposed to be a commend, the parameters, are values that are given to the LLM, and the expectedOutput is what the LLM should output, in this case it would be a tool call.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I thought the expectedOutput was supposed to be the output from the plugin, and parameters are the tool call generated by the LLM.
Maybe we could change the name from parameters to issueContext, githubContext or just context, and expectedOutput to expectedToolCall, what do you think?

Is it important for expectedOutput to be a string instead of an object? Because it's easier to write an object than to deal with escape characters and it's more readable.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I thought the expectedOutput was supposed to be the output from the plugin, and parameters are the tool call generated by the LLM. Maybe we could change the name from parameters to issueContext, githubContext or just context, and expectedOutput to expectedToolCall, what do you think?

That sounds good. These terms would function more as guiding examples, which could be included in the prompt to assist with generating the tool calls.

Is it important for expectedOutput to be a string instead of an object? Because it's easier to write an object than to deal with escape characters and it's more readable.

No, it can definitely be an object instead


export const commandSchema = T.Object({
description: T.String({ minLength: 1 }),
"ubiquity:example": T.String({ minLength: 1 }),
parameters: T.Optional(T.Record(T.String(), T.Any())),
examples: T.Optional(T.Array(exampleCommandExecutionSchema, { default: [] })),
});

export const manifestSchema = T.Object({
Expand Down