| 3 | import { ModelMessage } from 'ai'; |
| 4 | |
| 5 | class HumanNormalMessage implements CustomMessage<HumanNormalMessage> { |
| 6 | public content: string; |
| 7 | private readonly topic: Topic; |
| 8 | constructor(topic: Topic, content: string) { |
| 9 | this.topic = topic; |
| 10 | this.content = content; |
| 11 | } |
| 12 | |
| 13 | async toMsg(): Promise<ModelMessage[]> { |
| 14 | return [{ |
| 15 | role: 'user', |
| 16 | content: this.content, |
| 17 | }]; |
| 18 | } |
| 19 | |
| 20 | |
| 21 | copy(): HumanNormalMessage { |
| 22 | return new HumanNormalMessage(this.topic, this.content); |
| 23 | } |
| 24 | |
| 25 | msgType: MsgType = 'human-normal'; |
| 26 | |
| 27 | getTopic(): Topic { |
| 28 | return this.topic; |
| 29 | } |
| 30 | |
| 31 | getTaskIds(): number[] { |
| 32 | return []; |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | export default HumanNormalMessage; |
nothing calls this directly
no outgoing calls
no test coverage detected