services-as-software
Version:
Primitives for building AI-powered services that operate as software
43 lines • 1.05 kB
TypeScript
/**
* Service implementation
*/
import type { ServiceDefinition, Service } from './types.js';
/**
* Create a service from a definition
*
* @example
* ```ts
* const service = Service({
* name: 'translation-service',
* version: '1.0.0',
* description: 'AI-powered translation service',
* pricing: {
* model: 'per-use',
* pricePerUnit: 0.01,
* currency: 'USD',
* },
* endpoints: [
* Endpoint({
* name: 'translate',
* method: 'POST',
* path: '/translate',
* input: {
* type: 'object',
* properties: {
* text: { type: 'string' },
* from: { type: 'string' },
* to: { type: 'string' },
* },
* required: ['text', 'to'],
* },
* handler: async (input) => {
* // Translation logic here
* return { translatedText: input.text }
* },
* }),
* ],
* })
* ```
*/
export declare function Service(definition: ServiceDefinition): Service;
//# sourceMappingURL=service.d.ts.map