File size: 980 Bytes
a987248
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
28
29
30
31
32
# import gradio as gr

# with gr.Blocks(theme=gr.themes.Soft(primary_hue='pink', secondary_hue='pink', neutral_hue='stone')) as app:

#     tab = gr.Tab(label="Tab 1")
    
#     # tab.add_text("Text Input", lines=5, name="text")
#     tab.update(name="Text Input")

# if __name__ == "__main__":
#     # app.launch(share=True, server_name="0.0.0.0", server_port=7860, auth=same_auth, auth_message="Please enter the same username and password")
#     app.launch(share=True, server_name="0.0.0.0", server_port=1111)

# # if __name__ == "__main__":
# #     main()

import os
import openai
os.environ['OPENAI_API_KEY'] = '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'



messages=[{"role": "user", "content": "As an intelligent AI model, if you could be any fictional character, who would you choose and why?"}]

response = openai.ChatCompletion.create(
model="gpt-4",
max_tokens=100,
temperature=1.2,
api_key=os.environ['OPENAI_API_KEY'],
messages = messages)

print(response)