发布

  • [OPIK-3423] [SDK] Implement ChatPrompt support with template_structure field (#4748)

    frostbyte_neo 发布于 2026-01-15 17:31:35 +00:00

    • [OPIK-3423] [SDK] Add ChatPrompt class and core chat prompt functionality

    Implements ChatPrompt domain object with message templates, formatting,
    and version management. Adds ChatPromptTemplate for message handling,
    error types, and comprehensive unit tests.

    Implements OPIK-3423: Implement chat prompt support

    • [OPIK-3423] [SDK] Refactor to BasePrompt and add integration tests

    Extracts BasePrompt base class for shared prompt functionality.
    Refactors ChatPrompt to extend BasePrompt. Adds integration tests
    for chat prompt CRUD operations and client methods.

    Implements OPIK-3423: Implement chat prompt support

    • [OPIK-3423] [SDK] Fix chat prompt client methods and test improvements

    Fixes client method implementations and improves test coverage.
    Updates integration tests with better assertions and error handling.

    Implements OPIK-3423: Implement chat prompt support

    • Refactor prompt creation logic to use common options

    Introduces CommonPromptOptions interface for shared configuration between text and chat prompts. Refactors createPrompt and createChatPrompt methods to utilize a new internal helper for streamlined prompt creation and version management. Enhances structure validation and logging for better clarity and error handling.

    Implements OPIK-3423: Improve prompt creation functionality

    • revert formatting-only change

    • Add error handling for invalid message content types in ChatPromptTemplate

    Enhances the ChatPromptTemplate class to throw PromptValidationError for invalid content types, including null, undefined, and non-string/array types. Adds comprehensive unit tests to validate error handling for various malformed input scenarios, ensuring robust prompt formatting functionality.

    • Synchronising logic with python sdk

    • clarify comments

    • Enhance prompt management documentation with detailed examples for both text and chat prompts. Introduce TypeScript SDK usage for creating, formatting, and managing chat prompts, including multimodal content support. Update search functionality to filter by prompt type and improve clarity on template types and versioning.

    • revert local test changes

    • expand tests to include unrecognised content

    • Enhance PromptVersion class to support intelligent comparison of chat prompts, including multimodal content. Introduce methods for detecting chat prompts and formatting them for human-readable diffs. Add unit tests to validate functionality across various content types, including text, images, and videos, while handling unrecognized types gracefully.

    • Add integration test

    下载附件