kenken999 commited on
Commit
b983fec
·
1 Parent(s): 14e2e89
Files changed (1) hide show
  1. mysite/interpreter/process.py +6 -0
mysite/interpreter/process.py CHANGED
@@ -23,11 +23,17 @@ def set_environment_variables():
23
  os.environ["MODEL_NAME"] = "llama3-8b-8192"
24
  os.environ["LOCAL_MODEL"] = "true"
25
 
 
 
 
 
26
  def send_google_chat_card(webhook_url, title, subtitle, link_text, link_url):
27
  headers = {
28
  'Content-Type': 'application/json; charset=UTF-8'
29
  }
30
 
 
 
31
  card_message = {
32
  "cards": [
33
  {
 
23
  os.environ["MODEL_NAME"] = "llama3-8b-8192"
24
  os.environ["LOCAL_MODEL"] = "true"
25
 
26
+ def convert_newlines_to_google_chat_format(text):
27
+ # 改行文字を <br> タグに置き換える
28
+ return text.replace('\n', '<br>')
29
+
30
  def send_google_chat_card(webhook_url, title, subtitle, link_text, link_url):
31
  headers = {
32
  'Content-Type': 'application/json; charset=UTF-8'
33
  }
34
 
35
+ subtitle = convert_newlines_to_google_chat_format(subtitle)
36
+
37
  card_message = {
38
  "cards": [
39
  {