We're Hiring!
Whitepaper
Docs
Sign In
@deseven
·
a year ago
function
Context Remover
Get
Last Updated
a year ago
Created
a year ago
Function
filter
v0.1
Name
Context Remover
Downloads
62+
Saves
0+
Description
Removes all context from the request to the model, leaving only the last user message (useful for cases where previous messages are not needed).
Function Code
Show
""" title: Context Remover author: deseven author_url: https://d7.wtf/ version: 0.1 """ from pydantic import BaseModel, Field from typing import Optional class Filter: class Valves(BaseModel): pass def __init__(self): self.valves = self.Valves() pass def inlet(self, body: dict, __user__: Optional[dict] = None) -> dict: if body["messages"]: body["messages"] = [body["messages"][-1]] return body def outlet(self, body: dict, __user__: Optional[dict] = None) -> dict: return body
Sponsored by Open WebUI Inc.
We are hiring!
Shape the way humanity engages with
intelligence
.
0