-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update examples to use local LM and upgrade dependencies
- updated discover.ts to use brain.discoverLocal() - added new file expert_for_model.ts with example usage of local LM - updated package.json to reflect dependency changes
- Loading branch information
Showing
3 changed files
with
28 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env node | ||
import { useAgentBrain, useLmExpert } from "@agent-smith/brain"; | ||
|
||
// run a local Ollama instance before running this example | ||
// node --loader ts-node/esm expert_for_model.ts | ||
|
||
const ex = useLmExpert({ | ||
name: "default", | ||
localLm: "ollama", | ||
}); | ||
// add more experts ... | ||
|
||
const brain = useAgentBrain([ex]); | ||
|
||
async function main() { | ||
// auto discover loc | ||
console.log("Auto discovering brain backend ..."); | ||
await brain.discover(true); | ||
await brain.expertsForModelsInfo() | ||
console.log("Experts for model:", brain.expertsForModels) | ||
} | ||
|
||
(async () => { | ||
await main(); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters