Skip to content

Commit 431783d

Browse files
committed
Update README for versioning and sundown warning
1 parent f3b6a68 commit 431783d

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,24 @@
11
# Prime Numbers Calculation Script by TLIEPE
22

3+
4+
## Versioning
5+
6+
This project maintains two versions:
7+
8+
- **v1**: Uses OpenAI's beta feature for structured outputs (deprecated approach).
9+
- **v2**: Updated to use the stable Instructor library integration with OpenAI API for structured outputs.
10+
11+
Version tags are available in the Git history for easy reference:
12+
13+
- `v1` - Original beta version
14+
- `v2` - Updated Instructor version
15+
16+
317
## Overview
418
This script is a showcase of a new approach to generating **structured output** using OpenAI's beta capabilities for structured outputs in its API. The script demonstrates a comparison between prime numbers generated locally and those generated through the OpenAI API using structured outputs.
519

20+
**Important Update:** As OpenAI's structured output feature is currently in beta and subject to future changes, this project has been updated to use the stable approach with the Instructor library. This prevents issues when the beta API is deprecated ("sundown"). The original beta version is preserved in the repository history.
21+
622
The **structured output** capability of OpenAI helps ensure responses adhere to a defined format, validated using tools like Pydantic. In this case, it ensures a list of prime numbers is returned in a consistent manner.
723

824
## How It Works
@@ -59,9 +75,11 @@ After setting up the virtual environment and installing the libraries, you're re
5975
```
6076

6177
## Notes
62-
- **Structured Output Beta Feature**: This script leverages OpenAI's beta feature for **structured outputs**, as detailed [here](https://openai.com/index/introducing-structured-outputs-in-the-api/).
78+
- **Structured Output Handling**: Initially, this project used OpenAI's beta feature for structured outputs. It now uses the Instructor library for a stable, production-ready approach. For details about the original beta feature, see [Structured Outputs Introduction](https://openai.com/index/introducing-structured-outputs-in-the-api/).
6379
- **MIT License**: This project is licensed under the MIT License, meaning you are free to use, modify, and distribute it as long as proper credit is given.
6480

81+
- **Strict Mode Option**: OpenAI now supports a strict mode in structured output, ensuring perfect schema compliance. This project currently uses a relaxed mode for flexibility in examples. For critical applications, enabling `strict: true` is recommended to guarantee response schema adherence.
82+
6583
## License
6684
MIT License. See `LICENSE` for more details.
6785

0 commit comments

Comments
 (0)