OpenAIModelProfile (profiles/openai.py)

Upsonic · src/upsonic/profiles/openai.py · python · MIT
ai, tag:embed-classified

OpenAIModelProfile defines configuration for OpenAI‑compatible chat models, including reasoning and tool support.

# Source: https://github.com/Upsonic/Upsonic | License: MIT | Copyright 2024 Upsonic Teknoloji A.Ş
# Provided via justclaw.it.com; keep this notice with the code.
from __future__ import annotations as _annotations

import re
import warnings
from collections.abc import Sequence
from dataclasses import dataclass
from typing import Any, Literal

from .._json_schema import JsonSchema, JsonSchemaTransformer
from upsonic.utils.package.exception import UserError
from . import ModelProfile

SAMPLING_PARAMS = (
    'temperature',
    'top_p',
    'presence_penalty',
    'frequency_penalty',
    'logit_bias',
    'openai_logprobs',
    'openai_top_logprobs',
)
"""Sampling parameter names that are incompatible with reasoning.

These parameters are not supported when reasoning is enabled (reasoning_ef

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

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

Get a free API key