This example demonstrates how to use the OpenAI model with the LangChain Go library to post multiple messages.
This nifty little program does the following:
-
Sets up a connection to the OpenAI API using the GPT-4o model.
-
Posts multiple messages to the AI, each with a different role (user, assistant, system).
-
Prints the AI's response for each message.
- Make sure you have Go installed on your system.
- Set up your OpenAI API key as an environment variable.
- Run the program:
go run openai-gpt4o-mutil-content.go