///
The Quicksilver SDK empowers developers to define and manage complex services and workflows as "programmable products." This example demonstrates how to create various types of products—from simple un
65 views
~65 views from guests
Guest views are estimated from total page views. These include anonymous visitors and users who weren't logged in when they viewed the page.
The Quicksilver SDK empowers developers to define and manage complex services and workflows as "programmable products." This example demonstrates how to create various types of products—from simple unit-based services to multi-agent workflows and streaming offerings—and how a customer can seamlessly purchase them. It highlights the expressive power of the ProductBuilder (aliased as Product), specifically showcasing the use of its charge(), guarantee(), and stage() methods.
This demo covers:
charge() and guarantee() for straightforward per-unit pricing and service level agreements.stage() method to orchestrate tasks delegated to different sub-agents, defining a clear workflow with associated charges and guarantees.stream() method for continuous, time-based services.Account object can purchase() these defined products, initiating corresponding transactions.The ProductBuilder abstracts away the underlying API complexity, allowing you to focus on the business logic of your programmable money primitives.
examples/4-programmable-products.tsThis example demonstrates how the Quicksilver SDK's ProductBuilder provides a powerful and intuitive way to model real-world services as programmable financial primitives.
client.product(id): The entry point for defining any new product, identified by a unique ID..charge(rate, unit, currency): Easily sets up unit-based pricing models, such as charging "per word" or "per line"..stream(rate, unit, currency): Configures real-time, continuous payment models, perfect for services billed "per second" or "per minute"..guarantee(guarantees): Allows attaching descriptive Service Level Agreements (SLAs) or other assurances directly to the product definition, enhancing transparency and trust..stage(name, config): Enables the definition of complex, multi-agent workflows by breaking a service down into discrete stages, each delegating to a specific agent with its own associated charge.account.purchase(product, options): Customers can interact with these defined products naturally, initiating transactions that automatically adhere to the product's embedded logic, pricing, and workflow.By encapsulating pricing, guarantees, and workflows within a Product object, developers can build a rich ecosystem of services where the financial logic is an inherent part of the product definition, not an afterthought.