Dino Geek, try to help you

How to use ChatGPT API parameters to influence output?


To influence the output of the ChatGPT API, you can use several parameters:

1. `messages`: It is an array of message objects. Each object includes a role (“system”, “user”, or “assistant”) and the content of the message from the role. The user’s message is used as input to the model.

1. `temperature`: It controls the randomness of the model’s responses. Higher values (e.g., 0.8) make the output more random, and lower values (e.g., 0.2) make it more deterministic.

1. `max_tokens`: This determines how long the model’s response will be. Setting this parameter to a specific number will limit the response to that number of tokens.

1. `top_p`: It can be used in place of temperature to use nucleus sampling in which the model chooses from the smallest possible set of tokens whose cumulative probability exceeds the threshold `top_p`.

1. `frequency_penalty`: It penalizes new tokens based on their frequency, giving you control over the model’s likelihood of generating frequent/plain tokens. Set it between -2.0 (encourage frequent tokens) and 2.0 (discourage frequent tokens).

1. `presence_penalty`: It penalizes new tokens based on their presence, giving you control over the model’s likelihood of generating novel tokens. Set it between -2.0 (encourage novel tokens) and 2.0 (discourage novel tokens).

Remember that these parameters might require some experimentation to get the desired generation style for your use case.


Simply generate articles to optimize your SEO
Simply generate articles to optimize your SEO





DinoGeek offers simple articles on complex technologies

Would you like to be quoted in this article? It's very simple, contact us at dino@eiki.fr

CSS | NodeJS | DNS | DMARC | MAPI | NNTP | htaccess | PHP | HTTPS | Drupal | WEB3 | LLM | Wordpress | TLD | Domain name | IMAP | TCP | NFT | MariaDB | FTP | Zigbee | NMAP | SNMP | SEO | E-Mail | LXC | HTTP | MangoDB | SFTP | RAG | SSH | HTML | ChatGPT API | OSPF | JavaScript | Docker | OpenVZ | ChatGPT | VPS | ZIMBRA | SPF | UDP | Joomla | IPV6 | BGP | Django | Reactjs | DKIM | VMWare | RSYNC | Python | TFTP | Webdav | FAAS | Apache | IPV4 | LDAP | POP3 | SMTP

| Whispers of love (API) | Déclaration d'Amour |






Legal Notice / General Conditions of Use