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

在输出是遇到#号之后的内容就不见了 #15

Closed
lxqlogo opened this issue Feb 22, 2023 · 3 comments
Closed

在输出是遇到#号之后的内容就不见了 #15

lxqlogo opened this issue Feb 22, 2023 · 3 comments

Comments

@lxqlogo
Copy link

lxqlogo commented Feb 22, 2023

比如提问:建一个红色H5页面,生成的代码中有#号之后的内容就没有了

@Grt1228
Copy link
Owner

Grt1228 commented Feb 22, 2023

使用:com.unfbx.chatgpt.OpenAiClient的这个方法:

    /**
     * 问答接口
     *
     * @param completion
     * @return CompletionResponse
     */
    public CompletionResponse completions(Completion completion) {
        Single<CompletionResponse> completions = this.openAiApi.completions(completion);
        return completions.blockingGet();
    }

自定义Completion 将stop参数设置为空。(现在默认的stop是:["#"])。(下版本修改下给成默认为空)

参考:/main/src/test/java/com/unfbx/chatgpt/OpenAiClientTest.java下的completionsV2方法

Completion completion = Completion.builder()
        .prompt("三体人是什么?")
        .model("zxxxxxxxxxxxxxxx")
        .maxTokens(10)
        .stop(Arrays.asList())
        .build();

@Grt1228
Copy link
Owner

Grt1228 commented Feb 28, 2023

@lxqlogo

@Grt1228
Copy link
Owner

Grt1228 commented Mar 2, 2023

1.0.2已经修复这个问题。默认stop参数为空

@Grt1228 Grt1228 closed this as completed Mar 2, 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

No branches or pull requests

2 participants