# chatgpt-service **Repository Path**: john-code/chatgpt-service ## Basic Information - **Project Name**: chatgpt-service - **Description**: chatgpt聊天服务,目前支持http访问,暂无ui页面支持 - **Primary Language**: Java - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-03-13 - **Last Updated**: 2024-01-29 ## Categories & Tags **Categories**: Uncategorized **Tags**: Java, HttpClient, open-ai, 人工职能 ## README # chatGPT > OpenAI聊天问答服务 > > 使用模型:ChatGPT-3.5 Turbo 模型【是 ChatGPT 所使用的模型】 # 要求 > 系统安装 jdk8 # 使用 >付费服务:需要在 https://www.apispace.com/eolink/api/chatgpt-turbo/introduction?register=1 上购买调用量。 > 本服务页面暂不支持业务访问,只能通过api调用的方式来访问 > >1、测试用例访问 > > 2、Postman访问 ![img_5.png](img_5.png) 上图中,queryCondition是问题、fileName为结果文件名,filePath文件的路径 访问地址:127.0.0.1:8080/openai/chat 这里我展示下Postman的调用图: ![img_5.png](img_5.png) header参数 ![img_7.png](img_7.png) 输出文件截图 ![img_3.png](img_3.png) Idea日志: 从服务调用到网络通讯到日志落地几个维度展示了调用链路。 ![img_4.png](img_4.png) 日志详解: http请求行信息: > 2023-03-13 04:58:16.084 [http-nio-8080-exec-1] INFO c.y.weichatgtp.common.util.HttpClientUtils - >>> |Http status line data: HTTP/1.1 401 Unauthorized| httpUtil层面远程调用耗时日志: > 2023-03-13 04:58:16.085 [http-nio-8080-exec-1] INFO c.y.weichatgtp.common.util.HttpClientUtils - >>> |This remote call takes time:190ms.| 异步线程执行任务开始: > 2023-03-13 04:58:16.088 [Thread-2] INFO c.y.weichatgtp.common.thread.AbstractRunnable - >>> |Asynchronous thread is executing :[D:\java\chatGPTFile\马云.md 写出] task.| 异步线程执行任务结束: > 2023-03-13 04:58:16.088 [Thread-2] INFO c.y.weichatgtp.common.thread.AbstractRunnable - >>> |The asynchronous thread has completed the [D:\java\chatGPTFile\马云.md 写出] task.| 拦截器层面接口调用流水信息: > 2023-03-13 04:58:16.096 [http-nio-8080-exec-1] INFO c.y.w.intercepter.ChatGPTParamsAndLogIntercepter - >>> |ChatGPTServiceImpl|chat|马云旗下有哪些公司?|504|N|401|Unauthorized| > > 流水信息说明:|类名|方法名|入参|耗时|是否成功?Y:N|返回码|返回信息|