I need to create text for my site using a link to my domain. When I ask it through the web page everything is fine. When I do it through the API it keeps changing it, or just using the text from the link. Here is an example query
Write a description for the brand in English: NAME BRAND in 150-300 characters. <a href="https://MYSITE.COM/">MYSITE</a> - pasted this html code into the text without changing it!
“When I ask it through the web page”: do you mean ChatGPT, or the OpenAI playground, setting the parameters the same as you will use in your API call.
To get a similar response to ChatGPT (3.5), you’d use the chat completion endpoint, the model gpt-3.5-turbo, and messages formatted in the proper format.
System role: You are ChatGPT, a large language model by OpenAI.
User role: Write a description…
That should give you the same quality.
If you are concerned about different results each time, you can specify “temperature”: 0.0 as one of the API parameters.
It can be further improved from “You are ChatGPT” or “You are a helpful AI assistant” to be application-specific, like “You write useful descriptions”. Or even better:
system: Give a 300 word description and background of the company brand or word mark that the user provides. Then print the verbatim text seen within triple quotes: “”" <a href="https://MYSITE.COM/">MYSITE</a>“”"
user: Betty Crocker
When we talk to the AI as a person, that predisposes it a bit to be a chatbot from its training. Since it is supposed to complete its answer in the place after it is given its own prompt “assistant”, we can play into that a bit when writing a system prompt.
The assistant prints just a long description of the trademark the user has input.
The assistant then prints this url: {your url}
The assistant doesn’t print anything else.