@output.ai/core 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -90
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,96 +3,9 @@
|
|
|
3
3
|
Workflow orchestration and worker runtime for building durable LLM applications with Temporal.
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@output.ai/core)
|
|
6
|
-
[](https://docs.output.ai/packages/core)
|
|
7
|
-
|
|
8
|
-
## Installation
|
|
9
|
-
|
|
10
|
-
```bash
|
|
11
|
-
npm install @output.ai/core
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
## Quick Start
|
|
15
|
-
|
|
16
|
-
```typescript
|
|
17
|
-
// workflow.ts
|
|
18
|
-
import { workflow, z } from '@output.ai/core';
|
|
19
|
-
import { processData } from './steps.js';
|
|
20
|
-
|
|
21
|
-
export default workflow({
|
|
22
|
-
name: 'myWorkflow',
|
|
23
|
-
inputSchema: z.object({ text: z.string() }),
|
|
24
|
-
outputSchema: z.object({ result: z.string() }),
|
|
25
|
-
fn: async (input) => {
|
|
26
|
-
const result = await processData(input.text);
|
|
27
|
-
return { result };
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
```typescript
|
|
33
|
-
// steps.ts
|
|
34
|
-
import { step, z } from '@output.ai/core';
|
|
35
|
-
|
|
36
|
-
export const processData = step({
|
|
37
|
-
name: 'processData',
|
|
38
|
-
inputSchema: z.string(),
|
|
39
|
-
outputSchema: z.string(),
|
|
40
|
-
fn: async (text) => {
|
|
41
|
-
return text.toUpperCase();
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
## Key Exports
|
|
47
|
-
|
|
48
|
-
| Export | Description |
|
|
49
|
-
|--------|-------------|
|
|
50
|
-
| `workflow` | Define orchestration logic that coordinates steps |
|
|
51
|
-
| `step` | Define reusable units of work that handle I/O |
|
|
52
|
-
| `evaluator` | Define steps that return evaluation results |
|
|
53
|
-
| `createWebhook` | Pause workflow execution until external input |
|
|
54
|
-
| `z` | Zod schema library for input/output validation |
|
|
55
|
-
|
|
56
|
-
## File Structure
|
|
57
|
-
|
|
58
|
-
Each workflow lives in its own directory:
|
|
59
|
-
|
|
60
|
-
```text
|
|
61
|
-
src/workflows/
|
|
62
|
-
└── my-workflow/
|
|
63
|
-
├── workflow.ts # Workflow definition
|
|
64
|
-
├── steps.ts # Step implementations
|
|
65
|
-
├── evaluators.ts # Evaluators (optional)
|
|
66
|
-
├── prompts/ # LLM prompt templates
|
|
67
|
-
│ └── prompt@v1.prompt
|
|
68
|
-
└── scenarios/ # Test scenarios
|
|
69
|
-
└── test_input.json
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
## Environment Variables
|
|
73
|
-
|
|
74
|
-
The worker reads these environment variables:
|
|
75
|
-
|
|
76
|
-
| Variable | Description |
|
|
77
|
-
|----------|-------------|
|
|
78
|
-
| `TEMPORAL_ADDRESS` | Temporal backend address |
|
|
79
|
-
| `TEMPORAL_NAMESPACE` | Temporal namespace name |
|
|
80
|
-
| `TEMPORAL_API_KEY` | API key for remote Temporal (leave blank for local) |
|
|
81
|
-
| `CATALOG_ID` | **Required.** Name of the local catalog (use your email) |
|
|
82
|
-
| `API_AUTH_KEY` | API key for Framework API (blank for local, required for remote) |
|
|
83
|
-
| `TRACE_LOCAL_ON` | Enable local trace saving (requires `REDIS_URL`) |
|
|
84
|
-
| `TRACE_REMOTE_ON` | Enable remote trace saving (requires `REDIS_URL` and AWS secrets) |
|
|
85
|
-
| `REDIS_URL` | Redis address (required when tracing is enabled) |
|
|
86
|
-
| `TRACE_REMOTE_S3_BUCKET` | AWS S3 bucket for traces (required for remote tracing) |
|
|
87
|
-
| `AWS_REGION` | AWS region matching the S3 bucket (required for remote tracing) |
|
|
88
|
-
| `AWS_ACCESS_KEY_ID` | AWS key ID (required for remote tracing) |
|
|
89
|
-
| `AWS_SECRET_ACCESS_KEY` | AWS secret key (required for remote tracing) |
|
|
90
6
|
|
|
91
7
|
## Documentation
|
|
8
|
+
- [README](https://docs.output.ai/packages/core)
|
|
9
|
+
- [API Reference](https://output-ai-reference-code-docs.onrender.com/modules/core_src.html)
|
|
92
10
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
- [Package Reference](https://docs.output.ai/packages/core)
|
|
96
|
-
- [Workflows Guide](https://docs.output.ai/core/workflows)
|
|
97
|
-
- [Steps Guide](https://docs.output.ai/core/steps)
|
|
98
|
-
- [Getting Started](https://docs.output.ai/quickstart)
|
|
11
|
+
<!-- Internal Dev Note: The documentation for this package is found at docs/guides/packages/core.mdx -->
|