mirror of
https://github.com/CodePhiliaX/Chat2DB.git
synced 2025-07-30 19:22:58 +08:00
query gateway update
This commit is contained in:
@ -246,25 +246,9 @@ public class Chat2DBAIStreamClient {
|
||||
|
||||
FastChatEmbeddingResponse chatEmbeddingResponse = null;
|
||||
Response response = this.okHttpClient.newCall(request).execute();
|
||||
StringBuilder body = new StringBuilder();
|
||||
if (response.isSuccessful()) {
|
||||
ResponseBody responseBody = response.body();
|
||||
if (responseBody != null) {
|
||||
// 获取响应体的输入流
|
||||
java.io.InputStream inputStream = responseBody.byteStream();
|
||||
java.io.BufferedReader reader = new java.io.BufferedReader(new java.io.InputStreamReader(inputStream));
|
||||
|
||||
String line;
|
||||
while ((line = reader.readLine()) != null) {
|
||||
// 在这里处理每行响应内容
|
||||
body.append(line);
|
||||
}
|
||||
|
||||
// 关闭流
|
||||
reader.close();
|
||||
inputStream.close();
|
||||
}
|
||||
chatEmbeddingResponse = mapper.readValue(body.toString(), FastChatEmbeddingResponse.class);
|
||||
String body = response.body().string();
|
||||
chatEmbeddingResponse = mapper.readValue(body, FastChatEmbeddingResponse.class);
|
||||
}
|
||||
log.info("finish invoking chat embedding");
|
||||
return chatEmbeddingResponse;
|
||||
|
@ -61,8 +61,8 @@ public interface GatewayClientService {
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@Post("/api/client/milvus/knowledge/save")
|
||||
ActionResult knowledgeVectorSave(@Query KnowledgeRequest request);
|
||||
@Post(url = "/api/client/milvus/knowledge/save", contentType = "application/json")
|
||||
ActionResult knowledgeVectorSave(@Body KnowledgeRequest request);
|
||||
|
||||
/**
|
||||
* save table schema vector
|
||||
@ -70,8 +70,8 @@ public interface GatewayClientService {
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@Post("/api/client/milvus/schema/save")
|
||||
ActionResult schemaVectorSave(@Query TableSchemaRequest request);
|
||||
@Post(url = "/api/client/milvus/schema/save", contentType = "application/json")
|
||||
ActionResult schemaVectorSave(@Body TableSchemaRequest request);
|
||||
|
||||
/**
|
||||
* save knowledge vector
|
||||
|
Reference in New Issue
Block a user