Skip to content

Commit ab0cc93

Browse files
committed
refactor: cleans up Message DTO
1 parent 11c3c03 commit ab0cc93

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

src/Messages/DTO/Message.php

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -41,20 +41,6 @@ public function __construct(MessageRoleEnum $role, array $parts)
4141
$this->parts = $parts;
4242
}
4343

44-
/**
45-
* Creates a message from a simple text string.
46-
*
47-
* @since n.e.x.t
48-
*
49-
* @param MessageRoleEnum $role The role of the message sender.
50-
* @param string $text The text content.
51-
* @return self
52-
*/
53-
public static function fromText(MessageRoleEnum $role, string $text): self
54-
{
55-
return new self($role, [MessagePart::text($text)]);
56-
}
57-
5844
/**
5945
* Gets the role of the message sender.
6046
*
@@ -91,7 +77,7 @@ public static function getJsonSchema(): array
9177
'properties' => [
9278
'role' => [
9379
'type' => 'string',
94-
'enum' => ['user', 'model', 'system'],
80+
'enum' => MessageRoleEnum::getValues(),
9581
'description' => 'The role of the message sender.',
9682
],
9783
'parts' => [

0 commit comments

Comments
 (0)