@astii/monaco-chat
v0.0.1
Published
monaco-editor inline chat
Downloads
64
Readme
@astii/monaco-chat
inline AI chat tool for monaco-editor. with tool can use any model which response based on SSE
Install
$ npm install @astii/monaco-chat
Usage
import { registerChat } from '@astii/monaco-chat'
useEffect(() => {
if (!monaco || !editor) return;
const dispose = registerChat(monaco, editor, {
language: "typescript",
path: "index.ts", //unique label
request: new Request("", {
method: "POST",
headers: {
"x-dmo-provider": "",
authorization: "Bearer ",
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "",
stream: true,
temperature: 0.1,
}),
}),
onAccept(code: string) {
},
onFree() {
}
});
return () => {
dispose();
};
}, [monaco, editor]);
with the Request params, developer can request custom model service
LICENSE
MIT