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

[BUG]调用混元大模型返回null #118

Open
shangdev opened this issue Nov 27, 2023 · 1 comment
Open

[BUG]调用混元大模型返回null #118

shangdev opened this issue Nov 27, 2023 · 1 comment

Comments

@shangdev
Copy link

版本:3.0.1031

$cred = new Credential($this->secretId, $this->secretKey);

// 实例化一个http选项,可选的,没有特殊需求可以跳过
$httpProfile = new HttpProfile();
$httpProfile->setEndpoint("hunyuan.tencentcloudapi.com");

// 实例化一个client选项,可选的,没有特殊需求可以跳过
$clientProfile = new ClientProfile();
$clientProfile->setHttpProfile($httpProfile);

// 实例化要请求产品的client对象,clientProfile是可选的
$client = new HunyuanClient($cred, "", $clientProfile);

// 实例化一个请求对象,每个接口都会对应一个request对象
$params = [
"Messages"    => [
	[
		'Role'    => 'user',
		'Content' => '你是谁?'
	],
],
"TopP"        => 0,
"Temperature" => 0,
];
$req = new ChatProRequest();
$req->fromJsonString(json_encode($params));

// 返回的resp是一个GetTokenCountResponse的实例,与请求对象对应
$resp = $client->ChatPro($req);
return $resp->toJsonString();

返回的$resp中所有对象都是null值,也没有异常抛出,请问是调用方式有问题吗?

@zqfan
Copy link
Member

zqfan commented Nov 27, 2023

混元接口采用了非json的协议,php还未支持,所以应该是未解析出返回。

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