mirror of
https://github.com/vxcontrol/langchaingo.git
synced 2026-07-22 17:35:24 -04:00
29a1abdab3
- Updated go.mod and go.sum files across multiple example projects to reflect the latest dependency versions. - Introduced new example scripts for various use cases, enhancing the repository's functionality and usability. - Cleaned up and optimized existing example configurations for better performance and maintainability.
OpenAI STRUCTURED JSON Example
This example demonstrates how to use the OpenAI model with the LangChain Go library to generate structured JSON output.
What does this example do?
This nifty little program does the following:
-
Sets up a connection to the OpenAI API using the GPT-4o model.
-
Prompts the AI to generate a structured JSON output.
How to Run
- 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_jsonformat.go