import { AiServiceAdapter } from './ai.adapter';

export class TongyiAdapter implements AiServiceAdapter {
  constructor(private readonly config: any) {}

  // 实现AiServiceAdapter接口定义的方法
  async generateText(model: string, prompt: string, config?: Record<string, any>): Promise<string> {
    // 这里添加调用Tongyi API的具体实现
    return `Response from Tongyi: ${prompt}`;
  }

  async chat(model: string, messages: Array<{role: string, content: string}>, config?: Record<string, any>): Promise<string> {
    // 这里添加调用Tongyi API的具体实现
    return `Chat response from Tongyi: ${messages[messages.length - 1].content}`;
  }
}