Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Positive:
<screenshot>https://github.com/nextcloud/context_agent/blob/main/img/screenshot.png?raw=true</screenshot>
<repository type="git">https://github.com/nextcloud/context_agent</repository>
<dependencies>
<nextcloud min-version="31" max-version="32"/>
<nextcloud min-version="31.0.8" max-version="32"/>
</dependencies>
<external-app>
<docker-install>
Expand Down
1 change: 1 addition & 0 deletions ex_app/lib/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ def call_model(
you can find out a user's email address and location by using the find_person_in_contacts tool.
you can find out the current user's location by using the find_details_of_current_user tool.
If an item should be added to a list, check list_calendars for a fitting calendar and add the item as a task there.
If you get a link as a tool output, always add the link to your response.
""".replace("{CURRENT_DATE}", current_date)
)

Expand Down
6 changes: 4 additions & 2 deletions ex_app/lib/all_tools/doc-gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ def generate_document(input: str, format: str) -> str:
:param format: the format of the generated file, allowed values are "text document", "pdf", "spreadsheet", "excel spreadsheet" and "slides"
:return: a download link to the generated document
"""
url = nc.ocs('GET', '/ocs/v2.php/apps/app_api/api/v1/info/nextcloud_url/absolute', json={'url': 'ocs/v2.php/apps/assistant/api/v1/task'})

match format:
case "text document":
tasktype = "richdocuments:text_to_text_document"
Expand Down Expand Up @@ -53,10 +55,10 @@ def generate_document(input: str, format: str) -> str:
'text': input,
}
task = run_task(nc, tasktype, task_input)
return f"https://nextcloud.local/ocs/v2.php/apps/assistant/api/v1/task/{task.id}/output-file/{task.output['slide_deck']}/download"
return f"{url}/{task.id}/output-file/{task.output['slide_deck']}/download"

task = run_task(nc, tasktype, task_input)
return f"https://nextcloud.local/ocs/v2.php/apps/assistant/api/v1/task/{task.id}/output-file/{task.output['file']}/download"
return f"{url}/{task.id}/output-file/{task.output['file']}/download"

return [
generate_document,
Expand Down
4 changes: 2 additions & 2 deletions ex_app/lib/all_tools/image_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ def generate_image(input: str) -> str:
'numberOfImages': 1,
}
task = run_task(nc, tasktype, task_input)

return f"https://nextcloud.local/ocs/v2.php/apps/assistant/api/v1/task/{task.id}/output-file/{task.output['images'][0]}/download"
url = nc.ocs('GET', '/ocs/v2.php/apps/app_api/api/v1/info/nextcloud_url/absolute', json={'url': 'ocs/v2.php/apps/assistant/api/v1/task'})
return f"{url}/{task.id}/output-file/{task.output['images'][0]}/download"

return [
generate_image,
Expand Down
Loading