package com.huimv.employment.integration.kb;

import com.fasterxml.jackson.databind.ObjectMapper;

import org.springframework.http.ResponseEntity;

import java.io.IOException;
import java.io.OutputStream;

/**
 * 智能体网关转发（{@code GET /api/version}、{@code POST /api/console/chat}）。
 */
public interface KbOpenAiProxyService {

    ResponseEntity<byte[]> getVersion();

    void streamConsoleChat(byte[] requestBody, String agentId, OutputStream output) throws IOException;

    /**
     * 流式转发 SSE 并聚合 assistant 文本（供会话落库场景使用，不影响纯透传接口）。
     *
     * @return 助手正文 + 是否收到 complete / 流结束
     */
    ConsoleChatCollectResult streamConsoleChatCollecting(byte[] requestBody, String agentId, OutputStream output,
                                                         ObjectMapper objectMapper) throws IOException;
}
