pub struct PromptRegistry {
prompts: HashMap<String, PromptDefinition>,
}Expand description
Registry of pre-defined prompts.
Fields§
§prompts: HashMap<String, PromptDefinition>Available prompts.
Implementations§
Source§impl PromptRegistry
impl PromptRegistry
Sourcefn all_prompts() -> Vec<PromptDefinition>
fn all_prompts() -> Vec<PromptDefinition>
Returns all prompt definitions.
fn session_start_prompt() -> PromptDefinition
fn session_start_alias_prompt() -> PromptDefinition
fn subcog_prompt() -> PromptDefinition
fn tutorial_prompt() -> PromptDefinition
fn generate_tutorial_definition() -> PromptDefinition
fn generate_tutorial_alias_prompt() -> PromptDefinition
fn capture_assistant_prompt() -> PromptDefinition
fn capture_prompt_alias() -> PromptDefinition
fn review_prompt() -> PromptDefinition
fn document_decision_prompt() -> PromptDefinition
fn generate_decision_alias_prompt() -> PromptDefinition
fn search_help_prompt() -> PromptDefinition
fn recall_prompt_alias() -> PromptDefinition
fn browse_prompt() -> PromptDefinition
fn list_prompt() -> PromptDefinition
fn intent_search_prompt() -> PromptDefinition
fn intent_search_alias_prompt() -> PromptDefinition
fn query_suggest_prompt() -> PromptDefinition
fn query_suggest_alias_prompt() -> PromptDefinition
fn context_capture_prompt() -> PromptDefinition
fn context_capture_alias_prompt() -> PromptDefinition
fn discover_prompt() -> PromptDefinition
fn discover_alias_prompt() -> PromptDefinition
Sourcepub fn list_prompts(&self) -> Vec<&PromptDefinition>
pub fn list_prompts(&self) -> Vec<&PromptDefinition>
Returns all prompt definitions (built-in only).
Sourcepub fn list_all_prompts(
&self,
prompt_service: &mut PromptService,
) -> Vec<PromptDefinition>
pub fn list_all_prompts( &self, prompt_service: &mut PromptService, ) -> Vec<PromptDefinition>
Returns all prompt definitions including user-defined prompts.
User prompts are fetched from the PromptService and combined with built-in prompts.
Built-in prompts take precedence if there are name conflicts.
Sourcepub fn get_prompt_with_user(
&self,
name: &str,
prompt_service: &mut PromptService,
) -> Option<PromptDefinition>
pub fn get_prompt_with_user( &self, name: &str, prompt_service: &mut PromptService, ) -> Option<PromptDefinition>
Gets a prompt definition by name, including user prompts.
User prompts are prefixed with “user/” (e.g., “user/code-review”).
Sourcepub fn get_prompt(&self, name: &str) -> Option<&PromptDefinition>
pub fn get_prompt(&self, name: &str) -> Option<&PromptDefinition>
Gets a prompt definition by name.
Sourcepub fn get_prompt_messages(
&self,
name: &str,
arguments: &Value,
) -> Option<Vec<PromptMessage>>
pub fn get_prompt_messages( &self, name: &str, arguments: &Value, ) -> Option<Vec<PromptMessage>>
Generates prompt messages for a given prompt and arguments.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PromptRegistry
impl RefUnwindSafe for PromptRegistry
impl Send for PromptRegistry
impl Sync for PromptRegistry
impl Unpin for PromptRegistry
impl UnwindSafe for PromptRegistry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].