📂 Advanced File Manager
Multi-Root Navigation System
⚡ Quick Jump
Server (/)
Home (/home)
Var_www (/var/www)
Current (/home4/shelley/public_html/wp-content/mu-plugins)
📍 Go
⬆ Ke Atas
🏠 Root Server
🏠 Root App
🔄 Refresh
📀 /
›
usr
›
lib
›
python3.9
›
site-packages
›
oci
›
generative_ai_inference
›
models
›
📁 __pycache__
📍
Lokasi:
/usr/lib/python3.9/site-packages/oci/generative_ai_inference/models/__pycache__
💾
Free:
45.4 GB
⚠️ Direktori ini
tidak writable
.
✏️ Mengedit: generic_chat_request.cpython-39.pyc
a ���fK � @ sD d dl mZ ddlmZmZmZ ddlmZ eG dd� de��ZdS )� )�BaseChatRequest� )�formatted_flat_dict� NONE_SENTINEL�#value_allowed_none_or_none_sentinel)�init_model_state_from_kwargsc @ s� e Zd ZdZdd� Zedd� �Zejdd� �Zedd� �Zejd d� �Zed d� �Z e jdd� �Z ed d� �Z e jdd� �Z edd� �Zejdd� �Zedd� �Zejdd� �Zedd� �Z e jdd� �Z edd� �Zejdd� �Zedd� �Zejdd� �Zedd � �Zejd!d � �Zed"d#� �Zejd$d#� �Zed%d&� �Zejd'd&� �Zed(d)� �Zejd*d)� �Zd+d,� Zd-d.� Zd/d0� Zd1S )2�GenericChatRequestz' Details for the chat request. c K s� ddddddddddddddd�| _ d d ddd dddddddddd�| _d| _d| _d| _d| _d| _d| _d| _d| _ d| _ d| _d| _d| _ d| _d| _d| _dS )a� Initializes a new GenericChatRequest object with values from keyword arguments. The default value of the :py:attr:`~oci.generative_ai_inference.models.GenericChatRequest.api_format` attribute of this class is ``GENERIC`` and it should not be changed. The following keyword arguments are supported (corresponding to the getters/setters of this class): :param api_format: The value to assign to the api_format property of this GenericChatRequest. Allowed values for this property are: "COHERE", "GENERIC" :type api_format: str :param messages: The value to assign to the messages property of this GenericChatRequest. :type messages: list[oci.generative_ai_inference.models.Message] :param is_stream: The value to assign to the is_stream property of this GenericChatRequest. :type is_stream: bool :param num_generations: The value to assign to the num_generations property of this GenericChatRequest. :type num_generations: int :param is_echo: The value to assign to the is_echo property of this GenericChatRequest. :type is_echo: bool :param top_k: The value to assign to the top_k property of this GenericChatRequest. :type top_k: int :param top_p: The value to assign to the top_p property of this GenericChatRequest. :type top_p: float :param temperature: The value to assign to the temperature property of this GenericChatRequest. :type temperature: float :param frequency_penalty: The value to assign to the frequency_penalty property of this GenericChatRequest. :type frequency_penalty: float :param presence_penalty: The value to assign to the presence_penalty property of this GenericChatRequest. :type presence_penalty: float :param stop: The value to assign to the stop property of this GenericChatRequest. :type stop: list[str] :param log_probs: The value to assign to the log_probs property of this GenericChatRequest. :type log_probs: int :param max_tokens: The value to assign to the max_tokens property of this GenericChatRequest. :type max_tokens: int :param logit_bias: The value to assign to the logit_bias property of this GenericChatRequest. :type logit_bias: object �strz list[Message]�bool�int�floatz list[str]�object)Z api_format�messages� is_stream�num_generations�is_echo�top_k�top_p�temperature�frequency_penalty�presence_penalty�stop� log_probs� max_tokens� logit_biasZ apiFormatr ZisStreamZnumGenerationsZisEchoZtopKZtopPr ZfrequencyPenaltyZpresencePenaltyr ZlogProbsZ maxTokensZ logitBiasNZGENERIC)Z swagger_typesZ attribute_mapZ_api_format� _messages� _is_stream�_num_generations�_is_echo�_top_k�_top_p�_temperature�_frequency_penalty�_presence_penalty�_stop� _log_probs�_max_tokens�_logit_bias)�self�kwargs� r* �[/usr/lib/python3.9/site-packages/oci/generative_ai_inference/models/generic_chat_request.py�__init__ sZ A��zGenericChatRequest.__init__c C s | j S )ad Gets the messages of this GenericChatRequest. The series of messages in a chat request. Includes the previous messages in a conversation. Each message includes a role (`USER` or the `CHATBOT`) and content. :return: The messages of this GenericChatRequest. :rtype: list[oci.generative_ai_inference.models.Message] �r �r( r* r* r+ r � s zGenericChatRequest.messagesc C s || _ dS )ak Sets the messages of this GenericChatRequest. The series of messages in a chat request. Includes the previous messages in a conversation. Each message includes a role (`USER` or the `CHATBOT`) and content. :param messages: The messages of this GenericChatRequest. :type: list[oci.generative_ai_inference.models.Message] Nr- )r( r r* r* r+ r � s c C s | j S )a Gets the is_stream of this GenericChatRequest. Whether to stream back partial progress. If set to true, as tokens become available, they are sent as data-only server-sent events. :return: The is_stream of this GenericChatRequest. :rtype: bool �r r. r* r* r+ r � s zGenericChatRequest.is_streamc C s || _ dS )a& Sets the is_stream of this GenericChatRequest. Whether to stream back partial progress. If set to true, as tokens become available, they are sent as data-only server-sent events. :param is_stream: The is_stream of this GenericChatRequest. :type: bool Nr/ )r( r r* r* r+ r � s c C s | j S )z� Gets the num_generations of this GenericChatRequest. The number of of generated texts that will be returned. :return: The num_generations of this GenericChatRequest. :rtype: int �r r. r* r* r+ r � s z"GenericChatRequest.num_generationsc C s || _ dS )z� Sets the num_generations of this GenericChatRequest. The number of of generated texts that will be returned. :param num_generations: The num_generations of this GenericChatRequest. :type: int Nr0 )r( r r* r* r+ r � s c C s | j S )z� Gets the is_echo of this GenericChatRequest. Whether to include the user prompt in the response. Applies only to non-stream results. :return: The is_echo of this GenericChatRequest. :rtype: bool �r r. r* r* r+ r � s zGenericChatRequest.is_echoc C s || _ dS )z� Sets the is_echo of this GenericChatRequest. Whether to include the user prompt in the response. Applies only to non-stream results. :param is_echo: The is_echo of this GenericChatRequest. :type: bool Nr1 )r( r r* r* r+ r � s c C s | j S )a� Gets the top_k of this GenericChatRequest. An integer that sets up the model to use only the top k most likely tokens in the generated output. A higher k introduces more randomness into the output making the output text sound more natural. Default value is -1 which means to consider all tokens. Setting to 0 disables this method and considers all tokens. If also using top p, then the model considers only the top tokens whose probabilities add up to p percent and ignores the rest of the k tokens. For example, if k is 20, but the probabilities of the top 10 add up to .75, then only the top 10 tokens are chosen. :return: The top_k of this GenericChatRequest. :rtype: int �r r. r* r* r+ r � s zGenericChatRequest.top_kc C s || _ dS )a� Sets the top_k of this GenericChatRequest. An integer that sets up the model to use only the top k most likely tokens in the generated output. A higher k introduces more randomness into the output making the output text sound more natural. Default value is -1 which means to consider all tokens. Setting to 0 disables this method and considers all tokens. If also using top p, then the model considers only the top tokens whose probabilities add up to p percent and ignores the rest of the k tokens. For example, if k is 20, but the probabilities of the top 10 add up to .75, then only the top 10 tokens are chosen. :param top_k: The top_k of this GenericChatRequest. :type: int Nr2 )r( r r* r* r+ r � s c C s | j S )ao Gets the top_p of this GenericChatRequest. If set to a probability 0.0 < p < 1.0, it ensures that only the most likely tokens, with total probability mass of p, are considered for generation at each step. To eliminate tokens with low likelihood, assign p a minimum percentage for the next token's likelihood. For example, when p is set to 0.75, the model eliminates the bottom 25 percent for the next token. Set to 1 to consider all tokens and set to 0 to disable. If both k and p are enabled, p acts after k. :return: The top_p of this GenericChatRequest. :rtype: float �r r. r* r* r+ r s zGenericChatRequest.top_pc C s || _ dS )as Sets the top_p of this GenericChatRequest. If set to a probability 0.0 < p < 1.0, it ensures that only the most likely tokens, with total probability mass of p, are considered for generation at each step. To eliminate tokens with low likelihood, assign p a minimum percentage for the next token's likelihood. For example, when p is set to 0.75, the model eliminates the bottom 25 percent for the next token. Set to 1 to consider all tokens and set to 0 to disable. If both k and p are enabled, p acts after k. :param top_p: The top_p of this GenericChatRequest. :type: float Nr3 )r( r r* r* r+ r s c C s | j S )a[ Gets the temperature of this GenericChatRequest. A number that sets the randomness of the generated output. A lower temperature means a less random generations. Use lower numbers for tasks with a correct answer such as question answering or summarizing. High temperatures can generate hallucinations or factually incorrect information. Start with temperatures lower than 1.0 and increase the temperature for more creative outputs, as you regenerate the prompts to refine the outputs. :return: The temperature of this GenericChatRequest. :rtype: float �r! r. r* r* r+ r s zGenericChatRequest.temperaturec C s || _ dS )ae Sets the temperature of this GenericChatRequest. A number that sets the randomness of the generated output. A lower temperature means a less random generations. Use lower numbers for tasks with a correct answer such as question answering or summarizing. High temperatures can generate hallucinations or factually incorrect information. Start with temperatures lower than 1.0 and increase the temperature for more creative outputs, as you regenerate the prompts to refine the outputs. :param temperature: The temperature of this GenericChatRequest. :type: float Nr4 )r( r r* r* r+ r * s c C s | j S )a� Gets the frequency_penalty of this GenericChatRequest. To reduce repetitiveness of generated tokens, this number penalizes new tokens based on their frequency in the generated text so far. Values > 0 encourage the model to use new tokens and values < 0 encourage the model to repeat tokens. Set to 0 to disable. :return: The frequency_penalty of this GenericChatRequest. :rtype: float �r"