Skip to content

Latest commit

 

History

History
35 lines (21 loc) · 993 Bytes

File metadata and controls

35 lines (21 loc) · 993 Bytes

Python & Flask & OpenAI

1-click-deploy

Setup

This sample requires an API key to access the OpenAI API. The name of the config value is referenced in the compose.yaml file. To provide a value for it, you can use the Defang CLI like this:

defang config set --name OPENAI_KEY

and then enter the value when prompted.

Testing

echo "Hello" | curl -H "Content-Type: application/text" -d @- https://xxxxxxxx/prompt

or

cat prompt.txt | curl -H "Content-Type: application/text" -d @- https://xxxxxxxx/prompt

Title: Python & Flask & OpenAI

Short Description: An app that demonstrates how to use the OpenAI API with Python and Flask.

Tags: Python, Flask, OpenAI, AI, Python

Languages: python