Batch prompt from file for chatgpt 3.5-turbo to write poems inspired on a poet writing style and Dall-e to draw these inspired by the style of several artists. Requests to Azure OpenAI API.
![blog-aigallery2](https://private-user-images.githubusercontent.com/24430655/256454072-7de6f1c7-54be-407f-8c97-530a85d16850.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxODg1OTUsIm5iZiI6MTczOTE4ODI5NSwicGF0aCI6Ii8yNDQzMDY1NS8yNTY0NTQwNzItN2RlNmYxYzctNTRiZS00MDdmLThjOTctNTMwYTg1ZDE2ODUwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEwVDExNTEzNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTFkZGNmZjVlZjU4MWFkNzU0MzNmMjViZWI3ZTA0ZTQyM2QzNzIyNmVjNTIwMjlhMmZhZmI0ZDNlMTZiMjY2ZWQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.WIVmZBZFDvz016a2ESmv4FQL40joNPhGzfwxX7rglTk)
Batch image results available on augmented reality for iPhone at the Tapgaze app.
generate_all_fast.mp4
Repo File Structure:
.
├── creds.json #enter your Azure OpenAI API credentials, sample below
├── descriptions.txt #poem description
├── images #poem and dalle output
├── LICENSE
├── README.md
├── request_manager.py #manager calling scripts to send requests to chatgpt3.5 and dalle models
├── send_dalle_request.py #Azure OpenAI send request method to dalle
├── send_gpt35_request.py #Azure OpenAI send request method to gpt3.5_turbo
└── user_inputs.py #request inputs
Complete creds.json with your Azure OpenAI credentials:
{
"chatgpt35_openai_api": {
"OPENAI_API_KEY": "",
"OPENAI_API_VERSION": "",
"OPENAI_API_BASE": "",
"OPENAI_API_TYPE": "",
"OPENAI_API_DEPLOYMENT_NAME": ""
},
"dalle_openai_api": {
"OPENAI_API_KEY": "",
"OPENAI_API_VERSION": "",
"OPENAI_API_BASE": "",
"OPENAI_API_TYPE": "",
"OPENAI_API_DEPLOYMENT_NAME": "DOES_NOT_APPLY_NA"
}
}
---------------------------------------------
See code decorator branch for ChatGPT assisted poem description. You can read more about this generation flow at our Blog at Tapgaze: Part II: Chained Specialized AI Models Deliver Better Results
Inputs at: user_inputs.py and creds.json
If you find this helpful you can buy me a coffee :)