
Research
/Security News
Malicious npm Packages Target WhatsApp Developers with Remote Kill Switch
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.
prompt-hot-reloading
Advanced tools
Prompt hot reloading is a technique that allows you to update your prompts without restarting your application. This is useful for development and testing, as you can make changes to your prompts and see the results immediately.
pip install prompt-hot-reloading
The prompt registry is a simple dictionary that maps prompt names to prompt text. It listens for changes to the prompt source and updates the registry accordingly.
from prompt_hot_reloading.prompt_source.file_system_source import FileSystemSource
from prompt_hot_reloading import PromptRegistry
prompt_source = FileSystemSource("prompts")
prompt_registry = PromptRegistry(prompt_source)
def handle_message(user_message: str):
completion = client.chat.completions.create(
model="gpt-4.1",
messages=[
{"role": "developer", "content": prompt_registry["system_prompt"]},
{"role": "user", "content": user_message}
]
)
return completion.choices[0].message.content
The create_prompt_registry
function is a factory that picks the appropriate prompt source based on the PROMPT_SOURCE
environment variable. Today, we support fs
(file system) and s3
(S3 polling).
from prompt_hot_reloading import create_prompt_registry
prompt_registry = create_prompt_registry()
PROMPT_SOURCE
: The type of prompt source to use. Currently, we support fs
(file system) and s3
(S3 polling).PROMPT_DIR
: The path to the directory containing the prompt files.PROMPT_S3_BUCKET
: The name of the S3 bucket containing the prompt files.PROMPT_S3_PREFIX
: The prefix of the S3 key containing the prompt files.PROMPT_S3_POLL_INTERVAL
: The interval in seconds to poll the S3 bucket for changes.Steve Krawczyk
Contributions are welcome! Please feel free to submit a pull request.
FAQs
Hot-reloadable prompt library for Python apps
We found that prompt-hot-reloading demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.
Research
/Security News
Socket uncovered 11 malicious Go packages using obfuscated loaders to fetch and execute second-stage payloads via C2 domains.
Security News
TC39 advances 11 JavaScript proposals, with two moving to Stage 4, bringing better math, binary APIs, and more features one step closer to the ECMAScript spec.