Skip to content

Commit 7fb170c

Browse files
committed
Update
1 parent b7e4818 commit 7fb170c

7 files changed

Lines changed: 57 additions & 4 deletions

File tree

docs/bot/summarize-with-ai.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
id: summarize-with-ai
3+
sidebar_label: Summarize With AI
4+
title: Summarize With AI
5+
---
6+
7+
Here is a quick way you can have a chat summary after the chat has ended. It will summarize only if the following conditions were met
8+
9+
* We should pass visitors and operators messages only.
10+
* Only chats with operators assigned.
11+
* There should be at-least one visitor message after a chat was accepted.
12+
13+
We will need few things
14+
15+
* Listen on `chat.close` event
16+
* Define Rest API call
17+
* Create a bot with and trigger which will call `Rest API`
18+
* After you are happy how it works you can uncheck `Log all request and their responses as system messages.`
19+
20+
In this scenario, we will use ChatGPT as a sample. But any Chat completion api would work.
21+
22+
## Define Rest API call
23+
24+
* Download and import Rest API from [here](/img/bot/ai/summarize-rest-api.json)
25+
* Enter your API in `Rest API => Authorization` section.
26+
* At the moment it uses `{{msg_all_since_transfer_content_date_nick}}` variable if you have an older version you can use just `{{msg_all_since_transfer_content}}`
27+
* You can also adjus system message in `Body` section.
28+
29+
## Bot setup
30+
31+
* Import bot from [here](/img/bot/ai/summarize-with-ai-bot.json) and choose just imported Rest API.
32+
33+
## Webhook setup
34+
35+
Webhook will define that on chat close we will execute this trigger. Just setup as in screnshot below.
36+
37+
![Summarize With AI](/img/bot/summarize-with-ai.png)
38+
39+
If you did everything correctly, you should see a summary after the chat has ended as a system message.
40+
41+
42+
43+
44+
45+
46+

docs/install.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ rm composer.lock
6161
composer.phar install
6262
```
6363

64+
`composer.phar` you can download from https://getcomposer.org/download/
65+
6466
## Folders permissions
6567

6668
* After granting permission to write to the cache folder, you should see the following window. If you encounter a strange error instead of the installation page, please ensure that:

docs/upgrading.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ Here is basic tutorial how to perform upgrades since 2.04 version. This version
88
If you are upgrading from older version to any version 3.30v and higher you have to install composer dependencies.
99
```
1010
cd lhc_web
11-
composer install
11+
composer.phar install
1212
```
1313

14+
If you don't have `composer.phar` you can download it from https://getcomposer.org/download/
15+
1416
* You can download version with dependencies included https://github.com/LiveHelperChat/livehelperchat/releases look for newest file name `*.**v-with-dependencies.tgz` **8.2 PHP** version is required.
1517

1618
It has a folder `lib/vendor` in it so you don't need to install composer thing yourself. Copy it to `lib/vendor`
@@ -28,7 +30,7 @@ It has a folder `lib/vendor` in it so you don't need to install composer thing y
2830
5. [Download the most recent LHC version](http://livehelperchat.com/article/static/5) Overwrite `doc`,`ezcomponents`,`lib`,`modules`,`pos`,`translations`,`design` folders. Also, overwrite `index.php` and `cron.php` files with the new version.
2931
1. https://github.com/remdex/livehelperchat/archive/master.zip - latest master branch zip without composer denpendencies
3032
2. https://github.com/LiveHelperChat/livehelperchat/releases - latest release with composer dependencies.
31-
6. Overwrite `composer.json` and `composer.lock` files and run `composer install` or `composer update` command.
33+
6. Overwrite `composer.json` and `composer.lock` files and run `composer.phar install` or `composer.phar update` command.
3234
7. Disable [cache in settings.ini.php](debug.md#disabling-cache)
3335
8. Log in to LHC again and go to `"System configuration" -> "Clear Cache" and click Clear Cache`
3436
1. You can also clear the cache by executing this command from the command line: `php cron.php -s site_admin -c cron/util/clear_cache`
@@ -61,7 +63,7 @@ You will loose facebook messenger compatibility.
6163
"symfony/event-dispatcher": "^7.1",
6264
```
6365

64-
* Execute `composer update`
66+
* Execute `composer.phar update`
6567

6668
## Permissions
6769

sidebars.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,8 @@ module.exports = {
147147
'bot/chatgpt-integration',
148148
'bot/deepseek-integration',
149149
'bot/ollama-integration',
150-
'bot/gemini-integration'
150+
'bot/gemini-integration',
151+
'bot/summarize-with-ai'
151152
]
152153
},
153154
{
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"name":"ChatGPTSummary","description":"ChatGTP","configuration":"{\"host\":\"https:\/\/api.openai.com\",\"log_code\":\"\",\"log_audit\":false,\"log_system\":true,\"ecache\":false,\"parameters\":[{\"method\":\"POST\",\"authorization\":\"bearer\",\"api_key_location\":\"header\",\"query\":[],\"header\":[{\"key\":\"OpenAI-Beta\",\"value\":\"assistants=v1\",\"id\":\"temp1707815973681\"}],\"conditions\":[],\"postparams\":[],\"userparams\":[],\"output\":[{\"key\":\"\",\"value\":\"\",\"id\":\"temp1707816009806\",\"success_name\":\"Success\",\"success_location\":\"choices:0:message:content\",\"success_header\":\"200\",\"output_priority\":\"10\"},{\"key\":\"\",\"value\":\"\",\"id\":\"temp1707819824689\",\"output_priority\":\"5\",\"success_name\":\"Failure\",\"success_location\":\"\"},{\"key\":\"\",\"value\":\"\",\"id\":\"temp1736423057534\",\"success_name\":\"Tool call\",\"success_header\":\"200\",\"output_priority\":\"30\",\"success_condition_val\":\"choices:0:message:tool_calls:0:type\",\"success_location\":\"choices:0:message:tool_calls:0:id\",\"success_location_2\":\"choices:0:message:tool_calls:0:function:name\",\"success_location_3\":\"choices:0:message:tool_calls:0:function:arguments\",\"success_location_4\":\"choices:0:message:tool_calls\",\"success_condition\":\"eq\",\"success_compare_value\":\"function\"}],\"id\":\"temp1707815934109\",\"name\":\"ChatCompletion\",\"suburl\":\"\/v1\/chat\/completions\",\"body_request_type\":\"raw\",\"body_request_type_content\":\"json\",\"auth_bearer\":\"your_api_key\",\"body_raw\":\"{\\n \\\"model\\\": \\\"gpt-4o-mini\\\",\\n \\\"messages\\\": [\\n {\\n \\\"role\\\": \\\"system\\\",\\n \\\"content\\\": \\\"You are summarizing assistant. Sumarize provided conversation.\\\"\\n },\\n {\\n \\\"role\\\": \\\"user\\\",\\n \\\"content\\\": \\\"Summarize this: \\\\n raw_{{msg_all_since_transfer_content_date_nick}}\\\"\\n }\\n ]\\n }\",\"max_execution_time\":120}]}"}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"bot":{"name":"Summarize With AI"},"groups":[{"group":{"name":"Sumarize","is_collapsed":0,"pos":0},"triggers":[{"trigger":{"id":2528,"name":"Sumarize chat","actions":"[{\"_id\":\"9WwnK2vt9\",\"type\":\"restapi\",\"content\":{\"text\":\"\",\"rest_api\":96,\"rest_api_method\":\"temp1707815934109\",\"rest_api_method_params\":[],\"rest_api_method_output\":{\"temp1707816009806\":\"2529\"},\"attr_options\":{\"no_body\":true,\"background_process_delegate\":true}}}]","default":0,"default_unknown":0,"default_always":0,"default_unknown_btn":0,"as_argument":0,"in_progress":0},"events":[],"payloads":[]},{"trigger":{"id":2529,"name":"Store sumarization","actions":"[{\"_id\":\"V8LaIdlOD\",\"type\":\"text\",\"content\":{\"text\":\"{content_1}\",\"attr_options\":{\"as_system\":true}}}]","default":0,"default_unknown":0,"default_always":0,"default_unknown_btn":0,"as_argument":0,"in_progress":0},"events":[],"payloads":[]},{"trigger":{"id":2530,"name":"Process sumarization","actions":"[{\"_id\":\"bVDDrssHx\",\"type\":\"conditions\",\"content\":{\"text\":\"\",\"conditions\":[{\"_id\":\"wXVJO3KEk\",\"type\":\"condition\",\"content\":{\"field\":\"\",\"comp\":\"gt\",\"val\":\"0\",\"attr\":\"{args.chat.user_id}\"}},{\"_id\":\"p_hHu2k6j\",\"type\":\"condition\",\"content\":{\"field\":\"\",\"comp\":\"gt\",\"val\":\"{args.chat.pnd_time}\",\"attr\":\"{args.chat.last_user_msg_time}\"}}],\"attr_options\":{\"callback_match\":\"2528\"}}}]","default":0,"default_unknown":0,"default_always":0,"default_unknown_btn":0,"as_argument":0,"in_progress":0},"events":[],"payloads":[]}]}]}
50.2 KB
Loading

0 commit comments

Comments
 (0)