-
Notifications
You must be signed in to change notification settings - Fork 69
Expand file tree
/
Copy pathindex.ts
More file actions
29 lines (27 loc) · 1012 Bytes
/
index.ts
File metadata and controls
29 lines (27 loc) · 1012 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import type { OpenClawPluginApi } from "openclaw/plugin-sdk";
import { emptyPluginConfigSchema } from "openclaw/plugin-sdk";
import { registerOpikCli } from "./src/cli.js";
import { createOpikService, type OpikRuntimeService } from "./src/service.js";
import { parseOpikPluginConfig } from "./src/types.js";
const plugin = {
id: "opik-openclaw",
name: "Opik",
description: "Export LLM traces and spans to Opik for observability",
configSchema: emptyPluginConfigSchema(),
register(api: OpenClawPluginApi) {
const pluginConfig = parseOpikPluginConfig(api.pluginConfig);
const service = createOpikService(api, pluginConfig) as OpikRuntimeService;
service.registerHooks();
api.registerService(service);
api.registerCli(
({ program }) =>
registerOpikCli({
program,
loadConfig: api.runtime.config.loadConfig,
writeConfigFile: api.runtime.config.writeConfigFile,
}),
{ commands: ["opik"] },
);
},
};
export default plugin;