MCPcopy Index your code
hub / github.com/SkyworkAI/DeepResearchAgent / SystemMessage

Class SystemMessage

src/message/types.py:193–220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

191
192
193class SystemMessage(Message):
194 role: Literal['system'] = Field(default='system', description="The role of the messages author, in this case `system`.") # type: ignore
195 content: Union[str, List[Union[
196 ContentPartText,
197 ContentPartImage,
198 ContentPartAudio,
199 ContentPartVideo,
200 ContentPartPdf,
201 ]]] = Field(description="The contents of the system message.")
202 name: Optional[str] = Field(default=None, description="An optional name for the participant. Provides the model information to differentiate between participants of the same role.") # type: ignore
203
204 @property
205 def text(self) -> str:
206 """
207 Automatically parse the text inside content, whether it's a string or a list of content parts.
208 """
209 if isinstance(self.content, str):
210 return self.content
211 elif isinstance(self.content, list):
212 return '\n'.join([str(part) for part in self.content])
213 else:
214 return ''
215
216 def __str__(self) -> str:
217 return f'SystemMessage(content={self.text})'
218
219 def __repr__(self) -> str:
220 return f'SystemMessage(content={repr(self.text)})'
221
222
223class AssistantMessage(Message):

Callers 15

get_messageMethod · 0.90
_process_memoryMethod · 0.90
_process_memoryMethod · 0.90
_extract_file_contentMethod · 0.90
_merge_summariesMethod · 0.90
transcribe_audioFunction · 0.90

Calls

no outgoing calls

Tested by 10

test_math_benchmarkFunction · 0.72
test_chatFunction · 0.72
test_transcriptionFunction · 0.72
test_embeddingFunction · 0.72
test_videoFunction · 0.72
test_pdfFunction · 0.72
test_response_formatFunction · 0.72
test_tool_callingFunction · 0.72
test_searchFunction · 0.72
test_messageFunction · 0.72