Initial commit: queue workspace

Made-with: Cursor
This commit is contained in:
apple
2026-03-21 02:55:24 +08:00
commit 78de918c37
12388 changed files with 1840126 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
<?php
namespace crmeb\services\ai\storage;
use crmeb\basic\BaseAi;
class Ai extends BaseAi
{
const CONVERSATION = 'v2/chat/conversation';
const CHAT = 'v2/chat/chat';
protected function initialize(array $config = [])
{
parent::initialize($config);
}
public function chat(string $systemContent, string $userContent)
{
$param['messages'] = [
[
'role' => 'system',
'content' => $systemContent
],
[
'role' => 'user',
'content' => $userContent
]
];
$param['max_tokens'] = '4096';
$param['temperature'] = '1';
$param['frequency_penalty'] = '0';
$param['presence_penalty'] = '0';
$param['model'] = 'deepseek-chat';
$param['response_format'] = '{ "type": "json_object" }';
$result = $this->accessToken->httpRequest(self::CHAT, $param);
return str_replace(['```json', '```'], '', $result['data']['choices'][0]['message']['content']);
}
}