Files
langchaingo/examples/openai-jsonformat-example
Dmitry Ng 29a1abdab3 chore: update dependencies, new tag for next release and add new build examples script
- 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.
2025-05-08 18:37:25 +03:00
..
2025-01-07 15:03:47 +08:00

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:

  1. Sets up a connection to the OpenAI API using the GPT-4o model.

  2. Prompts the AI to generate a structured JSON output.

How to Run

  1. Make sure you have Go installed on your system.
  2. Set up your OpenAI API key as an environment variable.
  3. Run the program:
go run openai_jsonformat.go