有時(shí)候翻譯可能會(huì)出現(xiàn)問(wèn)題,可以改prompt優(yōu)化
curl "https://plus.chatyx.net/app/ai/chat/translate" ^
-H "accept: application/json, text/javascript, */*; q=0.01" ^
-H "accept-language: zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6" ^
-H "content-type: application/json" ^
-H "cookie: PHPSID=84b7467d1a8cd9413be40d8d62467a32" ^
-H "origin: https://plus.chatyx.net" ^
-H "priority: u=1, i" ^
-H "referer: https://plus.chatyx.net/app/ai/painting" ^
-H ^"sec-ch-ua: ^\^"Chromium^\^";v=^\^"124^\^", ^\^"Microsoft Edge^\^";v=^\^"124^\^", ^\^"Not-A.Brand^\^";v=^\^"99^\^"^" ^
-H "sec-ch-ua-mobile: ?0" ^
-H ^"sec-ch-ua-platform: ^\^"Windows^\^"^" ^
-H "sec-fetch-dest: empty" ^
-H "sec-fetch-mode: cors" ^
-H "sec-fetch-site: same-origin" ^
-H "user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 Edg/124.0.0.0" ^
-H "x-requested-with: XMLHttpRequest" ^
--data-raw ^"^{^\^"content^\^":^\^"^小^貓^吃^魚(yú)^\^"^}^"
返回內(nèi)容很奇怪
{content: "好的,請(qǐng)發(fā)送要翻譯的內(nèi)容"}
相當(dāng)于直接把上一次回復(fù)發(fā)了一次
改為英文可能更容易輸出英文
$modelRequestData->data = [
'model' => $model,
'temperature' => 1,
'messages' => [
['role' => 'user', 'content' => $prompt],
['role' => 'assistant', 'content' => 'Okay, please send the content to be translated'],
['role' => 'user', 'content' => "Please translate:$content"]
],
];