发布

  • [NA] [FE] docs: update Python SDK examples in Use This Prompt dialog (#6812)

    frostbyte_neo 发布于 2026-05-21 10:47:58 +00:00

    • [NA] [FE] docs: update Python SDK examples in Use This Prompt dialog

    Replace the deprecated opik.Prompt(...) and opik.ChatPrompt(...) direct
    constructors with the current SDK surface (client.create_prompt(...) and
    client.create_chat_prompt(...)), aligning the "Creating a prompt" examples
    with the rest of the documentation.

    Also fix the format() calls in both the creating and getting sections to
    use keyword arguments (prompt.format(name="Alice", ...)) instead of a
    positional dict, matching the actual SDK signature which takes **kwargs.

    Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

    • [NA] [FE] fix: use variables dict for ChatPrompt.format in dialog snippets

    ChatPrompt.format takes a positional variables: Dict[str, Any] arg, not
    **kwargs (unlike Prompt.format for text prompts). Update both chat snippets
    in the Use This Prompt dialog to pass variables={...} so the example code
    actually runs against the current SDK.

    Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com


    Co-authored-by: Claude Opus 4.7 (1M context) noreply@anthropic.com

    下载附件