发布

  • [NA] [BE][FE][SDK] Rename OPIK_BUILTIN to OPIK_FREE and improve free model UX (#4443)

    frostbyte_neo 发布于 2025-12-17 13:20:55 +00:00

    • [NA] [BE][FE][SDK] Rename OPIK_BUILTIN to OPIK_FREE and improve free model UX

    Rename internal terminology from OPIK_BUILTIN to OPIK_FREE and enhance
    the user experience for the free model in the Playground.

    • Display free model directly in model selector (not in a dropdown/submenu)

    • Show model as "gpt-4o-mini (free)" with Opik icon for clear identification

    • Dynamic model label from backend config via model_label field

    • Provider label changed from "Opik Built-in" to "Opik"

    • Description updated to "Free model provided by Opik - no API key required"

    • API key name changed to "OPIK_FREE_MODEL_API_KEY" in configuration page

    • Free model included in search/filter results

    • LlmProvider enum: OPIK_BUILTIN → OPIK_FREE (value: "opik-free")

    • Package rename: opikbuiltin → freemodel

    • Class renames: OpikBuiltin* → FreeModel*

    • Config: opikbuiltinProviderEnabled → opikfreeProviderEnabled

    • Environment variable: TOGGLE_OPIKBUILTIN_PROVIDER_ENABLED → TOGGLE_OPIKFREE_PROVIDER_ENABLED

    • Added model_label to provider configuration for dynamic UI display

    • PROVIDER_TYPE.OPIK_BUILTIN → PROVIDER_TYPE.OPIK_FREE

    • PROVIDER_MODEL_TYPE.OPIK_BUILTIN_MODEL → PROVIDER_MODEL_TYPE.OPIK_FREE_MODEL

    • Feature toggle: OPIKBUILTIN_PROVIDER_ENABLED → OPIKFREE_PROVIDER_ENABLED

    • Refactored PromptModelSelect for improved free model presentation

    • TypeScript SDK provider types updated

    • OpenAPI specs updated

    • Address PR feedback: add validation and improve robustness
    • FreeModelConfig: Add JavaDoc explaining required fields
    • FreeModelConfig: isEnabled() now validates that actualModel, spanProvider,
      and baseUrl are set, ensuring fail-fast on misconfiguration
    • PromptModelSelect: Handle empty string for model_label with .trim() check
    • Fix camelCase naming for opikFreeProviderEnabled

    Rename opikfreeProviderEnabled to opikFreeProviderEnabled to follow
    consistent camelCase naming convention in configuration properties.

    • Remove opikFreeProviderEnabled feature toggle

    The free model visibility is already controlled by freeModel.enabled
    backend config, making the feature toggle redundant. This simplifies
    the codebase by removing unnecessary toggle checks.

    Changes:

    • Remove toggle from backend config and ServiceTogglesConfig
    • Remove toggle from frontend feature-toggles and DEFAULT_STATE
    • Update ProviderSelect and ProviderGrid to explicitly exclude OPIK_FREE
    • Update PROVIDER_FEATURE_TOGGLE_MAP type to use Exclude<>
    • Regenerate OpenAPI specs and SDKs
    • [NA] [FE] Add opik_free_model metadata flag for BI tracking

    Add a boolean flag to span metadata when users use the free model,
    enabling the BI team to identify and track free model usage in the
    analytics database.

    • Revision 3: Refactor PromptModelSelect - extract useModelOptions hook
    • Extract data transformation logic into useModelOptions hook
    • Simplify renderSelectTrigger with getSelectedModelInfo callback
    • Fix vertical alignment with py-1 padding on options container
    • Reduce component from 484 to ~350 lines
    • Revision 4: Fix useModelOptions type errors
    • Change ProviderKey to ProviderObject (correct exported type)
    • Use ModelOption[] instead of inline type for consistency
    • Revision 5: Fix free model row vertical alignment in PromptModelSelect
    下载附件