-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenai1.py
More file actions
27 lines (25 loc) · 843 Bytes
/
openai1.py
File metadata and controls
27 lines (25 loc) · 843 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from openai import OpenAI
client = OpenAI(api_key= "nothin-to-see-here")
response = client.responses.create(
model="gpt-5",
instructions="You are a helpful assistant that compares bank interest rates accurately and neutrally.",
input="Perform a web-search on interest rate comparisons for FD accounts comparing DCB Bank to its competitors.",
reasoning={"effort": "low"},
tools=[
{
"type": "web_search",
"filters": {
"allowed_domains": [
"www.dcbbank.com",
"www.hdfcbank.com",
"icicibank.com",
"axisbank.com",
"aubank.in",
]
},
}
],
tool_choice="auto",
include=["web_search_call.action.sources"]
)
print(response.output_text)