0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Google Workspace StudioのGeminiは [suspicious link removed] が出やすいようだ

0
Last updated at Posted at 2026-01-26

Google Workspace StudioとGoogle Apps Script(GAS)を使って、「Googleカレンダー上に記載された予定を参照し、本日訪問先の会社の最新ニュースをSlack通知する」という機能を実装しました。

そのために次のようなプロンプトを書きました。

株式会社LIFULLにまつわる最近3ヶ月のニュースを可能な限り全て、最大5件リサーチして。結果は以下の形式のjsonスキーマに従ったjsonのみにして。

===
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Company News Schema",
  "type": "object",
  "properties": {
    "company": {
      "type": "string",
      "const": "${company}",
      "description": "会社名"
    },
    "news": {
      "type": "array",
      "description": "ニュース記事のリスト",
      "items": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "description": "ニュース記事のタイトル"
          },
              "url": {
                "type": "string",
                "description": "ニュース記事のURL",
                "format": "uri"
              }
        },
        "required": ["title", "url"]
      }
    }
  },
  "required": ["company", "news"]
}

Geminiで処理すると次の結果が返ってきます。その会社の検索結果をJSONで返答させ、それをスプレッドシートに記入、それをGASを使ってSlack通知する仕組みを作ろうと考えていました。

{
  "company": "株式会社LIFULL",
  "news": [
    {
      "title": "止まらない価格高騰、全種別で過去最高を更新。福岡市の一棟マンション価格が東京23区に迫る「収益物件 市場動向四半期レポート」2025年10月~12月期",
      "url": "https://prtimes.jp/main/html/rd/p/000000803.000033058.html"
    },
    {
      "title": "【26年1月】住宅購入者と購入検討者に『住宅ローンに関する定期意識調査』をLIFULL HOME'Sが実施",
      "url": "https://lifull.com/news/46560/"
    },
    {
      "title": "川口春奈さんが1人4役を演じる! LIFULL HOME'S 新TVCM「おうちまるっとホームズ『4人の川口春奈』篇」を2026年1月4日から放映開始",
      "url": "https://lifull.com/news/46439/"
    },
    {
      "title": "LIFULLが掲げる”次世代の住まい探し構想”統合型AIエージェント「LIFULL AI」を発表",
      "url": "https://lifull.com/news/46387/"
    },
    {
      "title": "株式会社LIFULL本社移転決定のお知らせ(2027年8月予定)",
      "url": "https://lifull.com/news/45889/"
    }
  ]
}

しかし、Workspace Studioで上記のプロンプトを動作させようとすると、ほとんどの場合、URL部分が [suspicious link removed] と置き換えられてしまいました。より簡素なプロンプトの場合は、Workspace Studioでも表示できることもあります。もしかすると、Workspace Studioのほうが生成AIでの自動化を主眼に置いたサービスで、外部アクセスなどのガバナンス対策をしっかりしているのかもしれません。

そのため今回のケースでは、GASでのSlack通知時に「Google検索結果のURL」を表示するようにして回避しました。ちょっと不便ですがソースが一応追える形にはできたかなと。

// companyNewsは上記のjsonを読み込んだobject
companyNews.news.forEach(x => {
  x.url = "https://www.google.com/search?q=" + encodeURIComponent(x.title + " " + company);
})

また、「GoogleアラートのRSSで読み取って、必要に応じて読み取り先を変える」というのも検討したのですが、GASからGoogleアラートの設定を自動登録できないらしく断念。API等も公開されていないようでした。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?