Skip to main content

Crate systemprompt_provider_contracts

Crate systemprompt_provider_contracts 

Source
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

§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::NavConfig;
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.yaml of each profile.

Macros§

submit_job

Structs§

ComponentContext
ContentDataContext
ExtendedData
ExtenderContext
ExtenderContextBuilder
FrontmatterContext
JobContext
JobResult
PageContext
PagePrepareContext
PageRenderSpec
PartialTemplate
PlaceholderMapping
RenderedComponent
RssFeedContext
RssFeedItem
RssFeedMetadata
RssFeedSpec
SitemapAlternate
SitemapContext
SitemapSourceSpec
SitemapUrlEntry
TemplateDefinition
ToolCallRequest
ToolCallResult
ToolContext
ToolDefinition

Enums§

PartialSource
ProviderError
TemplateSource
ToolContent
ToolProviderError

Traits§

ComponentRenderer
ContentDataProvider
FrontmatterProcessor
Job
PageDataProvider
PagePrerenderer
RssFeedProvider
SitemapProvider
TemplateDataExtender
TemplateProvider
ToolProvider

Type Aliases§

DynPagePrerenderer
ProviderResult
ToolProviderResult