Skip to content
Fondazione ITS INCOM

Examples · General

From a group chat to a task list

Paste the chat of your project group and Qwen3.6 pulls out who does what and by when, with real dates instead of “by Friday”.

Intermediate · 30 min

What you need

A key and the openai library, as in Your first API call in Python.

The model

Qwen3.6 35B (qwen3.6-35b): strong on office work, like reading a messy conversation and turning it into a table.

The program

The chat is from a group preparing the Networks project. Note the date of “today” in the request: without it, the model cannot know which Friday “by Friday” is.

import json
import os

from openai import OpenAI

client = OpenAI(
    base_url="https://api.ai.itsincom.org/v1",
    api_key=os.environ["API_KEY"],
)

chat = """[06/10/26 18:02] Giulia: allora il project work di Reti va consegnato il 23 ottobre
[06/10/26 18:03] Marco: io faccio lo schema della rete con Packet Tracer, entro venerdì
[06/10/26 18:05] Sara: io scrivo la relazione, ma mi serve prima lo schema di Marco
[06/10/26 18:06] Luca: la configurazione del firewall la faccio io
[06/10/26 18:10] Giulia: ok, io preparo le slide per la presentazione, le finisco il 21
[06/10/26 18:12] Marco: chi chiede al prof se va bene pfSense?
[06/10/26 18:15] Luca: lo chiedo io domani a lezione
[07/10/26 09:40] Luca: fatto, il prof dice che pfSense va bene"""

schema = {
    "type": "object",
    "properties": {
        "delivery": {"type": "string", "description": "YYYY-MM-DD"},
        "tasks": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "task": {"type": "string"},
                    "owner": {"type": "string"},
                    "deadline": {"type": "string", "description": "YYYY-MM-DD, or empty if none was given"},
                    "waiting_for": {"type": "string", "description": "what it depends on, or empty"},
                    "done": {"type": "boolean"},
                },
                "required": ["task", "owner", "deadline", "waiting_for", "done"],
            },
        },
    },
    "required": ["delivery", "tasks"],
}

answer = client.chat.completions.create(
    model="qwen3.6-35b",
    temperature=0,
    messages=[
        {"role": "system", "content": "Today is Wednesday 7 October 2026. From the group chat, extract the "
                                      "project delivery date and every task: who, what, by when, what it "
                                      "waits for, and whether it is done. Dates as YYYY-MM-DD. Tasks in English."},
        {"role": "user", "content": chat},
    ],
    response_format={"type": "json_schema", "json_schema": {"name": "tasks", "schema": schema}},
)

result = json.loads(answer.choices[0].message.content)
print("Delivery:", result["delivery"])
for t in result["tasks"]:
    mark = "x" if t["done"] else " "
    waiting = f" (waits for: {t['waiting_for']})" if t["waiting_for"] else ""
    print(f"[{mark}] {t['deadline'] or '----------'}  {t['owner']:7} {t['task']}{waiting}")

What you should see

Delivery: 2026-10-23
[ ] 2026-10-09  Marco   Network diagram in Packet Tracer
[ ] ----------  Sara    Write the report (waits for: Marco's network diagram)
[ ] ----------  Luca    Firewall configuration
[ ] 2026-10-21  Giulia  Presentation slides
[x] 2026-10-07  Luca    Ask the teacher whether pfSense is OK

The wording can change; the owners, the dates and what is done must not.

Exercise

All examples