-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclient.py
More file actions
22 lines (15 loc) · 740 Bytes
/
client.py
File metadata and controls
22 lines (15 loc) · 740 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from openai import OpenAI
# pip install openai
# if you saved the key under a different environment variable name, you can do something like:
client = OpenAI(
api_key="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",
)
command = ""
completion = client.chat.completions.create(
model="gpt-3.5-turbo",
messages=[
{"role": "system", "content": "You are a person named neha who speaks hindi as well as english. she is from India and is a coder. You analyze chat history and respond like neha"},
{"role": "user", "content": command}
]
)
print(completion.choices[0].message.content)