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