Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev http client #2

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Dev http client #2

wants to merge 8 commits into from

Conversation

lunasaw
Copy link

@lunasaw lunasaw commented Apr 28, 2023

增加 HttpOpenAiClient 实现OpenAiClient接口,使用httpclient5, 处理api请求,包含sse处理.新增统一接口回调标志接口,com.lzhpo.chatgpt.sse.Listener,上层回调用接口使用这个标志入参。
使用5.2.1最新版本,因为springboo-parent的spring-boot-dependencies索引了httpClient5.1.5会有class not found风险。顾需要本地管理。

<dependencyManagement>
        <dependencies>
            <!-- https://mvnrepository.com/artifact/org.apache.httpcomponents.client5/httpclient5 -->
            <dependency>
                <groupId>org.apache.httpcomponents.client5</groupId>
                <artifactId>httpclient5</artifactId>
                <version>5.2.1</version>
            </dependency>
            <dependency>
                <groupId>org.apache.httpcomponents.core5</groupId>
                <artifactId>httpcore5</artifactId>
                <version>5.2.1</version>
            </dependency>
            <dependency>
                <groupId>org.apache.httpcomponents.core5</groupId>
                <artifactId>httpcore5-h2</artifactId>
                <version>5.2.1</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

chenzhangyue added 7 commits April 27, 2023 20:31
# Conflicts:
#	pom.xml
#	src/main/java/com/lzhpo/chatgpt/OpenAiAutoConfiguration.java
#	src/main/java/com/lzhpo/chatgpt/sse/CountDownLatchEventSourceListener.java
#	src/main/java/com/lzhpo/chatgpt/sse/SseEventSourceListener.java
#	src/main/java/com/lzhpo/chatgpt/sse/WebSocketEventSourceListener.java
#	src/test/java/com/lzhpo/chatgpt/OpenAiTestController.java
#	src/test/resources/application.yml
@lunasaw lunasaw closed this Apr 28, 2023
@lunasaw lunasaw reopened this Apr 28, 2023
@lunasaw lunasaw closed this Apr 29, 2023
@lunasaw lunasaw reopened this Apr 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant