fix tool config in example in SDK README.md
This commit is contained in:
@@ -40,9 +40,6 @@ import {
|
|||||||
ModelRegistry,
|
ModelRegistry,
|
||||||
SessionManager,
|
SessionManager,
|
||||||
SettingsManager,
|
SettingsManager,
|
||||||
codingTools,
|
|
||||||
readOnlyTools,
|
|
||||||
readTool, bashTool, editTool, writeTool,
|
|
||||||
} from "@earendil-works/pi-coding-agent";
|
} from "@earendil-works/pi-coding-agent";
|
||||||
|
|
||||||
// Auth and models setup
|
// Auth and models setup
|
||||||
@@ -64,7 +61,7 @@ await loader.reload();
|
|||||||
const { session } = await createAgentSession({ resourceLoader: loader, authStorage, modelRegistry });
|
const { session } = await createAgentSession({ resourceLoader: loader, authStorage, modelRegistry });
|
||||||
|
|
||||||
// Read-only
|
// Read-only
|
||||||
const { session } = await createAgentSession({ tools: readOnlyTools, authStorage, modelRegistry });
|
const { session } = await createAgentSession({ tools: ["read", "grep", "find", "ls"], authStorage, modelRegistry });
|
||||||
|
|
||||||
// In-memory
|
// In-memory
|
||||||
const { session } = await createAgentSession({
|
const { session } = await createAgentSession({
|
||||||
@@ -92,8 +89,8 @@ const { session } = await createAgentSession({
|
|||||||
authStorage: customAuth,
|
authStorage: customAuth,
|
||||||
modelRegistry: customRegistry,
|
modelRegistry: customRegistry,
|
||||||
resourceLoader,
|
resourceLoader,
|
||||||
tools: [readTool, bashTool],
|
tools: ["read", "bash", "my_tool"],
|
||||||
customTools: [{ tool: myTool }],
|
customTools: [myTool],
|
||||||
sessionManager: SessionManager.inMemory(),
|
sessionManager: SessionManager.inMemory(),
|
||||||
settingsManager: SettingsManager.inMemory(),
|
settingsManager: SettingsManager.inMemory(),
|
||||||
});
|
});
|
||||||
@@ -117,7 +114,7 @@ await session.prompt("Hello");
|
|||||||
| `agentDir` | `~/.pi/agent` | Config directory |
|
| `agentDir` | `~/.pi/agent` | Config directory |
|
||||||
| `model` | From settings/first available | Model to use |
|
| `model` | From settings/first available | Model to use |
|
||||||
| `thinkingLevel` | From settings/"off" | off, low, medium, high |
|
| `thinkingLevel` | From settings/"off" | off, low, medium, high |
|
||||||
| `tools` | `codingTools` | Built-in tools |
|
| `tools` | `["read", "grep", "find", "ls", "bash", "edit", "write"]` | Built-in tools |
|
||||||
| `customTools` | `[]` | Additional tool definitions |
|
| `customTools` | `[]` | Additional tool definitions |
|
||||||
| `resourceLoader` | DefaultResourceLoader | Resource loader for extensions, skills, prompts, themes |
|
| `resourceLoader` | DefaultResourceLoader | Resource loader for extensions, skills, prompts, themes |
|
||||||
| `sessionManager` | `SessionManager.create(cwd)` | Persistence |
|
| `sessionManager` | `SessionManager.create(cwd)` | Persistence |
|
||||||
|
|||||||
Reference in New Issue
Block a user