Skip to content

Commit

Permalink
Minor updates in cli
Browse files Browse the repository at this point in the history
  • Loading branch information
synw committed Nov 1, 2024
1 parent 1a3e936 commit ffe3ac1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
9 changes: 4 additions & 5 deletions packages/cli/bin/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useAgentBrain } from "@agent-smith/brain";
import { LmTaskBuilder } from "@agent-smith/lmtask";
import { MarkedExtension, marked } from 'marked';
import { markedTerminal } from "marked-terminal";
import { FeatureType, RunMode } from "./interfaces.js";
import { FeatureType } from "./interfaces.js";

marked.use(markedTerminal() as MarkedExtension);

Expand All @@ -12,7 +12,6 @@ const taskBuilder = new LmTaskBuilder<FeatureType>(brain);

async function initExperts() {
brain.experts.forEach((ex) => {
//ex.backend.setOnStartEmit(() => console.log(""))
ex.backend.setOnToken((t) => {
process.stdout.write(t)
});
Expand All @@ -25,9 +24,9 @@ async function initAgent(isVerbose = false): Promise<boolean> {
//console.log("Init", isVerbose);
await brain.initLocal(true, isVerbose);
await initExperts();
/*console.log("Backends:", brain.backends.map(x => x.name));
console.log("Experts:", brain.experts.map(x => x.name));
console.log("Bfm:", brain.backendsForModels);*/
//console.log("Backends:", brain.backends.map(x => x.name));
//console.log("Experts:", brain.experts.map(x => x.name));
//console.log("Bfm:", brain.backendsForModels);
}
const brainUp = brain.state.get().isOn;
if (isVerbose) {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/bin/cmd/clicmds/cmds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ async function _executeTaskCmd(args: Array<string> = [], options: any): Promise<
console.warn(error)
}
if (formatMode.value == "markdown") {
console.log("\n\n------------------\n");
console.log("\n------------------\n");
console.log((marked.parse(data) as string).trim())
} else {
console.log()
Expand Down
2 changes: 2 additions & 0 deletions packages/cli/bin/cmd/lib/execute_task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ async function executeTaskCmd(args: Array<string> = [], options: any = {}): Prom
throw new Error("No expert found for model " + m)
}
ex.checkStatus();
//ex.backend.setOnStartEmit(() => console.log("[START]"));
ex.backend.setOnToken((t) => {
//console.log("|")
process.stdout.write(t)
});
conf.expert = ex;
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@agent-smith/cli",
"description": "Agent Smith: terminal client for language model agents",
"repository": "https://github.com/synw/agent-smith",
"version": "0.0.20",
"version": "0.0.21",
"scripts": {
"buildrl": "rm -rf dist/* && rollup -c",
"build": "rm -rf dist/* && tsc",
Expand Down

0 comments on commit ffe3ac1

Please sign in to comment.