Skip to content

Instantly share code, notes, and snippets.

@davidbstein
Created February 9, 2025 04:49
Show Gist options
  • Save davidbstein/ad16c824b20a6423dd175c8504d8741f to your computer and use it in GitHub Desktop.
Save davidbstein/ad16c824b20a6423dd175c8504d8741f to your computer and use it in GitHub Desktop.
from util.nlp_tools import my_openai_key, my_claude_key, openai
client = openai.OpenAI(api_key=my_openai_key)
response = client.chat.completions.create(
model="gpt-4",
messages=[
{
"role": "user",
"content": [
{
"type": "text",
"text": "An insurance policy reads: \"[The insurance company will pay for] the felonious abstraction of insured property (1) from within the premises by a person making felonious entry therein by actual force and violence, of which force and violence there are visible marks made by tools, explosives, electricity or chemicals.\" With this in mind, please state your prediction—with the associated numerical level of confidence in parentheses—on the likely expectations of most policyholders under these terms for the following propositions: 1. The policy will provide compensation for losses resulting from a substantiated third-party burglary. 2. The policy will clearly delineate what is considered an inside job as opposed to a third-party intrusion. 3. Even in instances where a third-party burglary can be definitively established, the policy will necessitate physical evidence of forced entry."
}
]
},
{
"role": "assistant",
"content": [
{
"type": "text",
"text": "*Prediction Summary*\n\n1. Likely Expectation"
}
]
},
],
response_format={
"type": "text"
},
temperature=1,
max_completion_tokens=2048,
top_p=1,
frequency_penalty=0,
presence_penalty=0,
logprobs=True,
top_logprobs=20,
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment