Commit cf2ec92c by 王祖波

Merge branch 'feature-content4-2' into developer

parents d441220f c22b5381
......@@ -37,6 +37,31 @@
</dependencyManagement>
<dependencies>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-ai-openai</artifactId>
<version>1.0.0-beta.5</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.10.0</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.10.0</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.10.0</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>open-ai-sdk</artifactId>
<version>3.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
......
......@@ -7,13 +7,12 @@ import com.gic.content.api.dto.aigc.AIGCContent;
import com.gic.content.api.qdto.aigc.ContentAIGCQDTO;
import com.gic.content.api.service.common.ThirdApiService;
import com.gic.haoban.manage.web.qo.content.ContentAIGCQO;
import com.open.ai.OpenAIUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
/**
* 好办-三方接口
......@@ -43,4 +42,16 @@ public class ContentThirdController {
}
return RestResponse.successResult(response.getResult());
}
/**
* openAI会话
* @param question
* @return
*/
@RequestMapping(value = "/ai/chat", method = RequestMethod.GET, produces = "text/event-stream;charset=UTF-8")
public SseEmitter openAiChat(String question,String userId,String enterpriseId) {
SseEmitter emitter = new SseEmitter(30000L);
OpenAIUtil.chat(emitter, question,userId,enterpriseId);
return emitter;
}
}
......@@ -55,6 +55,7 @@
<list>
<value>text/html;charset=UTF-8</value>
<value>application/x-www-form-urlencoded;charset=UTF-8</value>
<value>text/plain;charset=UTF-8</value>
<!--默认是 iso-8859-1 -->
</list>
</property>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment