feat(ai,coding-agent): add faux provider and ModelRegistry factories
This commit is contained in:
@@ -44,7 +44,7 @@ import {
|
||||
|
||||
// Auth and models setup
|
||||
const authStorage = AuthStorage.create();
|
||||
const modelRegistry = new ModelRegistry(authStorage);
|
||||
const modelRegistry = ModelRegistry.create(authStorage);
|
||||
|
||||
// Minimal
|
||||
const { session } = await createAgentSession({ authStorage, modelRegistry });
|
||||
@@ -73,7 +73,7 @@ const { session } = await createAgentSession({
|
||||
// Full control
|
||||
const customAuth = AuthStorage.create("/my/app/auth.json");
|
||||
customAuth.setRuntimeApiKey("anthropic", process.env.MY_KEY!);
|
||||
const customRegistry = new ModelRegistry(customAuth);
|
||||
const customRegistry = ModelRegistry.create(customAuth);
|
||||
|
||||
const resourceLoader = new DefaultResourceLoader({
|
||||
systemPromptOverride: () => "You are helpful.",
|
||||
@@ -109,7 +109,7 @@ await session.prompt("Hello");
|
||||
| Option | Default | Description |
|
||||
|--------|---------|-------------|
|
||||
| `authStorage` | `AuthStorage.create()` | Credential storage |
|
||||
| `modelRegistry` | `new ModelRegistry(authStorage)` | Model registry |
|
||||
| `modelRegistry` | `ModelRegistry.create(authStorage)` | Model registry |
|
||||
| `cwd` | `process.cwd()` | Working directory |
|
||||
| `agentDir` | `~/.pi/agent` | Config directory |
|
||||
| `model` | From settings/first available | Model to use |
|
||||
|
||||
Reference in New Issue
Block a user