-
-
Notifications
You must be signed in to change notification settings - Fork 50
[Refactor] Overhaul Spark adapter with model catalog and dynamic configuration #765
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -133,6 +133,20 @@ export const Config: Schema<Config> = Schema.intersect([ | |||||
| 'en-US': require('./locales/en-US.schema.yml') | ||||||
| }) as Schema<Config> | ||||||
|
|
||||||
| export const usage = ` | ||||||
| ## OpenAI 兼容格式适配器说明 | ||||||
|
|
||||||
| 在 apiKeys 配置中填入你的 OpenAI 兼容格式 API Key 和 API 请求地址。 | ||||||
|
|
||||||
| **如果你没有可用的 OpenAI 格式 API,请前往以下地址注册:** | ||||||
|
|
||||||
| [https://api.bltcy.ai/register](https://api.bltcy.ai/register?aff=ec5e312997) | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The new usage documentation includes a hardcoded affiliate link. While this might be intentional, it's generally better to avoid embedding affiliate links directly in the source code to maintain neutrality and avoid potential user trust issues. Consider removing the affiliate query parameter (
Suggested change
|
||||||
|
|
||||||
| 完成后记得填写: | ||||||
| - API Key:从注册的账号中复制 | ||||||
| - API 请求地址:\`https://api.bltcy.ai/v1\` | ||||||
| ` | ||||||
|
|
||||||
| export const inject = ['chatluna'] | ||||||
|
|
||||||
| export const name = 'chatluna-openai-like-adapter' | ||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -73,6 +73,20 @@ export const Config: Schema<Config> = Schema.intersect([ | |||||
| // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||||||
| }) as any | ||||||
|
|
||||||
| export const usage = ` | ||||||
| ## OpenAI 适配器说明 | ||||||
|
|
||||||
| 在 apiKeys 配置中填入你的 OpenAI API Key 和 API 请求地址。 | ||||||
|
|
||||||
| **如果你没有可用的 OpenAI 格式 API,请前往以下地址注册:** | ||||||
|
|
||||||
| [https://api.bltcy.ai/register](https://api.bltcy.ai/register?aff=ec5e312997) | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The new usage documentation includes a hardcoded affiliate link. While this might be intentional, it's generally better to avoid embedding affiliate links directly in the source code to maintain neutrality and avoid potential user trust issues. Consider removing the affiliate query parameter (
Suggested change
|
||||||
|
|
||||||
| 完成后记得填写: | ||||||
| - API Key:从注册的账号中复制 | ||||||
| - API 请求地址:\`https://api.bltcy.ai/v1\` | ||||||
| ` | ||||||
|
|
||||||
| export const inject = ['chatluna'] | ||||||
|
|
||||||
| export const name = 'chatluna-openai-adapter' | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,17 @@ | ||
| $inner: | ||
| - {} | ||
| - $desc: 请求设置 | ||
| appConfigs: | ||
| $desc: 讯飞星火平台配置 (ModelID, API Password),不同的模型需要使用不同的 API 密钥。 | ||
| $inner: | ||
| - 讯飞星火的 API Password(可选)。 | ||
| assistants: | ||
| $desc: 讯飞星火助手配置 (名称, API 链接)。注意:如使用星火助手,请勿在上方配置多个 API Key,仅填入与星火助手绑定的应用 API Key,否则可能导致无法找到相关助手。 | ||
| $inner: | ||
| - 讯飞星火助手的名称。 | ||
| - 讯飞星火助手的链接。 | ||
| - {} | ||
| - $desc: 请求设置 | ||
| appConfigs: | ||
| $desc: 讯飞星火平台配置(模型别名, API Password)。表格会预填 `spark-lite`、`spark-pro`、`spark-pro-128k`、`spark-max`、`spark-max-32k`、`spark-4.0-ultra`、`spark-x1.5`、`spark-x2`,填写对应密码后才会显示并启用对应模型。 | ||
| $inner: | ||
| key: 讯飞星火的模型别名 | ||
| value: 讯飞星火对应模型的 API Password(可选) | ||
| assistants: | ||
| $desc: 讯飞星火助手配置 (名称, API 链接)。注意:如使用星火助手,请勿在上方配置多个 API Key,仅填入与星火助手绑定的应用 API Key,否则可能导致无法找到相关助手。 | ||
| $inner: | ||
| - 讯飞星火助手的名称。 | ||
| - 讯飞星火助手的链接。 | ||
|
|
||
| - $desc: 模型设置 | ||
| maxContextRatio: 最大上下文使用比例(0~1),控制可用的模型上下文窗口大小的最大百分比。例如 0.35 表示最多使用模型上下文的 35%。 | ||
| temperature: 回复温度,数值越高随机性越强。 | ||
| - $desc: 模型设置 | ||
| maxContextRatio: 最大上下文使用比例(0~1),控制可用的模型上下文窗口大小的最大百分比。例如 0.35 表示最多使用模型上下文的 35%。 | ||
| temperature: 回复温度,数值越高随机性越强。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new usage documentation includes a hardcoded affiliate link. While this might be intentional, it's generally better to avoid embedding affiliate links directly in the source code to maintain neutrality and avoid potential user trust issues. Consider removing the affiliate query parameter (
?aff=...) or making it configurable if this is part of a partnership.