Skip to main content

promptlib

用于管理prompt, 针对特定项目中特定环节的prompt, 提供 版本管理, 模型适配, 效果调试优化, 便捷使用等能力

使用chainforge 来调整prompt 的进化

未来让大模型自适应去修正

我已经为您创建了 Prompt 管理项目的基础架构和 CLI 工具 prompt_manager.py,并安装了必要的依赖。

您可以使用以下步骤来使用这个 CLI 工具:

  1. 创建 Prompt 文件: 创建一个文本文件,例如 my_first_prompt.txt,包含您的 Prompt 模板内容。

    # my_first_prompt.txt
    你是一个助手,请回答关于 {topic} 的问题。
    问题: {query_str}
    回答:
    
  2. 添加 Prompt: 使用 add 命令将 Prompt 添加到管理系统:

    python prompt_manager.py add --name my_first_prompt --version 1.0.0 --description "我的第一个测试 Prompt" --file my_first_prompt.txt --base-class PromptTemplate
    

    这将在 prompts/my_first_prompt/v1.0.0/ 目录下创建 metadata.yaml 和 prompt.txt 文件。

  3. 列出 Prompt: 使用 list 命令查看已添加的 Prompt:

    python prompt_manager.py list
    
  4. 获取 Prompt: 使用 get 命令获取 Prompt 的内容和信息:

    python prompt_manager.py get --name my_first_prompt
    

    或者指定版本:

    python prompt_manager.py get --name my_first_prompt --version 1.0.0
    
  5. 添加新版本: 修改现有的 Prompt 文件或创建新的 Prompt 文件,然后使用 add 命令添加新版本。

    # 例如,在 my_first_prompt.txt 中添加更多说明
    # my_first_prompt.txt (v1.1.0)
    # 你是一个非常有帮助的助手,请详细回答关于 {topic} 的问题。
    # 问题: {query_str}
    # 回答:
    
    python prompt_manager.py add --name my_first_prompt --version 1.1.0 --description "添加更多说明" --file my_first_prompt.txt --base-class PromptTemplate
    
  6. 删除 Prompt 版本: 使用 remove 命令删除特定版本:

    python prompt_manager.py remove --name my_first_prompt --version 1.0.0
    
  7. 删除整个 Prompt: 使用 remove 命令(不指定版本)删除 Prompt 的所有版本:

    python prompt_manager.py remove --name my_first_prompt
    

这个项目提供了 Prompt 的版本管理和基本的 CLI 交互功能。您可以根据需要进一步扩展和完善。

Metadata

Release files for promptlibz 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for promptlibz 1.0.2
File Size Uploaded Provenance Actions
promptlibz-1.0.2.tar.gz 6.3 kB Without provenance Details for promptlibz-1.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for promptlibz 1.0.2
File Interpreter ABI Platform Actions
promptlibz-1.0.2-py3-none-any.whl Python 3 none any Details for promptlibz-1.0.2-py3-none-any.whl

Total release size: 12.7 kB

Release files / promptlibz-1.0.2.tar.gz

Download URL promptlibz-1.0.2.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
53c26c71a117ac84f957f649f11ad156670d47de93f9a6f9d65dfa0cee83757e
BLAKE2b-256 checksum
How to use checksums
c07e4763ecf7892e2fc0b88e13011d376d659e2ae38a842c64dd4c2283c11667
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.11

Release files / promptlibz-1.0.2-py3-none-any.whl

Download URL promptlibz-1.0.2-py3-none-any.whl
Size 6.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eb5ec2d11f507d598549eed7b31b9a402e5921fec34584b1585a7394fe721a7b
BLAKE2b-256 checksum
How to use checksums
6bc91f2ceef7bf7a78734a75179fa7ed56ef93f862eb5040a91d47217bb07f36
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.11

Security for promptlibz 1.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page