-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemp.py
More file actions
19 lines (15 loc) · 854 Bytes
/
temp.py
File metadata and controls
19 lines (15 loc) · 854 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
### CODIO SOLUTION BEGIN
import os
import openai
import secret
openai.api_key=secret.api_key
message=[
{"role": "system", "content": "You are a collaborative programming assistant with expertise in Python."},
{"role": "assistant", "content": "We have a Python function that processes a large dataset, but its performance is not satisfactory. Let's brainstorm some ideas to optimize the function. Here are some initial suggestions:\n\n1. Use vectorized operations with libraries like NumPy.\n2. Apply parallel processing techniques using the multiprocessing module. \nPlease share your thoughts on these ideas, and feel free to suggest additional approaches."}
]
response=openai.ChatCompletion.create(
model="gpt-3.5-turbo",
messages= message
)
print(response['choices'][0]['message']['content'].strip())
### CODIO SOLUTION END