PromptBase
PromptBase SelectGet Select
Close icon
General
Home
Marketplace
Create
Hire
Login
Chat
Sell
Explore

Prompt Details

Model
Completion - GPT-3.5 (text-davinci-003)
Token size
94 ($0.00190 / call)
Example input
I need a script that uses OpenAI API to create short adventure stories
Example output
import openai # Set up API key openai.api_key = "YOUR_API_KEY" # Define prompt prompt = "Write a short adventure story" # Generate story response = openai.Completion.create( engine="text-davinci-002", prompt=prompt, max_tokens=1024, n=1, stop=None, temperature=0.5, ) # Print generated story generated_story = response["choices"][0]["text"] print(generated_story) This script uses the OpenAI API to generate a single short adventure story based on the prompt "Write a short adventure story". The API response is stored in the response variable, and the generated story is extracted from the response and printed to the console. Note: This script assumes that you have already obtained an API key for the OpenAI API and have entered it in the openai.api_key line. Keep in mind that the quality of the generated stories will depend on the data that the API model was trained on and the parameters you provide in the request. You may need to experiment with different prompts, maximum token lengths, and temperature values to generate stories that meet your desired quality and style.
GPT

Python Script Creator - No Code Necesary

Add to Cart
PromptBase Select
Get this prompt + 9 more with Select$14 your first month, then $19/mo$14 first month, then $19/mo
View Select
Instant accessInstant access
Usage rightsCommercial use
Money-back guaranteeMoney‑back
By purchasing this prompt, you agree to our terms of service
TEXT-DAVINCI-003
Tested icon
Guide icon
Free credits icon
💻Automate your processes with custom Python code made easy! 📝Our brand new model is designed specifically to be your Own Personal Python Freelancer. It's programmed to be user-friendly, ask questions and make suggestions! 💡Just type your Idea for an App and let us take care of the rest. Just copy - paste the code and start working your magic! 🧙
...more
Added over 1 month ago
Report
  • Reviews for this prompt (1)
Browse Marketplace