Prompt Security 发布了新版 Prompt Fuzzer,这是一个开源的交互式工具,用于评估和增强 GenAI 应用的系统提示安全性。
新版本的主要改进包括:
Prompt Fuzzer 可以帮助开发者:
Prompt Security 致力于推动 GenAI 的安全应用,并鼓励开发者积极使用和改进 Prompt Fuzzer。
来源:
https://www.prompt.security/blog/now-available-a-new-version-of-prompt-fuzzer-the-first-interactive-open-source-tool-for-genai-apps-vulnerability-assessment
微软的 PowerGridForecast API 现已对开发者开放!它可以预测电网碳排放,帮助你的应用/游戏在碳排放低的时候进行更新,或者在用户不活跃的时候进行资源密集型操作,从而减少碳足迹。快来试试吧!
using Windows.Devices.Power; void PrintBestTimes(PowerGridForecast forecast) { double bestSeverity = double.MaxValue; double bestLowImpactSeverity = double.MaxValue; DateTime bestTime = DateTime.MaxValue; DateTime bestLowImpactTime = DateTime.MaxValue; TimeSpan blockDuration = forecast.BlockDuration; DateTime startTime = forecast.StartTime; IList forecastSignals = forecast.Forecast; if (forecastSignals.Count == 0) { Console.WriteLine("Error encountered with getting forecast; try again later."); return; } foreach (PowerGridData data in forecastSignals) { if (data.Severity < bestSeverity) { bestSeverity = data.Severity; bestTime = startTime; } if (data.IsLowUserExperienceImpact && data.Severity < bestLowImpactSeverity) { bestLowImpactSeverity = data.Severity; bestLowImpactTime = startTime; } startTime = startTime + blockDuration; } if (bestLowImpactTime != DateTime.MaxValue) { DateTime endBestLowImpactTime = bestLowImpactTime + blockDuration; Console.WriteLine($"Lowest severity during low impact is {bestLowImpactSeverity}, which starts at {bestLowImpactTime.ToString()}, and ends at {endBestLowImpactTime}."); } else { Console.WriteLine("There's no low-user-impact time in which to do work."); } if (bestTime != DateTime.MaxValue) { DateTime endBestSeverity = bestTime + blockDuration; Console.WriteLine($"Lowest severity is {bestSeverity}, which starts at {bestTime.ToString()}, and ends at {endBestSeverity.ToString()}."); } } PowerGridForecast forecast = PowerGridForecast.GetForecast(); PrintBestTimes(forecast); PowerGridForecast 类为开发者提供了一种有效的方式,可以利用电网碳排放预测信息来优化应用程序,从而实现节能减排的目标。
来源:
https://learn.microsoft.com/zh-cn/uwp/api/windows.devices.power.powergridforecast?view=winrt-26100
如对以上的代码示例感兴趣,可以结合 AI 进一步探索:
# 从指定的 .c文件获取数据,使用 Google Gemini AI 进行分析 x cat save_power.c | @gemini '代码主要的功能是什么?' 
进一步探索:
除了使用 Google Gemini AI 模型,还可以使用 OpenAI、Mistral 和 Kimi 等 AI 模型。
更多内容请查阅 : blog-240803
关注微信官方公众号 : oh my x
获取开源软件和 x-cmd 最新用法