update
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@kevisual/ai",
|
"name": "@kevisual/ai",
|
||||||
"version": "0.0.14",
|
"version": "0.0.15",
|
||||||
"description": "AI Center Services",
|
"description": "AI Center Services",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"basename": "/root/ai-center-services",
|
"basename": "/root/ai-center-services",
|
||||||
|
|||||||
@@ -13,6 +13,19 @@ import { Kimi } from './chat-adapter/kimi.ts';
|
|||||||
|
|
||||||
import { ChatMessage } from './core/type.ts';
|
import { ChatMessage } from './core/type.ts';
|
||||||
|
|
||||||
|
export {
|
||||||
|
Ollama,
|
||||||
|
SiliconFlow,
|
||||||
|
Custom,
|
||||||
|
Volces,
|
||||||
|
DeepSeek,
|
||||||
|
ModelScope,
|
||||||
|
BaseChat,
|
||||||
|
BailianChat,
|
||||||
|
Zhipu,
|
||||||
|
Kimi,
|
||||||
|
ChatMessage,
|
||||||
|
}
|
||||||
export const OllamaProvider = Ollama;
|
export const OllamaProvider = Ollama;
|
||||||
export const SiliconFlowProvider = SiliconFlow;
|
export const SiliconFlowProvider = SiliconFlow;
|
||||||
export const CustomProvider = Custom;
|
export const CustomProvider = Custom;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ export class AIUtils {
|
|||||||
* @param str 包含 JSON 的字符串
|
* @param str 包含 JSON 的字符串
|
||||||
* @returns 解析后的对象或 null
|
* @returns 解析后的对象或 null
|
||||||
*/
|
*/
|
||||||
extractJsonFromMarkdown(str: string): any | null {
|
static extractJsonFromMarkdown(str: string): any | null {
|
||||||
// Try to extract JSON from ```json ... ```
|
// Try to extract JSON from ```json ... ```
|
||||||
const jsonRegex = /```json\s*([\s\S]*?)\s*```/;
|
const jsonRegex = /```json\s*([\s\S]*?)\s*```/;
|
||||||
const match = str.match(jsonRegex);
|
const match = str.match(jsonRegex);
|
||||||
|
|||||||
Reference in New Issue
Block a user