转载

ChatGPT插件例子 TL;DR 总结

通过在文本段落的末尾添加“tl;dr:”来总结文本。它表明 API 了解如何在没有指令的情况下执行许多任务。

提问

中子星是大质量超巨星坍缩的核心,其总质量在 10 到 25 个太阳质量之间,如果恒星特别富含金属,则可能更多。 [1] 中子星是除黑洞和假想的白洞、夸克星和奇异星之外最小、密度最大的恒星。 [2] 中子星的半径约为 10 公里(6.2 英里),质量约为 1.4 个太阳质量。 [3] 它们是由大质量恒星的超新星爆炸和引力坍缩相结合产生的,后者将核心压缩到超过白矮星密度,达到原子核的密度。

tl;dr

回答

中子星是大质量超巨星坍缩的核心,半径约为 10 公里,质量为 1.4 个太阳质量。它们是由大质量恒星的超新星爆炸与引力坍缩相结合形成的,将核心压缩到白矮星密度之外。

API请求

<font size="3">import os
import openai

openai.api_key = os.getenv("OPENAI_API_KEY")

response = openai.Completion.create(
  model="text-davinci-003",
  prompt="A neutron star is the collapsed core of a massive supergiant star, which had a total mass of between 10 and 25 solar masses, possibly more if the star was especially metal-rich.[1] Neutron stars are the smallest and densest stellar objects, excluding black holes and hypothetical white holes, quark stars, and strange stars.[2] Neutron stars have a radius on the order of 10 kilometres (6.2 mi) and a mass of about 1.4 solar masses.[3] They result from the supernova explosion of a massive star, combined with gravitational collapse, that compresses the core past white dwarf star density to that of atomic nuclei.\n\nTl;dr",
  temperature=0.7,
  max_tokens=60,
  top_p=1.0,
  frequency_penalty=0.0,
  presence_penalty=1
)</font>