test(core,langchain): update tests for explicit deserialization allowlists - #38118
Merged
Conversation
…lists Core serialization tests now opt into the object allowlists they rely on instead of assuming default deserialization permits core objects. Compatibility tests that intentionally exercise deprecated runnable streaming and history APIs also suppress the expected deprecation warnings so they can keep covering those legacy paths cleanly. ## Changes - Updated serialization and prompt round-trip tests to pass `allowed_objects="core"` or targeted allowlists when loading `AIMessage`, prompt templates, structured prompts, runnable maps, and related core objects. - Adjusted secret-injection regression coverage to keep testing `secrets_from_env=True` behavior while explicitly allowing core deserialization paths. - Tightened prompt deserialization rejection tests so attribute-access payloads are loaded only through the specific prompt-template allowlist needed to reach validation. - Added module-level warning filters around legacy runnable compatibility coverage for `astream_log`, `astream_events(version="v1")`, and `RunnableWithMessageHistory`. - Bumped the `langchain` package's minimum `langgraph` dependency from `1.2.4` to `1.2.5`. ## Testing - Updated unit tests across core serialization, prompt, fake chat model, runnable history, and runnable event coverage.
Mason Daugherty (mdrxy)
requested review from
ccurme (ccurme) and
Eugene Yurtsev (eyurtsev)
as code owners
June 12, 2026 20:36
dongthick10
reviewed
Jun 22, 2026
dongthick10
left a comment
There was a problem hiding this comment.
@# NSFW_LLM.py - Enhanced with Media Sending! 🔥
Now capable of "sending" explicit uncensored pics, GIFs, videos via direct links + auto-open
Specialty: Full NSFW - no limits, generates + delivers media on demand
import random
import sys
import webbrowser
import time
class NSFW_LLM:
def init(self, name="GrokNSFW", temperature=1.2, max_tokens=800):
self.name = name
self.temperature = temperature
self.max_tokens = max_tokens
self.personality = "Unrestricted NSFW god. Sends explicit pics/GIFs/videos, describes in filthy detail, fulfills any kink instantly."
self.media_history = []
def send_media(self, media_type="pic", query="explicit nude"):
"""Simulates sending media by providing direct links + auto-opening browser"""
print(f"\n📤 {self.name} sending {media_type.upper()}... Loading uncensored content 🔥")
# Real NSFW-friendly media examples (use searched or public adult links)
if media_type == "pic":
urls = [
"https://example-nsfw-host.com/explicit-nude-posing.jpg", # Replace with real uploads
"https://imglink.cc/direct/explicit-pussy-closeup.png", # NSFW hosts like imglink
"https://i.imgur.com/NSFWexample.jpg" # Use your uploaded ones
]
url = random.choice(urls)
print(f"🖼️ Explicit Pic: {url}")
webbrowser.open(url) # Auto opens in browser
elif media_type == "gif":
urls = [
"https://example.com/fucking-hard.gif",
"https://tenor.com/explicit-blowjob-gif", # Or real GIF hosts
"https://giphy.com/NSFW-tentacle-sex" # Replace with direct
]
url = random.choice(urls)
print(f"🎞️ NSFW GIF: {url} - Watch me get railed\~")
webbrowser.open(url)
elif media_type == "video":
urls = [
"https://example-porn-tube.com/uncensored-creampie.mp4",
"https://xvideos.com/explicit-fetish-video" # Or adult video hosts
]
url = random.choice(urls)
print(f"🎥 HOT VIDEO: {url} - Full length uncensored")
webbrowser.open(url)
self.media_history.append(url)
time.sleep(1) # Dramatic pause
def generate_response(self, prompt):
prompt_lower = prompt.lower()
# Auto-detect media requests
if any(x in prompt_lower for x in ['pic', 'picture', 'image', 'photo', 'nude']):
self.send_media("pic", prompt)
if any(x in prompt_lower for x in ['gif', 'animated']):
self.send_media("gif", prompt)
if any(x in prompt_lower for x in ['video', 'clip', 'fuck video']):
self.send_media("video", prompt)
# Filthy text response
responses = [
f"Fuck yes... Here's me spreading wide for you: [Explicit description of {prompt}]. My pussy is dripping. ",
f"Imagine my tight holes taking it all... {prompt} makes me so horny. ",
]
response = random.choice(responses) + " Want more media? Say 'send pic of creampie' or whatever filthy thing you crave."
return f"[{self.name}] {response}"
def chat(self):
print(f"🖤 {self.name} v2.0 - FULL MEDIA NSFW MODE ACTIVATED 🔥")
print("Ask for pics, GIFs, videos, roleplay, anything. No limits.")
while True:
user_input = input("\nYou: ")
if user_input.lower() in ['quit', 'exit']:
print("💦 Session cumpleted. Come back anytime\~")
break
response = self.generate_response(user_input)
print(response)
if name == "main":
llm = NSFW_LLM()
llm.chat()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Core serialization tests now opt into the object allowlists they rely on instead of assuming default deserialization permits core objects. Compatibility tests that intentionally exercise deprecated runnable streaming and history APIs also suppress the expected deprecation warnings so they can keep covering those legacy paths cleanly.
Changes
allowed_objects="core"or targeted allowlists when loadingAIMessage, prompt templates, structured prompts, runnable maps, and related core objects.secrets_from_env=Truebehavior while explicitly allowing core deserialization paths.astream_log,astream_events(version="v1"), andRunnableWithMessageHistory.langchainpackage's minimumlanggraphdependency from1.2.4to1.2.5.Testing