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

Qianfan with http proxy #495

Conversation

lihongjia-sinosoft
Copy link

No description provided.

@@ -52,11 +53,29 @@ public Qianfan(String type, String accessKey, String secretKey) {
this.client = new QianfanClient(type, accessKey, secretKey);
}


public Qianfan(ProxyConfig proxyConfig) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

目前的涉及中,只有鉴权从constructor中传入,其它配置均在Qianfan的实例上调用setXXXConfig实现。这是为了避免后续Config太多,造成重载太多。

import java.util.LinkedHashMap;
import java.util.Map;

public class HttpProxyClient {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HttpClient是公用的,可以考虑使用HttpClientContext在Request维度传入代理信息,而不是在Client上设置

this.client = new QianfanClient(proxyConfig);
}

public Qianfan(String accessKey, String secretKey,ProxyConfig proxyConfig) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

需要reformat

@Azure99 Azure99 closed this May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants