mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-06 05:51:15 +08:00
docs: document byteplus provider
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
/**
|
||||
* Public BytePlus provider plugin API exports.
|
||||
*/
|
||||
export { buildBytePlusCodingProvider, buildBytePlusProvider } from "./provider-catalog.js";
|
||||
export {
|
||||
buildBytePlusModelDefinition,
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/**
|
||||
* BytePlus provider plugin entrypoint for model and video generation providers.
|
||||
*/
|
||||
import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
|
||||
import { createProviderApiKeyAuthMethod } from "openclaw/plugin-sdk/provider-auth-api-key";
|
||||
import { ensureModelAllowlistEntry } from "openclaw/plugin-sdk/provider-onboard";
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/**
|
||||
* BytePlus model catalog helpers derived from the plugin manifest.
|
||||
*/
|
||||
import { buildManifestModelProviderConfig } from "openclaw/plugin-sdk/provider-catalog-shared";
|
||||
import type { ModelDefinitionConfig } from "openclaw/plugin-sdk/provider-model-shared";
|
||||
import manifest from "./openclaw.plugin.json" with { type: "json" };
|
||||
@@ -12,9 +15,12 @@ const BYTEPLUS_CODING_MANIFEST_PROVIDER = buildManifestModelProviderConfig({
|
||||
catalog: manifest.modelCatalog.providers["byteplus-plan"],
|
||||
});
|
||||
|
||||
/** Base URL for BytePlus chat/model APIs from the manifest catalog. */
|
||||
export const BYTEPLUS_BASE_URL = BYTEPLUS_MANIFEST_PROVIDER.baseUrl;
|
||||
/** Base URL for BytePlus Plan coding APIs from the manifest catalog. */
|
||||
export const BYTEPLUS_CODING_BASE_URL = BYTEPLUS_CODING_MANIFEST_PROVIDER.baseUrl;
|
||||
|
||||
/** Fallback cost shape retained for callers that need BytePlus defaults. */
|
||||
export const BYTEPLUS_DEFAULT_COST = {
|
||||
input: 0.0001,
|
||||
output: 0.0002,
|
||||
@@ -22,10 +28,13 @@ export const BYTEPLUS_DEFAULT_COST = {
|
||||
cacheWrite: 0,
|
||||
};
|
||||
|
||||
/** BytePlus general model catalog entries. */
|
||||
export const BYTEPLUS_MODEL_CATALOG: ModelDefinitionConfig[] = BYTEPLUS_MANIFEST_PROVIDER.models;
|
||||
/** BytePlus coding/planning model catalog entries. */
|
||||
export const BYTEPLUS_CODING_MODEL_CATALOG: ModelDefinitionConfig[] =
|
||||
BYTEPLUS_CODING_MANIFEST_PROVIDER.models;
|
||||
|
||||
/** Clones one manifest model definition so callers can mutate safely. */
|
||||
export function buildBytePlusModelDefinition(entry: ModelDefinitionConfig): ModelDefinitionConfig {
|
||||
return {
|
||||
...entry,
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
/**
|
||||
* BytePlus model provider builders backed by the plugin manifest catalog.
|
||||
*/
|
||||
import { buildManifestModelProviderConfig } from "openclaw/plugin-sdk/provider-catalog-shared";
|
||||
import type { ModelProviderConfig } from "openclaw/plugin-sdk/provider-model-shared";
|
||||
import manifest from "./openclaw.plugin.json" with { type: "json" };
|
||||
|
||||
/** Builds the standard BytePlus model provider config. */
|
||||
export function buildBytePlusProvider(): ModelProviderConfig {
|
||||
return buildManifestModelProviderConfig({
|
||||
providerId: "byteplus",
|
||||
@@ -9,6 +13,7 @@ export function buildBytePlusProvider(): ModelProviderConfig {
|
||||
});
|
||||
}
|
||||
|
||||
/** Builds the BytePlus Plan coding-provider config. */
|
||||
export function buildBytePlusCodingProvider(): ModelProviderConfig {
|
||||
return buildManifestModelProviderConfig({
|
||||
providerId: "byteplus-plan",
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/**
|
||||
* Static provider discovery entries for BytePlus manifest-backed catalogs.
|
||||
*/
|
||||
import type { ProviderPlugin } from "openclaw/plugin-sdk/provider-model-shared";
|
||||
import { buildBytePlusCodingProvider, buildBytePlusProvider } from "./provider-catalog.js";
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/**
|
||||
* BytePlus Seedance video generation provider implementation.
|
||||
*/
|
||||
import { extensionForMime } from "openclaw/plugin-sdk/media-mime";
|
||||
import { isProviderApiKeyConfigured } from "openclaw/plugin-sdk/provider-auth";
|
||||
import { resolveApiKeyForProvider } from "openclaw/plugin-sdk/provider-auth-runtime";
|
||||
@@ -227,6 +230,7 @@ async function downloadBytePlusVideo(params: {
|
||||
};
|
||||
}
|
||||
|
||||
/** Builds the BytePlus video generation provider registered by the plugin. */
|
||||
export function buildBytePlusVideoGenerationProvider(): VideoGenerationProvider {
|
||||
return {
|
||||
id: "byteplus",
|
||||
|
||||
Reference in New Issue
Block a user