绘制 TiKZ 图
背景
此 prompt 通过要求 LLM 在 TiKZ 中绘制独角兽来测试其代码生成能力。在下面的示例中,模型应该生成 LaTeX 代码,然后可以使用该代码生成独角兽或传递的任何对象。
Prompt
Draw a unicorn in TiKZ
代码 / API
from openai import OpenAI
client = OpenAI()
response = client.chat.completions.create(
model="gpt-4",
messages=[
{
"role": "user",
"content": "Draw a unicorn in TiKZ"
}
],
temperature=1,
max_tokens=1000,
top_p=1,
frequency_penalty=0,
presence_penalty=0
)
参考
- 通用人工智能的火花:GPT-4 的早期实验 (在新标签页中打开) (2023 年 4 月 13 日)