MCPcopy Create free account
hub / github.com/InternScience/SciReason / post

Method post

opencompass/utils/lark.py:13–40  ·  view source on GitHub ↗

Post a message to Lark. When title is None, message must be a str. otherwise msg can be in rich text format (see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/im-v1/message/create_json#45e0953e for details).

(self,
             content: Union[str, List[List[Dict]]],
             title: Optional[str] = None)

Source from the content-addressed store, hash-verified

11 self.url = url
12
13 def post(self,
14 content: Union[str, List[List[Dict]]],
15 title: Optional[str] = None):
16 """Post a message to Lark.
17
18 When title is None, message must be a str. otherwise msg can be in rich
19 text format (see
20 https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/im-v1/message/create_json#45e0953e
21 for details).
22 """
23 if title is None:
24 assert isinstance(content, str)
25 msg = {'msg_type': 'text', 'content': {'text': content}}
26 else:
27 if isinstance(content, str):
28 content = [[{'tag': 'text', 'text': content}]]
29 msg = {
30 'msg_type': 'post',
31 'content': {
32 'post': {
33 'zh_cn': {
34 'title': title,
35 'content': content
36 }
37 }
38 }
39 }
40 requests.post(self.url, data=json.dumps(msg))
41
42
43def parse_args():

Callers 15

lark.pyFile · 0.80
summarizeMethod · 0.80
_launchMethod · 0.80
summarizeMethod · 0.80
summarizeMethod · 0.80
summarizeMethod · 0.80
summarizeMethod · 0.80
summarizeMethod · 0.80
summarizeMethod · 0.80
_openai_functionMethod · 0.80
mainFunction · 0.80
_generateMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected