CompletionProvider

Trait CompletionProvider 

Source
pub trait CompletionProvider: Send + Sync {
    // Provided methods
    fn complete_prompt<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        prompt_name: &'life1 str,
        argument_name: &'life2 str,
        argument_value: &'life3 str,
    ) -> Pin<Box<dyn Future<Output = Vec<CompletionValue>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait { ... }
    fn complete_resource<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        uri: &'life1 str,
        argument_name: &'life2 str,
        argument_value: &'life3 str,
    ) -> Pin<Box<dyn Future<Output = Vec<CompletionValue>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait { ... }
    fn max_completions(&self) -> usize { ... }
}
Expand description

Trait for providing completion suggestions

Implement this trait to provide custom completion logic for prompts and resources.

Provided Methods§

Source

fn complete_prompt<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, prompt_name: &'life1 str, argument_name: &'life2 str, argument_value: &'life3 str, ) -> Pin<Box<dyn Future<Output = Vec<CompletionValue>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Provide completions for a prompt argument

§Arguments
  • prompt_name - Name of the prompt being completed
  • argument_name - Name of the argument being completed
  • argument_value - Current partial value of the argument
§Returns

List of completion suggestions matching the partial value

Source

fn complete_resource<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, uri: &'life1 str, argument_name: &'life2 str, argument_value: &'life3 str, ) -> Pin<Box<dyn Future<Output = Vec<CompletionValue>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Provide completions for a resource URI argument

§Arguments
  • uri - URI pattern of the resource
  • argument_name - Name of the argument being completed
  • argument_value - Current partial value of the argument
§Returns

List of completion suggestions matching the partial value

Source

fn max_completions(&self) -> usize

Maximum completions to return (default: 100)

Implementors§