Generative AI

OpenAI Releases GPT-Live and GPT-Live-1 mini: Full-Duplex Voice Models Delivering Deep Reasoning in GPT-5.5

"""Illustrative simulation of the GPT-Live full-duplex decision loop.
Teaching model of the described architecture, NOT the real API."""
import random
random.seed(7)  # reproducible output

class BackgroundModel:                      # stands in for GPT-5.5
    def run(self, query):
        return f"answer to '{query}'"

class GPTLive:
    def __init__(self, background):
        self.background = background
        self.pending = None                 # a delegated task, if one is running

    def decide(self, user_speaking, needs_deep_work):
        # A real model makes this choice many times per second.
        if self.pending is not None:
            return "await_delegate"
        if needs_deep_work:
            return "delegate"
        if user_speaking:
            return random.choice(["listen", "backchannel"])
        return "speak"

    def step(self, frame):
        action = self.decide(frame["user_speaking"], frame["needs_deep_work"])
        if action == "delegate":
            self.pending = frame["query"]                 # hand off, keep talking
            return 'speak      -> "one sec, still with you"'
        if action == "await_delegate":
            result = self.background.run(self.pending)     # background result
            self.pending = None
            return f'speak      -> "{result}"'
        if action == "backchannel":
            return 'backchannel-> "mhmm" (while user talks)'
        if action == "listen":
            return "listen     -> (quiet, attending)"
        return "speak      -> (normal reply)"

# A short scripted stream of audio frames the loop consumes in order.
stream = [
    {"user_speaking": True,  "needs_deep_work": False, "query": None},
    {"user_speaking": True,  "needs_deep_work": False, "query": None},
    {"user_speaking": False, "needs_deep_work": True,  "query": "weather at 6pm"},
    {"user_speaking": False, "needs_deep_work": False, "query": None},  # result returns
    {"user_speaking": False, "needs_deep_work": False, "query": None},
]

live = GPTLive(BackgroundModel())
for i, frame in enumerate(stream):
    print(f"frame {i}: {live.step(frame)}")

Source link

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button