Skip to content

Instantly share code, notes, and snippets.

@ikanez
Created May 17, 2021 14:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ikanez/55049f00075c61d240c580393f41142d to your computer and use it in GitHub Desktop.
Save ikanez/55049f00075c61d240c580393f41142d to your computer and use it in GitHub Desktop.
Prompting the GPT-3 with "banking" context.
def call_openapi(question):
response = openai.Completion.create(
engine="davinci",
prompt="""
This is a banking expert.
Q: What is interest rate?
A: The interest rate is the amount a lender charges for the use of assets expressed as a percentage of the principal.
Q: What is PD?
A: Probability of default.
Q: {question}?
A:""".format(question=question),
temperature=0.3,
max_tokens=60,
top_p=1.0,
frequency_penalty=0.0,
presence_penalty=0.0,
stop=["\n"]
)
return response
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment