-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathMessage.php
More file actions
83 lines (75 loc) · 1.83 KB
/
Message.php
File metadata and controls
83 lines (75 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\Assistant\Db\ChattyLLM;
use OCP\AppFramework\Db\Entity;
use OCP\DB\Types;
/**
* @method \int getSessionId()
* @method \void setSessionId(int $sessionId)
* @method \string getRole()
* @method \void setRole(string $role)
* @method \string getContent()
* @method \void setContent(string $content)
* @method \int getTimestamp()
* @method \void setTimestamp(int $timestamp)
* @method \int getOcpTaskId()
* @method \void setOcpTaskId(int $ocpTaskId)
* @method \string getSources()
* @method \void setSources(string $sources)
*/
class Message extends Entity implements \JsonSerializable {
/** @var int */
protected $sessionId;
/** @var string */
protected $role;
/** @var string */
protected $content;
/** @var int */
protected $timestamp;
/** @var int */
protected $ocpTaskId;
/** @var string */
protected $sources;
public static $columns = [
'id',
'session_id',
'role',
'content',
'timestamp',
'ocp_task_id',
'sources',
];
public static $fields = [
'id',
'sessionId',
'role',
'content',
'timestamp',
'ocpTaskId',
'sources',
];
public function __construct() {
$this->addType('session_id', Types::INTEGER);
$this->addType('role', Types::STRING);
$this->addType('content', Types::STRING);
$this->addType('timestamp', Types::INTEGER);
$this->addType('ocp_task_id', Types::INTEGER);
$this->addType('sources', Types::STRING);
}
#[\ReturnTypeWillChange]
public function jsonSerialize() {
return [
'id' => $this->id,
'session_id' => $this->sessionId,
'role' => $this->role,
'content' => $this->content,
'timestamp' => $this->timestamp,
'ocp_task_id' => $this->ocpTaskId,
'sources' => $this->sources,
];
}
}