DEV Community

Cover image for Invoking OpenAI's ChatGPT from 6 different programming languages
Thomas Hansen for AINIRO.IO

Posted on • Edited on • Originally published at ainiro.io

Invoking OpenAI's ChatGPT from 6 different programming languages

I just asked our Oracle Machine to provide me with example code invoking OpenAI's ChatGPT API with 6 different programming languages. Below are the result.

I am a little but disappointed by the results. Several of the example snippets are using text-davinci-003 and OpenAI's completion API, and not the GPT API. I also suspect that some of the examples aren't complete examples, but only partial place holder code snippets.

However, the results are based upon DuckDuckGo's top results. I suspect if I had phrased my question slightly better, it would have provided better results.

I would therefor like to challenge the community to create a prompt/search-phrase that somehow correctly invokes DuckDuckGo and uses ChatGPT to transform the results into working code, for OpenAI's latest models. Feel free to use whatever programming language you wish :)

If you get a particular good result, we'll create a permalink out of it. Until I find the correct prompt to use, I'll just leave the above as permalinks temporarily.

Top comments (2)

Collapse
 
arianygard profile image
AriaNygard

It'd be pretty cool to see if someone were able to do this!

Collapse
 
ajackus profile image
Ajackus

Great read! This is a fantastic breakdown of how to invoke OpenAI’s ChatGPT from multiple programming languages. The step-by-step approach makes it easy to follow, and it's incredibly helpful for developers looking to integrate AI into their projects seamlessly.

Cross-language implementation is a crucial topic, and your post does a great job of making it accessible. Thanks for sharing such valuable insights!

For more resources on AI, programming, and content strategies, feel free to check out our webpage: ChatGPT AI. Looking forward to more of your content!