Skip to content

Commit ae0ae0a

Browse files
authored
AppAPI 1.1.0, /init endpoint (#151)
Checks will fail, it is expected until new version of AppAPI will not be released. --------- Signed-off-by: Alexander Piskun <[email protected]>
1 parent d516159 commit ae0ae0a

23 files changed

+204
-57
lines changed

.run/TalkBotAI (27).run.xml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<component name="ProjectRunConfigurationManager">
2+
<configuration default="false" name="TalkBotAI (27)" type="PythonConfigurationType" factoryName="Python">
3+
<module name="nc_py_api" />
4+
<option name="INTERPRETER_OPTIONS" value="" />
5+
<option name="PARENT_ENVS" value="true" />
6+
<envs>
7+
<env name="APP_ID" value="talk_bot_ai" />
8+
<env name="APP_PORT" value="9034" />
9+
<env name="APP_SECRET" value="12345" />
10+
<env name="APP_VERSION" value="1.0.0" />
11+
<env name="NEXTCLOUD_URL" value="http://stable27.local" />
12+
<env name="PYTHONUNBUFFERED" value="1" />
13+
</envs>
14+
<option name="SDK_HOME" value="" />
15+
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
16+
<option name="IS_MODULE_SDK" value="true" />
17+
<option name="ADD_CONTENT_ROOTS" value="true" />
18+
<option name="ADD_SOURCE_ROOTS" value="true" />
19+
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
20+
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/examples/as_app/talk_bot_AI/src/main.py" />
21+
<option name="PARAMETERS" value="" />
22+
<option name="SHOW_COMMAND_LINE" value="false" />
23+
<option name="EMULATE_TERMINAL" value="false" />
24+
<option name="MODULE_MODE" value="false" />
25+
<option name="REDIRECT_INPUT" value="false" />
26+
<option name="INPUT_FILE" value="" />
27+
<method v="2" />
28+
</configuration>
29+
</component>

.run/TalkBotAI.run.xml renamed to .run/TalkBotAI (28).run.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<component name="ProjectRunConfigurationManager">
2-
<configuration default="false" name="TalkBotAI" type="PythonConfigurationType" factoryName="Python">
2+
<configuration default="false" name="TalkBotAI (28)" type="PythonConfigurationType" factoryName="Python">
33
<module name="nc_py_api" />
44
<option name="INTERPRETER_OPTIONS" value="" />
55
<option name="PARENT_ENVS" value="true" />

.run/ToGif(28).run.xml renamed to .run/ToGif (28).run.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<component name="ProjectRunConfigurationManager">
2-
<configuration default="false" name="ToGif(28)" type="PythonConfigurationType" factoryName="Python">
2+
<configuration default="false" name="ToGif (28)" type="PythonConfigurationType" factoryName="Python">
33
<module name="nc_py_api" />
44
<option name="INTERPRETER_OPTIONS" value="" />
55
<option name="PARENT_ENVS" value="true" />
66
<envs>
7+
<env name="PYTHONUNBUFFERED" value="1" />
78
<env name="APP_ID" value="to_gif" />
89
<env name="APP_PORT" value="9031" />
910
<env name="APP_SECRET" value="12345" />
1011
<env name="APP_VERSION" value="1.0.0" />
1112
<env name="NEXTCLOUD_URL" value="http://nextcloud.local" />
12-
<env name="PYTHONUNBUFFERED" value="1" />
1313
</envs>
1414
<option name="SDK_HOME" value="" />
1515
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [0.4.1 - 2023-10-17]
6+
7+
### Added
8+
9+
- Support for the new AppAPI endpoint `/init` and automatically downloading models from `huggingface`. #151
10+
11+
### Changed
12+
13+
- All examples were adjusted to changes in AppAPI.
14+
515
## [0.4.0 - 2023-10-15]
616

717
As the project moves closer to `beta`, final unification changes are being made.

examples/as_app/skeleton/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,18 @@ deploy:
3232
.PHONY: run28
3333
run28:
3434
docker exec master-nextcloud-1 sudo -u www-data php occ app_api:app:unregister skeleton --silent || true
35-
docker exec master-nextcloud-1 sudo -u www-data php occ app_api:app:register skeleton docker_dev -e --force-scopes \
35+
docker exec master-nextcloud-1 sudo -u www-data php occ app_api:app:register skeleton docker_dev --force-scopes \
3636
--info-xml https://raw.githubusercontent.com/cloud-py-api/nc_py_api/main/examples/as_app/skeleton/appinfo/info.xml
3737

3838
.PHONY: run27
3939
run27:
4040
docker exec master-stable27-1 sudo -u www-data php occ app_api:app:unregister skeleton --silent || true
41-
docker exec master-stable27-1 sudo -u www-data php occ app_api:app:register skeleton docker_dev -e --force-scopes \
41+
docker exec master-stable27-1 sudo -u www-data php occ app_api:app:register skeleton docker_dev --force-scopes \
4242
--info-xml https://raw.githubusercontent.com/cloud-py-api/nc_py_api/main/examples/as_app/skeleton/appinfo/info.xml
4343

4444
.PHONY: manual_register
4545
manual_register:
4646
docker exec master-nextcloud-1 sudo -u www-data php occ app_api:app:unregister skeleton --silent || true
4747
docker exec master-nextcloud-1 sudo -u www-data php occ app_api:app:register skeleton manual_install --json-info \
4848
"{\"appid\":\"skeleton\",\"name\":\"App Skeleton\",\"daemon_config_name\":\"manual_install\",\"version\":\"1.0.0\",\"secret\":\"12345\",\"host\":\"host.docker.internal\",\"port\":9030,\"scopes\":{\"required\":[],\"optional\":[]},\"protocol\":\"http\",\"system_app\":0}" \
49-
-e --force-scopes
49+
--force-scopes
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
nc_py_api[app]>=0.3.0
1+
nc_py_api[app]>=0.4.1

examples/as_app/talk_bot/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,18 @@ deploy:
3232
.PHONY: run28
3333
run28:
3434
docker exec master-nextcloud-1 sudo -u www-data php occ app_api:app:unregister talk_bot --silent || true
35-
docker exec master-nextcloud-1 sudo -u www-data php occ app_api:app:register talk_bot docker_dev -e --force-scopes \
35+
docker exec master-nextcloud-1 sudo -u www-data php occ app_api:app:register talk_bot docker_dev --force-scopes \
3636
--info-xml https://raw.githubusercontent.com/cloud-py-api/nc_py_api/main/examples/as_app/talk_bot/appinfo/info.xml
3737

3838
.PHONY: run27
3939
run27:
4040
docker exec master-stable27-1 sudo -u www-data php occ app_api:app:unregister talk_bot --silent || true
41-
docker exec master-stable27-1 sudo -u www-data php occ app_api:app:register talk_bot docker_dev -e --force-scopes \
41+
docker exec master-stable27-1 sudo -u www-data php occ app_api:app:register talk_bot docker_dev --force-scopes \
4242
--info-xml https://raw.githubusercontent.com/cloud-py-api/nc_py_api/main/examples/as_app/talk_bot/appinfo/info.xml
4343

4444
.PHONY: manual_register
4545
manual_register:
4646
docker exec master-nextcloud-1 sudo -u www-data php occ app_api:app:unregister talk_bot --silent || true
4747
docker exec master-nextcloud-1 sudo -u www-data php occ app_api:app:register talk_bot manual_install --json-info \
4848
"{\"appid\":\"talk_bot\",\"name\":\"TalkBot\",\"daemon_config_name\":\"manual_install\",\"version\":\"1.0.0\",\"secret\":\"12345\",\"host\":\"host.docker.internal\",\"port\":9032,\"scopes\":{\"required\":[\"TALK\", \"TALK_BOT\"],\"optional\":[]},\"protocol\":\"http\",\"system_app\":0}" \
49-
-e --force-scopes
49+
--force-scopes
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
nc_py_api[app]>=0.3.0
1+
nc_py_api[app]>=0.4.1

examples/as_app/talk_bot_ai/Makefile

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ help:
1717
@echo " For development of this example use PyCharm run configurations. Development is always set for last Nextcloud."
1818
@echo " First run 'TalkBotAI' and then 'make manual_register', after that you can use/debug/develop it and easy test."
1919
@echo " "
20-
@echo " manual_register perform registration of running 'TalkBotAI' into the 'manual_install' deploy daemon."
20+
@echo " manual_register28 perform registration of running 'TalkBotAI' into the 'manual_install' deploy daemon."
21+
@echo " manual_register27 perform registration of running 'TalkBotAI' into the 'manual_install' deploy daemon."
2122

2223
.PHONY: build-push
2324
build-push:
@@ -32,18 +33,25 @@ deploy:
3233
.PHONY: run28
3334
run28:
3435
docker exec master-nextcloud-1 sudo -u www-data php occ app_api:app:unregister talk_bot_ai --silent || true
35-
docker exec master-nextcloud-1 sudo -u www-data php occ app_api:app:register talk_bot_ai docker_dev -e --force-scopes \
36+
docker exec master-nextcloud-1 sudo -u www-data php occ app_api:app:register talk_bot_ai docker_dev --force-scopes \
3637
--info-xml https://raw.githubusercontent.com/cloud-py-api/nc_py_api/main/examples/as_app/talk_bot_ai/appinfo/info.xml
3738

39+
.PHONY: manual_register28
40+
manual_register28:
41+
docker exec master-nextcloud-1 sudo -u www-data php occ app_api:app:unregister talk_bot_ai --silent || true
42+
docker exec master-nextcloud-1 sudo -u www-data php occ app_api:app:register talk_bot_ai manual_install --json-info \
43+
"{\"appid\":\"talk_bot_ai\",\"name\":\"TalkBotAI\",\"daemon_config_name\":\"manual_install\",\"version\":\"1.0.0\",\"secret\":\"12345\",\"host\":\"host.docker.internal\",\"port\":9034,\"scopes\":{\"required\":[\"TALK\", \"TALK_BOT\"],\"optional\":[]},\"protocol\":\"http\",\"system_app\":0}" \
44+
--force-scopes
45+
3846
.PHONY: run27
3947
run27:
4048
docker exec master-stable27-1 sudo -u www-data php occ app_api:app:unregister talk_bot_ai --silent || true
41-
docker exec master-stable27-1 sudo -u www-data php occ app_api:app:register talk_bot_ai docker_dev -e --force-scopes \
49+
docker exec master-stable27-1 sudo -u www-data php occ app_api:app:register talk_bot_ai docker_dev --force-scopes \
4250
--info-xml https://raw.githubusercontent.com/cloud-py-api/nc_py_api/main/examples/as_app/talk_bot_ai/appinfo/info.xml
4351

44-
.PHONY: manual_register
45-
manual_register:
46-
docker exec master-nextcloud-1 sudo -u www-data php occ app_api:app:unregister talk_bot_ai --silent || true
47-
docker exec master-nextcloud-1 sudo -u www-data php occ app_api:app:register talk_bot_ai manual_install --json-info \
52+
.PHONY: manual_register27
53+
manual_register27:
54+
docker exec master-stable27-1 sudo -u www-data php occ app_api:app:unregister talk_bot_ai --silent || true
55+
docker exec master-stable27-1 sudo -u www-data php occ app_api:app:register talk_bot_ai manual_install --json-info \
4856
"{\"appid\":\"talk_bot_ai\",\"name\":\"TalkBotAI\",\"daemon_config_name\":\"manual_install\",\"version\":\"1.0.0\",\"secret\":\"12345\",\"host\":\"host.docker.internal\",\"port\":9034,\"scopes\":{\"required\":[\"TALK\", \"TALK_BOT\"],\"optional\":[]},\"protocol\":\"http\",\"system_app\":0}" \
49-
-e --force-scopes
57+
--force-scopes

examples/as_app/talk_bot_ai/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
nc_py_api[app]>=0.3.0
1+
nc_py_api[app]>=0.4.1
22
transformers>=4.33
33
torch
44
torchvision

0 commit comments

Comments
 (0)