feat: Add AI Assist module - Conversational intelligence with specialized agent switching - Real-time preview for code, design, content, and SEO - Multi-agent routing logic (Content, SEO, SMM, PM, Code, Design) - High-end UI with chat thread and live preview sandbox - Integrated with Ollama, Qwen, and Z.AI services
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import type { ModelProvider, APIResponse, ChatMessage } from "@/types";
|
||||
import type { ModelProvider, APIResponse, ChatMessage, AIAssistMessage } from "@/types";
|
||||
import OllamaCloudService from "./ollama-cloud";
|
||||
import ZaiPlanService from "./zai-plan";
|
||||
import qwenOAuthService, { QwenOAuthConfig, QwenOAuthToken } from "./qwen-oauth";
|
||||
@@ -256,6 +256,19 @@ export class ModelAdapter {
|
||||
return this.callWithFallback((service) => service.generateMarketResearch(options, model), providers);
|
||||
}
|
||||
|
||||
async generateAIAssist(
|
||||
options: {
|
||||
messages: AIAssistMessage[];
|
||||
currentAgent: string;
|
||||
},
|
||||
provider?: ModelProvider,
|
||||
model?: string
|
||||
): Promise<APIResponse<string>> {
|
||||
const fallback = this.buildFallbackProviders(this.preferredProvider, "qwen", "ollama", "zai");
|
||||
const providers: ModelProvider[] = provider ? [provider] : fallback;
|
||||
return this.callWithFallback((service) => service.generateAIAssist(options, model), providers);
|
||||
}
|
||||
|
||||
|
||||
async chatCompletion(
|
||||
messages: ChatMessage[],
|
||||
|
||||
Reference in New Issue
Block a user