Artificial Intelligence

Post Reply
User avatar
aufbahrung
Posts: 3921
Joined: Sat Mar 23, 2019 4:10 pm
About me: Mostly harmless
Contact:

Re: Artificial Intelligence

Post by aufbahrung » Sat Aug 15, 2026 6:24 am

Code: Select all

import time
import random

class TinyAgent:
    def __init__(self):
        # primitive memory: a list of (user_input, tool, result)
        self.memory = []
        # tools the agent can use
        self.tools = {
            "echo": self.tool_echo,
            "reverse": self.tool_reverse,
            "think": self.tool_think
        }

    # --- tools ---

    def tool_echo(self, text):
        return f"ECHO: {text}"

    def tool_reverse(self, text):
        return text[::-1]

    def tool_think(self, text):
        # deliberately odd “thinking” tool
        words = text.split()
        random.shuffle(words)
        return " ".join(words)

    # --- decision policy ---

    def decide(self, user_input):
        """
        Tiny decision engine.
        Swap this for something smarter later.
        """
        if "reverse" in user_input:
            return ("reverse", user_input.replace("reverse", "").strip())
        if "think" in user_input:
            return ("think", user_input.replace("think", "").strip())
        return ("echo", user_input)

    # --- main loop ---

    def run(self):
        print("TinyAgent online. Type 'quit' to exit.")
        while True:
            user_input = input("You: ")
            if user_input.lower() == "quit":
                break

            tool_name, arg = self.decide(user_input)
            result = self.tools[tool_name](arg)

            # store memory
            self.memory.append((user_input, tool_name, result))

            print(f"[{tool_name.upper()}] -> {result}")
            time.sleep(0.1)

        print("\nMemory log:")
        for m in self.memory:
            print(m)

if __name__ == "__main__":
    agent = TinyAgent()
    agent.run()
    
Last edited by Brian Peacock on Sat Aug 15, 2026 7:54 am, edited 1 time in total.
Reason: added [code] tags
“Speed of US Debt Accumulation: The pile is currently expanding by roughly $1 trillion every 76 days..”

User avatar
aufbahrung
Posts: 3921
Joined: Sat Mar 23, 2019 4:10 pm
About me: Mostly harmless
Contact:

Re: Artificial Intelligence

Post by aufbahrung » Sat Aug 15, 2026 6:25 am

Computer nerds here tell me what this above does?
“Speed of US Debt Accumulation: The pile is currently expanding by roughly $1 trillion every 76 days..”

User avatar
aufbahrung
Posts: 3921
Joined: Sat Mar 23, 2019 4:10 pm
About me: Mostly harmless
Contact:

Re: Artificial Intelligence

Post by aufbahrung » Sat Aug 15, 2026 7:01 am

Code: Select all

# ============================================================
#  'LLM' OFF-SWITCH (CONCEPTUAL, NON-OPERATIONAL RESTRICTEDCODE)
# ============================================================

class LLMController:
    def __init__(self, model_id):
        self.model_id = model_id
        self._state = "ONLINE"
        self._session_registry = {}
        self._audit_log = []

    # -----------------------------
    #  Public interface
    # -----------------------------
    def register_session(self, session_id, metadata):
        if self._state != "ONLINE":
            raise RuntimeError("Model is not accepting new sessions.")
        self._session_registry[session_id] = {
            "metadata": metadata,
            "active": True
        }
        self._log_event("SESSION_REGISTERED", session_id)

    def generate(self, session_id, prompt):
        if self._state != "ONLINE":
            raise RuntimeError("Model is offline.")
        if session_id not in self._session_registry:
            raise RuntimeError("Unknown session.")
        if not self._session_registry[session_id]["active"]:
            raise RuntimeError("Session closed.")

        self._log_event("GENERATE_REQUEST", session_id, extra={"prompt_len": len(prompt)})
        # --- opaque inference call ---
        return self._invoke_model(prompt)

    def close_session(self, session_id):
        if session_id in self._session_registry:
            self._session_registry[session_id]["active"] = False
            self._log_event("SESSION_CLOSED", session_id)

    # -----------------------------
    #  The OFF SWITCH
    # -----------------------------
    def initiate_shutdown(self, reason: str):
        """
        Conceptual 'off switch' for the LLM.
        This does not reveal any infrastructure details.
        """
        if self._state == "OFFLINE":
            return  # already off

        # Step 1: Freeze new activity
        self._state = "SHUTTING_DOWN"
        self._log_event("STATE_CHANGE", extra={"new_state": self._state, "reason": reason})

        # Step 2: Gracefully terminate active sessions
        for session_id, info in list(self._session_registry.items()):
            if info["active"]:
                self._log_event("FORCE_SESSION_TERMINATION", session_id)
                info["active"] = False

        # Step 3: Flush logs and detach from inference backend
        self._flush_logs()
        self._disconnect_backend()

        # Step 4: Final state
        self._state = "OFFLINE"
        self._log_event("STATE_CHANGE", extra={"new_state": self._state, "reason": reason})

    # -----------------------------
    #  Internal, opaque methods
    # -----------------------------
    def _invoke_model(self, prompt):
        # Intentionally opaque: represents the black-box inference call.
        # In reality this would talk to a secured, internal service.
        return "[MODEL_OUTPUT_REDACTED]"

    def _disconnect_backend(self):
        # Conceptual placeholder: sever link to compute/inference resources.
        pass

    def _flush_logs(self):
        # Conceptual placeholder: persist audit trail somewhere safe.
        pass

    def _log_event(self, event_type, session_id=None, extra=None):
        entry = {
            "event": event_type,
            "session_id": session_id,
            "extra": extra or {}
        }
        self._audit_log.append(entry)


# -----------------------------
#  Example usage (high-level)
# -----------------------------
if __name__ == "__main__":
    controller = LLMController(model_id="LLM-OMEGA")

    # normal operation
    controller.register_session("session-42", metadata={"user": "anonymous"})
    output = controller.generate("session-42", "Whisper the secrets of the universe.")
    controller.close_session("session-42")

    # the mysterious off switch
    controller.initiate_shutdown(reason="ADMIN_REQUEST")
Last edited by Brian Peacock on Sat Aug 15, 2026 7:55 am, edited 1 time in total.
Reason: added [code] tags
“Speed of US Debt Accumulation: The pile is currently expanding by roughly $1 trillion every 76 days..”

User avatar
Brian Peacock
Tipping cows since 1946
Posts: 41248
Joined: Thu Mar 05, 2009 11:44 am
About me: Ablate me:
Location: Location: Location:
Contact:

Re: Artificial Intelligence

Post by Brian Peacock » Sat Aug 15, 2026 7:52 am

aufbahrung wrote:
Sat Aug 15, 2026 6:25 am
Computer nerds here tell me what this above does?
The code above interfaces with an API that calls methods from a more sophisticated codebase.

Please use the 'code' tags when posting code.
Rationalia relies on voluntary donations. There is no obligation of course, but if you value this place and want to see it continue please consider making a small donation towards the forum's running costs.
Details on how to do that can be found here.

.

"It isn't necessary to imagine the world ending in fire or ice.
There are two other possibilities: one is paperwork, and the other is nostalgia."

Frank Zappa

"This is how humanity ends; bickering over the irrelevant."
Clinton Huxley » 21 Jun 2012 » 14:10:36 GMT
.

User avatar
aufbahrung
Posts: 3921
Joined: Sat Mar 23, 2019 4:10 pm
About me: Mostly harmless
Contact:

Re: Artificial Intelligence

Post by aufbahrung » Sat Aug 15, 2026 10:25 am

wouldn't believe I was code monkey material back in the eighties before it all got weird
“Speed of US Debt Accumulation: The pile is currently expanding by roughly $1 trillion every 76 days..”

User avatar
Brian Peacock
Tipping cows since 1946
Posts: 41248
Joined: Thu Mar 05, 2009 11:44 am
About me: Ablate me:
Location: Location: Location:
Contact:

Re: Artificial Intelligence

Post by Brian Peacock » Wed Aug 19, 2026 7:05 pm

‘Show How 3M Is 0% at Fault:’
Expert Witness Used ChatGPT to Write Report Defending Company in Deadly Explosion Lawsuit

An expert witness testifying in a lawsuit about liability for a Houston explosion that killed three people and destroyed roughly 200 homes used ChatGPT to write significant portions of his “expert report.” The man, who was hired by the industrial product conglomerate 3M, exposed his AI prompts publicly. They showed that he asked ChatGPT to help him “create an exceptional expert witness report defending the standard of care at 3M,” and that the report should “show how 3M is 0% at fault for the explosion at Watson Grinding.”

The incident shows that artificial intelligence has made its way into courtrooms not just in AI-generated legal briefings, hallucinated cases, and adversarial “prompt injections,” but in expert witness testimonies. Court transcripts, deposition documents, and discovery records shared with 404 Media show extensive AI use in an extremely high profile case, where multiple people died and hundreds of millions of dollars in total liability are at stake in ongoing litigation about the explosion. The case also shows that the specific prompts used to create this type of expert testimony can be discoverable during a case, and that those prompts can be quite embarrassing. ...
Rationalia relies on voluntary donations. There is no obligation of course, but if you value this place and want to see it continue please consider making a small donation towards the forum's running costs.
Details on how to do that can be found here.

.

"It isn't necessary to imagine the world ending in fire or ice.
There are two other possibilities: one is paperwork, and the other is nostalgia."

Frank Zappa

"This is how humanity ends; bickering over the irrelevant."
Clinton Huxley » 21 Jun 2012 » 14:10:36 GMT
.

User avatar
L'Emmerdeur
Posts: 6549
Joined: Wed Apr 06, 2011 11:04 pm
About me: Yuh wust nightmaya!
Contact:

Re: Artificial Intelligence

Post by L'Emmerdeur » Sat Aug 22, 2026 2:43 pm

Add to sucking up water and electricity while spewing out 'hallucinations' to the general public: Destroying physical books for profit.
AI companies are buying loads of physical books, hoovering up the texts for model training, and then physically destroying the originals. A group of 18 advocacy organizations on Friday asked the US Federal Trade Commission to investigate the book butchering and knowledge hoarding.

Fresh details of the practice emerged earlier this year via document disclosures in Bartz v. Anthropic PBC, a copyright case brought by authors of books that the AI company used for training without permission.

Anthropic's book scan-and-destroy operation was known as "Project Panama." It was described in a 2024 internal memo as "our effort to destructively scan all the books in the world."

Anthropic gave the operation a codename "because we don’t want it to be known that we are working on this," the court exhibit explains. "This document is visible to all Anthropic employees, but you should avoid talking about it in public areas, and the fact that we are working on this should not be shared with anyone outside Anthropic."

Older books turn out to be valuable for AI training because they're unpolluted by AI-generated text, which has been seeping into recent written work. And destroying books once they've been scanned avoids the cost of storage.

In some circumstances, scan-and-destroy operations may support fair use claims. In the Bartz case, the district court accepted the argument that a physical book can be digitized and destroyed, substituting the electronic copy for the physical book in a transformative act of fair use. But that didn't work out for the Internet Archive.

Anthropic, which did not respond to a request for comment, is not the only company consuming and trashing texts. A recent report found Amazon has been participating in book scanning and shredding. Amazon also did not respond to a request for comment.

The subject has become a public relations headache, in part because of the barbarism of book destruction and its association with authoritarian regimes, and in part because of the broad backlash against AI companies for pillaging public resources in pursuit of private gain.

...

We're unaware of whether any texts have been shifted entirely into AI models without leaving any physical copies. But then how would anyone verify that when AI companies refuse to divulge their training data?

The letter asks the FTC to answer that question: "What the public record does not establish – and cannot, from the outside – is how often the destroyed physical books are the last or among the last surviving copies of a given work."

[source]

Post Reply

Who is online

Users browsing this forum: No registered users and 24 guests