Skip to content

Question: how to use resources for prompts? #433

@github-gregory-bougeard

Description

Hi, it's more a question than an issue but I'd like to know how to efficiently use resources for prompts.

My idea is to expose markdown files for prompts as resources. and to combine (or not) those resources to expose a prompt.
My markdown files might be templated (need to replace some parameters coming from the prompt request).

Is the following a way to go:

let uri = "prompt:///my_prompt";
let messages = vec![PromptMessage::new_resource(
                    PromptMessageRole::User,
                    uri,
                )];

                Ok(GetPromptResult {
                    description: Some(format!(
                        "Prompt using my input",
                        my_input,
                    )),
                    messages,
                })

I am not sure about how to use PromptMessage::new_resource and if it is a good idea to process this way. Would you mind adding some examples of its usage? (Maybe add an example while resolving #337 ?)

Thanks a lot.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions