generated from ellisonleao/nvim-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
243 additions
and
207 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
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 |
---|---|---|
@@ -1,28 +1,40 @@ | ||
import { AnthropicClient } from '../anthropic' | ||
import { Logger } from '../logger' | ||
import { AnthropicClient } from "../anthropic.js"; | ||
import { Logger } from "../logger.js"; | ||
|
||
const logger = new Logger({ | ||
outWriteLine: () => Promise.resolve(undefined), | ||
errWriteLine: () => Promise.resolve(undefined) | ||
}, { | ||
level: 'trace' | ||
}) | ||
const logger = new Logger( | ||
{ | ||
outWriteLine: () => Promise.resolve(undefined), | ||
errWrite: () => Promise.resolve(undefined), | ||
errWriteLine: () => Promise.resolve(undefined), | ||
}, | ||
{ | ||
level: "trace", | ||
}, | ||
); | ||
|
||
async function run() { | ||
const client = new AnthropicClient(logger) | ||
const client = new AnthropicClient(logger); | ||
|
||
await client.sendMessage([{ | ||
role: 'user', | ||
content: 'try reading the contents of the file ./src/index.js' | ||
}], (text) => { | ||
return Promise.resolve(console.log('text: ' + text)) | ||
}) | ||
await client.sendMessage( | ||
[ | ||
{ | ||
role: "user", | ||
content: "try reading the contents of the file ./src/index.js", | ||
}, | ||
], | ||
(text) => { | ||
return Promise.resolve(console.log("text: " + text)); | ||
}, | ||
); | ||
} | ||
|
||
run().then(() => { | ||
console.log('success'); | ||
process.exit(0) | ||
}, (err) => { | ||
console.error(err); | ||
process.exit(1) | ||
}) | ||
run().then( | ||
() => { | ||
console.log("success"); | ||
process.exit(0); | ||
}, | ||
(err) => { | ||
console.error(err); | ||
process.exit(1); | ||
}, | ||
); |
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
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
Oops, something went wrong.