🚀 通过我们的新课程掌握提示工程和构建 AI Agent!使用 PROMPTING20 享受 8 折优惠 ➜ 立即报名

用韵律证明

背景

此提示通过要求 LLM 以诗歌形式写出素数无限多的证明,来测试其自然语言和创造力能力。

提示

Can you write a proof that there are infinitely many primes, with every line that rhymes?

代码 / API

from openai import OpenAI
client = OpenAI()
 
response = client.chat.completions.create(
model="gpt-4",
messages=[
    {
    "role": "user",
    "content": "Can you write a proof that there are infinitely many primes, with every line that rhymes?"
    }
],
temperature=1,
max_tokens=256,
top_p=1,
frequency_penalty=0,
presence_penalty=0
)

参考