public class PromptHubJinjaExample extends Object
如果你想在 prompt 中使用 Jinja 模板,可以参考以下示例。
展示: - Jinja 模板的使用 - 各种变量类型的格式化(string, int, bool, float, object, array) - 复杂数据结构的处理
使用前请先设置以下环境变量: - COZELOOP_WORKSPACE_ID: 你的工作空间 ID - COZELOOP_API_TOKEN: 你的访问令牌
注意:需要在平台上创建一个 Prompt(Prompt Key 设置为 'prompt_hub_demo'), 并在模板中添加以下消息,然后提交版本: - System: You are a helpful bot, the conversation topic is {{var1}}. - Placeholder: placeholder1 - User: My question is {{var2}} - Placeholder: placeholder2
| Constructor and Description |
|---|
PromptHubJinjaExample() |
public static void main(String[] args)
Copyright © 2026. All rights reserved.