Skip to content

Commit

Permalink
Merge pull request #1 from cloud-py-api/v1.0.1
Browse files Browse the repository at this point in the history
renamed "@ai" to "@Assistant"
  • Loading branch information
bigcat88 authored Oct 6, 2023
2 parents 176bfac + 539a96f commit 4cb827b
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .run/TalkBotAI.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs>
<env name="PYTHONUNBUFFERED" value="1" />
<env name="APP_ID" value="talk_bot_ai_example" />
<env name="APP_PERSISTENT_STORAGE" value="$USER_HOME$/persis_storage" />
<env name="APP_PORT" value="9034" />
<env name="APP_SECRET" value="12345" />
<env name="APP_VERSION" value="1.0.0" />
<env name="NEXTCLOUD_URL" value="http://nextcloud.local" />
<env name="PYTHONUNBUFFERED" value="1" />
<env name="AE_VERSION" value="1.0.0" />
</envs>
<option name="SDK_HOME" value="" />
Expand Down
2 changes: 1 addition & 1 deletion HOW_TO_INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ How To Install
2. Create a deployment daemon following the [instructions](https://cloud-py-api.github.io/app_api/CreationOfDeployDaemon.html) provided by AppAPI. _(If you are using AIO, it will be created automatically)_
3. Navigate to the `External Apps` menu from your Nextcloud instance, find this example, and click the `Install` button.
4. Enable this bot in conversation settings.
5. Type in conversation: **@ai I have a question for you**
5. Type in conversation: **@assistant I have a question for you**
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ It shouldn't be too difficult to use a more advanced model based on this example
Refer to [How to install](https://github.com/cloud-py-api/talk_bot_ai_example/blob/main/HOW_TO_INSTALL.md) to try it.
]]></description>
<version>1.0.0</version>
<version>1.0.1</version>
<licence>MIT</licence>
<author mail="andrey18106x@gmail.com" homepage="https://github.com/andrey18106">Andrey Borysenko</author>
<author mail="bigcat88@icloud.com" homepage="https://github.com/bigcat88">Alexander Piskun</author>
Expand Down
Binary file modified screenshots/talk_bot_ai.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def talk_bot_app(request: Request) -> TalkBotMessage:


def ai_talk_bot_process_request(message: TalkBotMessage):
r = re.search(r"@ai\s(.*)", message.object_content["message"], re.IGNORECASE)
r = re.search(r"@assistant\s(.*)", message.object_content["message"], re.IGNORECASE)
if r is None:
return
model = pipeline("text2text-generation", model=MODEL_NAME)
Expand Down Expand Up @@ -222,7 +222,7 @@ def enabled_handler(enabled: bool, request: Request):
params = {
"name": "AI talk bot example",
"route": BOT_URL,
"description": "Usage: `@ai What sounds do cats make?`",
"description": "Usage: `@assistant What sounds do cats make?`",
}
result = ocs_call(method="POST", path="/ocs/v1.php/apps/app_api/api/v1/talk_bot", json_data=params)
result_dict = json.loads(result.text)["ocs"]["data"]
Expand Down

0 comments on commit 4cb827b

Please sign in to comment.