management-llm/flask_testing/testing_api.py
2023-07-28 10:27:09 -04:00

10 lines
534 B
Python

import os
import openai
# Load your API key from an environment variable or secret management service
openai.api_key = os.getenv("OPENAI_API_KEY")
response = openai.Completion.create(model="text-davinci-003", prompt="You are a software manager at the company Alphabet. Q: Format a message that specifically delegates the parts of the following task to your team of engineers. TASK: develop a new Machine Learning-based recommendation system for YouTube. A: ", temperature=0, max_tokens=100)
print(response.choices[0].text.strip())