pw-core
Shared types for the PromptWallet ecosystem - an OpenAI-compatible AI infrastructure platform.
Features
- OpenAI-compatible Chat Types: Request/response types that work with OpenAI, Anthropic, Groq, OpenRouter, and other LLM providers
- Artifact Storage Types: Types for semantic search and artifact management
- Extension Registry Types: Types for the PromptWallet extension system
Installation
Add to your Cargo.toml:
[]
= "0.1"
For server-side use with sqlx:
[]
= { = "0.1", = ["sqlx"] }
Usage
Chat Messages
use ;
// Create messages using convenience methods
let messages = vec!;
// Build a request
let request = ChatCompletionRequest ;
Artifacts
use ;
// Create an artifact
let artifact = new
.with_title
.with_metadata;
// Build a search query
let query = new
.with_types
.with_limit;
Extensions
use ;
// Extension status
let status = Stable;
assert_eq!;
Modules
pw_core::chat- OpenAI-compatible chat types (Message, ChatCompletionRequest, ChatCompletionResponse, etc.)pw_core::artifacts- Artifact storage types (Artifact, ArtifactType, SearchResult, etc.)pw_core::extensions- Extension registry types (ExtensionInfo, Category, ClientApp, etc.)
Compatibility
These types are designed to be compatible with:
- OpenAI API
- Anthropic Claude API (via adapter)
- Groq API
- OpenRouter API
- Any OpenAI-compatible provider
License
MIT