为Sparrow DSL生成的LLM解析器和合规检查器
你好,
我认为大型语言模型(LLM)在生成领域特定语言(DSL)代码方面非常出色,只要提供结构良好且清晰的提示。
我是Sparrow的作者(https://github.com/melezhik/Sparrow6/blob/master/documentation/taskchecks.md),这是一种用于文本解析和自动化的DSL,支持多种编程语言的SDK。我对深度寻求(deep seek)在生成不同配置文件的解析器和合规检查器方面的表现印象深刻,例如sudoers、sshd、redis和forgejo等。以下是一些示例:
- forgejo - https://chat.deepseek.com/share/y3f2om2b6hvzcm752h
- redis - https://chat.deepseek.com/share/9eakpdlaa6b88e38u3
- sshd - https://chat.deepseek.com/share/1roo31ihmuz10xjxem
- sudoers - https://chat.deepseek.com/share/is2ey6vgbhvdbyqtoa
以下是我使用的两个提示:
- 使用Python SDK - https://gist.github.com/melezhik/d57132c9d3ba0ae9cee30a7c04c98399
- 使用Raku SDK - https://gist.github.com/melezhik/6f25775aab9f5ec2e22f1193e7ca824b
你可以选择其中任何一个,将“sshd”或“forgejo”替换为你感兴趣的任何词,并尝试使用免费的深度寻求聊天机器人,专家级别的浏览器,祝你玩得开心。
附言:你最好尝试Raku SDK的提示,因为它可以处理带有逻辑分组(ini风格)的配置文件,但你也可以通过借用Raku提示中的措辞轻松修改Python的提示。
查看原文
Hi<p>I believe LLM are really cool in generating DSL code. If one provides well structured and clear prompt.<p>I am the author of Sparrow ( https://github.com/melezhik/Sparrow6/blob/master/documentation/taskchecks.md ) DSL for text parsing and automation with SDK for many programming languages , and I am really impressed how well deep seek generates parsers and compliance checkers for different configuration files - sudoers, sshd, redis, forgejo to name a few. Here are just some examples:<p>- forgejo - https://chat.deepseek.com/share/y3f2om2b6hvzcm752h<p>- redis - https://chat.deepseek.com/share/9eakpdlaa6b88e38u3<p>- sshd - https://chat.deepseek.com/share/1roo31ihmuz10xjxem<p>- sudoers - https://chat.deepseek.com/share/is2ey6vgbhvdbyqtoa<p>Here are two prompts I use :<p>- With Python SDK - https://gist.github.com/melezhik/d57132c9d3ba0ae9cee30a7c04c98399
- With Raku SDK - https://gist.github.com/melezhik/6f25775aab9f5ec2e22f1193e7ca824b<p>You may choose any of them replace words sshd/forgejo by any word of your interest and try it out with free deep seek chat bot, expert level with browser, have fun<p>PS you’d better try Raku SDK prompt as it handles configuration files with logical groups ( ini style ) as well , but you can easily modify the Python one by stealing the phrasing from Raku prompt