diff options
| author | Guillermo Serrahima <dev@vylion.com> | 2026-06-26 14:39:23 +0200 |
|---|---|---|
| committer | Guillermo Serrahima <dev@vylion.com> | 2026-06-26 14:39:23 +0200 |
| commit | 963f59569437fe43a49ce36a003a143fa2f767c8 (patch) | |
| tree | 968b0dad13193536770ae1e6b580b27e22f9366b /agent/orchestrator/loop.py | |
| parent | 741a04c2abcbd77451c0933a19d91fddb9982882 (diff) | |
| download | senia-963f59569437fe43a49ce36a003a143fa2f767c8.tar.xz senia-963f59569437fe43a49ce36a003a143fa2f767c8.zip | |
created custom agent loop
Diffstat (limited to 'agent/orchestrator/loop.py')
| -rw-r--r-- | agent/orchestrator/loop.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/agent/orchestrator/loop.py b/agent/orchestrator/loop.py new file mode 100644 index 0000000..ed2c0a8 --- /dev/null +++ b/agent/orchestrator/loop.py @@ -0,0 +1,18 @@ +"""Per-turn orchestration. + +A turn is: gather dynamic context, hand the conversation to the backend, return +the response. As capabilities grow (memory recall, routing per intent, channel +adapters) they hang off this function. +""" + +from .context import build_turn_context +from .models import Message, ModelRequest, call_model + + +def handle_turn(messages: list[Message]) -> str: + request = ModelRequest( + messages=messages, + turn_context=build_turn_context(), + ) + response = call_model(request) + return response.content |
