Expand description
Provider trait contracts for systemprompt.io.
This crate defines the trait surface every provider implementation (LLM, tool, RSS, sitemap, frontmatter, content-data, page-data, page-prerender, component, template-data extender, job, template) is expected to satisfy. Domain crates depend on these traits; concrete providers live in higher-up crates and slot in via composition.
§Public errors
- LLM providers return
llm::LlmProviderError. - Tool providers return
tool::ToolProviderError. - All other providers return
error::ProviderError.
§Feature flags
This crate currently exposes no Cargo feature flags — all trait contracts are always compiled. Provider implementations gate their own SDK choices via features further up the stack.
§Example
use systemprompt_provider_contracts::llm::{ChatMessage, ChatRequest};
let _request = ChatRequest::new(vec![ChatMessage::user("Hello")], "claude-sonnet-4-7", 1024);Re-exports§
pub use llm::ChatMessage;pub use llm::ChatRequest;pub use llm::ChatResponse;pub use llm::ChatRole;pub use llm::ChatStream;pub use llm::LlmProvider;pub use llm::LlmProviderError;pub use llm::LlmProviderResult;pub use llm::SamplingParameters;pub use llm::TokenUsage;pub use llm::ToolExecutionContext;pub use llm::ToolExecutor;pub use web_config::AnimationConfig;pub use web_config::BrandingConfig;pub use web_config::CardConfig;pub use web_config::ColorsConfig;pub use web_config::FontsConfig;pub use web_config::LayoutConfig;pub use web_config::LogoConfig;pub use web_config::MobileConfig;pub use web_config::PathsConfig;pub use web_config::RadiusConfig;pub use web_config::ScriptConfig;pub use web_config::ShadowsConfig;pub use web_config::SiteI18nConfig;pub use web_config::SocialActionBarConfig;pub use web_config::SocialPlatform;pub use web_config::SpacingConfig;pub use web_config::TouchTargetsConfig;pub use web_config::TypographyConfig;pub use web_config::WebConfig;pub use web_config::WebConfigError;pub use web_config::ZIndexConfig;
Modules§
- llm
- Large-language-model provider contracts.
- web_
config - Web rendering configuration: paths, branding, theme, layout, and
navigation. These types are serialized to / from YAML in the
webconfig.yamlof each profile.
Macros§
Structs§
- Component
Context - Content
Data Context - Extended
Data - Extender
Context - Extender
Context Builder - Frontmatter
Context - JobContext
- JobResult
- Page
Context - Page
Prepare Context - Page
Render Spec - Partial
Template - Placeholder
Mapping - Rendered
Component - RssFeed
Context - RssFeed
Item - RssFeed
Metadata - RssFeed
Spec - Sitemap
Alternate - Sitemap
Context - Sitemap
Source Spec - Sitemap
UrlEntry - Template
Definition - Tool
Call Request - Tool
Call Result - Tool
Context - Tool
Definition
Enums§
Traits§
- Component
Renderer - Content
Data Provider - Frontmatter
Processor - Job
- Page
Data Provider - Page
Prerenderer - RssFeed
Provider - Sitemap
Provider - Template
Data Extender - Template
Provider - Tool
Provider