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?

続:watsonx Orchestrateで法務部門への問い合わせに対応するAgentにサイボウズGaroonから問い合わせてみた

Posted at

これは簡単!! watsonx Orchestrateで法務部門への問い合わせに対応するAgentを作成してみました。にて、作成したwatsonx Orchestrate(以下wxO) Agentに関する続編です。
弊社におけるメール以外のコミニュケーションツールはMicrosoft Teamsです。一般的には、SlackまたはTeamsが2トップかもしれません
そこで、社員が普段から使っている、つまり、Windowsのデスクトップでアクティブにしているteamsのインプットからwxoに問い合わせができたらいいよね?ということで、検証してみました
ところが、質問、回答のやりとりはできるものの、reasoningや参照先のドキュメントのリンク、加えてthumbs-upとthumbs-downのfeedbackボタンも表示されません。
image.png
調べてみると、どうやらteamsがwxOからの情報をすべては受け取っていない様子でした。(詳細割愛)
技術的にはTeamsをインターフェースにするためのアプリケーションの開発と稼働など方法はありそうですが、
もうひとつ、弊社ではサイボウズGaroonをグループウェアとして全社員が使用しています。
主な用途はスケジュール、掲示板などです。
そこで、社員が慣れ親しんだ、この画面からwxOに問い合わせができないか?やってみました。
前置きが長くなりましたが、以下に書きたいと思います

wxO側の操作

wxO側の操作としては、対応させたいAgentのChannelsの中にあるEmbedded agentに書かれているjava scriptをコピーするところから始めます。LIVEはDeploy済のAgent用です。
image.png

image.png
*スクリプト頭と最後に<script>もコピーされますが、サイボウズGaroon側が補完するようで、これを除いた.jsファイルを保管するようにしてください。

法務お助けAgent.js
puts 
function feedbackHandler(event) {
    console.log('feedback', event);
}
function preReceiveHandler(event) {
    console.log('pre-receive event', event);
    const lastItem = event?.content?.[event.content.length - 1];
    if (lastItem) {
        lastItem.message_options = {
            feedback: {
                is_on: true,
                show_positive_details: false,
                show_negative_details: true,
                // Note, these positive details are not used as long as show_positive_details is false.
                positive_options: {
                    categories: ['Funny', 'Helpful', 'Correct'],
                    disclaimer: "Provide content that can be shared publicly.",
                },
                negative_options: {
                    categories: ['Inaccurate', 'Incomplete', 'Too long', 'Irrelevant', 'Other'],
                    disclaimer: "Provide content that can be shared publicly.",
                },
            },
        };
    }
}
function onChatLoad(instance) {
    instance.on('pre:receive', preReceiveHandler);
    instance.on('feedback', feedbackHandler);
}
window.wxOConfiguration = {
    ...
        };
setTimeout(function () {
            ...
        }, 0);

サイボウズGaroon側の設定

システム管理の画面から、カスタマイズ➡java script/CSSによるカスタマイズを選択
image.png

あらかじめカスタマイズグループを作成し、それに対して、先ほどのjavascriptを.jsとして保管したものをファイル追加します
image.png
右下のChat吹き出しからwxOに問い合わせできます。
image.png
Teamsのケースと同様ですが、thumbs-upとthumbs-downのfeedbackボタンは表示されませんでした。
こちらのドキュメント参考にしてチャレンジ中です。

image.png
 

補足:AgentのWelcome messageとQuick start prompts

これらが設定できるようになりました。ガルーンで連携した場合も反映されます。よくある問い合わせを設定しておくと利便性向上しますね。
image.png

image.png

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?