Skip to content

Commit

Permalink
fixup! feat: Add task processing API
Browse files Browse the repository at this point in the history
  • Loading branch information
provokateurin committed Jun 7, 2024
1 parent e0d60c2 commit 24570f8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,15 @@ class BackgroundProcessTask(threading.Thread):
def run(self, *args, **kwargs): # pylint: disable=unused-argument
nc = NextcloudApp()

provider_ids = set()
task_type_ids = set()
for chain_name, _ in chains.items():
provider_ids.add("llm2:" + chain_name)
(model, task) = chain_name.split(":", 2)
task_type_ids.add("core:text2text:" + task)

while True:
response = nc.providers.task_processing.next_task(list(task_type_ids))
response = nc.providers.task_processing.next_task(list(provider_ids), list(task_type_ids))
if not isinstance(response, dict):
time.sleep(5)
continue
Expand Down

0 comments on commit 24570f8

Please sign in to comment.