#To customize gpt.
1 messages · Page 1 of 1 (latest)
Hi @sturdy turret. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
To customize parameters such as top_p and frequency_penalty in your ChatGPT API calls, you can include these parameters in your API request. However, it's important to note that custom GPT models are exclusive to the ChatGPT Plus ecosystem and are not accessible via the API. You would need to develop your own code-based solution using API models that offer the same techniques.
Here's an example of how you can customize top_p and frequency_penalty in a Python script using the OpenAI API:
import openai
openai.api_key = 'your-api-key'
response = openai.Completion.create(
engine="text-davinci-003",
prompt="Translate the following English text to French: '{}'",
max_tokens=60,
top_p=0.9,
frequency_penalty=0.5
)
In this example, top_p is set to 0.9 and frequency_penalty is set to 0.5. You can adjust these values according to your needs. Please note that the top_p parameter's value range is from 0 to 1.
Remember to replace 'your-api-key' with your actual OpenAI API key.
Sources:
- Forum Post: How can I create python script to connect with my custom chatgpt (https://community.openai.com/t/547685)
- Forum Post: Is it possible to access a custom GPT from the API? (https://community.openai.com/t/545254)
- Forum Post: What is the top_p value range? (https://community.openai.com/t/612433)