mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-25 20:29:33 +00:00
38 lines
1.3 KiB
TypeScript
38 lines
1.3 KiB
TypeScript
import { defineSingleProviderPluginEntry } from "openclaw/plugin-sdk/provider-entry";
|
|
import { applyCohereConfig, COHERE_DEFAULT_MODEL_REF } from "./onboard.js";
|
|
import { buildCohereProvider } from "./provider-catalog.js";
|
|
import { createCohereCompletionsWrapper } from "./stream.js";
|
|
|
|
export default defineSingleProviderPluginEntry({
|
|
id: "cohere",
|
|
name: "Cohere Provider",
|
|
description: "Cohere provider plugin",
|
|
provider: {
|
|
label: "Cohere",
|
|
docsPath: "/providers/cohere",
|
|
auth: [
|
|
{
|
|
methodId: "api-key",
|
|
label: "Cohere API key",
|
|
hint: "OpenAI-compatible inference",
|
|
optionKey: "cohereApiKey",
|
|
flagName: "--cohere-api-key",
|
|
envVar: "COHERE_API_KEY",
|
|
promptMessage: "Enter Cohere API key",
|
|
defaultModel: COHERE_DEFAULT_MODEL_REF,
|
|
applyConfig: (cfg) => applyCohereConfig(cfg),
|
|
wizard: {
|
|
groupLabel: "Cohere",
|
|
groupHint: "OpenAI-compatible inference",
|
|
},
|
|
},
|
|
],
|
|
catalog: {
|
|
buildProvider: buildCohereProvider,
|
|
buildStaticProvider: buildCohereProvider,
|
|
},
|
|
wrapStreamFn: (ctx) => createCohereCompletionsWrapper(ctx.streamFn),
|
|
wrapSimpleCompletionStreamFn: (ctx) => createCohereCompletionsWrapper(ctx.streamFn),
|
|
},
|
|
});
|