Skip to content

Commit 6767cd6

Browse files
committed
fix(docs): fix 7 remaining crashes in README and docs
1 parent d07ea72 commit 6767cd6

4 files changed

Lines changed: 13 additions & 11 deletions

File tree

packages/docs/content/docs/guides/rag-pipeline.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ const knowledge = createKnowledge({
5757
},
5858
});
5959

60-
await ingest('./handbook.pdf', knowledge.embedder, knowledge.store, {
60+
await knowledge.ingest('./handbook.pdf', {
6161
metadata: { source: 'handbook', version: '2024' },
6262
});
6363
```

packages/docs/content/docs/modules/knowledge.mdx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,15 @@ const result = await ingest(
109109
// result.chunks — number of chunks stored
110110
```
111111

112-
### `search(knowledge, query, options?)`
112+
### `search(query, embedder, store, options?)`
113113

114-
Semantic search across ingested documents.
114+
Semantic search across ingested documents. Also available as `knowledge.search(query, options?)` on a `KnowledgeClient`.
115115

116116
```ts
117117
function search(
118-
knowledge: KnowledgeClient,
119118
query: string,
119+
embedder: EmbedFunction,
120+
store: VectorStore,
120121
options?: SearchOptions,
121122
): Promise<SearchResult[]>
122123
```

packages/docs/content/docs/modules/security.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ function checkOutput(response: string, rules: GuardrailRule[]): GuardrailResult
109109

110110
```ts
111111
const rules = [
112-
{ id: 'no-pii', description: 'No PII in output', test: (text) => detectPII(text).length === 0 },
113-
{ id: 'max-length', description: 'Under 10k chars', test: (text) => text.length < 10000 },
112+
{ id: 'no-pii', description: 'No PII in output', test: (text) => detectPII(text).length > 0 },
113+
{ id: 'max-length', description: 'Under 10k chars', test: (text) => text.length >= 10000 },
114114
];
115115
116116
const guardrails = createGuardrails(rules);

packages/toolkit/README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,11 @@ const tsSplitter = createLanguageSplitter('typescript', { chunkSize: 1000 });
123123
```typescript
124124
import { createAgent, createGraph, route } from '@jamaalbuilds/ai-toolkit/agents';
125125

126-
const researcher = createAgent({ name: 'researcher', instructions: 'Research topics' });
127-
const writer = createAgent({ name: 'writer', instructions: 'Write content' });
126+
const researcher = createAgent({ name: 'researcher', systemPrompt: 'Research topics' });
127+
const writer = createAgent({ name: 'writer', systemPrompt: 'Write content' });
128128

129129
const graph = await createGraph({
130-
agents: { researcher, writer },
130+
agents: [researcher, writer],
131131
edges: [{ from: 'researcher', to: 'writer' }],
132132
});
133133

@@ -209,13 +209,14 @@ const emailJob = defineJob(workflow, {
209209

210210
// Human-in-the-loop approval (pauses workflow until approved)
211211
const approval = await humanInTheLoop(step, {
212-
prompt: 'Approve welcome email?',
212+
stepId: 'approve',
213+
event: 'approval/response',
213214
timeout: '24h',
214215
});
215216

216217
// AI-powered step (calls LLM inside a durable step)
217218
const summary = await aiStep(step, {
218-
name: 'summarize-signup',
219+
stepId: 'summarize-signup',
219220
prompt: `Summarize signup for ${event.data.email}`,
220221
});
221222
});

0 commit comments

Comments
 (0)