@live-codes/monaco-codeium-provider
v0.2.2
Published
AI auto-completion provider for Monaco editor powered by Codeium
Downloads
13
Readme
Monaco Codeium Provider
AI auto-completion provider for Monaco editor powered by Codeium.
As used in LiveCodes.
Based on https://github.com/Exafunction/codeium-react-code-editor (MIT License)
Installation
npm install @live-codes/monaco-codeium-provider
Usage
import { registerCodeiumProvider } from "@live-codes/monaco-codeium-provider";
const provider = registerCodeiumProvider(
monaco,
// optional config
{
languageServer: "https://web-backend.codeium.com",
apiKey: "codeium-api-key",
onAutocomplete: (acceptedText) => {
// runs on completion
console.log(acceptedText);
},
getEditors: () => {
// return an array of other monaco editors that you want their content to be used for AI context
// e.g. if the current editor is for JS, return HTML and CSS editors
return [];
},
}
);
// to dispose
provider.dispose();