mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 16:10:49 +00:00
feat: declare byteplus model catalog
This commit is contained in:
@@ -1,13 +1,19 @@
|
|||||||
|
import { buildManifestModelProviderConfig } from "openclaw/plugin-sdk/provider-catalog-shared";
|
||||||
import type { ModelDefinitionConfig } from "openclaw/plugin-sdk/provider-model-shared";
|
import type { ModelDefinitionConfig } from "openclaw/plugin-sdk/provider-model-shared";
|
||||||
import {
|
import manifest from "./openclaw.plugin.json" with { type: "json" };
|
||||||
buildVolcModelDefinition,
|
|
||||||
VOLC_MODEL_GLM_4_7,
|
|
||||||
VOLC_MODEL_KIMI_K2_5,
|
|
||||||
VOLC_SHARED_CODING_MODEL_CATALOG,
|
|
||||||
} from "openclaw/plugin-sdk/volc-model-catalog-shared";
|
|
||||||
|
|
||||||
export const BYTEPLUS_BASE_URL = "https://ark.ap-southeast.bytepluses.com/api/v3";
|
const BYTEPLUS_MANIFEST_PROVIDER = buildManifestModelProviderConfig({
|
||||||
export const BYTEPLUS_CODING_BASE_URL = "https://ark.ap-southeast.bytepluses.com/api/coding/v3";
|
providerId: "byteplus",
|
||||||
|
catalog: manifest.modelCatalog.providers.byteplus,
|
||||||
|
});
|
||||||
|
|
||||||
|
const BYTEPLUS_CODING_MANIFEST_PROVIDER = buildManifestModelProviderConfig({
|
||||||
|
providerId: "byteplus-plan",
|
||||||
|
catalog: manifest.modelCatalog.providers["byteplus-plan"],
|
||||||
|
});
|
||||||
|
|
||||||
|
export const BYTEPLUS_BASE_URL = BYTEPLUS_MANIFEST_PROVIDER.baseUrl;
|
||||||
|
export const BYTEPLUS_CODING_BASE_URL = BYTEPLUS_CODING_MANIFEST_PROVIDER.baseUrl;
|
||||||
export const BYTEPLUS_DEFAULT_MODEL_ID = "seed-1-8-251228";
|
export const BYTEPLUS_DEFAULT_MODEL_ID = "seed-1-8-251228";
|
||||||
export const BYTEPLUS_CODING_DEFAULT_MODEL_ID = "ark-code-latest";
|
export const BYTEPLUS_CODING_DEFAULT_MODEL_ID = "ark-code-latest";
|
||||||
export const BYTEPLUS_DEFAULT_MODEL_REF = `byteplus/${BYTEPLUS_DEFAULT_MODEL_ID}`;
|
export const BYTEPLUS_DEFAULT_MODEL_REF = `byteplus/${BYTEPLUS_DEFAULT_MODEL_ID}`;
|
||||||
@@ -19,20 +25,9 @@ export const BYTEPLUS_DEFAULT_COST = {
|
|||||||
cacheWrite: 0,
|
cacheWrite: 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const BYTEPLUS_MODEL_CATALOG = [
|
export const BYTEPLUS_MODEL_CATALOG: ModelDefinitionConfig[] = BYTEPLUS_MANIFEST_PROVIDER.models;
|
||||||
{
|
export const BYTEPLUS_CODING_MODEL_CATALOG: ModelDefinitionConfig[] =
|
||||||
id: "seed-1-8-251228",
|
BYTEPLUS_CODING_MANIFEST_PROVIDER.models;
|
||||||
name: "Seed 1.8",
|
|
||||||
reasoning: false,
|
|
||||||
input: ["text", "image"] as const,
|
|
||||||
contextWindow: 256000,
|
|
||||||
maxTokens: 4096,
|
|
||||||
},
|
|
||||||
VOLC_MODEL_KIMI_K2_5,
|
|
||||||
VOLC_MODEL_GLM_4_7,
|
|
||||||
] as const;
|
|
||||||
|
|
||||||
export const BYTEPLUS_CODING_MODEL_CATALOG = VOLC_SHARED_CODING_MODEL_CATALOG;
|
|
||||||
|
|
||||||
export type BytePlusCatalogEntry = (typeof BYTEPLUS_MODEL_CATALOG)[number];
|
export type BytePlusCatalogEntry = (typeof BYTEPLUS_MODEL_CATALOG)[number];
|
||||||
export type BytePlusCodingCatalogEntry = (typeof BYTEPLUS_CODING_MODEL_CATALOG)[number];
|
export type BytePlusCodingCatalogEntry = (typeof BYTEPLUS_CODING_MODEL_CATALOG)[number];
|
||||||
@@ -40,5 +35,9 @@ export type BytePlusCodingCatalogEntry = (typeof BYTEPLUS_CODING_MODEL_CATALOG)[
|
|||||||
export function buildBytePlusModelDefinition(
|
export function buildBytePlusModelDefinition(
|
||||||
entry: BytePlusCatalogEntry | BytePlusCodingCatalogEntry,
|
entry: BytePlusCatalogEntry | BytePlusCodingCatalogEntry,
|
||||||
): ModelDefinitionConfig {
|
): ModelDefinitionConfig {
|
||||||
return buildVolcModelDefinition(entry, BYTEPLUS_DEFAULT_COST);
|
return {
|
||||||
|
...entry,
|
||||||
|
input: [...entry.input],
|
||||||
|
cost: { ...entry.cost },
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,130 @@
|
|||||||
"providerAuthAliases": {
|
"providerAuthAliases": {
|
||||||
"byteplus-plan": "byteplus"
|
"byteplus-plan": "byteplus"
|
||||||
},
|
},
|
||||||
|
"modelCatalog": {
|
||||||
|
"providers": {
|
||||||
|
"byteplus": {
|
||||||
|
"baseUrl": "https://ark.ap-southeast.bytepluses.com/api/v3",
|
||||||
|
"api": "openai-completions",
|
||||||
|
"models": [
|
||||||
|
{
|
||||||
|
"id": "seed-1-8-251228",
|
||||||
|
"name": "Seed 1.8",
|
||||||
|
"input": ["text", "image"],
|
||||||
|
"contextWindow": 256000,
|
||||||
|
"maxTokens": 4096,
|
||||||
|
"cost": {
|
||||||
|
"input": 0.0001,
|
||||||
|
"output": 0.0002,
|
||||||
|
"cacheRead": 0,
|
||||||
|
"cacheWrite": 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "kimi-k2-5-260127",
|
||||||
|
"name": "Kimi K2.5",
|
||||||
|
"input": ["text", "image"],
|
||||||
|
"contextWindow": 256000,
|
||||||
|
"maxTokens": 4096,
|
||||||
|
"cost": {
|
||||||
|
"input": 0.0001,
|
||||||
|
"output": 0.0002,
|
||||||
|
"cacheRead": 0,
|
||||||
|
"cacheWrite": 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "glm-4-7-251222",
|
||||||
|
"name": "GLM 4.7",
|
||||||
|
"input": ["text", "image"],
|
||||||
|
"contextWindow": 200000,
|
||||||
|
"maxTokens": 4096,
|
||||||
|
"cost": {
|
||||||
|
"input": 0.0001,
|
||||||
|
"output": 0.0002,
|
||||||
|
"cacheRead": 0,
|
||||||
|
"cacheWrite": 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"byteplus-plan": {
|
||||||
|
"baseUrl": "https://ark.ap-southeast.bytepluses.com/api/coding/v3",
|
||||||
|
"api": "openai-completions",
|
||||||
|
"models": [
|
||||||
|
{
|
||||||
|
"id": "ark-code-latest",
|
||||||
|
"name": "Ark Coding Plan",
|
||||||
|
"input": ["text"],
|
||||||
|
"contextWindow": 256000,
|
||||||
|
"maxTokens": 4096,
|
||||||
|
"cost": {
|
||||||
|
"input": 0.0001,
|
||||||
|
"output": 0.0002,
|
||||||
|
"cacheRead": 0,
|
||||||
|
"cacheWrite": 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "doubao-seed-code",
|
||||||
|
"name": "Doubao Seed Code",
|
||||||
|
"input": ["text"],
|
||||||
|
"contextWindow": 256000,
|
||||||
|
"maxTokens": 4096,
|
||||||
|
"cost": {
|
||||||
|
"input": 0.0001,
|
||||||
|
"output": 0.0002,
|
||||||
|
"cacheRead": 0,
|
||||||
|
"cacheWrite": 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "glm-4.7",
|
||||||
|
"name": "GLM 4.7 Coding",
|
||||||
|
"input": ["text"],
|
||||||
|
"contextWindow": 200000,
|
||||||
|
"maxTokens": 4096,
|
||||||
|
"cost": {
|
||||||
|
"input": 0.0001,
|
||||||
|
"output": 0.0002,
|
||||||
|
"cacheRead": 0,
|
||||||
|
"cacheWrite": 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "kimi-k2-thinking",
|
||||||
|
"name": "Kimi K2 Thinking",
|
||||||
|
"input": ["text"],
|
||||||
|
"contextWindow": 256000,
|
||||||
|
"maxTokens": 4096,
|
||||||
|
"cost": {
|
||||||
|
"input": 0.0001,
|
||||||
|
"output": 0.0002,
|
||||||
|
"cacheRead": 0,
|
||||||
|
"cacheWrite": 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "kimi-k2.5",
|
||||||
|
"name": "Kimi K2.5 Coding",
|
||||||
|
"input": ["text"],
|
||||||
|
"contextWindow": 256000,
|
||||||
|
"maxTokens": 4096,
|
||||||
|
"cost": {
|
||||||
|
"input": 0.0001,
|
||||||
|
"output": 0.0002,
|
||||||
|
"cacheRead": 0,
|
||||||
|
"cacheWrite": 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"discovery": {
|
||||||
|
"byteplus": "static",
|
||||||
|
"byteplus-plan": "static"
|
||||||
|
}
|
||||||
|
},
|
||||||
"providerAuthChoices": [
|
"providerAuthChoices": [
|
||||||
{
|
{
|
||||||
"provider": "byteplus",
|
"provider": "byteplus",
|
||||||
|
|||||||
@@ -1,24 +1,17 @@
|
|||||||
|
import { buildManifestModelProviderConfig } from "openclaw/plugin-sdk/provider-catalog-shared";
|
||||||
import type { ModelProviderConfig } from "openclaw/plugin-sdk/provider-model-shared";
|
import type { ModelProviderConfig } from "openclaw/plugin-sdk/provider-model-shared";
|
||||||
import {
|
import manifest from "./openclaw.plugin.json" with { type: "json" };
|
||||||
buildBytePlusModelDefinition,
|
|
||||||
BYTEPLUS_BASE_URL,
|
|
||||||
BYTEPLUS_CODING_BASE_URL,
|
|
||||||
BYTEPLUS_CODING_MODEL_CATALOG,
|
|
||||||
BYTEPLUS_MODEL_CATALOG,
|
|
||||||
} from "./models.js";
|
|
||||||
|
|
||||||
export function buildBytePlusProvider(): ModelProviderConfig {
|
export function buildBytePlusProvider(): ModelProviderConfig {
|
||||||
return {
|
return buildManifestModelProviderConfig({
|
||||||
baseUrl: BYTEPLUS_BASE_URL,
|
providerId: "byteplus",
|
||||||
api: "openai-completions",
|
catalog: manifest.modelCatalog.providers.byteplus,
|
||||||
models: BYTEPLUS_MODEL_CATALOG.map(buildBytePlusModelDefinition),
|
});
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function buildBytePlusCodingProvider(): ModelProviderConfig {
|
export function buildBytePlusCodingProvider(): ModelProviderConfig {
|
||||||
return {
|
return buildManifestModelProviderConfig({
|
||||||
baseUrl: BYTEPLUS_CODING_BASE_URL,
|
providerId: "byteplus-plan",
|
||||||
api: "openai-completions",
|
catalog: manifest.modelCatalog.providers["byteplus-plan"],
|
||||||
models: BYTEPLUS_CODING_MODEL_CATALOG.map(buildBytePlusModelDefinition),
|
});
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user