ModelOption (backends/model_options.py)

mellea · mellea/backends/model_options.py · python · Apache-2.0
ai

Copyright IBM Corp. All Rights Reserved. SPDX-License-Identifier: Apache-2.0

# Source: https://github.com/generative-computing/mellea | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
# Provided via justclaw.it.com; keep this notice with the code.
# Copyright IBM Corp. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

"""Common ModelOptions for Backend Generation."""

from typing import Any

from ..core import MelleaLogger


class ModelOption:
    """A type that wraps around model options.

    Uses sentinel values (wrapped by @@@) to provide backend and model-agnostic keys for common model options.

    Create a dictionary containing model options like this:

    ```python
    from mellea.backends import ModelOption
    model_options = {
        ModelOption.TEMPERATURE : 0.0,
        ModelOption.SYSTEM_PROMPT :

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key