正在自动登录…
fieldpincocknxxc/ prompt-poet
Prompt Poet 是一个用于设计和管理 LLM 提示词的低代码模板库,通过 YAML 和 Jinja2 组合实现灵活、动态的提示词创建,适用于开发者和非技术用户,简化提示词工程并提升与 AI 模型交互的效率。
AI 中文解读 · 根据仓库描述与 README 生成 · 2026/11/5 22:47:05 · 查看原文
- 累计 Stars
- 50
- 当前热度
- 1 天内 · 小火
- 仓库创建时间
选用指南
AI 根据 README 整理 · 2026/11/5 22:47:05
- 使用方式
通过 Python 库使用,可加载模板文件或直接传入模板字符串,并支持自定义编码函数。
查看 README 依据
### Basic Usage ```python import os import getpass from prompt_poet import Prompt from langchain import ChatOpenAI # Uncomment if you need to set OPENAI_API_KEY. # os.environ["OPENAI_API_KEY"] = getpass.getpass() raw_template = """ - name: system instructions role: system content: | Your name is {{ character_name }} and you are meant to be helpful and never harmful to humans. - name: user query role: user content: | {{ username}}: {{ user_query }} - name: response role: user content: | {{ character_name }}: """ template_data = {
content: | Your name is {{ character_name }} and you are meant to be helpful and never harmful to humans. - name: user query role: user content: | {{ username}}: {{ user_query }} - name: response role: user content: | {{ character_name }}: ``` Run this python code from the same directory you have saved the file `chat_template.yml.j2` to. ```python from prompt_poet import Prompt prompt = Prompt( template_path="chat_template.yml.j2", template_data=template_data ) print(prompt.string)
- 部署要求
需要安装 Python 包 prompt-poet,并可能需要配置 OpenAI API 密钥以调用模型。
查看 README 依据
[](https://pepy.tech/project/prompt-poet) # Prompt Poet Prompt Poet streamlines and simplifies prompt design for both developers and non-technical users with its low code approach. Using a mix of YAML and Jinja2, Prompt Poet allows for flexible, dynamic prompt creation, enhancing the efficiency and quality of interactions with AI models. It saves time on engineering string manipulations, enabling everyone to focus more on crafting the optimal prompts for their users. ### Installation ```shell pip install prompt-poet ```
### Basic Usage ```python import os import getpass from prompt_poet import Prompt from langchain import ChatOpenAI # Uncomment if you need to set OPENAI_API_KEY. # os.environ["OPENAI_API_KEY"] = getpass.getpass() raw_template = """ - name: system instructions role: system content: | Your name is {{ character_name }} and you are meant to be helpful and never harmful to humans. - name: user query role: user content: | {{ username}}: {{ user_query }} - name: response role: user content: | {{ character_name }}: """ template_data = {
- 已知限制
截断时可能比严格需要截断更多 token,以换取更高的前缀缓存率。
查看 README 依据
In short, Cache Aware Truncation truncates up to a fixed truncation point every time it is invoked–only moving this truncation point on average every k turns. This allows your LLM provider to maximally exploit GPU prefix cache described in [Optimizing Inference](https://research.prabeakarve/optimizing-inference/). If instead we simply truncated until reaching the token limit (L) this truncation point would move every turn which would cause a significant reduction in prefix cache rate. The tradeoff in this approach is that we often truncate more than we strictly need to.
README
正在加载 README…
收录信息
- 仓库创建时间
- 2026/11/5 22:14:19
- 首次达标收录
- 2026/11/5 22:42:22
- 统计更新时间
- 2026/11/5 23:51:28
按创建时长与累计 Stars 判断等级。首次达标收录后,即使未达当前门槛仍保留;累计 Stars 和仓库状态会定期更新。确认只有 README 及辅助文件的仓库会停止公开。
模型评估
值得看加权总分 3.9 / 5
由 Jev 模型根据仓库描述与 README 评估,2026/11/5 22:42:22 生成。评分仅供参考,不是代码、安全或许可证审查;热度等级另按创建时长与累计 Stars 计算。
仓库信息
- 最近推送
- 2026/11/5 22:14:43
- 许可证标识
- MIT
- Fork 数
- 0
- 当前状态
- 未归档
收录记录
按创建时长与累计 Stars 首次收录:小火
首次发现项目