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

Optional type info for Prompt parameters, or better allow JsonSchema for prompts as well #136

Open
headinthebox opened this issue Jan 9, 2025 · 2 comments
Labels
enhancement New feature or request

Comments

@headinthebox
Copy link

Conceptually, prompts and tools are very similar, i.e., a prompt is a tool that returns a list of messages.
However, the types of Prompts and Tools are unnecessarily different. Why not specify prompt parameters using JsonSchema as well.

If that goes to far, I'd like to be able to specify an inputType for a PromptArgument such that the UI for entering them can reflect their types.

export interface Prompt {
/**

  • The name of the prompt or prompt template.
    /
    name: string;
    /
    *
  • An optional description of what this prompt provides
    /
    description?: string;
    /
    *
  • A list of arguments to use for templating the prompt.
    */
    arguments?: PromptArgument[];
    }

export interface PromptArgument {
/**

  • The name of the argument.
    /
    name: string;
    /
    *
  • A human-readable description of the argument.
    /
    description?: string;
    /
    *
  • Whether this argument must be provided.
    */
    required?: boolean;
    }

export interface Tool {
/**

  • The name of the tool.
    /
    name: string;
    /
    *
  • A human-readable description of the tool.
    /
    description?: string;
    /
    *
  • A JSON Schema object defining the expected parameters for the tool.
    */
    inputSchema: {
    type: "object";
    properties?: { [key: string]: object };
    required?: string[];
    };
    }
@headinthebox headinthebox added the enhancement New feature or request label Jan 9, 2025
@jspahrsummers
Copy link
Member

jspahrsummers commented Jan 10, 2025

We discussed this a bit while designing prompts, and IIRC our main concern was supporting slash command style inputs (/myprompt foo bar), especially in CLIs, which is made harder if prompts accept complex types rather than just strings.

I think it's good if prompts can always support plain strings somehow, but maybe we can allow more structured types over the top if the client and server both support them. Maybe like <img> tag alt text?

@dsp-ant Curious for your thoughts

@headinthebox
Copy link
Author

I'd be OK if you could specify only simple types (like text, number, date, time, boolean, enum)

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

No branches or pull requests

2 participants