|
| 1 | +from enum import Enum |
| 2 | + |
| 3 | +from typing import Optional |
| 4 | + |
| 5 | +from box_sdk_gen.internal.base_object import BaseObject |
| 6 | + |
| 7 | +from box_sdk_gen.box.errors import BoxSDKError |
| 8 | + |
| 9 | + |
| 10 | +class AiLlmEndpointParamsIbmTypeField(str, Enum): |
| 11 | + IBM_PARAMS = 'ibm_params' |
| 12 | + |
| 13 | + |
| 14 | +class AiLlmEndpointParamsIbm(BaseObject): |
| 15 | + _discriminator = 'type', {'ibm_params'} |
| 16 | + |
| 17 | + def __init__( |
| 18 | + self, |
| 19 | + *, |
| 20 | + type: AiLlmEndpointParamsIbmTypeField = AiLlmEndpointParamsIbmTypeField.IBM_PARAMS, |
| 21 | + temperature: Optional[float] = None, |
| 22 | + top_p: Optional[float] = None, |
| 23 | + top_k: Optional[float] = None, |
| 24 | + **kwargs |
| 25 | + ): |
| 26 | + """ |
| 27 | + :param type: The type of the AI LLM endpoint params object for IBM. |
| 28 | + This parameter is **required**., defaults to AiLlmEndpointParamsIbmTypeField.IBM_PARAMS |
| 29 | + :type type: AiLlmEndpointParamsIbmTypeField, optional |
| 30 | + :param temperature: What sampling temperature to use, between 0 and 1. Higher values like 0.8 will make the output more random, |
| 31 | + while lower values like 0.2 will make it more focused and deterministic. |
| 32 | + We generally recommend altering this or `top_p` but not both., defaults to None |
| 33 | + :type temperature: Optional[float], optional |
| 34 | + :param top_p: An alternative to sampling with temperature, called nucleus sampling, where the model considers the results |
| 35 | + of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability |
| 36 | + mass are considered. We generally recommend altering this or temperature but not both., defaults to None |
| 37 | + :type top_p: Optional[float], optional |
| 38 | + :param top_k: `Top-K` changes how the model selects tokens for output. A `top-K` of 1 means the next selected token is |
| 39 | + the most probable among all tokens in the model's vocabulary (also called greedy decoding), |
| 40 | + while a `top-K` of 3 means that the next token is selected from among the three most probable tokens by using temperature., defaults to None |
| 41 | + :type top_k: Optional[float], optional |
| 42 | + """ |
| 43 | + super().__init__(**kwargs) |
| 44 | + self.type = type |
| 45 | + self.temperature = temperature |
| 46 | + self.top_p = top_p |
| 47 | + self.top_k = top_k |
0 commit comments