We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
代码是这样的 ` Credential cred = new Credential { SecretId = Environment.GetEnvironmentVariable("SecretId"), SecretKey = Environment.GetEnvironmentVariable("SecretKey") };
var cpf = new ClientProfile(); var client = new HunyuanClient(cred, "ap-chengdu"); var req = new ChatStdRequest { Messages = new[] { new Message { Role = "user", Content = args[0], } } }; try { var resp = await client.ChatStd(req); Console.WriteLine(resp); foreach (var ec in resp) { Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine($"-------> {ec}"); } } catch (Exception ex) { Console.WriteLine($"-----> 发生了未预期的错误!{ex.Message}"); }`
获得的结果是“-----> 发生了未预期的错误!请求签名验证失败,请检查您的签名计算是否正确。”
The text was updated successfully, but these errors were encountered:
同样问题
Sorry, something went wrong.
代码是这样的 ` Credential cred = new Credential { SecretId = Environment.GetEnvironmentVariable("SecretId"), SecretKey = Environment.GetEnvironmentVariable("SecretKey") }; var cpf = new ClientProfile(); var client = new HunyuanClient(cred, "ap-chengdu"); var req = new ChatStdRequest { Messages = new[] { new Message { Role = "user", Content = args[0], } } }; try { var resp = await client.ChatStd(req); Console.WriteLine(resp); foreach (var ec in resp) { Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine($"-------> {ec}"); } } catch (Exception ex) { Console.WriteLine($"-----> 发生了未预期的错误!{ex.Message}"); }` 获得的结果是“-----> 发生了未预期的错误!请求签名验证失败,请检查您的签名计算是否正确。”
SecretId = Environment.GetEnvironmentVariable("SecretId"), 这里需要在环境变量中先有这个Key,如果只是本地测试,你可以直接在这个位置填写密钥信息,正式环境最好是从配置文件或者环境变量中读取
问题解决了吗?怎么解决的
No branches or pull requests
代码是这样的
`
Credential cred = new Credential
{
SecretId = Environment.GetEnvironmentVariable("SecretId"),
SecretKey = Environment.GetEnvironmentVariable("SecretKey")
};
获得的结果是“-----> 发生了未预期的错误!请求签名验证失败,请检查您的签名计算是否正确。”
The text was updated successfully, but these errors were encountered: